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
Show search panel results
function showSearchPanelResults(searchPanelInstance, features){ if(features.length){ // Here we select where to show the search results var targetComponent = null; if(typeof(mapSearchPanelOutputRegion) == 'undefined'){ mapSearchPanelOutputRegion = 'default'; } // These option are for different output modes var collapsible = true; var autoHeight = true; switch(mapSearchPanelOutputRegion){ case 'right': targetComponent = Ext.getCmp('RightPanel'); break; case 'bottom': targetComponent = Ext.getCmp('BottomPanel'); collapsible = false; // No collapsible in bottom break; case 'popup': if(typeof(Ext.getCmp('SearchResultsPopUp')) == 'undefined'){ targetComponent = new Ext.Window( { id: 'SearchResultsPopUp', layout: 'fit', width: "80%", height: 300, modal: false, closeAction: 'hide' }); } autoHeight = false; // No scrollbars if true collapsible = false; // No collapsible in popup targetComponent = Ext.getCmp('SearchResultsPopUp'); break; case 'default': default: targetComponent = searchPanelInstance; break; } // Make sure it's shown and expanded targetComponent.show(); targetComponent.collapsible && targetComponent.expand(); // Delete and re-create try { Ext.getCmp('SearchPanelResultsGrid').destroy(); } catch(e) { // Eventually log... } searchPanelInstance.resultsGrid = new Ext.grid.GridPanel({ id: 'SearchPanelResultsGrid', title: searchResultString[lang], collapsible: collapsible, collapsed: false, store: searchPanelInstance.store, columns: searchPanelInstance.gridColumns, autoHeight: autoHeight, // No vert. scrollbars in popup if true!! viewConfig: { forceFit: true } }); searchPanelInstance.resultsGrid.on('rowclick', searchPanelInstance.onRowClick, searchPanelInstance); targetComponent.add(searchPanelInstance.resultsGrid); targetComponent.doLayout(); // Always make sure it's shown and expanded searchPanelInstance.resultsGrid.show(); searchPanelInstance.resultsGrid.collapsible && searchPanelInstance.resultsGrid.expand(); } else { // No features: shouldn't we warn the user? Ext.MessageBox.alert(searchPanelTitleString[lang], searchNoRecordsFoundString[lang]); try { Ext.getCmp('SearchPanelResultsGrid').destroy(); } catch(e) { // Eventually log... } searchPanelInstance.resultsGrid = null; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onShowSearchResultPanel() {\n mediator.getView('searchResult');\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(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 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 displaySearch(results) {\n console.log(results);\n $(\".travelResults\").empty(); //Prevents Search Duplicates\n\n var searchContent = \"\"; //String to creates out View Results\n searchContent = '<div class=\"panel-group\">';\n searchContent += '<div class=\"panel panel-info\">';\n searchContent += '<div class=\"panel-heading\">';\n searchContent += '<img class=\"img_small\" src=\"' + results[\"logo_url\"] + '\" /> ';\n searchContent += '<span style=\"font-size: 18pt;color: coral;vertical-align: middle;\">' + results[\"walkscore\"] + '</span>';\n searchContent += '<a href=\"' + results[\"more_info_link\"] + '\">';\n searchContent += '<img class=\"img_small\" src=\"' + results[\"more_info_icon\"] + '\"/>';\n searchContent += '</a>';\n searchContent += '</div>';\n searchContent += '<div class=\"panel-body\">';\n searchContent += '<p style=\"font-size: 11pt;color: steelblue;vertical-align: middle;\"> <strong>Description:</strong> ' + results[\"description\"] + '</p>';\n searchContent += '</div>';\n searchContent += '<div class=\"panel-footer\">';\n searchContent += '<a style=\"font-size:8pt;color:darkgray;\" href=\"' + results[\"help_link\"] + '\">' + 'For How Walks Score Works!' + '</a>';\n searchContent += '</div>';\n $(\".travelResults\").append(searchContent);\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 showResults(results){\n\t\n}", "function showResults () {\n $('#results').fadeIn();\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 displaySearch(data) {\n var result = data.query.search;\n $(\".search-result\").html(\"\");\n for (var i = 0; i < result.length; i++) {\n var tmp =\n '<div class=\"row result\" id=\"result-' +\n (i + 1) +\n '\">' +\n '<h5 class=\"title\" id=\"title' +\n (i + 1) +\n '\">' +\n '<a href=\"https://en.wikipedia.org/wiki/' +\n result[i].title +\n '\"> ' +\n result[i].title +\n \"</a></h5><br>\" +\n '<p class=\"snippet\" id=\"snippet' +\n (i + 1) +\n '\">' +\n result[i].snippet +\n \"...</p></div>\";\n $(\".search-result\").html($(\".search-result\").html() + tmp);\n }\n $(\".result\").css({\n background: \"rgba(244, 244, 244)\",\n margin: \"15px\",\n padding: \"15px\",\n width: \"100%\"\n });\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 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(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 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 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 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}", "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 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 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 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 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 displayResults (data) {\n displayList(data);\n initMap(data);\n unhideHtml();\n}", "function showSearchResult() {\n pixabayApi\n .fetchImages()\n .then(dataArray => galleryCardTpl(dataArray))\n .then(markup => {\n markupRender(markup, galleryListRef);\n // The condition to prevent the page from scrolling on the very first batch of images\n if (pixabayApi.pageNumber > 2) {\n // Method window.scrollTo() did not work quite the way I expected, so I used another method mentioned in MDN\n window.scrollBy({\n // The page is scrolled by the height of the window minus the height of the search bar\n top: window.innerHeight - 110,\n behavior: 'smooth',\n });\n }\n if (pixabayApi.isLastPage) {\n loadMoreBtnApi.hide();\n } else {\n loadMoreBtnApi.show();\n loadMoreBtnApi.enable();\n }\n })\n .catch(er => {\n loadMoreBtnApi.hide();\n showError(er);\n });\n}", "function doSearch() {\r\n $(\"#listLoader\").modal('show');\r\n var srch = determineSearchParms();\r\n if (srch.urlParms === gblDefaultAllSearchParms.urlParms) { \r\n showAlphaPage('0');\r\n } else {\r\n /* set paging here, in-case map draws first and the zoom level changes */\r\n gblNextPage = 0;\r\n setPagingMode(NUMERIC_PAGING_METHOD);\r\n getSearchData(srch);\r\n redrawMap();\r\n }\r\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 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 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 surveySearch()\n{\n\t$(\"#surveys\").displayResults(\n\t{\n\t\turl: root + \"selfserve/wosurveylookup.jsf?t=1&search=\",\n\t\trecordName: \"Surveys\",\n\t\trowClass: \"clickable\",\n\t\terrorMsg: \"There was a problem searching Surveys\",\n\t\tonAfter: function(resultData, resultData2)\n\t\t{\t\t\n\t\t\t$(\"#surveys table.results tbody tr\").on(\"click\", function()\n\t\t\t{\n\t\t\t\topenUrl($(this).find(\"td\").eq(2).find(\"a\").attr(\"href\"));\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t$(\"#surveys table.results tbody tr\").each(function (i, row)\n\t\t\t{\n\t\t\t\tvar link = $(row).find(\"td\").eq(2).text();\n\t\t\t\t$(row).find(\"td\").eq(2).html(\"<a href='\" + link + \"' target='_blank'>Link</a>\");\n\t\t\t});\n\t\t\t\n\t\t\t$(\"#surveys table.results a\").on(\"click\", function()\n\t\t\t{\n\t\t\t\t$(this).parent().parent().trigger(\"click\");\n\t\t\t\treturn false;\n\t\t\t});\t\t\t\n\t\t\t\n\t\t\tif (resultData.records.length > 0)\n\t\t\t{\n\t\t\t\t$(\"#surveys p.summary\").text(\"These are the surveys available for this Work Order. Click on a link or a row to open the survey.\");\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#surveys p.summary\").show();\n\t\t}\n\t});\t\n}", "function showBrmSearch() {\r\n /*\r\n * When the results have been rendered:\r\n *\r\n * - Show the plug-in's rendered results.\r\n * - Hide the original results.\r\n */\r\n brmSearchContainer.one('brm-rendered', function (event) {\r\n var resultsContainer = $('#container');\r\n\r\n resultsContainer.insertBefore(originalState.results);\r\n originalState.results.hide();\r\n });\r\n\r\n /* Call the search plug-in. The 'search' method performs a search based on the location in the address bar. */\r\n //console.log(\"searching\");\r\n //console.log(brmSearchContainer);\r\n brmSearchContainer.brm_search('search');\r\n //console.log(\"brm_search done\");\r\n\r\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 goSearch() {\n display_serach();\n $(\"#navpanel\").panel(\"close\");\n}", "function displaySearchResults(response, search) {\n var user_finder = new RegExp(search, 'i'),\n results_string = \"\",\n i,\n j;\n\n if(globe.getID(0)) {\n removeLink();\n }\n\n if (globe.search_type_name.checked) {\n for (i = 0; i < response.length; i += 1) {\n if (user_finder.test(response[i].toMake)) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + response[i].toMake + \"</p>\";\n globe.addID(i.toString());\n }\n }\n } else {\n for (i = 0; i < response.length; i += 1) {\n for (j = 0; j < response[i].ingredients.length; j += 1) {\n if (user_finder.test(response[i].ingredients[j].ingredient)) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + response[i].ingredients[j].ingredient + \"</p>\";\n globe.addID(i.toString());\n break;\n }\n }\n }\n }\n\n globe.hint_span.innerHTML = \"\";\n if (results_string === \"\") {\n results_string = \"<span>No results.</span>\";\n }\n globe.results_div.innerHTML = results_string;\n \n if (globe.getID(0)) {\n createLink();\n }\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 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 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 showResults(results) {\n \n $.each(results, function(index,value) {\n\n var vidid = value.id.videoId;\n var vidtitle = value.snippet.title;\n var vidurl = \"http://www.youtube.com/watch?feature=player_embedded&v=\" + vidid;\n var viddiv = '<div class=\"result-box\"><div class=\"inner-box\"><div class=\"inner-img\"><a class=\"yt-video\" href=\"http://www.youtube.com/watch?feature=player_embedded&v=' + vidid + '\" target=\"external\"><img src=\"http://img.youtube.com/vi/' + vidid + '/0.jpg\" alt=\"video\" width=\"240\" height=\"180\"/></a></div><div class=\"title-div\"><h3 class=\"vid-title\"><a class=\"yt-video\" href=\"' + vidurl + '\">' + vidtitle + '</a></h3></div></div></div>';\n \n \n $(\".search-container\").append(viddiv).hide().show(\"fade\", \"slow\");\n });\n //This shows the user what value they just searched for and returns the search field to blank\n var currentQuery = $(\"#query\").val();\n var currentDisplay = '<div><h4 class=\"current-term\">Search results for \"' + currentQuery + '\"';\n $(\"#current-search\").append(currentDisplay).hide().show(\"blind\", 500);\n $(\"#query\").val('').focus();\n \n \n}", "function getResults() {\n var searchText = document.getElementById('search').value;\n var searchData = control.query(\n 'femaleClients',\n 'client_id = ?',\n [searchText]);\n if(searchData.getCount() > 0) {\n // open filtered list view if client found\n control.openTableToListView(\n 'femaleClients',\n 'client_id = ?',\n [searchText],\n '/tables/FemaleClients/html/femaleClients_list.html');\n } else {\n // open 'client not found' page\n control.openTableToListView(\n 'femaleClients',\n null,\n null,\n 'assets/clients_not_found_list.html');\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 }", "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.classList.add('header-searchResults--show')\r\n\r\n let resultsHtml = '';\r\n if (results.length){\r\n \r\n resultsHtml = `Found ${results.length} post(s).`;\r\n for(let result of results){\r\n let doc = searchEngine.documentStore.getDoc(result.ref);\r\n resultsHtml += `\r\n <div class=\"header-searchResult\">\r\n <a href=\"${doc.id}\">${doc.title}</a>\r\n </div>`;\r\n\r\n }\r\n } else{\r\n resultsHtml = `<div class=\"header-searchResult\">\r\n No results found for ${searchField.value}\r\n </div>`;\r\n }\r\n\r\n searchResults.innerHTML = resultsHtml;\r\n}", "function _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 opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\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 basicsearch() {\n searchString = document.basicForm.basicText.value;\n searchTerms = searchString.split(/\\s/);\n\n putHeader();\n\n findResults();\n putResults();\n\n putFooter();\n\n writeResultsPage();\n}", "function SearchPanel() {\n Panel.call(this, $('<section>'\n +'<form class=\"form-row margin-bottom\">'\n + '<input class=\"form-control col-11\" type=\"text\" name=\"query\" placeholder=\"...\">'\n + '<button class=\"btn btn-basic col-1\" type=\"submit\">Search</button>'\n +'</form>'\n +'<div class=\"\">'\n +'<ul class=\"row\" id=\"list\"></ul>'\n +'</div>'\n +'</section>'));\n\n var $container = this.$element;\n\n var $form = $container.children('form');\n $container.append($form);\n this.__$form__ = $form;\n\n var $queryInput = $form.children('input');\n $form.append($queryInput);\n this.__$queryInput__ = $queryInput;\n\n var errorPanel = new ErrorPanel;\n $container.append(errorPanel.$element);\n this.__errorPanel__ = errorPanel;\n\n var $resultList = $container.find('ul');\n $container.append($resultList);\n this.__$resultList__ = $resultList;\n}", "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 displayResults() {\n\n $(\"#resultsPage\").show();\n $('#questionPage').hide();\n setTimeout(reset, 1000 * 10);\n }", "function search() {\n\t\tvar query_value = $('input#search').val();\n\t\t$('b#search-string').html(query_value);\n\t\tif(query_value !== ''){\n //alert(\"Uneto:\"+query_value);\n\t\t\t$.ajax({\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t\t\tdataType: \"json\",\n\t\t\t\turl: \"QuickSearchResults?name=\"+query_value,\n\t\t\t\tsuccess: function(server_response){\n var content=returnHtmlContent(server_response);\n\t\t\t\t\t$(\"ul#results\").html(content);\n \n //menjamo border radius kad se predje strlicom preko polja\n $(\".result\").mouseover(function(){\n //alert(\"called\");\n $(this).css({\"border-radius\": \"10px;\"});\n });\n $('.result').click(function(){\n var idFilm=$(this).children(\":first\").attr(\"id\");\n //alert(\"Kliknuto\");\n showInfo(idFilm); \n });\n\t\t\t\t}\n\t\t\t});\n \n /**/\n\t\t}\n\n return false; \n\t}", "function getSearchResults() {\n var searchString = getSearchBoxValue();\n var url = getPageBaseURL() + '/results/' + searchString;\n window.location = url;\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 search(value){\n\t// console.log(\"search: \" + value);\n\tshowSection(null, '#section-searchresults');\n\t$('#section-searchresults h1').html(\"Results for: '\" + value + \"'\");\n\tcontroller.search(value);\n}", "function ShowAdvancedSearch() {\r\n $('.questionControl .panel-heading').toggleClass('showAdvance');\r\n $scope.search();\r\n \r\n }", "function displaySearchResults(results) {\n var addressClickHandler = function() {\n var location = $(this).data('location');\n $('#directions').empty();\n findPollingLocationFor(location);\n };\n if (results.length === 1) {\n findPollingLocationFor(results[0].geometry.location);\n } else {\n var $ul = $('<ul>').addClass('location-choices').appendTo('#directions');\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var link = $('<a>').text(result.formatted_address).data('location', result.geometry.location).on('click', addressClickHandler);\n $('<li>').append(link).appendTo($ul);\n }\n $('.modal').modal('hide');\n }\n }", "function search() {\n var currentForms = session.forms;\n\n\n var SearchProductListsResult = new Pipelet('SearchProductLists', {\n PublicOnly: true\n }).execute({\n EventType: currentForms.giftregistry.search.simple.eventType.value,\n EventCity: currentForms.giftregistry.search.advanced.eventCity.value,\n EventState: currentForms.giftregistry.search.advanced.eventAddress.states.state.value,\n EventCountry: currentForms.giftregistry.search.advanced.eventAddress.country.value,\n RegistrantFirstName: currentForms.giftregistry.search.simple.registrantFirstName.value,\n RegistrantLastName: currentForms.giftregistry.search.simple.registrantLastName.value,\n Type: ProductList.TYPE_GIFT_REGISTRY,\n EventMonth: currentForms.giftregistry.search.advanced.eventMonth.value,\n EventYear: currentForms.giftregistry.search.advanced.eventYear.value,\n EventName: currentForms.giftregistry.search.advanced.eventName.value\n });\n var ProductLists = SearchProductListsResult.ProductLists;\n/**\n * TODO\n */\n showSearch({\n ProductLists: ProductLists\n });\n}", "function searchSite()\n{\n document.getElementById(\"displayArea\").style.display = \"none\";\n document.getElementById(\"searchArea\").style.display = \"block\";\n}", "function menuShow (resultBN_id) {\n // Make the source object visible .. and scroll to it\n handleResultClick(resultBN_id);\n\n // If close search option is set, close search pane now\n if (options.closeSearch) {\n\tclearSearchTextHandler();\n }\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 }", "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 onSearchComplete() {\n $('events').hide(); $('search-results').show(); $('back-to-events-button').show();\n}", "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n\n $episodesArea.hide();\n populateShows(shows);\n}", "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n\n $episodesArea.hide();\n populateShows(shows);\n}", "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n\n $episodesArea.hide();\n populateShows(shows);\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 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}", "show() {\n this.printUi();\n this.rl.question(\"> \", term => {\n let matchingEntries = this.compareSearchWords(term, [\"go get milk\", \"something\", \"milk\", \"grab food\"]); //TODO connect to State**\n this.printResultsUi(term, matchingEntries);\n this.rl.question(\"Enter to return to the main screen. \", () => {\n const screen = new MainScreen(this.rl, this.state);\n screen.show();\n });\n });\n }", "function displaySearchResult(search) {\n window.location.replace(\"?=\" + food + \"\");\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 showResults(results) {\n resultHead.innerHTML = results[0];\n resultDesc.innerHTML = results[1];\n\n body.classList.add('animated');\n modal.classList.add(results[2]);\n modal.classList.remove('hidden');\n modal.classList.add('slideInLeft');\n}", "function showResults(){\n $('.resultsPopUp').fadeIn('slow');\n $('.placeholder').hide();\n\n}", "function showResultsPanel () {\n\tconst $calculatorResultsPanel = document.getElementById('calculator-results');\n\n\t// Only show animation the first time the 'Calculate' button is clicked, and if\n\t// mobile media query applies.\n\tif (window.matchMedia('screen and (max-width: 920px)').matches &&\n\t\t$calculatorResultsPanel.classList.contains('hide-results')) {\n\t\t$calculatorResultsPanel.classList.add('show-calculator-results');\n\t}\n\n\t$calculatorResultsPanel.classList.remove('hide-results');\n}", "function displaySearchResults(results, store) {\n var searchResults = document.getElementById('search-results');\n\n if (results.length) { // Are there any results?\n var appendString = '';\n\n for (var i = 0; i < results.length; i++) { // Iterate over the results\n var item = store[results[i].ref];\n //Recreate card layout for each result item\n appendString += '<div class=\"col-md-4 col-sm-6 learning-item\">';\n appendString += '<picture class=\"intrinsic intrinsic-item\">';\n appendString += '<img class=\"img-responsive intrinsic-img\" src=\"' + item.siteURL + '/assets/images/resources/' + item.image + '\" alt=\"' + item.title + '\">';\n appendString += '</picture>';\n appendString += '<h2><a href=\"' + item.resourceUrl + '\" target=\"_blank\">' + item.title + '</a></h2>';\n appendString += '<p class=\"attribution\">';\n if ( item.resourceAuthor ) {\n appendString += item.resourceAuthor + ', ';\n }\n appendString += item.resourceOrg + '</p>';\n appendString += item.contentHTML;\n appendString += '<div class=\"labels pull-right\">';\n if (item.resourceType === \"Ebook\") {\n appendString += '<i class=\"glyphicon glyphicon-book\"></i> ';\n }\n if (item.resourceType === \"Course\") {\n appendString += '<i class=\"glyphicon glyphicon-blackboard\"></i> ';\n }\n if (item.resourceType === \"Email Course\") {\n appendString += '<i class=\"glyphicon glyphicon-send\"></i> ';\n }\n if (item.resourceType === \"Website\") {\n appendString += '<i class=\"glyphicon glyphicon-link\"></i> ';\n }\n if (item.resourceType === \"Podcast\") {\n appendString += '<i class=\"glyphicon glyphicon-headphones\"></i> ';\n }\n appendString += item.resourceType + ' | ';\n if (item.access === \"Requires Email\") {\n appendString += '<i class=\"glyphicon glyphicon-envelope\"></i> ';\n }\n if (item.access === \"Requires Registration\") {\n appendString += '<i class=\"glyphicon glyphicon-user\"></i> ';\n }\n if (item.access === \"Free\") {\n appendString += '<i class=\"glyphicon glyphicon-download-alt\"></i> ';\n }\n appendString += item.access + ' </div>';\n appendString += '<div class=\"post-sharing pull-right\">';\n var learningItemURL = \"https://hackid.github.io%23\" + item.learningItemID;\n appendString += '<a href=\"https://twitter.com/share?url=' + learningItemURL + '&via=anthkris&hashtags=hackidlearning&text=' + item.title + ' free ' + item.resourceType + '\" target=\"_blank\">';\n appendString += '<img src=\"' + item.siteURL +'/assets/images/twitter-logo.svg\" class=\"social-logo\"/></a>';\n appendString += '<a href=\"https://plus.google.com/share?url=' + learningItemURL + '&title=' + item.title + ' free ' + item.resourceType + '\" target=\"_blank\">';\n appendString += '<img src=\"' + item.siteURL + '/assets/images/google-plus.svg\" class=\"social-logo\"/></a></div>';\n appendString += '<a href=\"' + item.resourceUrl + '\" target=\"_blank\" class=\"button view-button\">View</a>';\n appendString += '</div>';\n }\n\n searchResults.innerHTML = appendString;\n } else {\n searchResults.innerHTML = '<div class=\"col-xs-12\"><p class=\"no-results\">No results found.<br /><a href=\"https://docs.google.com/forms/d/e/1FAIpQLSe-Vw60TcOyTjd_FgTLD7eZ_fPwYTXsUWWNZEN1NrLTPK-qKA/viewform\" target=\"_blank\">Try submitting a resource on this topic!</a></p></div>';\n }\n }", "function search() {\n $('#loadingOverlay').show();\n var q = $('#query').val();\n var request = gapi.client.youtube.search.list({\n q: q,\n part: 'snippet',\n type: 'video',\n maxResults: 10\n });\n\n request.execute(function(response) {\n yotobe.lastSearchResults = response.result;\n yotobe.searchTemplate.link(\"#search-container\", response.result);\n $('#loadingOverlay').hide();\n });\n return false;\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}", "openSearch() {\n this.element_main.style.visibility = \"visible\"; // show search box\n this.element_input.focus(); // put focus in input box so you can just start typing\n this.visible = true; // search visible\n }", "function handleSearchResult(data) {\n\t\tvar searchResult = \"\";\n\t\tsearchResult += \"<div class='resultButton'>\"\n\t\tsearchResult += \"<img class='resultImage' alt='test' src='\" + data[0].profilePicture +\"'\\>\";\n\t\tsearchResult += \"<h2 class='resultName' action='/profile'>\" + data[0].username + \"</h2>\";\n\t\tsearchResult += \"</div>\";\n\t\tdocument.getElementById(\"searchResults\").innerHTML = searchResult;\t\n\t}", "function 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 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 displayYouTubeSearchData(data) {\n let results = data.items.map(function(item, index) {\n return renderResult(item);\n });\n $(\".js-search-results\").html(results);\n}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function display_results() {\n}", "function SearchResults() {\n\n}", "function showResultsForSearchItem(prodType, name, prodId, brand) {\n\tvar c = $('#item-container'), products=$('<div class=\"product-type\"></div>');\n\tvar title = $('<span class=\"product-type-name\"></span>');\n\t//set title name\n\ttitle.text(prodType.toUpperCase());\n\tproducts.append(title);\n\t//show title for user till getting full results\n\tc.html(products);\n\t//make an ajax call and get all results\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=search-full-results&typ='+prodType+'&n='+name+'&id='+prodId+'&b='+brand,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\t//show search item results\n\t\t\tappendSearchItemResults(data, prodId);\n\n\t\t\t//show loading\n\t\t\tcloseLoading();\n\t\t},\n\t\terror: function(response) {\n\t\t\t//log js errors\n\t\t\tshortTimeMesg('Alert! Search full results failed!', 'short-time-msg-failure');\n\n\t\t\t//show loading\n\t\t\tcloseLoading();\n\t\t}\n\t}\n\t);\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(responseJson) {\n console.log(responseJson); // pulling the correct information when testing\n const results = []; \n // \n for (let i = 0; i < responseJson.length; i++) { // for loop to push results into results\n results.push(`\n <p><a href='${responseJson[i].html_url}'>${responseJson[i].name}</a></p><hr>\n `);\n }\n $('#js-search-results').html(results.join('')); // target and generate html string of loop results\n}", "function search_results(data, context){\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $('#loading').hide();\n $search_results.hide();\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2>');\n if (data.ids.length>0) {\n $search_results.append('<ul class=\"paging\"></ul>');\n pager = $('ul.paging');\n for(item in data.ids) {\n object_id = data.ids[item];\n display_item(object_id, pager);\n }\n } else {\n $search_results.append('<div>None found. Please try again...</div>');\n }\n page_size = 10;\n if (data.ids.length>200) {\n page_size = data.ids.length/20;\n }\n pager.quickPager({pageSize: page_size, pagerLocation: \"both\"});\n $search_results.fadeIn();\n }", "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 displayMatches() {\n hide(textDiv);\n show(matchesList);\n matchesList.textContent = '';\n const filteredMatches = getFilteredMatches();\n if (filteredMatches.length > 0) {\n //\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 // // prefer exact matches — already done if SEARCH_OPTIONS expand is false\n // matches = matches.sort((a, b) => {\n // return exactPhrase.test(a.doc.t) ? -1 :\n // exactPhrase.test(b.doc.t) ? 1 : 0;\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 search() {\n restartSearch();\n if (searchField.val()) {\n dt.search(searchField.val()).draw();\n }\n if (searchSelect.val()) {\n dt.columns(2).search(searchSelect.val()).draw();\n }\n}", "function showSearched(ele) {\n\tlet selector = ele;\n\tconst rezname = Array.from(document.querySelectorAll(\"[data-rezeptname]\"));\n\tconst rezingred = Array.from(document.querySelectorAll(\"[data-rezeptingred]\"));\n\tconst rezcate = Array.from(document.querySelectorAll(\"[data-rezeptcate]\"));\n\tconst reztag = Array.from(document.querySelectorAll(\"[data-rezepttags]\"));\n\tlet ourDivs = Array.from(document.querySelectorAll(\".search\"));\n\n\t// Hier werden alle Bilder vorerst versteckt oder angzeigt\n\tif (selector != '') {\n\t\tfor (i = 0; i < ourDivs.length; i++) {\n\t\t\tourDivs[i].classList.add(\"notShown\");\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < ourDivs.length; i++) {\n\t\t\tourDivs[i].classList.remove(\"notShown\");\n\t\t}\n\t}\n\n\t// Hier werden die checkboxen gefrueft und bearbeitet\n\tif (rezeptName) {\n\t\tfor (i = 0; i < ourDivs.length; i++) {\n\t\t\tif (rezname[i].dataset[\"rezeptname\"].toLowerCase().includes(selector.toLowerCase())) {\n\t\t\t\tourDivs[i].classList.remove(\"notShown\");\n\t\t\t}\n\t\t}\n\t}\n\tif (rezeptIngred) {\n\t\tfor (i = 0; i < ourDivs.length; i++) {\n\t\t\tfor (t = 0; t < rezingred[i].dataset[\"rezeptingred\"].length; t++) {\n\t\t\t\tif (rezingred[i].dataset[\"rezeptingred\"][t].zutatenName.toLowerCase().includes(selector.toLowerCase())) {\n\t\t\t\t\tourDivs[i].classList.remove(\"notShown\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (rezeptCate) {\n\t\tfor (i = 0; i < ourDivs.length; i++) {\n\t\t\tfor (t = 0; t < rezcate[i].dataset[\"rezeptcate\"].length; t++) {\n\t\t\t\tif (rezcate[i].dataset[\"rezeptcate\"][t].toLowerCase().includes(selector.toLowerCase())) {\n\t\t\t\t\tourDivs[i].classList.remove(\"notShown\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (rezeptTag) {\n\t\tfor (i = 0; i < ourDivs.length; i++) {\n\t\t\tfor (t = 0; t < reztag[i].dataset[\"rezepttags\"].length; t++) {\n\t\t\t\tif (reztag[i].dataset[\"rezepttags\"][t].toLowerCase().includes(selector.toLowerCase())) {\n\t\t\t\t\tourDivs[i].classList.remove(\"notShown\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function search_results_ui(view) {\n\t\n\t// Presets\n\tvar $error = $('#error');\n\tif (jQuery.isEmptyObject(do_search.results) && $error.is(':hidden')) {};\n\tif ('undefined'==typeof(view)) view = $('#search_spreadsheet').find('.view-buttons').find('button[class*=\"btn-primary\"]').attr('id');\n\tif ('undefined'!=typeof($.fn.spreadsheet_view)) $.fn.spreadsheet_view.remove();\n\t// Sort results, but only if there's more than one archive being search\n\tif (do_search.total > 1) do_search.results = sort_rdfjson_by_prop(do_search.results, 'http://purl.org/dc/terms/title');\n\t// Set num results\n\t$('.num_results').html( $.map(do_search.results, function(n, i) { return i; }).length );\n\t// Pagination\n\t$('.page').css('visibility','hidden');\n\tif (do_search.page > 1) $('.prev-page').css('visibility','visible').find('.num').html(do_search.page-1);\n\t$('.next-page').css('visibility','visible').find('.num').html(do_search.page+1);\n\t// Load current view\n\tvar view_path = $('link#base_url').attr('href')+'application/views/templates/jquery.'+view+'.js';\n\t$.getScript(view_path, function() {\n\t\t$('#search_spreadsheet_content').attr('class',view+'_view').spreadsheet_view({rows:do_search.results,check:get_imported(),num_archives:do_search.total});\n\t});\t\n\t\n}", "function displayResults (a_BTN) {\n // Discard previous results table if any\n // Can happen if we have slow searches, and several have been \"queued\" in series all happening\n // after last updateSearch() dispatch ..\n if (resultsTable != null) {\n\tSearchResult.removeChild(resultsTable);\n\tresultsTable = null;\n\tcurResultRowList = {};\n//\tresultsFragment = null;\n\n\t// If a row cell was highlighted, do not highlight it anymore\n//\tclearCellHighlight(rcursor, rlastSelOp, rselection.selectIds);\n\tcancelCursorSelection(rcursor, rselection);\n }\n\n // Create search results table\n// resultsFragment = document.createDocumentFragment();\n resultsTable = document.createElement(\"table\");\n resultsTable.id = \"resultstable\";\n SearchResult.appendChild(resultsTable); // Display the search results table + reflow\n// resultsFragment.appendChild(resultsTable);\n\n let len = a_BTN.length;\n//trace(\"Results: \"+len);\n if ((len <= 3) && (searchlistTimeoutId != undefined)) { // Close search history immediately when there are too few results\n\tclearTimeout(searchlistTimeoutId);\n\tcloseSearchList();\n }\n if (len > 0) {\n\tlet i;\n\tfor (let j=0 ; j<len; j++) {\n\t i = a_BTN[j];\n\t let url = i.url;\n//trace(\"Matching BTN.id: \"+i.id+\" \"+i.title+\" \"+url);\n\t if ((url == undefined) // folder (or separator ...)\n\t\t || !url.startsWith(\"place:\") // \"place:\" results behave strangely .. (they have no title !!)\n\t\t ) {\n\t\t// Append to the search result table\n\t\tlet BTN_id = i.id;\n\t\tif ((i.type != \"separator\") && (BTN_id != TagsFolder) && (BTN_id != MobileBookmarks)) { // Do not display separators nor Tags nor MobileBookmarks folders in search results\n\t\t let BN = curBNList[BTN_id];\n\t\t if (BN == undefined) { // Desynchro !! => reload bookmarks from FF API\n\t\t\t// Signal reload to background, and then redisplay to all\n\t\t\tsendAddonMessage(\"reloadFFAPI_auto\");\n\t\t\tbreak; // Break loop in case of error\n\t\t }\n\t\t if ((options.trashEnabled && options.trashVisible) || (BN.inBSP2Trash != true)) { // Don't display BSP2 trash folder results except on debug\n\t\t\tappendResult(BN);\n\t\t }\n\t\t}\n\t }\n\t}\n }\n // Stop waiting icon and display the search result table\n WaitingSearch.hidden = true;\n// SearchResult.appendChild(resultsFragment); // Display the search results table + reflow\n}", "function searchUserLocal()\n {\n var typed = this.value.toString().toLowerCase(); \n var results = document.getElementById(\"results-cont\").children;\n\n if(typed.length >= 2)\n { \n for(var j=0; j < results.length; j++)\n {\n if(results[j].id.substr(0, typed.length).toLocaleLowerCase() !== typed)\n results[j].style.display = \"none\";\n else\n results[j].style.display = \"flex\";\n }\n } \n else\n {\n for(var i=0; i < results.length; i++)\n results[i].style.display = \"flex\";\n } \n }", "function searchResults(event) {\n\tconst search = event.target.value;\n\t// empty search term - everything matches ''\n\tconst re = new RegExp(search, 'i');\n\tconst usernameElems = Array.from(document.getElementsByClassName('results-username'));\n\tlet even = false;\n\tfor (const e of usernameElems) {\n\t\tconst row = e.parentNode;\n\t\t// visibility: collapse seems to remove innerText (display: none didn't)\n\t\t// So I'm using textContent here instead.\n\t\tif (e.textContent.match(re)) {\n\t\t\trow.classList.remove('hidden');\n\t\t\tif (even) {\n\t\t\t\trow.classList.add('even');\n\t\t\t} else {\n\t\t\t\trow.classList.remove('even');\n\t\t\t}\n\t\t\teven = !even;\n\t\t} else {\n\t\t\trow.classList.add('hidden');\n\t\t}\n\t}\n}", "function Search() {\n if ($('#doc-count').html() != \"\") {\n $('#loading-indicator').show();\n }\n else $('#progress-indicator').show();\n\n q = $(\"#q\").val();\n\n // Get center of map to use to score the search results\n $.get('/api/GetDocuments',\n {\n q: q != undefined ? q : \"*\",\n searchFacets: selectedFacets,\n currentPage: currentPage\n },\n function (data) {\n $('#loading-indicator').css(\"display\", \"none\");\n $('#progress-indicator').css(\"display\", \"none\");\n UpdateResults(data);\n });\n}", "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 onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}" ]
[ "0.8149672", "0.74154586", "0.7351451", "0.73156697", "0.71737444", "0.716216", "0.7157756", "0.7067799", "0.70615697", "0.7057377", "0.6979734", "0.6970673", "0.6956325", "0.6879121", "0.68723845", "0.68686473", "0.6864502", "0.6855489", "0.68504167", "0.68268293", "0.68023074", "0.67208725", "0.6719165", "0.6718798", "0.670493", "0.6664834", "0.66598606", "0.66497743", "0.6647842", "0.6647738", "0.66470075", "0.66415983", "0.6635608", "0.6634098", "0.66299796", "0.662883", "0.6624538", "0.6619771", "0.6619771", "0.6607707", "0.66054595", "0.6565376", "0.65627146", "0.65394634", "0.6531445", "0.652188", "0.6519742", "0.65177715", "0.65120125", "0.6505401", "0.6490467", "0.6489411", "0.64768386", "0.6474532", "0.6462053", "0.64558834", "0.6447423", "0.644069", "0.6440467", "0.64304113", "0.64304113", "0.64304113", "0.6430048", "0.642514", "0.64249974", "0.64213276", "0.6418876", "0.64143157", "0.64135355", "0.641", "0.6401679", "0.6401549", "0.639586", "0.63956106", "0.6395252", "0.6389207", "0.638883", "0.6388166", "0.6382701", "0.63787407", "0.63718885", "0.6371085", "0.6370882", "0.6356497", "0.63484573", "0.634385", "0.6341868", "0.633164", "0.63264775", "0.63246137", "0.6308798", "0.6294471", "0.62868226", "0.6276703", "0.62672955", "0.6265789", "0.6255367", "0.6255367", "0.6255367", "0.6255367" ]
0.6778393
21
function to display a loadMask during lengthy load operations
function displayLoadMask() { if (mapIsLoading) { // check if layer is still loading loadMask = new Ext.LoadMask(Ext.getCmp('MapPanel').body, {msg:mapLoadingString[lang]}); loadMask.show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maskWC (sLoadingText, aMaskEl)\n// ---------------------------------------------------------------------\n{\n // ++g_nMaskCnt;\n if (!sLoadingText)\n {\n sLoadingText = getString(\"ait_loading\");\n }\n aMaskEl = aMaskEl || document.body;\n Ext.get (aMaskEl).mask (sLoadingText, 'x-mask-loading');\n}", "function showLoader(){\n\t //show Loader\n $(\"#result\").html('<img src=\"images/grey.gif\" style=\"width:20%; top:-5em;left:80%;\"/>');\n\t}", "function showLoading(show) {\r\n if (show) {\r\n Ext.getBody().mask(loadHtml);\r\n } else {\r\n Ext.getBody().unmask();\r\n }\r\n}", "function showLoading(show) {\r\n if (show) {\r\n Ext.getBody().mask(loadHtml);\r\n } else {\r\n Ext.getBody().unmask();\r\n }\r\n}", "function showLoading() {\n\tesri.show(app.loading);\n\tapp.map.disableMapNavigation();\n\tapp.map.hideZoomSlider();\n}", "function displayLoading() {\n console.log(\"Loading...\");\n }", "function loading() {\n\tloader.hidden = false;\n\tmain.hidden = true;\n}", "function load(){\n\n //Display an optional loading bar\n // g.loadingBar();\n}", "displayLoading(){\n $.showLoading({\n name: \"line-scale\"\n });\n }", "function isLoading()/*:Boolean*/ {\n return this.previewLoadMask$67CD && !this.previewLoadMask$67CD.disabled && this.previewLoadMask$67CD['el'].isMasked();\n }", "function ShowLoader()\r\n{\r\n\ttry\r\n\t{\r\n\t\tvar dimmer = '<div id=\"divDimmer\" style=\"filter: alpha(opacity=55); -moz-opacity: .55; background-color: #EEE;';\r\n dimmer += 'z-index: 900; visibility: hidden; position: absolute; left: 0px; top: 0px; width: 100%;height: 100%;\"></div>';\r\n \r\n if (!el('divDimmer'))\r\n {\r\n\t\t\tdocument.body.innerHTML += dimmer;\r\n\t\t}\r\n\t\t\r\n\t\tel('divDimmer').style.visibility = 'visible';\r\n \r\n\t\tvar verticalpos = \"fromtop\"\r\n\t\tel('loadinfo').valign = 'middle';\r\n\t\tel('loadinfo').style.height = '50px';\r\n\t\tel('loadinfo').style.width = '220px';\r\n\t\tel('loadinfo').style.visibility = 'visible';\r\n\t\t\r\n\t\tvar startX = 10;\r\n\t\tvar startY = 15;\r\n\t\tvar ns = (navigator.appName.indexOf(\"Netscape\") != -1);\r\n\t\tvar d = document;\r\n\t\tfunction ml(id)\r\n\t\t{\r\n\t\t\tvar elem=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];\r\n\t\t\tif(d.layers)\r\n\t\t\t\telem.style = elem;\r\n\t\t\t\r\n\t\t\telem.sP = function(x,y)\r\n\t\t\t{\r\n\t\t\t\tthis.style.left = x;\r\n\t\t\t\tthis.style.top = y;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\telem.x = startX;\r\n\t\t\tif (verticalpos == 'fromtop')\r\n\t\t\t{\r\n\t\t\t\telem.y = startY;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\telem.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;\r\n\t\t\t\telem.y -= startY;\r\n\t\t\t}\r\n\t\t\treturn elem;\r\n\t\t}\r\n\t\t\r\n\t\twindow.stayTopLeft = function()\r\n\t\t{\r\n\t\t\tif (verticalpos == 'fromtop')\r\n\t\t\t{\r\n\t\t\t\tvar pY = ns ? pageYOffset : document.body.scrollTop;\r\n\t\t\t\tftlObj.y += (pY + startY - ftlObj.y)/8;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;\r\n\t\t\t\tftlObj.y += (pY - startY - ftlObj.y)/8;\r\n\t\t\t}\r\n\t\t\tftlObj.sP(ftlObj.x, ftlObj.y);\r\n\t\t\tsetTimeout(\"stayTopLeft();\", 10);\r\n\t\t}\r\n\t\tftlObj = ml(\"loadinfo\");\r\n\t\tstayTopLeft();\r\n\t}\r\n\tcatch(e)\r\n\t{\t\t\r\n\t}\r\n}", "function showLoading() {\n\t\t// Create loading layer at first usage\n\t\tif (!ajax_load_element) {\n\t\t\tajax_load_element = document.createElement('div');\n\t\t\tajax_load_element.className = 'ajaxLoad';\n\t\t\tvar\n\t\t\t\toverlay = document.createElement('div'),\n\t\t\t\tload_indicator = document.createElement('div')\n\t\t\t;\n\t\t\toverlay.className = 'overlay';\n\t\t\tajax_load_element.appendChild(overlay);\n\n\t\t\tload_indicator.className = 'loadIcon';\n\t\t\tload_indicator.innerHTML = msg.ajaxLoadingText;\n\t\t\tajax_load_element.appendChild(load_indicator);\n\n\t\t\tdocument.body.appendChild(ajax_load_element);\n\t\t\tsetTransparency(overlay, overlay_opacity);\n\t\t}\n\t\tvar el_pos = getElPos(img_lib_element);\n\t\twith (ajax_load_element.style) {\n\t\t\tdisplay = '';\n\t\t\ttop = el_pos.top + 'px';\n\t\t\tleft = el_pos.left + 'px';\n\t\t\twidth = el_pos.width + 'px';\n\t\t\theight = el_pos.height + 'px';\n\t\t}\n\t}", "function repaintAllLabels(){\n\t\t\t\t//enableLoadingScreen();\n\t\t\t\t//give chance for loading screen to pop up\n\t\t\t\t//setTimeout(function() {\n\t\t\t\t\trepaintLabels(undefined);\t\n\t\t\t\t\t//disableLoadingScreen();\n\t\t\t\t//},0);\n\t\t\t}", "function showLoadingView() {\n $loader.css(\"display\", \"block\");\n }", "function showAdminLoadingDiv() { tf.showAdminLoading(); }", "function addLoad(){\n $('#loadingPopup').css('display', 'block');\n }", "function resourceLoaded()\n{\n if(++curLoadResNum >= totalLoadResources){\n redraw();\n }\n}", "function _load() {\r\n document.getElementById(\"loading-icon\").style.visibility = \"hidden\";\r\n document.getElementById(\"body\").style.visibility = \"visible\";\r\n }", "function displayLoading(show) {\n if (show) {\n // Display the loading message\n $('.mapLoading').css({ display: \"inherit\" });\n }\n else {\n // Hide the loading message\n $('.mapLoading').css({ display: \"none\" });\n }\n}", "function showLoading(show) { $.overlay.style.opacity = show ? 1 : 0; }", "function loading(){\n $('#load').css('display','none');\n}", "_loading() {\n }", "function loading() {\n push();\n textSize(32);\n textStyle(BOLD);\n textAlign(CENTER, CENTER);\n text(`Loading ${modelName}...`, width / 2, height / 2);\n pop();\n}", "function showLoadSeeUI(){\n\tif (lastclicked == \"load\"){\n\t\t$(\"#loadSeeConfig\").toggle(\"blind\");\n\t}else{\n\t\thideAll();\n\t\tlastclicked=\"load\";\n\t\tshowLoadSeeUI();\n\t}\n}", "function showLoading() {\n $B.removeClass(\"js-loaded loaded-reveal\").addClass(\"show-loading\");\n $(\".sl-progress span\").css(\"width\", \"0%\");\n }", "function show_loading_image () {\n\t\tstrLoading = '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"font-size:10px;\"><tr><td align=\"center\"><b>Loading..</b></td></tr><tr><td align=\"center\" style=\"padding-top:10px;\"><img src=\"'+JS_HTTP_CURRENT_TEMPLATE+'/media/site-image/loading1.gif\" alt=\"Loading..\" /></td></tr></table>';\n\t\treturn strLoading;\n\t}", "function resourceLoaded()\n{\n\tif(++curLoadResNum >= totalLoadResources){\n\t\tredraw();\n\t}\n}", "onStoreLoadStart() {\n if (this.loadMask) {\n this.maskBody(this.loadMask);\n }\n }", "function loadingEllipsis() {\n\tvar loadingHeader = document.getElementById('loadingTexturesHeader');\n\n\tswitch(loadingHeader.innerHTML.length) {\n\t\tcase 7:\n\t\t\tloadingHeader.innerHTML = 'Loading.';\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tloadingHeader.innerHTML = 'Loading..';\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tloadingHeader.innerHTML = 'Loading...';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tloadingHeader.innerHTML = 'Loading';\n\t\t\tbreak;\n\t}\n}", "function loader(){\n load = setTimeout(function(){\n document.getElementById('game-level').style.visibility = 'visible';\n }, 4000); // Mudar esse tempo para a duração da Animação do logo\n}", "function preloadFadeIn() {\n $(\".preload-mask\").fadeIn();\n loaderStart();\n}", "function loader() {\n loaded += 1;\n if(loaded === toLoad) {\n spinner.stop();\n process.stdout.write('\\r ' + url);\n console.log('');\n }\n }", "renderLoadingIcon() {}", "function loading_show(){\n $('#loading7').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function loading_show(){\n $('#loading4').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function showLoad () \n{\n//\talert('lo');\n//\t$('load').style.display = 'block';\n}", "function showLoader() {\n\n loader.style.display = \"block\";\n\n }", "function showLoading() {\n $(\"body\").append(\"<div class='pmDynaformLoading' style='position: fixed;left: 0px;top: 0px;width: 100%;height: 100%;z-index: 9999;background: url(/lib/img/loading.gif) 50% 50% no-repeat rgba(255,255,255,0.5);'></div>\");\n}", "function showMask(){\n\tList.showMask = true;\n\tCard.showMask = true;\n}", "function showLoading(selector) {\r\n var html = \"<div class = 'text-center'>\";\r\n html += \" <img src = 'images/ajax-loader.gif'></div>\";\r\n insertHtml(selector, html);\r\n }", "function showLoader() {\n loader.style.display = 'block';\n }", "function showLoading() {\n if (loadingMessageId === null) {\n loadingMessageId = rcmail.display_message('loading', 'loading');\n }\n }", "function loading() {\n}", "function drawLoadingLine() {\n const value = p.millis() - p.timeOfStart;\n p.loadingWidth = p.map(value, 0, p.props.gameTime*1000, 0, p.width, true);\n p.push();\n p.fill('blue');\n p.noStroke();\n p.rect(0, 0, p.loadingWidth, 2);\n p.pop();\n }", "function loading_show(){\n $('#loading8').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function loading_show(){\n $('#loading3').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function showLoader() {\n\tloader.className = 'show';\n\tsetTimeout(() => {\n\t\tloader.className = loader.className.replace('show', '');\n\t}, 90000);\n}", "function startLoader() {\r\n\t$(\"#fe\").show();\r\n\t$(\"#fe_intro_moon\").html(\"<img src='img/hf_moon_state_0.png'><p></p>\");\r\n\tanimateLoader();\r\n}", "function showLoadingView() {\n $loadScreen.show();\n $startGameButton.text(\"Loading...\");\n $gameCategoryRow.empty();\n $gameQuestionsBody.empty();\n $gameBoard.hide();\n\n\n}", "function loadTimeoutFunction() {\n if (isLoading == 1) {\n stat.innerHTML = \"Your internet seems to be be slow...\";\n // isLoading = 0;\n // runrun.src = \"img/loading-static.png\";\n }\n}", "function loadingStatus(mapDefinition) {\n\n mapDefinition._currentPercentage = mapDefinition._currentPercentage + mapDefinition._percentagePerPoint;\n mapDefinition._loadingProgress.setProgress(mapDefinition._currentPercentage);\n mapDefinition._pointsProcessed++;\n\n if (mapDefinition._pointsProcessed == mapDefinition._pointsArray.length) {\n flyToBounds(mapDefinition);\n $('.ladda-label').text('Carregado');\n $('.loading-points').toggle('slow');\n }\n }", "function drupalgap_loading_message_show() {\n try {\n // Backwards compatability for versions prior to 7.x-1.6-alpha\n if (drupalgap.loading === 'undefined') { drupalgap.loading = false; }\n // Return if the loading message is already shown.\n if (drupalgap.loading) { return; }\n var options = drupalgap_loader_options();\n if (arguments[0]) { options = arguments[0]; }\n // Show the loading message.\n //$.mobile.loading('show', options);\n //drupalgap.loading = true;\n setTimeout(function() {\n $.mobile.loading('show', options);\n drupalgap.loading = true;\n }, 1);\n }\n catch (error) { console.log('drupalgap_loading_message_show - ' + error); }\n}", "function loader(status) {\n jQuery(\"#loadIndicatorContainer\").dxLoadPanel({\n shadingColor: \"rgba(0,0,0,0.4)\",\n position: { of: \"#loading\" },\n showIndicator: true,\n showPane: true,\n shading: true,\n visible: status\n });\n}", "function showLoadingView() {\n\n}", "function loading_show(){\n $('#loading6').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function loading_show(){\n $('#loading5').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function slideLoader_stat() {\n //used when pre-loading the first X slides\n preload_ctr++;\n $('#pre-load-status').html('Preloaded ' + preload_ctr + ' slides');\n if (preload_ctr >= 3) {\n slideLoaded = true;\n $('#pre-load-status').html('Slides loaded...pre-loading video...');\n };\n}", "function onLoadStarted() {\n // nicer visually to not display the lightlayer yet when we start loading\n franceLightLayer.remove();\n loadingBar.addTo(map);\n}", "function addLoader(){\n\t\t\t\t\t$contain.append( '<i class=\"enlarge_loader\"><i></i></i>' );\n\t\t\t\t}", "updateLoadingBar() {\n if (this.loadingRemains !== G.resource.remains) {\n this.loadingBar.text = `${G.resource.remains} resource(s) to load...\\nReceived file '${G.resource.currentLoad}'.`;\n }\n }", "function di_loading(val) {\n\tif(val=='show') {\n\t\tdi_jq('#block_div').show();\n\t\tdi_jq('#block_div_loading').show();\n\t}\n\telse{\n\t\tdi_jq('#block_div_loading').hide();\n\t\tdi_jq('#block_div').hide();\n\t}\n}", "function unsureIfthisIsAnActualLoadingScreen() {\n //FrameCount on the loading state to \"waste\" your time\n let wasteOfTime = 120;\n if (frameCount > wasteOfTime) {\n state = `bubblePoppin`;\n }\n\n //The text\n push();\n textSize(30);\n fill(255, 132, 0);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`Loading...`, width / 2, height / 2);\n pop();\n}", "function OnLoad() {\r\n\tif (document.getElementById)\r\n\tdocument.getElementById(\"loading\").style.visibility = \"hidden\";\r\n\telse if (document.layers)\r\n\tdocument.loading.visibility = \"hidden\";\r\n\telse if (document.all)\r\n\tdocument.all.loading.style.visibility = \"hidden\";\r\n}", "function show_loader()\r\n {\r\n $(\"#loader\").show();\r\n }", "function loading() {\n // Sets all positional DOM elements to Loading\n document.getElementById(\"name\").innerHTML = `Satellite Name: Loading`;\n document.getElementById(\"id\").innerHTML = `Satellite ID: Loading`;\n document.getElementById(\"lat\").innerHTML = `Latitude: Loading`;\n document.getElementById(\"long\").innerHTML = `Longitude: Loading`;\n document.getElementById(\"alt\").innerHTML = `Altitude: Loading`;\n document.getElementById(\"vel\").innerHTML = `Velocity: Loading`;\n document.getElementById(\"vis\").innerHTML = `Visibility: Loading`;\n document.getElementById(\"daynum\").innerHTML = `Day Number: Loading`;\n document.getElementById(\"sollat\").innerHTML = `Solar Latitude: Loading`;\n document.getElementById(\"sollong\").innerHTML = `Solar Longitude: Loading`;\n document.getElementById(\"interval\").innerHTML = `Lag Interval: Loading`;\n}", "function loading_show(){\n \t\t$('#loading').html(\"<img src='img/loading.gif'/>\").fadeIn('fast');\n }", "function showLoading() {\n loading.classList.add(\"show\");\n setTimeout(callData, 2000);\n }", "function loading() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "function loading() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "function loading_show(){\n $('#loading2').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function loadProgressHandler(loader) {\n\n // show loading progress in percentage\n console.log(\"Loading sprites.. \" + Math.round(loader.progress) + \"%\");\n\n}", "function loading_show(){\n $('#loading').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function lonlight ( timer )\n{\n isLoadOn = true;\n if ( typeof timer === undefined ){timer = 500;\n }\n timer = !is_numeric ( timer ) ? 500 : timer;\n $ ( '#loadIconDiv1' ).animate ( { 'opacity' : 1 } , timer ).dequeue ();\n $ ( '#loadIconDiv1' ).fadeIn ( timer ).dequeue ();\n $ ( '#hiderLayer1' ).fadeOut ( timer ).dequeue ();\n hueRotation ();\n\n}", "function exibeDivLoading() {\n $('#div-fade-loading').css('visibility', 'visible');\n}", "function loading( block, processing )\n{\n if(typeof processing == 'undefined')\n processing = false;\n var img = \"<img class='loader' src='http://www.turismoinliguria.it/images/loader.gif'/>\";\n if( processing )\n $(block).append(img);\n else\n $(block + ' img.loader').remove();\n}", "function animateLoader() {\n var length = (ellipses.text().length + 1) % 5;\n ellipses.text(Array(length + 1).join(\".\"));\n padding.text(Array(length + 1).join('\\xA0')); //add padding to the front of the loader to keep it centred\n }", "function updateLoading() {\n //messageField.text = \"Loading \" + (preload.progress*100|0) + \"%\"\n console.log(\"Loading \" + (preload.progress * 100 | 0) + \"%\");\n stage.update();\n }", "function continueLabeling() {\n document.getElementById(\"runningDiv\").style.display = \"block\";\n document.getElementById(\"dumpDiv\").style.display = \"none\";\n}", "function callBackToComputeLoadState() {\n if (!loadStatus) {\n showIncorrectPasswordPage();\n return;\n }\n\n if (filesRead !== maxFiles) {\n filesRead++;\n }\n\n if (filesRead === maxFiles) {\n if (loadStatus) {\n hidePasswordInput();\n showInputOutput();\n }\n }\n return;\n }", "function LoadingOn() {\n document.getElementById(\"divLoading\").style.display = \"block\";\n var imgProcessing = document.getElementById(\"imgProcessing\");\n if (imgProcessing != null) { imgProcessing.style.display = \"\"; }\n}", "function contentLoading() {\n hide(topSearch);\n hide(clearSearchIcon);\n //show(loadingContentElement);\n show(\".es-progress-indicator\");\n hide(resultsElement);\n hide(articleDisplay);\n }", "function loading(alreadyLoaded) {\n\t\tif(alreadyLoaded == false){\n\t\t\t$loading.prependTo( 'body' ).fadeIn();\n\t\t}\n }", "function instructionDisplay() {\r\n\t// update time\r\n\tlet d = new Date();\r\n\tlet timeElapsed = d.getTime() - n;\r\n\t\r\n\tif (timeElapsed < instructionDisplayTime) {\r\n\t\tinstructionText.alpha = 100;\r\n\t} else {\r\n\t\tinstructionText.alpha = 0;\r\n\t};\r\n}", "function showLoading() {\n _updateState(hotelStates.SHOW_LOADING);\n }", "function loadingIcon() {\n var loadIcon = '<img id=\\\"iconLoad\\\" src=\\\"/ms/img/loading.gif\\\" />';\n return loadIcon;\n }", "showLoadingView() {\n $('#start').empty();\n document.getElementById('start').innerHTML = 'Loading! ';\n $('#start').append($('<i class=\"fas fa-spinner fa-pulse\"></i>'))\n $('#load-screen').append($('<i id=\"loading\" class=\"mt-4 fas fa-spinner fa-pulse\"></i>'))\n }", "function load() {\r\n\r\n //Display the file currently being loaded\r\n console.log(`loading: ${g.loadingFile}`);\r\n\r\n //Display the percentage of files currently loaded\r\n console.log(`progress: ${g.loadingProgress}`);\r\n\r\n //Add an optional loading bar.\r\n g.loadingBar();\r\n\r\n //This built-in loading bar is fine for prototyping, but I\r\n //encourage to to create your own custom loading bar using Hexi's\r\n //`loadingFile` and `loadingProgress` values. See the `loadingBar`\r\n //and `makeProgressBar` methods in Hexi's `core.js` file for ideas\r\n}", "function showloading(){ // waiting/working gif-animation\n $(\"#loading\").showv();\n}", "function showLoader(){\n\t $(\".loading\").show();\n\t $(\"footer\").css(\"display\",\"none\");\n\t \n }", "function zeigeLadegrafik(zeigen) {\n\tvar bild = document.getElementById(\"load\");\n\tif (bild) {\n\t\tif (zeigen) bild.style.display = 'block';\n\t\telse bild.style.display = 'none';\t\n\t}\n}", "function load(){\n game.loadingBar();\n}", "function showLoadingView() {\n $('#gameboard').html('');\n $('#new-game-btn').text('Loading...');\n $('#loading-gif').removeClass('hidden');\n}", "function hideLoadingView() {\n $loadScreen.hide()\n $gameBoard.show();\n\n}", "function blockControl(control){\r\n\tcontrol.block({message: jQuery('#loading-img'), css:{border:'none',backgroundColor:'#fff',opacity: '.8', width:'120px'}});\r\n}", "function loaded(){\n\t\tipcRenderer.send('asynchronous-message', {\"tag\":\"loaded\"});\n\t\t$( document ).tooltip();\n\t}", "function showLoader()\n {\n\t\t// $('.loader-container').show();\n // $('.loader-container').preloader({\n // zIndex: 1000,\n // setRelative: false\n // });\n // $('.loader-back').show();\n }", "function showDataIsLoaded() {\n let loadingIndicator = document.getElementById(\"loadingIndicator\");\n loadingIndicator.innerHTML = \"Data loaded!\";\n setTimeout(() => loadingIndicator.style.display = \"none\", 1000);\n}", "function showLoading() {\n $('#MCLoading')[0].innerHTML = 'Loading ...';\n}", "function showQuiosqueLoad(){\n $(\"#myloadingDiv\" ).show();\n }", "function loadingScreen() {\r\n document.getElementById('map__loader').classList.add('anim-not-loaded');\r\n setTimeout(function() {\r\n document.getElementById('map__loader').classList.remove('anim-not-loaded');\r\n document.getElementById('map__loader').classList.add('not-loaded');\r\n }, 1000);\r\n}" ]
[ "0.6589804", "0.6279969", "0.62251884", "0.62251884", "0.61610055", "0.6148395", "0.6046313", "0.6045253", "0.60235906", "0.599463", "0.5974879", "0.595893", "0.59328926", "0.59071106", "0.5888625", "0.5886988", "0.58783716", "0.5834538", "0.582026", "0.5809646", "0.5743445", "0.5735008", "0.57197237", "0.5710351", "0.570081", "0.56913567", "0.5685661", "0.5680163", "0.56740034", "0.5666098", "0.5663922", "0.56603235", "0.56587684", "0.56565475", "0.5631282", "0.56291866", "0.5624008", "0.5622327", "0.56215125", "0.5620953", "0.56194717", "0.55948347", "0.55934715", "0.55921763", "0.55909395", "0.55900615", "0.5587592", "0.557065", "0.55613416", "0.55530983", "0.55519974", "0.55500823", "0.5548208", "0.55468667", "0.5540332", "0.5532406", "0.55280983", "0.55182564", "0.5516991", "0.55094683", "0.5505185", "0.54993683", "0.5495348", "0.5493727", "0.5492907", "0.5489232", "0.54879063", "0.54779774", "0.54779774", "0.54778165", "0.54634523", "0.5460923", "0.54515386", "0.54351777", "0.54288316", "0.54257786", "0.54207444", "0.54187214", "0.54172784", "0.54165465", "0.5416136", "0.54089904", "0.54087985", "0.54052234", "0.540137", "0.54010147", "0.54008657", "0.5397712", "0.53947353", "0.53887403", "0.53886175", "0.53879493", "0.5381924", "0.53800464", "0.5379985", "0.5377937", "0.5375506", "0.5373469", "0.5370995", "0.5363834" ]
0.82097787
0
function for the help viewer
function scrollToHelpItem(targetId) { Ext.get(targetId).dom.scrollIntoView(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListHelp() {\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(HELP_DOC);\r\n}", "function displayHelp()\n{\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(helpDoc);\r\n}", "function displayHelp()\n{\n // Replace the following call if you are modifying this file for your own use.\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function help() {\n\n}", "openHelpPage() {}", "help() {\nlet helpData = getHelpData();\nlet keywords = Object.keys(helpData.keywords);\nlet ids = null;\nthis._help = this._help.toUpperCase();\nfor (let i = 0; i < keywords.length; i++) {\nif (keywords[i].toUpperCase().indexOf(this._help) !== -1) {\nids = helpData.keywords[keywords[i]];\n}\n}\nif (!ids) {\nreturn;\n}\nlet id = ids[0];\nlet item = null;\nif (id in helpData.subjectById) {\nitem = helpData.subjectById[id];\n} else if (id in helpData.sectionById) {\nitem = helpData.sectionById[id];\n}\nif (!item) {\nreturn;\n}\ndispatcher.dispatch(\n'Dialog.Help.Show',\n{\nkeyword: this._help,\nfileIndex: item.fileIndex\n}\n);\n}", "function showHelp(){\n showListHelp();\n}", "function displayHelp() {\t\n\tvar win;\n\tvar baseWindow = window;\n\t\n\t// get mother of all windows \n\twhile (baseWindow.opener) {\t\t\n\t\tbaseWindow = baseWindow.opener;\t\t\n\t}\n\n\t/* PNI, MDO:\n\t * Variable top.helpUrl is set on each page, \n\t * so we know what help page is to be open with certain page\t \n\t */\n\t\t\n\tvar url = top.helpUrl;\n\t\n\tif (url && (url != '')) {\n\n\t\twin = (window.open(url ,'help','menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, status=yes,fullscreen=yes')).focus();\n\t\tbaseWindow.top.openedWindows.push(win);\n\t\t\n\t}\n}", "function showHelp() {\n\t//Use figlet npm package to convert text to art/drawing.\n\tfiglet('LIRI help', function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\tvar helpInfo = \"Usage: node liri.js <command> [arguments]\"\n\tvar helpColumns = columnify([{\n\t\tCommand: 'my-tweets',\n\t\tDescription: \"Shows the last 20 tweets from Twitter timeline and when they were created.\"\n\t}, {\n\n\t\tCommand: \"movie-this [movie_name]\",\n\t\tDescription: \"Shows information about the specifid movie. If no movie is specified, Mr. Nobody is displayed by default.\"\n\t}, {\n\n\t\tCommand: \"spotify-this-song [song_name]\",\n\t\tDescription: \"Shows top 10 songs on Spotify that have specified name. If no song is specified, The Sign by Ace of Base is displayed by default.\"\n\t}, {\n\n\t\tCommand: 'do-what-it-says',\n\t\tDescription: \"Shows the top 10 songs on Spotify for the song, 'I want it that way.'\"\n\t}])\n\tconsole.log(\"==================================================================================================\");\n\tconsole.log(helpInfo);\n\tconsole.log(\"==================================================================================================\");\n\tconsole.log(helpColumns);\n}", "getHelp () {\n var editor = atom.workspace.getActiveTextEditor()\n\n if (editor && editor.getGrammar().scopeName === 'source.matlab') {\n var keyword = atom.workspace.getActiveTextEditor().getSelectedText()\n var htmlPath = path.join(MatlabHelpView.prototype.getHelpPath(), keyword + '.html')\n var docPath = path.join(MatlabHelpView.prototype.getHelpPath(), '..', 'index.html')\n\n if (!keyword) {\n atom.workspace.open('atom-matlab-editor://matlab-help').then((view) => {\n if (view instanceof MatlabHelpView) view.loadView(docPath, '')\n })\n } else if (fs.existsSync(htmlPath)) {\n atom.workspace.open('atom-matlab-editor://matlab-help').then((view) => {\n if (view instanceof MatlabHelpView) view.loadView(htmlPath, '')\n })\n }\n }\n }", "function help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "function onHelpButtonClick() {\n\t\t\talert(\"帮助:\\n\\n\" +\n\t\t\t\t\"##用得开心就好!##\\n\\n\" +\n\t\t\t\t\"\", \"SPRenderQueueTools\"\n\t\t\t);\n\t\t}", "function createIntroWindow() {\n pageCollection.showHelp();\n}", "function onHelp( a_label )\n{\n helpWindow = window.open( 'edit_help.html#' + a_label, \"edit_help\" );\n helpWindow.focus();\n}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "openHelpWindow(source) {\n EnigmailWindows.openWin(\n \"enigmail:help\",\n \"chrome://openpgp/content/ui/enigmailHelp.xhtml?src=\" + source,\n \"centerscreen,resizable\"\n );\n }", "function toggleHelp() {\n\ttoggleAnalyserPanel('help');\n}", "function xhelp(xdocname) {\n var xdocurl = \"/vwweb/help/\" + xdocname + \".html\";\n helpdoc = window.open(xdocurl,\"InstructionWindow\",\"width=500,height=400,toolbar=no,menubar=no,scrollbars\");\n }", "helpText(){\n\n if(this.getStep() === 0 ){\n return ` -== HELP ==-\n The first line is 1 integer, consisting of the number of the number of lines of source code (N).\n The second line is 1 integer, constiting of the number of queries (Q).\n The next N lines consiste of HRML source code, consisting of either an opening tag with zero or more attributes or a closing tag. \n Then the next Q lines contains the queries. \n Each line is a string that references an attribute in the HRML source code.`;\n\n }else if(this.getStep() === 1){\n return 'START';\n }\n }", "function Help() {\n}", "function Help() {\n}", "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function showHelpUsage() {\n let helpString = \"Hei, olen Relluassari! Yritän auttaa sinua relaatioiden ratkonnassa ;) \\n\" +\n \"<<< Koska olen vielä beta, älä pahastu jos en osaa jotain, tai kaadun kesken kaiken >>> \\n\" +\n \" \\n Miten kutsua minut apuun? \\n \" +\n \" TL;DR? Klikkaa tunnettua -> klikkaa tuntematonta -> klikkaa tuntematonta -> ... -> Repeat \\n\" +\n \" \\nEli miten? \\n\" +\n \" 1) Klikkaa graafista tunnettua sanaa \\n\" +\n \" -> Relluassari tekee Wikipediasta, Bingistä, Wiktionarystä ja Ratkojista lähdehaut ko. sanalla. \\n\" +\n \" 2) Kun haku valmis, klikkaa graafista tunnettuun kytkettyä tuntematonta sanaa \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 3) Kun brutetus valmis, klikkaa seuraavaa tunnettuun kytkettyä tuntematonta \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 4) Valitse uusi tunnettu sana lähteeksi ja siirry kohtaan 1) \\n\" +\n \"\\nAdvanced usage: \\n\" +\n \" Menu>Suorita lähdehaku (teemasana) - tekee lähdehaun vain teemasanalla \\n\" +\n \" Menu>Suorita lähdehaku (oma sana) - tekee lähdehaun syöttämälläsi sanalla/sanoilla (esim. usean sanan hakuun Bingistä) \\n\" +\n \" Menu>Parsi hakutulos sanoiksi - parsii hakutuloksesta *kaikkien* näkyvien tuntemattomien pituiset sanat \\n\" +\n \" Menu>Bruteta sanalista - brutettaa rellua sen hetken muistissa olevalla koko sanalistalla \\n\";\n alert(helpString);\n}", "help() {\n return util.call('help')\n }", "help(text) {\n return this.lib.help(text, __dirname);\n }", "function over(id_doc,id_help,texte,global,chaine)\r\n\t{\r\n\t\tikdoc(id_doc);// Add call of doc page\r\n\t\tset_text_help(id_help,texte,global,chaine,id_doc);\r\n\t}", "function help() {\n console.log(\n \"\\n\" +\n \"STRUCTURE\" +\n \"\\033[38;5;6m\" + \"\\n node liri.js (command) + (search(artist, concert, movie))\\n\" + \"\\033[0m\" +\n \"\\nCOMMAND OPTIONS\" +\n \"\\033[38;5;10m\" +\n \"\\n spotify-this-song\" + \"\\033[0m\" + \" search for artist details\" +\n \"\\033[38;5;10m\" +\n \"\\n concert-this\" + \"\\033[0m\" + \" search for concert details\" +\n \"\\033[38;5;10m\" +\n \"\\n movie-this\" + \"\\033[0m\" + \" search for movie details\" +\n \"\\033[38;5;10m\" +\n \"\\n do-what-it-says\" + \"\\033[0m\" + \" run a search based on what is written in 'random.txt'\"\n )\n}", "function Window_Help() {\n this.initialize.apply(this, arguments);\n}", "function helpDialog(helpText , title ,win , meta_wgl){\r var diag = new Window (\"dialog\",title + \"\");\r diag.preferredSize = {\"width\":450,\"height\":450};\rvar pan = diag.add('group',undefined,'');\r pan.orientation ='column';\rvar txt = pan.add('edittext',undefined,helpText,{multiline:true,scrolling: true});\r txt.preferredSize = {\"width\":440,\"height\":430};\rvar btg = pan.add (\"group\");\r\rvar cbg = btg.add (\"group\");\r\r cbg.alignment = \"left\";\r\r// var reset_button = cbg.add (\"button\", undefined, \"Reset Values to default\");\r\r btg.orientation = 'row';\r btg.alignment = \"right\";\r btg.add (\"button\", undefined, \"OK\");\r btg.add (\"button\", undefined, \"cancel\");\r\r\r if (diag.show () == 1){\r\r return true;\r\r }else{ \r\r return false;\r\r };\r}", "function openHelpWindow(contextName) {\r\n var pageURL = makeHelpURL() + contextName;\r\n openWin(pageURL);\r\n}", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "function help_menu() {\n console.log('Please use one of the following commands:')\n console.log('Summary: ./pandlss.sh -s <date> <time>')\n console.log('Breakdown: ./pandlss.sh -b <date> <time> <increment>')\n console.log('Breakdown one stock: ./pandlss.sh -b-os <stock> <date> <time> <increment>')\n}", "getHelpText(){\n return \"Tree Authoring Shell: Commands: cd {id} | @{id}. set tag {tags} | #{tag}, set value {variable} {value} | ${variable}: {value}, rm {id}, link {id} {id} | {id} > {id}, stash, unstash, prior | <, search {type} {variable} {value}\";\n\n }", "function displayHelpPage() {\n // Set display to \"no category selected\".\n pageCollection.setCategory('noCat');\n // Display the default page.\n pageCollection.setPage('helpPage');\n}", "function FreeTextDocumentationView() {\r\n}", "function showHelpMessage(hm) {\n $('#helpMessage').html(hm).showv();\n}", "onHelpClick() {\n Linking.openURL(helpURL);\n }", "function showhelp(){\n var helpWin = document.getElementById('shortcuthelp')\n if (helpWin){\n if (helpWin.style.display == \"block\"){\n helpWin.style.display = \"none\";\n }\n else {\n helpWin.style.top = window.pageYOffset+40;\n helpWin.style.display = \"block\";\n }\n }\n else {\n helpWin = document.createElement(\"div\");\n helpText = document.createElement(\"div\");\n helpWin.setAttribute(\"id\",\"shortcuthelp\");\n helpWin.innerHTML = \"<div style='color:black; background-color:#ff6600; width:100%; font-weight:bold;'>Shortcut commands</div><div style='font-size:.8em;'><i>Use shift as a modifier</i></div>\";\n helpWin.appendChild(helpText);\n for( i in ACTIONS) {\n helpText.innerHTML += \"<pre style='display:inline'>\"+i+\"</pre> : \"+ ACTIONS[i][0]+\"<br/>\";\n if (ACTIONS[i][1].length > 0 ){\n helpText.innerHTML += \"<pre style='display:inline; padding-left:1em;'>\"+i.toUpperCase()+\"</pre> : \"+ ACTIONS[i][1]+\"<br/>\";\n }\n }\n helpWin.setAttribute(\"style\",\"display: block; position: absolute; top: \"+(window.pageYOffset+40)+\"px; right: 10px; background-color: rgb(246, 246, 239);\");\n helpText.setAttribute(\"style\",\"padding:5px;\");\n \n document.childNodes[0].childNodes[1].appendChild(helpWin);\n }\n}", "function showHelp (fileName) {\r\n\tif (fileName === null || fileName == \"\") { fileName = \"Help.html\"; }\r\n helpWindow = window.open (\"/help/\" + fileName, 'Help', \"left=400,top=0,toolbar=yes,scrollbars=yes,menubar=yes,resizable=yes,location=yes,status=yes,height=575,width=700\");\r\n try {\r\n helpWindow.focus();\r\n } catch (e) {\r\n \r\n } \r\n}", "getHelp ( input, output ) {\n output.standardOutput.writeLine( 'Usage:' );\n this.getUsage().split( '\\n' ).forEach( line => output.standardOutput.writeLine( line ) );\n output.standardOutput.writeLine( '' );\n\n if ( this.getDescription() ) {\n output.standardOutput.writeLine( 'Description:' );\n output.standardOutput.writeLine( this.getDescription() );\n }\n\n output.standardOutput.writeLine( '' );\n }", "helpInformation() {\n let desc = [];\n\n if (this._description) {\n desc = [this._description, ''];\n const {\n argsDescription\n } = this;\n\n if (argsDescription && this._args.length) {\n const width = this.padWidth();\n desc.push('Arguments:');\n desc.push('');\n\n this._args.forEach(({\n name\n }) => {\n desc.push(` ${pad(name, width)} ${argsDescription[name]}`);\n });\n\n desc.push('');\n }\n }\n\n let cmdName = this._name;\n\n if (this._alias) {\n cmdName = `${cmdName}|${this._alias}`;\n }\n\n const usage = [`Usage: ${cmdName} ${this.getUsage()}`, ''];\n let cmds = [];\n const commandHelp = this.commandHelp();\n if (commandHelp) cmds = [commandHelp];\n const options = ['Options:', `${this.optionHelp().replace(/^/gm, ' ')}`, ''];\n return usage.concat(desc).concat(options).concat(cmds).join('\\n');\n }", "function help() {\n\tvar commandsArray = ['Help: List of available commands',\n\t\t'<span class=\"green\">>about</span>',\n\t\t'<span class=\"yellow\">>contact</span>',\n\t\t'<span class=\"purple\">>projects</span>',\n\t\t'<span class=\"orange\">>skills</span>',\n\t\t'<span class=\"blue\">>experiences</span>',\n\t\t'>help',\n\t\t'>ping',\n\t\t'>time',\n\t\t'>clear',\n\t\t'>say',\n\t\t'>info',\n\t\t'>exit'];\n\tseperator();\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function do_help(cmd) {\n let helptext = [\n \"sofa-tool make-workset <container_url> <workset_name>\",\n \"sofa-tool add-fragment <workset_url> <fragment_url> <fragment_name>\",\n // \"\",\n // \"\",\n ];\n helptext.forEach(\n (txt) => { console.log(txt); }\n );\n return Promise.resolve(null)\n .then(() => meld.process_exit(meld.EXIT_STS.SUCCESS, \"Help OK\"))\n ;\n}", "function getHelpCommon() {\n var help = \"\\\n<br/>#a (#app, show available apps) \\\n<br/>#a chess {#app chess, open 6-piece chess app window) \\\n<br/>#a {app} (#app, open given app or url) \\\n<br/>#a1 (#a on, #app on, turn on app) \\\n<br/>#a0 (#a off, #app off, hide app window) \\\n<br/>#ac (#a clear, #app clear, clear any app and hide app window) \\\n<br/>#c {room} (#create, create and join a new room) \\\n<br/>#e (#erase, erase chatroom content) \\\n<br/>#h (#?, #help, show help) \\\n<br/>#hm (#help master, show help for room master) \\\n<br/>#i {user} (#invite, invite a user to current room) \\\n<br/>#j {room} (#join, join an existing room) \\\n<br/>#l (#leave, leave current room, and enter Lobby) \\\n<br/>#o (#who, list users in current room) \\\n<br/>#p (#passwd, update password) \\\n<br/>#r (#rooms, list online rooms) \\\n<br/>#u (#users, list online users) \\\n<br/>#v1 (#vid, #vid on, turn on video camera) \\\n<br/>#v0 (#vid off, turn off video camera) \\\n<br/>#w (#where, show current room name) \\\n<br/>#x (#exit, #logout, logout) \\\n\";\n return help;\n }", "helpInfo () {\n\t\tlet me = this;\n\n\t\treturn [\n\t\t\t$('<h3>').append(\n\t\t\t\tt('Adicionar um novo equipamento à aventura')\n\t\t\t),\n\t\t\tEquipament.helpTypeMeaning()\n\t\t];\n\t}", "function setupHelpMain() {\n\tupkeep();\n\t\n\t// scale font\n\tvar a = $('#help_wrapper div.help-item-content');\n\ta.css('font-size', a.height()*0.35);\n\t\n\t// hover event\n\t$('#help_wrapper').on({\n\t\tclick: function() {\n\t\t\t\n\t\t},\n\t\tmouseenter: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\");\n\t\t\t$(this).css({'background-color': 'rgba(0, 255, 50, 0.75)', 'color': 'black'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'10px'});\n\t\t},\n\t\tmouseleave: function() {\n\t\t\t//$(this).children('img').attr(\"src\", \"\")\t\n\t\t\t$(this).css({'background-color': 'rgba(0, 0, 0, 0.65)', 'color': '#00ff32'});\n\t\t\t$(this).closest('div.help-item-outer').css({'left':'0'});\t\t\t\n\t\t}\n\t}, 'div.help-item-content');\n\t\n\t// do some custom drawing\n\tDRAW.helpBorder($('#help_title'));\n\tDRAW.previewBorder($('#help_preview'));\n\tDRAW.helpDeco($('#help_decoration'));\n\t\n\t// convert to pixel height\n\tvar b = $('#help_wrapper div.help-item-outer');\n\tb.height(b.height());\n\t\n\t// initialize custom scrollbar\n\t$('#help_wrapper').jScrollPane({'verticalGutter': 15});\n}", "function onHelpButtonPress(){\n\talert(strHelp);\n}", "get help() {\n\t\tlet response = \"\"\n\t\tif (this._description) { \n\t\t\tresponse = this._description; \n\t\t}\n\n\t\tresponse += \" - Usage: \" + this.format;\n\t\tresponse += \" - Ex: \" + this.example;\n\n\t\treturn response;\n\t}", "printHelpText() {\n const helpText = fs.readFileSync(\n path.join(__dirname, 'cli-help.txt'), 'utf8');\n logHelper.info(helpText);\n }", "function doHelpButton()\n{\n var selTab = document.getElementById(\"tabbox\").selectedTab;\n var key = selTab.getAttribute(\"help\");\n openHelp(key, \"chrome://communicator/locale/help/suitehelp.rdf\");\n}", "function UHelpNATIVE(topic,mode,logicalname)\n{\n w = window.open(\"help?topic=\"+topic+\"&mode=\"+mode+\"&logicalname=\"+logicalname, \"UnifaceHelpNative\",\n \"scrollbars=yes,resizable=yes,width=400,height=200\");\n if (uTestBrowserNS()) {\n w.focus();\n }\n}", "function help() {\n\tvar message;\n\tmessage = \"The following are valid text commands: N or n to move North, S or s to move South, W or w to move West, E or e to move East, or T or t to take an item at a given location.\";\n\tdocument.getElementById(\"Help\").innerHTML = message;\n}", "function openHelp(){\n $mdDialog.show(\n {\n templateUrl: \"app/components/helpDialog/helpDialog.html\",\n locals: PageHeaderFactory.getPageHelpContents(),\n bindToController: true,\n controller: function($mdDialog){\n this.hide = function(){\n $mdDialog.hide();\n };\n },\n controllerAs: \"Help\",\n clickOutsideToClose: true\n }\n );\n }", "function displayHelp(height,width,Link) {\n\tvar w=width+\"px\";\n\tvar h=height+\"px\";\n\t\n\tif (Link)\n\t{\n\t\turlPage=Link;\n\t\thelpURI=\"./showHelp2.asp#_\" + urlPage;\n\t}\n\telse\n\t{\n\t\tvar helpURI, urlPath, urlPage,m,n;\n\t\tvar objHelpWindow;\n\t\turlPath = location.pathname.toUpperCase();\n\t\tm = urlPath.lastIndexOf('/');\n\t\tn = urlPath.indexOf('.ASP');\n\t\tif (urlPath.indexOf('.ASP')== -1 ){\n\t\t\turlPage = \"HOMEPAGE\";\n\t\t} else {\n\t\t\turlPage = urlPath.substring(m+1,n);\n\t\t}\n\t\thelpURI=\"./showHelp.asp#_\" + urlPage;\n\t}\n\tif (urlPage==\"MAPPINGCENTER\") {\n\t\thelpURI=\"http://websas.bts.gov/website/help/maphelp/index.htm\";\n\t\tobjHelpWindow=window.open(helpURI,\"Help\");\n\t} else {\n\t\twindef=\"HEIGHT=\" + h +\",WIDTH=\" + w + \",Left=0, Top=0, dependent=yes,resizable=yes\"\n\t\tobjHelpWindow = window.open(\"\",\"Help\",windef);\n\t\tobjHelpWindow.location.href=helpURI;\n\t\tobjHelpWindow.focus(); \n\t}\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 helpMenu() {\n $scope.menuTitle = createText(\"Help\", [20, 10]);\n createText(\"Sorry you can't count on anyone's help for now\", [50, 80], {font: 'bold 20px Arial'});\n }", "function pickHelp(context) {\n var helpMessage = \"\";\n helpMessage = \"<p>Click on UI elements to find out more about them.<br>Click <b>?</b> to hide this pane.<br>Go <a href='changelog.html' >here</a> to see the list of changes and coming features.</p>\";\n return helpMessage;\n }", "function NewScriptDialogHelp() {\n\tgetNewScript().showDialog('Sheeter-DialogHelp.html', project_name + ' Help');\n}", "function action_help_texts(section) {\n\t$('div.step1details div.tips').hide();\n\tvar open_section = $('div#sideinfo-'+ section);\n\topen_section.show();\n}", "function getHelpAll() {\n var help = \"\\\n<br/>#a (#app, show available apps) \\\n<br/>#a chess {#app chess, open 6-piece chess app window) \\\n<br/>#a {app} (#app {app}, open given app or url) \\\n<br/>#a1 (#a on, #app on, turn on app) \\\n<br/>#a0 (#a off, #app off, hide app window) \\\n<br/>#ac (#a clear, #app clear, clear any app and hide app window) \\\n<br/>#b (#public, set room as public) \\\n<br/>#c {room} (#create, create and join a new room) \\\n<br/>#e (#erase, erase chatroom content) \\\n<br/>#h (#?, #help, show help) \\\n<br/>#ha (#help all, show help for all commands) \\\n<br/>#hm (#help master, show help for room master) \\\n<br/>#i {user} (#invite, invite a user to current room) \\\n<br/>#j {room} (#join, join an existing room) \\\n<br/>#k {user} (#kick, kick a user out of current room) \\\n<br/>#l (#leave, leave current room, and enter Lobby) \\\n<br/>#m {user} (#master, assign another room user as master) \\\n<br/>#o (#who, list users in current room) \\\n<br/>#p (#passwd, update password) \\\n<br/>#r (#rooms, list online rooms) \\\n<br/>#s {size} (#size, set room max size, 0 means no limit) \\\n<br/>#u (#users, list online users) \\\n<br/>#v (#private, set room as private) \\\n<br/>#v1 (#vid, #vid on, turn on video camera window) \\\n<br/>#v0 (#vid off, turn off video camera window) \\\n<br/>#w (#where, show current room name) \\\n<br/>#x (#exit, #logout, logout) \\\n\";\n return help;\n }", "function makeHelpURL(includeNav) {\r\n var context = \"context=\"+helpContext;\r\n var nav = \"single=true\";\r\n if (includeNav) {\r\n // when single is false, navigation pane appears\r\n nav = \"single=false\";\r\n }\r\n return (contextPath + helpURL +\"?\" + nav + \"&\" + context + \"&\" + \"topic=\");\r\n}", "function helpNav(){\n helpBox.innerHTML = \"<h3 style='color: white; font-style: italic'>This is the navigation bar. It displays links to other basic applications on the site. Authentication is also listed.</h3>\";\n showHelp();\n }", "function help() {\n res.send(\n {\n \"response_type\": \"ephemeral\",\n \"text\": \"Type `/support` for status accross all filters. Add a case link `https://help.disqus.com/agent/case/347519` or an email `archon@gmail.com` to get specific.\",\n }\n )\n }", "function showNeedHelpUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo',showFooterPopup, messages['gettingStartedUrl']);\n\treturn false;\n}", "function showToolTipHelp() {\n\t\tvar link = tip.triggerElement;\n\t\tif (!link) {\n\t\t\treturn false;\n\t\t}\n\t\tvar table = link.getAttribute('data-table');\n\t\tvar field = link.getAttribute('data-field');\n\t\tvar key = table + '.' + field;\n\t\tvar response = cshHelp.key(key);\n\t\ttip.target = tip.triggerElement;\n\t\tif (response) {\n\t\t\tupdateTip(response);\n\t\t} else {\n\t\t\t\t// If a table is defined, use ExtDirect call to get the tooltip's content\n\t\t\tif (table) {\n\t\t\t\tvar description = '';\n\t\t\t\tif (typeof(top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t} else if (opener && typeof(opener.top.TYPO3.LLL) !== 'undefined') {\n\t\t\t\t\tdescription = opener.top.TYPO3.LLL.core.csh_tooltip_loading;\n\t\t\t\t}\n\n\t\t\t\t\t// Clear old tooltip contents\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: description,\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: ''\n\t\t\t\t});\n\t\t\t\t\t// Load content\n\t\t\t\tTYPO3.CSH.ExtDirect.getTableContextHelp(table, function(response, options) {\n\t\t\t\t\tExt.iterate(response, function(key, value){\n\t\t\t\t\t\tcshHelp.add(value);\n\t\t\t\t\t\tif (key === field) {\n\t\t\t\t\t\t\tupdateTip(value);\n\t\t\t\t\t\t\t\t// Need to re-position because the height may have increased\n\t\t\t\t\t\t\ttip.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, this);\n\n\t\t\t\t// No table was given, use directly title and description\n\t\t\t} else {\n\t\t\t\tupdateTip({\n\t\t\t\t\tdescription: link.getAttribute('data-description'),\n\t\t\t\t\tcshLink: '',\n\t\t\t\t\tmoreInfo: '',\n\t\t\t\t\ttitle: link.getAttribute('data-title')\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function helpPopup(anchor) {\r\n\twindow.open(app_path_webroot_full+'index.php?action=help'+(anchor == null ? '' : '#'+anchor),'myWin','width=850, height=600, toolbar=0, menubar=0, location=0, status=0, scrollbars=1, resizable=1');\r\n}", "function openHelp() {\n\twindow.open(\"help.html\", \"_blank\");\n}", "function execHelp(args, msg) {\n if (args.length == 0) msg.channel.send(\"Please provide some more information, try using `!help [topic]`\");\n else msg.channel.send(\"Dont worry i'm here to help you with \" + args + \"!\");\n }", "function TreeHelp() {\n}", "function showHelp() {\t\n const helpText = fs.readFileSync('./help.txt',{encoding:'UTF-8'});\n console.log(helpText);\n}", "function commonHelpInfo(objCase, delement, dialogtitle,showalways) {\r\n\tif (objCase!=null) {\r\n\t\tvar clientHelpText = objCase._client.specs;\r\n\t\tif (showalways!=null && showalways)\r\n\t\t{\r\n\t\t // Display Client Help Text if it is defined.\r\n\t \tshowJQueryDialog(delement,dialogtitle ,clientHelpText); \t\r\n\t $(delement).css('display','block');\t\t\r\n\t\t} else\r\n\t\t{\r\n\t\t if (clientHelpText && clientHelpText != '') {\r\n\t\t \tshowJQueryDialog(delement,dialogtitle,clientHelpText); \t\r\n\t\t $(delement).css('display','block');\r\n\t\t } else {\r\n\t\t $(delement).css('display','none');\r\n\t\t }\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n}", "function help() {\n console.log(`Today I Learned\n\n Run locally with:\n\n node ./til.js\n\n Usage:\n\n til add \"something cool i learned today\"\n adds an entry to your TIL DB\n til list\n shows all entries, day by day\n til help\n shows this message\n `)\n process.exit(0);\n}", "function usage(){\n\tmsg.setBodyAsHTML('Bash Help:');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display a Quote: /bash [integer]');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display a Random Quote: /bash random');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display Help: /bash help');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Ex: /bash 5273');\n\tview.echoSentMessageToDisplay(msg);\n}", "printHelp(obj){\n console.log();\n this.terminal.green(\"Usage: %s [options]\\n\", obj.cmd ? obj.cmd : \"\");\n if( obj.desc ){\n this.terminal.brightBlack(\"\\t%s\\n\", obj.desc);\n }\n if( obj.opts && obj.opts.length > 0 ){\n this.terminal.black(\"\\nOptions:\\n\");\n let opt;\n for( let i = 0; i < obj.opts.length; i++ ){\n opt = obj.opts[i];\n if( !opt.cmd )\n continue;\n\n this.terminal.green(\"%s\\t%s\\n\", opt.cmd, opt.desc ? opt.desc : \"\");\n }\n }\n }", "static helpDialog (boxId) {\n\t\tlet me = Box.getBox(boxId);\n\n\t\tif (typeof me.helpInfo === 'function') {\n\n\t\t\tlet dialogId = me.createId('help_dialog');\n\n\t\t\t$(\"#master-table\").append(\n\t\t\t\t$(\"<div>\", {\n\t\t\t\t\tid: dialogId,\n\t\t\t\t\ttitle: '? ' + me.title + ' ?'\n\t\t\t\t}).html(me.helpInfo()) // window[id]()\n\t\t\t);\n\n\t\t\tvar height = $(window).height() - 30;\n\n\t\t\t$('#'+dialogId).dialog({\n\t\t\t\tposition: {\n\t\t\t\t\tmy: 'right top',\n\t\t\t\t\tat: 'right top',\n\t\t\t\t\tof: me.positionOf\n\t\t\t\t},\n\t\t\t\twidth: 420,\n\t\t\t\theight: height,\n\t\t\t\tshow: { effect: \"fade\", duration: 400 },\n\t\t\t\tclose: function(event, ui)\n\t\t\t\t{\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t$(this).remove();\n\t\t\t\t}\n\t\t\t}).css(\"background-color\", \"#dff\").css('padding', '4px');\n\t\t} else {\n\t\t\talert(t('Sem ajuda para essa funcionalidade ainda :('));\n\t\t}\n\t}", "function help(object)\n{\n\tif(object.id == \"help\")\n\t{\n\t\tobject.id = \"helpclick\";\n\t\tobject.innerHTML = helptekst(page);\n\t}\n\telse if(object.id == \"helpclick\")\n\t{\n\t\tobject.id = \"help\";\n\t\tobject.innerHTML = \"\";\n\t}\n\telse if(object.id == \"scroll\")\n\t{\n\t\tobject.id = \"clickscroll\";\n\t\tobject.innerHTML = helptekst(page);\n\t}\n\telse\n\t{\n\t\tobject.id = \"scroll\";\n\t\tobject.innerHTML = \"\";\n\t}\n}", "function js_open_help(scriptname, actiontype, optionval)\n{\n\treturn openWindow(\n\t\t'help.php?s=' + SESSIONHASH + '&do=answer&page=' + scriptname + '&pageaction=' + actiontype + '&option=' + optionval,\n\t\t600, 450, 'helpwindow'\n\t);\n}", "function Docs() {}", "function show_help(text)\n{\n // set workframe window for navigator pane\n if(window.name == \"treeframe\"){\n var mywindows = window.parent.frames[\"workframe\"].document; \n } else {\n var mywindows = window.document;\n }\n\n var myElement = mywindows.getElementById(\"tlhelp\");\n if(myElement == null)\n {\n \n var mybody = mywindows.getElementsByTagName(\"body\").item(0);\n var newdiv = mywindows.createElement('div');\n newdiv.setAttribute('id', 'tlhelp');\n newdiv.setAttribute('onclick', 'javascript: close_help()');\n mybody.appendChild(newdiv);\n\n myElement = mywindows.getElementById(\"tlhelp\");\n }\n\n myElement.innerHTML = text;\n}", "function StringHelp() {\n}", "function setHelpUrl (url) {\n\ttop.helpUrl = url;\t\n\n}", "function returnFromHelpScreen() \n{\n\twhichHelpScreen = 0;\n\tdocument.getElementById(\"Help\").style.display = \"none\";\n\tdocument.getElementById(\"helpText1\").style.display = \"none\";\n\tdocument.getElementById(\"text1\").style.display = \"none\";\n\tdocument.getElementById(\"helpText2\").style.display = \"none\";\n\tdocument.getElementById(\"helpText3\").style.display = \"none\";\n\tdocument.getElementById(\"toHelp\").style.display = \"none\";\n\tdocument.getElementById(\"toTitle\").style.display = \"none\";\n\tdocument.getElementById(\"phase1\").style.display = \"none\";\n\tdocument.getElementById(\"phase2\").style.display = \"none\";\n\tdocument.getElementById(\"phase3\").style.display = \"none\";\n\tCrafty.stage.elem.style.display = \"block\";\n\tCrafty.scene('StartScreen');\n}", "function showHelp(heading) {\n\t// open the dialog\n\t$('#help_dialog').dialog('open');\n\t$('#help_dialog_text').parent().scrollTo($('#help_' + heading), {duration:1000});\n}", "function showHelp(id){\n if (!document.getElementsByTagName) return\n if (document.getElementById(id).style.display=='block'){\n document.getElementById(id).style.display='none'\n }\n else{\n document.getElementById(id).style.display='block'\n }\n // focus is moved by the href of the link to the start of the help\n}", "function showHelp() { \n var search = $(select).find(':selected').nextAll().andSelf();\n var num_display = 1;\n\n // Clear out div.\n $(suggest_div).find('.suggest-prompt').empty();\n \n // Add help text.\n for (var i = 0; i < Math.min(num_display, search.length); i++) {\n $(suggest_div).find('.suggest-prompt').append(\n search[i].value + ' -- ' + search[i].title + '<br/>' \n );\n }\n }", "function help_() {\n var html = HtmlService.createHtmlOutputFromFile('help')\n .setTitle(\"Google Scripts Support\")\n .setWidth(550)\n .setHeight(350);\n var ss = SpreadsheetApp.getActive();\n ss.show(html);\n}", "function setHelpPane(help) {\n $(\"#helpPane\").css(\"display\", \"block\"); \n $(\"#old-help-req\").empty();\n if (help.length > 0) {\n help.forEach((req) => {\n $('#old-help-req').append('<hr><div><p><b>Missione</b>: ' + req.mission_name\n + '<br><b>Attività</b>: ' + req.activity_name\n + '<br><b>Domanda</b>: <p class=\"help-question\">' + req.question\n + '</p><br><b>Risposta</b>: <p class=\"help-answer\">'\n + (req.answer || '<i>Ancora nessuna risposta</i>') + '</p></div>');\n });\n } else {\n $('#old-help-req').append('<p id=\"no-help-msg\">Non hai effettuato richieste</p>');\n }\n}", "function initHelp() {\n $('#showHelp').click(function () {\n var height = $('#mainHelp').css('height');\n $('#mainHelp').animate({height: height === '0px' ? 280 : 0}, 'slow');\n $('#showHelp').html(height === '0px' ? \"Hide help\" : \"Show me how\");\n return false;\n });\n }", "function createHelpShortcut( ns, scLoc, dxLoc )\r\n{\r\nvar scRet = false;\r\n try\r\n {\r\n var sFile = scLoc //+ '.lnk';\r\n if ( fo.fileExists ( sFile ) ) { fo.deleteFile ( sFile, true ); }\r\n var osl = WSHShell.CreateShortcut( sFile );\r\n osl.TargetPath = dxLoc + 'dexplore.exe';\r\n osl.Arguments = ' /helpcol ms-help://' + ns;\r\n osl.WindowStyle = 1;\r\n osl.IconLocation = dxLoc + \"dexplore.exe, 0\";\r\n osl.Description = ns + ' Help';\r\n osl.WorkingDirectory = dxLoc;\r\n osl.Save();\r\n scRet = true;\r\n }\r\n catch (err_createhelpshortcut)\r\n {\r\n scRet = false;\r\n }\r\nreturn scRet;\r\n}", "function showHelp(state)\n{\n\tif(state==0)\n\t\tdocument.getElementById(\"window_help\").style.display = \"block\";\n\telse\n\t\tdocument.getElementById(\"window_help\").style.display = \"none\";\t\n}", "constructor() {\n super('help', ['h']);\n this.setDescription('Do you really need to know how to ask for help?');\n }", "function help() {\n\tvar fpath = path.join( __dirname, 'usage.txt' );\n\tfs.createReadStream( fpath )\n\t\t.pipe( process.stdout )\n\t\t.on( 'close', onClose );\n\n\tfunction onClose() {\n\t\tprocess.exit( 0 );\n\t}\n}", "function help() {\n\tvar fpath = path.join( __dirname, 'usage.txt' );\n\tfs.createReadStream( fpath )\n\t\t.pipe( process.stdout )\n\t\t.on( 'close', onClose );\n\n\tfunction onClose() {\n\t\tprocess.exit( 0 );\n\t}\n}", "function outputHelp(){\n print([\n \"\\nUsage: csslint-rhino.js [options]* [file|dir]*\",\n \" \",\n \"Global Options\",\n \" --help Displays this information.\",\n \" --format=<format> Indicate which format to use for output.\",\n \" --list-rules Outputs all of the rules available.\",\n \" --rules=<rule[,rule]+> Indicate which rules to include.\",\n \" --version Outputs the current version number.\"\n ].join(\"\\n\") + \"\\n\");\n}", "function openHelpWindowWithNavigation(contextName) {\r\n var pageURL = makeHelpURL(true) + contextName;\r\n openWin(pageURL);\r\n}", "function showHelp() {\n console.log(optimist.help().trim());\n process.exit(0);\n}", "function openHelpWindow(url) {\n\tvar top = 30;\n\tvar left = Math.floor(screen.availWidth * .66) - 10;\n\tvar width = Math.floor(screen.availWidth * .33);\n\tvar height = Math.floor(screen.availHeight * .9) - 30;\n\tvar win = window.open(\"help/\" + url, 'DDWRT_Help', 'top=' + top + ',left=' + left + ',width=' + width + ',height=' + height + \",resizable=yes,scrollbars=yes,statusbar=no\");\n\twin.focus();\n}", "helpMessage() {\n return \"*!who-knows <skill-name>*\\n\" +\n \"Gibt eine Liste von Kollegen zurück, die den angegebenen Skill beherrschen.\\n\" +\n \"Die Liste wird durch die API von HBT Power bereitgestellt, die Suche ist (noch) case sensitive.\\n\" +\n \" Alias: !wer-weiß, !häää?, !who-knows, wat?\";\n }" ]
[ "0.7966596", "0.78671783", "0.77850354", "0.7770311", "0.7760902", "0.7679154", "0.7390747", "0.7337917", "0.73221624", "0.7283328", "0.72699034", "0.7244186", "0.7110629", "0.70616406", "0.70450634", "0.69755924", "0.6964677", "0.69352305", "0.6930826", "0.6920032", "0.6875726", "0.68659407", "0.68659407", "0.6848687", "0.6839555", "0.68144923", "0.68134964", "0.6798239", "0.67893344", "0.6756318", "0.674088", "0.6713313", "0.6711786", "0.6711786", "0.6695815", "0.66896087", "0.6671413", "0.66685176", "0.66414595", "0.66328186", "0.66297853", "0.660111", "0.6601075", "0.6599189", "0.65917116", "0.6572482", "0.6562949", "0.6557904", "0.65480304", "0.6544882", "0.654003", "0.6539596", "0.6528706", "0.65256697", "0.65214986", "0.65213484", "0.65153337", "0.65137756", "0.6513015", "0.64972067", "0.6493989", "0.6485936", "0.64835733", "0.647625", "0.64759666", "0.6467301", "0.64650464", "0.64331937", "0.6431149", "0.6411338", "0.64020336", "0.63986653", "0.6396178", "0.639213", "0.6390796", "0.6388239", "0.63849443", "0.63783807", "0.6378019", "0.6372021", "0.63491756", "0.6344222", "0.63415986", "0.6340655", "0.632819", "0.6318508", "0.63142294", "0.6302627", "0.6298405", "0.62961197", "0.62874925", "0.62825066", "0.6278178", "0.62772465", "0.62750703", "0.62750703", "0.62749535", "0.6267469", "0.626284", "0.62568045", "0.6253334" ]
0.0
-1
function that creates a permalink
function createPermalink(){ var visibleLayers = Array(); var permalink; var permalinkParams = {}; visibleLayers = getVisibleLayers(visibleLayers, layerTree.root.firstChild); visibleLayers = uniqueLayersInLegend(visibleLayers); var visibleBackgroundLayer = getVisibleBackgroundLayer(); var startExtentArray = geoExtMap.map.getExtent().toArray(); var startExtent = startExtentArray[0] + "," + startExtentArray[1] + "," + startExtentArray[2] + "," + startExtentArray[3]; if (!norewrite){ var servername = location.href.split(/\/+/)[1]; permalink = "http://"+servername; if (gis_projects) { permalink += gis_projects.path + "/"; } else { permalink += "/"; } permalink += wmsMapName+"?"; } else { permalink = urlArray[0] + "?map="; permalink = permalink + "/" + wmsMapName.replace("/", ""); //add .qgs if it is missing if (!permalink.match(/\.qgs$/)) { permalink += ".qgs"; } permalink += "&"; } // extent permalinkParams.startExtent = startExtent; // visible BackgroundLayer permalinkParams.visibleBackgroundLayer = visibleBackgroundLayer; // visible layers and layer order permalinkParams.visibleLayers = visibleLayers.toString(); // layer opacities as hash of <layername>: <opacity> var opacities = null; for (layer in wmsLoader.layerProperties) { if (wmsLoader.layerProperties.hasOwnProperty(layer)) { var opacity = wmsLoader.layerProperties[layer].opacity; // collect only non-default values if (opacity != 255) { if (opacities == null) { opacities = {}; } opacities[layer] = opacity; } } } if (opacities != null) { permalinkParams.opacities = Ext.util.JSON.encode(opacities); } //layer order permalinkParams.initialLayerOrder = layerOrderPanel.orderedLayers().toString(); // selection permalinkParams.selection = thematicLayer.params.SELECTION; if (permaLinkURLShortener) { permalink = encodeURIComponent(permalink + decodeURIComponent(Ext.urlEncode(permalinkParams))); } else { permalink = permalink + Ext.urlEncode(permalinkParams); } return permalink; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async createPermalink () {\n\t\tawait this.createLink();\t// create the link as needed\n\t\tawait this.updateCodemark();\t// update the codemark as needed\n\t\treturn this.url;\n\t}", "async createPermalink () {\n\t\tif (this.attributes.teamId) {\n\t\t\tthis.attributes.permalink = await new PermalinkCreator({\n\t\t\t\trequest: this.request,\n\t\t\t\tcodeError: this.attributes\n\t\t\t}).createPermalink();\n\t\t}\n\t}", "makePermalink (linkId, isPublic, teamId, type) {\n\t\tconst origin = this.origin || this.request.api.config.apiServer.publicApiUrl;\n\t\tconst linkType = type === 'c' ? (isPublic ? 'p' : 'c') : type;\n\t\tlinkId = this.encodeLinkId(linkId);\n\t\tteamId = this.encodeLinkId(teamId);\n\t\treturn `${origin}/${linkType}/${teamId}/${linkId}`;\n\t}", "function generatePermalink(url, desktopUrl, language, whitelabeled, cookies, frameBreaker, https, commaTrue){\n var permalink = '';\n permalink = permalink + '?url=' + url;\n permalink = permalink + '&lang=' + language;\n permalink = permalink + (whitelabeled == true ? '&wl': '');\n permalink = permalink + (cookies == true ? '&cookies': '');\n permalink = permalink + (frameBreaker == true ? '&fb': '');\n permalink = permalink + (https == true ? '&https': '');\n permalink = permalink + (commaTrue == true ? '&ct': '');\n permalinkHTML = \"<a href='\" + permalink + \"'>Permalink</a>\";\n return permalink;\n}", "function permalink() {\r\n\tvar link = document.getElementsByTagName(\"input\")[64].value;\r\n\tlink = link.replace(\" \", \"\");\r\n\tlink = link.replace(new RegExp(\".awdid=.\",\"i\"), '');\r\n\tlink = link.replace(new RegExp(\"[a-z]+\",\"g\"), '');\r\n\t\r\n\tvar full_link = 'http://mediatheque.mairie-saintnazaire.fr/uPortal/Initialize?uP_reload_layout=true&uP_tparam=props&uP_sparam=activeTab&activeTab=2&showBrief=true&link=full' + link + '&currentPosition=0&searchTargetId=16';\r\n\t\r\n\tif ((link != \"<Péé\")&&(link != \"\")&&(link != \"MOTSCLES\")) {\r\n\t\t// Affichage Permalien\r\n\t\tnewtd = document.createElement(\"td\");\r\n\t\tnewtd.id = 'permalien';\r\n\t\tnewtd.innerHTML = '&nbsp;&nbsp;<img src=\"http://antoinev.alwaysdata.net/link.png\"/> <a target=\"_blank\" href=\"' +full_link+'\">Permalien</a><br /><br />';\r\n\t\tdocument.getElementsByTagName(\"table\")[19].appendChild(newtd);\r\n\t\t}\r\n}", "function Permalink(url) {\n var center = null, zoom = null, gp = null, tp = null, p = null, bl = null;\n var graphs = [];\n var layers = [];\n var scales = {};\n if ('zoom' in url.params) {\n zoom = parseInt(url.params.zoom, 10);\n }\n if ('center' in url.params) {\n center = url.params.center.split(',').map(function(s) { return parseFloat(s); });\n }\n if ('gp' in url.params) {\n var fields = url.params.gp.split(':');\n gp = {\n 'open' : parseInt(fields[0],10) !== 0\n };\n if (fields.length > 1) {\n gp.width = parseInt(fields[1],10);\n }\n }\n if ('tp' in url.params) {\n tp = url.params.tp;\n }\n if ('p' in url.params) {\n if (url.params.p === \"L\") {\n p = ceui.LAYERS_PERSPECTIVE;\n } else {\n p = ceui.GRAPHS_PERSPECTIVE;\n }\n }\n if ('graphs' in url.params) {\n url.params.graphs.split(',').forEach(function(graphString) {\n var fields = graphString.split(':');\n graphs.push({id:fields[0], type:fields[1]});\n });\n }\n if ('scales' in url.params) {\n url.params.scales.split(',').forEach(function(scale) {\n var fields = scale.split(':');\n /////////////////////////////////////////////////////////////////////////////\n // temporary patch to provide backward compatibility with permalink URLs that\n // used the old vertical axis binding names (\"tempc\", \"ytd-prcpmm\", etc):\n if (fields[0] === \"tempc\") { fields[0] = \"temp\"; }\n else if (fields[0] === \"ytd-prcpmm\") { fields[0] = \"ytd-prcp\"; }\n else if (fields[0] === \"prcpmm\") { fields[0] = \"prcp\"; }\n else if (fields[0] === \"snowmm\") { fields[0] = \"snow\"; }\n // end of temporary patch; remove this patch once all links have been changed;\n // see https://github.com/nemac/climate-explorer/issues/26\n /////////////////////////////////////////////////////////////////////////////\n scales[fields[0]] = { min : fields[1], max : fields[2] };\n });\n }\n if ('layers' in url.params) {\n url.params.layers.split(',').forEach(function(layerString) {\n var fields = layerString.split(':');\n layers.push({id:fields[0], opacity:fields[1]});\n });\n }\n if ('bl' in url.params) {\n bl = url.params.bl;\n }\n return {\n 'toString' : function() { return url.toString(); },\n 'haveCenter' : function() { return center !== null; },\n 'getCenter' : function() { return center; },\n 'setCenter' : function(c) {\n center = c;\n url.params.center = sprintf(\"%.1f\", center[0]) + \",\" + sprintf(\"%.1f\", center[1]);\n },\n 'haveZoom' : function() { return zoom !== null; },\n 'getZoom' : function() { return zoom; },\n 'setZoom' : function(z) {\n zoom = z;\n url.params.zoom = zoom.toString();\n },\n 'haveTp' : function() { return tp !== null; },\n 'getTp' : function() { return tp; },\n 'setTp' : function(t) {\n tp = t;\n url.params.tp = t;\n },\n 'havePerspective' : function() { return p !== null; },\n 'getPerspective' : function() { return p; },\n 'setPerspective' : function(q) {\n p = q;\n if (p === ceui.LAYERS_PERSPECTIVE) {\n url.params.p = \"L\";\n } else {\n url.params.p = \"G\";\n }\n },\n 'haveGp' : function() { return gp !== null; },\n 'getGp' : function() { return gp; },\n 'setGp' : function(g) {\n gp = g;\n url.params.gp = gp.open ? \"1\" : \"0\";\n if ('width' in gp) {\n url.params.gp = url.params.gp + \":\" + gp.width;\n }\n },\n 'haveGraphs' : function() { return graphs.length > 0; },\n 'getGraphs' : function() { return graphs; },\n 'addGraph' : function(graph) {\n var i;\n // don't add this graph if it's already in the list\n for (i=0; i<graphs.length; ++i) {\n if (graphs[i].id === graph.id && graphs[i].type == graph.type) {\n return;\n }\n }\n graphs.push(graph);\n url.params.graphs = graphs.map(function(g) { return g.id + \":\" + g.type; }).join(\",\");\n },\n 'removeGraph' : function(graph) {\n for ( var i = graphs.length - 1; i >= 0; i-- ) {\n if (graphs[i].type === graph.type && graphs[i].id === graph.id) {\n graphs.splice ( i, 1 );\n break;\n }\n }\n\n if (graphs.length > 0) {\n url.params.graphs = graphs.map(function(g) { return g.id + \":\" + g.type; }).join(\",\");\n } else {\n delete url.params.graphs;\n }\n },\n 'removeStation' : function(id) {\n for ( var i = graphs.length - 1; i >= 0; i-- ) {\n if (graphs[i].id === id) {\n graphs.splice ( i, 1 );\n }\n }\n\n if (graphs.length > 0) {\n url.params.graphs = graphs.map(function(g) { return g.id + \":\" + g.type; }).join(\",\");\n } else {\n delete url.params.graphs;\n }\n },\n 'setScales' : function(aR) {\n var bindingId;\n for (bindingId in aR) {\n if (!(bindingId in scales)) {\n scales[bindingId] = {};\n }\n scales[bindingId].min = aR[bindingId].min;\n scales[bindingId].max = aR[bindingId].max;\n }\n url.params.scales = Object.keys(scales).map(function(bindingId) {\n return bindingId.replace(\"-binding\", \"\") + \":\" +\n sprintf(\"%.1f\", Number(scales[bindingId].min)) + \":\" +\n sprintf(\"%.1f\", Number(scales[bindingId].max));\n }).join(\",\");\n },\n 'haveScales' : function() {\n return Object.keys(scales).length > 0;\n },\n 'getScales' : function() { return scales; },\n 'haveLayers' : function() { return layers.length > 0; },\n 'getLayers' : function() { return layers; },\n 'addLayer' : function(layerId) {\n var i;\n // don't add this layer if it's already in the list\n for (i=0; i<layers.length; ++i) {\n if (layers[i].id === layerId) {\n return;\n }\n }\n layers.push({id : layerId, opacity : 1});\n url.params.layers = layers.map(function(lyr) { return lyr.id + \":\" + lyr.opacity; }).join(\",\");\n },\n 'setLayerOpacity' : function(layerId, opacity) {\n var i;\n // don't add this layer if it's already in the list\n for (i=0; i<layers.length; ++i) {\n if (layers[i].id === layerId) {\n layers[i].opacity = opacity;\n url.params.layers = layers.map(function(g) { return g.id + \":\" + g.opacity; }).join(\",\");\n return;\n }\n }\n },\n 'clearLayers' : function() {\n layers = [];\n delete url.params.layers;\n },\n 'removeLayer' : function(layerId) {\n for ( var i = layers.length - 1; i >= 0; i-- ) {\n if (layers[i].id === layerId) {\n layers.splice ( i, 1 );\n break;\n }\n }\n if (layers.length > 0) {\n url.params.layers = layers.map(function(g) { return g.id + \":\" + g.opacity; }).join(\",\");\n } else {\n delete url.params.layers;\n }\n },\n 'setBl': function(bl) {\n\turl.params.bl = bl;\n },\n 'haveBl': function() { return bl !== null; },\n 'getBl': function() { return bl }\n };\n }", "function getPermalink(item){\n // console.log('getPermalink:', item);\n switch(getService(item)) {\n case 'facebook':\n return 'https://www.facebook.com/photo.php?fbid='+item.data.id;\n // case 'foursquare':\n // return 'https://foursquare.com/ + ??? + /checkin/'+item.data.checkin.id;\n case 'twitter':\n return 'https://twitter.com/' + item.data.user.screen_name + '/statuses/' + item.data.id_str;\n case 'instagram':\n return item.data.link;\n case 'tumblr':\n return item.data.post_url;\n // case 'linkedin':\n // return '#';\n default:\n return '#link-unknown';\n }\n}", "function makeShortUrl() {\n \n var text = \"\";\n var charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\n for( var i=0; i < 5; i++ )\n text += charset.charAt(Math.floor(Math.random() * charset.length));\n \n var shortUrl = \"https://www.\" + text + \".com\";\n \n insertObj(url, shortUrl);\n \n }", "createShortenedListURL(params) {\n return ApiService.post('/link', { url: params.url });\n }", "get __permalink() {\n\t\t// Explicit permalink in front matter\n\t\tif (this.frontmatter.permalink !== undefined) {\n\t\t\treturn this.frontmatter.permalink;\n\t\t}\n\t\tlet custom = this.constructor.Permalink\n\t\t\t? this.constructor.Permalink(this)\n\t\t\t: undefined;\n\t\treturn normalize(\n\t\t\tcustom !== undefined\n\t\t\t\t? custom\n\t\t\t\t: this.constructor.DefaultPermalink(this)\n\t\t);\n\t}", "function newUrl() {\n\trecordUrl();\n\n\tconstructUrlMarkup(2);\n}", "function openPermalink() {\n\t\tvar query = '?';\n\t\tfor (var i = 0; i < prefNames.length; i++) {\n\t\t\tquery += prefNames[i] + '=' + permaInfo[i] + '&';\n\t\t}\n\t\t//slice away last '&'\n\t\tquery = query.substring(0, query.length - 1);\n\t\twindow.open(query);\n\t}", "function makeHyperlink(url){\n return '<a target=\"_blank\" href=\"'+ url+ '\">' + url + '</a>'\n}", "function newp(name) {\n var newfolder = process.cwd() + '/' + name;\n mkdirp(newfolder, function(err){\n if (err) {\n console.log(err.red);\n }\n\n mkdirp(newfolder + '/posts', function(err){\n if(err) {\n console.log(err.red);\n }\n });\n\n // Write template file\n var template = '<!DOCTYPE html> \\\n <html>\\\n <head>\\\n \\\n </head>\\\n <body>\\\n <h1>My Blog</h1>\\\n {{ feed }}\\\n </body>\\\n </html>\\ ';\n fs.writeFileSync(newfolder + '/template.html', template);\n\n // Write index file\n fs.writeFileSync(newfolder + '/index.html', '');\n });\n}", "function modifyPublishURL () {\n var path = window.location.pathname,\n // composite id\n cId = path.split('/').slice(-1)[0].split('-'),\n owner = cId[0],\n collectionId = cId.slice(1).join('-'),\n params = $.param({\n collection_id : collectionId,\n owner: owner,\n collection_name: initialJson.collection.info.name\n }),\n // Stupid hack , remove when you change the Publish button to do a form POST\n href = ($(this).attr('href').indexOf('meta') > 0) ? $(this).attr('href') :\n ($(this).attr('href') + '?meta=' + window.btoa(params));\n\n $(this).attr('href', href);\n}", "function getUrl( new_pagename ){\n\t\n\tvar parent = $( \"#select-parent :selected\" ).text( );\n\n\tvar host = \"http://\" + window.location.hostname + \"/\";\n\n\t$( \"#page-name\" ).removeClass( \"error\" );\n\n\tvar fullUrl = ( parent == \"---\" ) ? host + new_pagename.replace(/\\s/g,\"-\") : host + getParents( ) + ( parent + \"/\" + new_pagename ).replace(/\\s/g,\"-\");\n\n\t$( \"#slug-url\" ).html( fullUrl );\n\n\t$( \"#slug-url\" ).attr( \"href\", fullUrl );\n\n\t$( \"#slug-put\" ).attr( \"value\", new_pagename );\n}", "function createShortUrl(req, res) {\n var url = req.body.url;\n if (url && url.match(urlRegex)) {\n urlShortener.shorten(url, {userId: req.user})\n .then(function (shortUrl) {\n var formattedUrl = urlUtil.format({\n protocol: protocol,\n host: host,\n pathname: shortUrl.hash\n });\n return res.apiMessage(Status.OK, 'short url created', {url: formattedUrl});\n }).fail(function (err) {\n logger.error('Error creating short url', err);\n return res.apiMessage(Status.BAD_REQUEST, 'error creating short url', url);\n });\n } else {\n logger.error('Invalid URL', url);\n return res.apiMessage(Status.BAD_REQUEST, 'Invalid URL', url);\n }\n }", "function generateThumbs() {\r\n\t\t\tfunction createNewImgIndex(url, src, el) {\r\n jQuery('<a href=\"' + url + '\" style=\"background-image: url('+ src +');\"></a>').prependTo(el);\r\n\t\t\t}\r\n\r\n jQuery('.index .post').each( function() {\r\n\t\t\t\tvar postURL = jQuery(this).find('.post-title a').attr('href');\r\n\t\t\t\tvar firstImg = jQuery(this).find('img:first-of-type');\r\n\t\t\t\tvar firstImgSrc = firstImg.attr('src');\r\n\t\t\t\tif (typeof firstImgSrc !== 'undefined') {\r\n\t\t\t\t\tcreateNewImgIndex(postURL, firstImgSrc, this);\r\n\t\t\t\t\tfirstImg.parent().remove();\r\n\t\t\t\t\tfirstImg.parent().parent().parent().find('.post-excerpt').remove();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n jQuery('.index .post > a').wrap('<div class=\"post-image\" />');\r\n\t\t}", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "function createUrl(item) {\n var urlObj = {\n protocol: config.HOST.protocol,\n slashes: config.HOST.slashes,\n auth: config.HOST.auth,\n host: config.HOST.host,\n hostname: config.HOST.hostname,\n hash: config.HOST.hash,\n query: item,\n pathname: config.HOST.pathname\n }\n var urlString = url.format(urlObj);\n return urlString\n}", "function makeLink(url, text) {\n const selection = document.getSelection();\n document.execCommand('createLink', true, url);\n selection.anchorNode.parentElement.target = '_blank';\n selection.anchorNode.parentElement.innerHTML = text;\n showPostPreview();\n}", "function set_slug(){\n $('#project_name').on(\"keyup\",function() {\n name = $('#project_name').val();\n\t\turl = name.replace(/([^a-z0-9]+)/gi, '-').toLowerCase();\n\t\t$('#project_permalink').val(url);\n });\n}", "function createPost() {\n}", "validatePermalink (permalink) {\n\t\tconst type = 'r';\n\t\tconst origin = this.test.apiConfig.apiServer.publicApiUrl.replace(/\\//g, '\\\\/');\n\t\tconst regex = `^${origin}\\\\/${type}\\\\/([A-Za-z0-9_-]+)\\\\/([A-Za-z0-9_-]+)$`;\n\t\tconst match = permalink.match(new RegExp(regex));\n\t\tAssert(match, `returned permalink \"${permalink}\" does not match /${regex}/`);\n\n\t\tconst teamId = this.decodeLinkId(match[1]);\n\t\tAssert.equal(teamId, this.test.team.id, 'permalink does not contain proper team ID');\n\t}", "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 makeLink() {\n // var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf(\n '/') + 1) + \"?lat=\" +\n map.getCenter()\n .lat()\n .toFixed(6) + \"&lng=\" +\n map.getCenter()\n .lng()\n .toFixed(6) +\n \"&zoom=\" + map.getZoom() +\n \"&type=\" +\n MapTypeId2UrlValue(map.getMapTypeId());\n if (filename !=\n \"TrashDays40.xml\") a +=\n \"&filename=\" + filename;\n document.getElementById(\n \"link\")\n .innerHTML =\n '<a href=\"' + a +\n '\">Link to this page<\\/a>';\n }", "function setupLinks() {\n\tfor(let i = 0; i < 11; i++) {\n\t\tif(i == 10) { \n\t\t\tlinks[i] = createA('/resilience-repository/about.html', proj_names[i]);\n\t\t}\n\t\telse {\n\t\t\tlinks[i] = createA('/resilience-repository/projects/proj'+i+'.html', proj_names[i]);\n\t\t}\n\t}\n}", "function generateLink(title, page, local) {\n return `[${title}](${URL}${page}.html${local || ''})`;\n}", "function createPermaLinkInputField(permalinkHREF) {\n var permalink = document.createElement('input');\n permalink.value = permalinkHREF;\n permalink.onclick = function () {\n permalink.setSelectionRange(0, permalink.value.length);\n };\n return permalink;\n}", "function link_generator(data){\n\n var i = 0,\n title = data[1],\n description = data[2],\n link = data[3];\n\n for(i; i < data[3].length; i++){\n var list_link = '<a href=\"'+link[i]+'\">'+title[i]+'</a><br/>';\n list_description = list_link+description[i]+'<hr>';\n links.append(list_description);\n }\n }", "function create_app_url(strPath, boolCustom)\r\n{\r\n\t\r\n}", "function createWebsiteElement(place, parent) {\n var websiteElem = document.createElement(\"a\");\n websiteElem.href = place.website;\n websiteElem.target = \"_blank\";\n websiteElem.innerText = place.name;\n websiteElem.style.color = \"#df6020\";\n parent.appendChild(websiteElem);\n}", "function create(req, res, next) {\n var url = req.body.url;\n ShortUrl.build({ url: url }).save().complete(function(err,short) {\n if(!err) {\n var id = short.id;\n res.json({url: url, hash_code: hasher.encode(id), hits: short.hits });\n } else {\n next(err);\n }\n });\n}", "function createURI(scheme: string, hostname: string, basePath: string, outputDirectory: string, slug: string, createAbsoluteURI: boolean, callback: Function)\n{\n let err;\n let URI = \"\";\n\n // Ensure that if we need it, the scheme is valid (for a website - might we ever need file: etc.?)\n if(scheme === \"http:\" || scheme === \"https:\" || createAbsoluteURI === false)\n {\n if(hostname.length)\n {\n if(slug.length)\n {\n // First, calculate the path component for this content type so we can add it to the basePath below\n const parsedPath = path.parse(outputDirectory); \n const outputTLD = parsedPath.base;\n \n // Second, create just the hostname and path section of the URI, replacing any instances of >1 / with a single /\n const URN = `${basePath}/${outputTLD}/${slug}.html`.replace(/\\/{2,}/g, \"/\");\n\n if(createAbsoluteURI === true)\n {\n // Now join the above to the scheme and we're done\n const URIEnd = `${hostname}/${URN}`.replace(/\\/{2,}/g, \"/\");\n\n URI = `${scheme}//${URIEnd}`;\n }\n else\n {\n URI = `${URN}`;\n }\n }\n else\n {\n err = new TypeError(\"Argument 'slug' must be a non-empty string\");\n }\n }\n else\n {\n err = new TypeError(\"Argument 'hostname' must be a non-empty string\");\n }\n }\n else\n {\n err = new TypeError(\"Argument 'scheme' must be either 'http:' or 'https:'\");\n }\n\n return callback(err, URI);\n}", "async createLink () {\n\t\tconst thing = this.codemark || this.review || this.codeError;\n\t\tconst type = (\n\t\t\t(this.codemark && 'c') ||\n\t\t\t(this.review && 'r') ||\n\t\t\t(this.codeError && 'e')\n\t\t);\n\t\tconst attr = (\n\t\t\t(this.codemark && 'codemarkId') ||\n\t\t\t(this.review && 'reviewId') ||\n\t\t\t(this.codeError && 'codeErrorId')\n\t\t);\n\t\tconst linkId = UUID().replace(/-/g, '');\n\t\tthis.url = this.makePermalink(linkId, this.isPublic, thing.teamId, type);\n\t\tconst hash = this.makeHash(thing, this.markers, this.isPublic, type);\n\n\t\t// upsert the link, which should be collision free\n\t\tconst update = {\n\t\t\t$set: {\n\t\t\t\tteamId: thing.teamId,\n\t\t\t\tmd5Hash: hash,\n\t\t\t\t[attr]: thing.id\n\t\t\t}\n\t\t};\n\n\t\tconst func = this.request.data.codemarkLinks.updateDirectWhenPersist ||\n\t\t\tthis.request.data.codemarkLinks.updateDirect;\t// allows for migration script\n\t\tawait func.call(\n\t\t\tthis.request.data.codemarkLinks,\n\t\t\t{ id: linkId },\n\t\t\tupdate,\n\t\t\t{ upsert: true }\n\t\t);\n\t}", "function createLinks(txt){\n let xp =/((?:https?|ftp):\\/\\/[\\-A-Z0-9+\\u0026\\u2019@#\\/%?=()~_|!:,.;]*[\\-A-Z0-9+\\u0026@#\\/%=~(_|])/gi\n \n if (_.isString(txt)){\n return txt.replace(xp, \"<br><a target='_blank' href='$1'>$1</a>\") \n }\n}", "function insertLinks () {\n var pages = {\n RecentChanges: {\n title: i18n('recent_changes').escape(),\n links: ['WikiActivity', 'DiscussionsActivity']\n },\n WikiActivity: {\n title: i18n('wiki_activity').escape(),\n links: ['WikiActivity/watchlist', 'RecentChanges', 'DiscussionsActivity']\n },\n DiscussionsActivity: {\n title: i18n('discussions_activity').escape(),\n links: ['RecentChanges', 'WikiActivity']\n },\n 'WikiActivity/watchlist': {\n title: i18n('watchlist').escape(),\n links: ['RecentChanges', 'WikiActivity', 'DiscussionsActivity']\n }\n };\n // Terminates the function if the current page is not in the list\n if (Object.keys(pages).every(function (p) { return 'Special:' + p !== config.wgCanonicalNamespace + ':' + config.wgTitle; })) {\n return;\n }\n var headerSubtitle = document.getElementsByClassName('page-header__page-subtitle')[0];\n var pagesLinked = pages[config.wgTitle].links;\n var links = [];\n\n pagesLinked.forEach(function (page) {\n links.push('<a href=\"/wiki/Special:' + page + '\" title=\"Special:' + page + '\">' + pages[page].title + ' ></a>');\n });\n // Doesn't include link to followed pages if it's an anonymous user\n links = (config.wgTitle === 'WikiActivity' && !config.wgUserName ? links.slice(1) : links);\n // Inserts links\n headerSubtitle.innerHTML = links.join(' | ');\n }", "function generateUrlTitle (title) {\n if (title) {\n // Remueve todos los caracteres no-alfanuméricos \n // y hace a los espacios guiones bajos. \n return title.replace(/\\s+/g, '_').replace(/\\W/g, '');\n } else {\n // Generá de forma aleatoria un string de 5 caracteres\n return Math.random().toString(36).substring(2, 7);\n }\n }", "function new_post_page(path, title, posts, url){\n router.get('/'+path, function(req, res, next) {\n res.render('dynamic', {\n\t\t\tTitle: title,\n\t\t\tPosts: posts,\n\t\t\tURL: url\n\t\t});\n });\n}", "function createCommentPermlink(parentAuthor, parentPermlink, postingKey, activeKey) {\n var permlink = void 0;\n\n // comments: re-parentauthor-parentpermlink-time\n var timeStr = new Date().toISOString().replace(/[^a-zA-Z0-9]+/g, '');\n var newParentPermlink = parentPermlink.replace(/(-\\d{8}t\\d{9}z)/g, '');\n permlink = 're-' + parentAuthor + '-' + newParentPermlink + '-' + timeStr;\n\n if (permlink.length > 255) {\n // STEEMIT_MAX_PERMLINK_LENGTH\n permlink = permlink.substring(permlink.length - 255, permlink.length);\n }\n // only letters numbers and dashes shall survive\n permlink = permlink.toLowerCase().replace(/[^a-z0-9-]+/g, '');\n return permlink;\n}", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "function link(mail) {\n\t\t\treturn mail.permalink\n\t\t}", "function feedLink(url) {\n var feed_link = document.createElement('a');\n feed_link.href = url;\n feed_link.addEventListener(\"click\", onClick);\n return feed_link;\n}", "function Hyperlink(){\n\tthis.createHyperlink =function(url, name, id){\n\t\tthis.item =document.createElement('a');\n\t\t//this.item.setAttribute(\"href\", url);\n\t\tvar linkText = document.createTextNode(name);\n\t\tthis.item.appendChild(linkText);\n\t\tthis.item.title = name;\n\t\tthis.item.href = 'http://' + url;\n\t\tconsole.log(this.item);\n\t\tdocument.body.appendChild(this.item);\n\n }\n this.addtodiv=function(id){\n document.getElementById(id).appendChild(this.item);\n }\n}", "function createLink(href, text){\n var link = document.createElement('a');\n link.href = href;\n link.innerText = text;\n link.target = '_blank';\n return link;\n}", "function mk_link(text) {\r\n var a = $e('a')\r\n a.style.background = null\r\n a.style.backgroundColor = null\r\n a.href = '#'\r\n a.appendChild( $t(text) )\r\n return a\r\n}", "function createPost() {\n var protoClass = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'proto-post';\n var imgSrc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'https://static.scientificamerican.com/blogs/cache/file/638FC5CE-96EC-46DA-AAC64985822092FE_source.jpg?w=590&h=800&BDB89ACC-71A2-463A-928419A181070C770';\n var postContent = arguments.length > 2 ? arguments[2] : undefined;\n var authorUsername = arguments.length > 3 ? arguments[3] : undefined;\n var authorImg = arguments.length > 4 ? arguments[4] : undefined;\n var newPost = document.getElementsByClassName(protoClass)[0].cloneNode(true);\n newPost.getElementsByTagName('img')[0].src = authorImg;\n newPost.getElementsByTagName('img')[1].src = imgSrc;\n newPost.getElementsByTagName('h1')[0].textContent = authorUsername;\n newPost.getElementsByTagName('p')[0].textContent = postContent;\n return newPost;\n} //-----------------show posts from everyone------------------", "function createNewUrlForUser(user_id, longURL) {\n //If there are no entries in the urlDatabase,\n //create an empty object for the current user\n if(!urlsForUser(user_id)) {\n databases.urlDatabase[user_id] = {};\n }\n\n //Create a random string for the shortURL\n let shortURL = generateRandomString();\n databases.urlDatabase[user_id][shortURL] = longURL;\n\n //Create a new entry in the urlVisits to keep track of visitors\n databases.urlVisits[shortURL] = {};\n databases.urlVisits[shortURL].visits = 0;\n\n return shortURL;\n}", "function genShortURL() {\n let randomLetters = '';\n \n for (let i = 0; i < 4; i++) {\n randomLetters += String.fromCharCode(Math.floor(Math.random() * 26) + 97);\n }\n \n return `short.ly/${randomLetters}`;\n}", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "async function generateUrl() {\n try{\n const response = await instance.post(\"/create_url\", {\n url: longurl,\n });\n setNew(response.data);\n }catch(error){\n console.log(error)\n }\n \n }", "function makeUrl ($name, $data) {\n var $template = $templates[$name];\n\n $data['summary'] = $data['description'];\n\n for (var $key in $data) {\n var $camelCaseKey = $name + $key.replace(/^[a-z]/, function($str){\n return $str.toUpperCase();\n });\n\n var $value = encodeURIComponent($data[$camelCaseKey] || $data[$key]);\n $template = $template.replace(new RegExp('{{'+$key.toUpperCase()+'}}', 'g'), $value);\n }\n\n return $template;\n }", "function createTinyUrl(req, res) {\n\n var longUrl = req.body.longUrl;\n addTinyUrl(req, res, trimUrl(longUrl))\n }", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "validatePermalink (permalink) {\n\t\tconst type = 'e';\n\t\tconst origin = this.test.apiConfig.apiServer.publicApiUrl.replace(/\\//g, '\\\\/');\n\t\tconst regex = `^${origin}\\\\/${type}\\\\/([A-Za-z0-9_-]+)\\\\/([A-Za-z0-9_-]+)$`;\n\t\tconst match = permalink.match(new RegExp(regex));\n\t\tAssert(match, `returned permalink \"${permalink}\" does not match /${regex}/`);\n\n\t\tconst teamId = this.decodeLinkId(match[1]);\n\t\tconst expectedTeamId = this.codeErrorInDifferentTeam ? this.codeErrorInDifferentTeam.teamId : this.test.team.id;\n\t\tAssert.equal(expectedTeamId, this.test.team.id, 'permalink does not contain proper team ID');\n\t}", "function createAnchor(issueId) {\n\t\tvar ret = $('<a href=\"\"></a>')\n\t\t\t\t\t.addClass('v1linkify_needs_prefetch')\n\t\t\t\t\t.text(issueId)\n\t\t\t\t\t.mouseover(function(e) {\n\t\t\t\t\t\t// If we already have the true permalink of this issue,\n\t\t\t\t\t\t// then the href has been set appropriately - do nothing.\n\t\t\t\t\t\t// Otherwise, we need to look it up before navigating.\n\t\t\t\t\t\tif ($(this).attr('href') === '' && !$(this).data('fetching')) {\n\t\t\t\t\t\t\t$(this).addClass('v1linkify_fetching_permalink')\n\t\t\t\t\t\t\t\t\t.attr('title', 'Fetching permalink...')\n\t\t\t\t\t\t\t\t\t.data('fetching', true);\n\t\t\t\t\t\t\tvar a = this;\n\t\t\t\t\t\t\tfetchPermalink(issueId, function(url) {\n\t\t\t\t\t\t\t\t$(a).attr('href', url)\n\t\t\t\t\t\t\t\t\t.removeClass('v1linkify_fetching_permalink')\n\t\t\t\t\t\t\t\t\t.removeClass('v1linkify_needs_prefetch')\n\t\t\t\t\t\t\t\t\t.removeAttr('title')\n\t\t\t\t\t\t\t\t\t.data('fetching', false);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Normal link - do nothing\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}).mousedown(function(e) {\n\t\t\t\t\t\t// TODO: This code is not useful ATM\n\t\t\t switch (e.which) {\n\t\t\t case 1:\n\t\t\t // Left mouse\n\t\t\t $(this).attr('target','_self');\n\t\t\t break;\n\t\t\t case 2:\n\t\t\t // Middle mouse - this one attempts to navigate\n\t\t\t // immediately on mousedown in a new tab\n\t\t\t $(this).attr('target','_newtab');\n\t\t\t break;\n\t\t\t case 3:\n\t\t\t // Right mouse\n\t\t\t $(this).attr('target','_blank');\n\t\t\t break;\n\t\t\t default:\n\t\t\t // Bizarro mouse\n\t\t\t $(this).attr('target','_self\"');\n\t\t\t }\n\t\t\t }).mouseup(function(e) { \n\t\t\t \t// TODO: This code does not work as intended\n\t\t\t \t//\t(intention: defer nav until permalink is fetched)\n\n\t\t\t\t\t\t// If the permalink has already been loaded, go there immediately.\n\t\t\t\t\t\t// If not, wait until the prefetch is done\n\t\t\t\t\t\tvar a = $(this);\n\t\t\t\t\t\tvar navIval = -1;\n\t\t\t\t\t\tfunction tryNavigate() {\n\t\t\t\t\t\t\tif (a.attr('href') === '') {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (a.attr('target') === '_self' || a.attr('target') === undefined) {\n\t\t\t\t\t\t\t\tdocument.location = a.attr('href');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twindow.open(a.attr('href'), a.attr('target'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclearInterval(navIval);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!tryNavigate()) {\n\t\t\t\t\t\t\tnavIval = setInterval(tryNavigate, 500);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\treturn ret[0];\n\t}", "function insertLink(title, url) {\n Links.insert({ title, url, createdAt: new Date() });\n}", "function createTopicResource(url, title) {\r\n //\r\n var webpageTitle = cleanUpForJson(title);\r\n var webtopic = '{\"uri\":\"\",\"type_uri\":\"dm4.webbrowser.web_resource\",\"composite\":'\r\n + '{\"dm4.webbrowser.web_resource_description\":\"'+webpageTitle+'\",\"dm4.webbrowser.url\":\"'+url+'\"}}';\r\n // checks if topic with given url already exists\r\n getTopicByValueAndType('dm4.webbrowser.url', url, function(responseText) {\r\n //\r\n if (responseText != undefined) {\r\n // ### Notify user and load existing Bookmark, may wants to change title/name of URL \r\n if (lookmarker.statusLabel != undefined) lookmarker.statusLabel.value = lookmarker.statusdoubledURL;\r\n } else { // undefined => no topic like this known.. go on create it.\r\n sendTopicPost(webtopic, getResultingTopicId);\r\n }\r\n });\r\n}", "function eLink(db,nm) {\nel = document.createElement(\"a\");\nel.setAttribute(\"target\",\"_blank\");\ndbs = new Array(\"http://www.wowarmory.com/search.xml?searchType=items&searchQuery=\",\"http://www.wowhead.com/?search=\",\"http://www.thottbot.com/?s=\",\"http://wow.allakhazam.com/search.html?q=\");\ndbTs = new Array(\"Armory\",\"Wowhead\",\"Thottbot\",\"Allakhazam\");\ndbHs = new Array(\"&real; \",\"&omega; \",\"&tau; \",\"&alpha;\");\nel.href = dbs[db]+nm;\nel.setAttribute(\"title\",dbTs[db]);\nel.innerHTML = dbHs[db];\nreturn el;\n}", "createURL() {\n\t\tthis.finalURL = [];\n\t\tthis.apiURL.map((name, index, arr) => {\n\t\t\tindex === 0 || index === 1\n\t\t\t\t? this.finalURL.push(name)\n\t\t\t\t: index === arr.length - 1\n\t\t\t\t? this.finalURL.push(`|${name}&display=swap`)\n\t\t\t\t: this.finalURL.push(`|${name}`);\n\t\t});\n\n\t\tlet finalURL = this.finalURL.join(\"\");\n\t\tlet linkUrl = document.createElement(\"link\");\n\t\tlinkUrl.setAttribute(\"href\", `${finalURL}`);\n\t\tlinkUrl.setAttribute(\"rel\", \"stylesheet\");\n\t\tlinkUrl.setAttribute(\"id\", \"fonts-url\");\n\n\t\tlet HTMLlink = document.getElementById(\"fonts-url\");\n\n\t\tif (HTMLlink) {\n\t\t\tHTMLlink.remove();\n\t\t\tdocument.head.appendChild(linkUrl);\n\t\t} else document.head.appendChild(linkUrl);\n\t}", "function createLink (name, href, c)\n{\n var a = document.createElement ('a');\n a.setAttribute ('href', href);\n a.setAttribute ('class', c || null);\n a.innerHTML = name;\n return a;\n}", "function upgradeHeading(h) {\n const df = importTemplate(\"_permalink-template\");\n const a = df.querySelector(\".permalink\");\n requestAnimationFrame(() => ((a.href = `#${h.id}`), h.appendChild(df)));\n}", "function addBlogsToPage(blogInfo){\r\n var blogHead = build_blog_skeleton(blogInfo.blog, blogInfo.url_name, blogInfo.name, time_stampify(blogInfo.created), \"fa-minus-square\"); \r\n\r\n $(\"#project #blogs-insert-point\").before(blogHead);\r\n\r\n fill_blog_body(blogInfo.blog, blogInfo.img_link, blogInfo.first_snippet, time_stampify(blogInfo.modified));\r\n\r\n\r\n}", "function createPost(title, price, description, url){\n // Set page title to post title.\n document.title = title;\n\n // Book title header.\n document.getElementById(\"title\").innerHTML = title;\n\n // Gets container to post it in.\n var content = document.getElementById(\"container\");\n\n\n // Getting images and setting text.\n document.getElementById(\"image\").src = url;\n document.getElementById(\"price\").innerHTML = \"$\" + price;\n document.getElementById(\"description\").innerHTML = description;\n}", "async function createSitemap() {\n\n const response = await axios.get(\"https://blog.gibkii-kamen.kz/api/blog\");\n const posts = response.data\n console.log(posts)\n // write the sitemap.xml file\n // directory MUST be `out/`\n await fs.writeFileSync(\"out/sitemap.xml\", generateSiteMap(posts));\n}", "function createUrl() {\n todaysDate = moment().format(\"YYYY-MM-DD\");\n return movieAndDinnerObject.movieShowtimeUrl + todaysDate + \"&lat=\" + movieAndDinnerObject.lat + \"&lng=\" + movieAndDinnerObject.long + movieAndDinnerObject.movieShowtimeAPIKey\n // http://data.tmsapi.com/v1.1/movies/showings?startDate=2019-04-10&lat=32.876709&lng=-117.206601&api_key=stp9q5rsr8afbrsfmmzvzubz\n }", "function generateAnchor(url, name) {\n let anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.innerText = name;\n anchor.id = \"save-as\";\n return anchor;\n}", "function CrearEnlace(url) {\n location.href=url;\n }", "function generateURL(url) {\n var value = input.value.replace(/ /g, \"%20\");\n var link = url + value + callback;\n console.log(link);\n search(link);\n }", "function addWebsite(url, title, description, ownerId,\n date, upVotes, downVotes, keywords) {\n var primary_keywords =\n Meteor.common.getKeywords(title + (keywords? ' ' + keywords: ''));\n\n var id = Websites.insert({\n title: title ? title: url,\n url: url,\n description: description ? description: 'No description given.',\n upVotes: upVotes ? upVotes: 0,\n downVotes: downVotes ? downVotes: 0,\n keywords: primary_keywords,\n ownerId: ownerId,\n createdAt: date ? date: new Date()\n });\n\n if (title) {\n primary_keywords.forEach(function (word) {\n Keywords.insert({\n word: word,\n siteId: id\n });\n });\n }\n\n if (description) {\n Meteor.common.getKeywords(description).forEach(function (word) {\n Keywords.insert({\n word: word,\n siteId: id\n });\n });\n }\n}", "getUrl() {\n let url = ''\n let pageConfig = Config.pages[this.page] || {}\n\n if(this.isBlogPost) {\n url = `${Config.siteUrl}/${this.post.frontmatter.path}`\n }\n else {\n url = pageConfig.url || Config.siteUrl\n }\n\n return url\n }", "async function createShorterURL(urlInput) {\n const res = await fetch(\"https://rel.ink/api/links/\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({ url: urlInput })\n });\n const data = await res.json();\n // Check if data is valid\n\n if (data.hashid) {\n const { hashid, url, created_at } = data;\n\n links.push({\n url,\n hashid,\n created_at\n });\n\n // Save links Array to localStorage\n localStorage.setItem(\"links\", JSON.stringify(links));\n\n short.innerHTML = ``;\n addLinksToDOM();\n } else {\n // Show a error message \"please enter a valid URL\"\n\n shortenInput.classList.add(\"error\");\n shortenErrorMessage.style.opacity = 1;\n shortenErrorMessage.innerHTML = `\n <small>Please add valid URL</small>\n `;\n\n // shortenInput.classList.remove(\"error\");\n // shortenErrorMessage.style.opacity = 0;\n // createShorterURL(shortenInput.value);\n // shortenInput.value = \"\";\n }\n}", "function postLink(link_title, link_address, callback) {\n var data = {\n title: link_title,\n link: link_address\n }\n\n $.post('./api/links/create', data, function(link) {\n callback(link)\n })\n}", "function reLink() {\r\n const linkList = document.querySelectorAll('a');\r\n\r\n linkList.forEach((link) => {\r\n const linkAttribute = link.getAttribute('href');\r\n\r\n if (linkAttribute.startsWith('/p/')) {\r\n const linkFormatted = 'https://instagram.com' + linkAttribute + 'media/?size=l'\r\n\r\n link.setAttribute('href', linkFormatted);\r\n\r\n // Log to the console the thumbnail and respective link for hover/click.\r\n\t\t\tconsole.log('-=-=-=-=-=-=-');\r\n \tconsole.log('Image: ', link.firstElementChild);\r\n \tconsole.log('Direct Link: ', linkFormatted);\r\n };\r\n });\r\n}", "function buildCreatedLink (linkURL) {\n if(Bkg.DEBUG)\n console.log(\"Popup.buildCreatedLink:\" + linkURL);\n var string = \"<span class='created_task_conv_link'>\" + linkURL + \"</span>\";\n return string;\n}", "function buildDpSearhUrl ( text ) {\n return \"http://www.dianping.com/search/keyword/1/0_\"+text;\n}", "pushParams() {\n const entities = this.getEntities(),\n targetKeyword = this.isCategory() ? 'category' : 'files';\n\n if (window.history && window.history.replaceState) {\n window.history.replaceState({}, document.title,\n `?${$.param(this.getParams())}&${targetKeyword}=${entities.join('|')}`\n );\n }\n\n $('.permalink').prop('href', `?${$.param(this.getPermaLink())}&${targetKeyword}=${entities.join('%7C')}`);\n }", "function getTitleLink(title, index = 0) {\n return `#${getCleanTitle(title).replace(/ /g, \"-\").toLowerCase()}${index > 0 ? `-${index}` : \"\"}`;\n}", "async buildPost (filename) {\n let md = await this.fs.promises.readFile(`${this.config.settings.SRC}/${filename}`, \"utf8\")\n let { content, data } = matter(md)\n data.permalink = filename\n let html = marked(content, { baseUrl: \"../../\" }) \n //await this.processContent( { content, html, data, filename } )\n //await this.processImages({ content })\n await this.plugins(\"onsave\", { content, html, data, filename })\n return { html, data }\n }", "function format(mail) {\n\t\t\treturn \"<a href='\"+mail.permalink+\"'><img src='\" + mail.image + \"' /><span class='title'>\" + mail.title +\"</span></a>\";\t\t\t\n\t\t}", "function makeLink() {\n if (_TEST)\n return;\n if (!retPgn.bonus) {\n let makeLink = '/scratch/tcec/Commonscripts/Divlink/makelnk.sh';\n exec(`${makeLink} ${retPgn.abb}`, (error, stdout, stderr) => {\n LS(`Error is: ${stderr}`);\n LS(`Output is: ${stdout}`);\n });\n }\n}", "function createNewURL(longURL, req) {\n let shortURL = generateRandomString();\n urlDatabase[shortURL] = {\n userID: req.session[\"user_id\"],\n longURL: longURL\n };\n return shortURL;\n}", "async function generateShortUrl(url) {\n try {\n const result = await fetch('https://rel.ink/api/links/', {\n method: 'POST',\n body: JSON.stringify({\n url: url\n }),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n });\n const data = await result.json();\n const shortUrl = `https://rel.ink/${data.hashid}`;\n displayToPage(shortUrl);\n showPreloader(false);\n } catch (error) {\n console.error(`Error: ${error}`);\n }\n\n}", "function generateLinks(text) {\n const reg = /\\b__([\\w\\/]+)__\\b/g;\n let tags;\n if (text) {\n tags = text.replace(reg, \"<a href=$1>$1</a>\");\n } else {\n console.log(\"Warning, text sent to generateLinks() was undefined.\");\n }\n return tags;\n }", "function generate_link_element(link_data) {\n\tvar link = document.createElement(\"a\");\n\tlink.classList.add(\"link\");\n\tlink.style.color = foreground_color;\n\tlink.href = link_data.link;\n\tlink.textContent = link_data.title;\n\n\treturn link;\n}", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "async function createBlogPostPages (graphql, actions, reporter) {\n const { createPage } = actions\n const result = await graphql(`\n {\n allSanityPost(filter: { slug: { current: { ne: null } } }) {\n edges {\n node {\n id\n publishedAt\n slug {\n current\n }\n }\n }\n }\n }\n `)\n\n if (result.errors) throw result.errors\n\n const postEdges = (result.data.allSanityPost || {}).edges || []\n\n postEdges.forEach((edge, index) => {\n const { id, slug = {}, publishedAt } = edge.node\n const dateSegment = format(legacyParse(publishedAt), convertTokens('yyyy/MM'))\n const path = `/blog/${dateSegment}/${slug.current}/`\n\n reporter.info(`Creating blog post page: ${path}`)\n\n createPage({\n path,\n component: require.resolve('./src/templates/blog-post.js'),\n context: { id }\n })\n })\n}", "function generateSlug(title) {\n return title.toLowerCase().replace(/\\s/g, '-')\n }", "function addPermalinkHeadings(container) {\n if (container) {\n ['h2','h3','h4'].forEach(function(h, i) {\n [].forEach.call(container.querySelectorAll(h), addPermalink);\n });\n }\n}", "static buildUrls(reflection, urls) {\n const mapping = DefaultTheme.getMapping(reflection);\n if (mapping) {\n if (!reflection.url ||\n !DefaultTheme.URL_PREFIX.test(reflection.url)) {\n const url = [\n mapping.directory,\n DefaultTheme.getUrl(reflection) + \".html\",\n ].join(\"/\");\n urls.push(new UrlMapping_1.UrlMapping(url, reflection, mapping.template));\n reflection.url = url;\n reflection.hasOwnDocument = true;\n }\n for (const child of reflection.children || []) {\n if (mapping.isLeaf) {\n DefaultTheme.applyAnchorUrl(child, reflection);\n }\n else {\n DefaultTheme.buildUrls(child, urls);\n }\n }\n }\n else if (reflection.parent) {\n DefaultTheme.applyAnchorUrl(reflection, reflection.parent);\n }\n return urls;\n }", "function createShortUrl(req, res, next) {\n\tif(!req.body.longUrl) {\n return res.status(400).send({\"status\": \"error\", \"message\": \"A long URL is required\"});\n }\n db.any('SELECT * FROM urls WHERE long_url = $1', [req.body.longUrl])\n .then(function (data) {\n if(data.length === 0) {\n \tvar hashids \t= new Hashids();\n \tvar response = {\n\t id: hashids.encode((new Date).getTime()),\n\t longUrl: req.body.longUrl\n \t}\n \tresponse.shortUrl = \"http://localhost:3000/\" + response.id;\n \t\n db.none('INSERT INTO urls(id, short_url, long_url) VALUES(${id}, ${shortUrl}, ${longUrl})', response)\n .then(function () {\n\t res.status(200)\n\t .json({\n\t status: 'success',\n data: response,\n\t message: 'Inserted one url'\n\t });\n\t })\n\t .catch(function (err) {\n\t return next(err);\n\t });\n\t\t} else {\n\t\t\tres.send(data[0]);\n\t\t}\n\t})\n\t.catch(function (err) {\n return next(err);\n });\n}", "function generateUrl(el) {\n\tvar generatedUrl = assembleUrl();\n\n\t// ADD TO CLIPBOARD add it to the dom\n\tcopyToClipboard(generatedUrl);\n\tdomElements.wrapperUrl.el.html(generatedUrl);\n}", "function postDir(sitePath, info, key){\n let path = sitePath + '/';\n if (key === 'year') path += info.year;\n else if (key === 'month') path += info.year + '/' + info.month;\n else if (key === 'day') path += info.year + '/' + info.month + '/' + info.day;\n else if (key === 'title') path += info.year + '/' + info.month + '/' + info.day + '/' + info.title;\n\n mkdirSync(path);\n}", "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n Url.findOne({shortUrl: text}, (err, doc) => {\n if (doc) {\n makeid();\n }\n })\n return text;\n}", "function makeDeployStudyTutorialURL(includeNav) {\r\n return (deployStudyTutorialURL + \"#\" + \"pagemode=bookmarks\" + \"&\" +\"nameddest=\");\r\n}", "function createLink(href, title, method = 'GET', schemaUrl = '') {\n return `\n <a\n class=\"resource-link\"\n href=\"${escapeAttr(href)}\"\n data-method=\"${escapeAttr(method)}\"\n data-schema-url=\"${escapeAttr(schemaUrl)}\"\n >${escapeHtml(title)}</a>\n `.trim();\n }", "function makeOverviewTutorialURL(includeNav) {\r\n return (overviewTutorialURL + \"#\" + \"pagemode=bookmarks\" + \"&\" +\"nameddest=\");\r\n}", "function createPost(id, title, body, date) { \n var post = [`<div class=\"post-preview\">`,\n `<h2 class=\"post-title\">${title}</h2>`,\n `<p class=\"post-subtitle\">${body}</p>`, \n `<p class=\"post-meta\">Posted at ${date}`,\n `<a href=\"javascript:edit(${id})\" class=\"btn\"><span class=\"glyphicon glyphicon-pencil\"></span></a>`,\n `<a href=\"javascript:del(${id})\" class=\"btn\"><span class=\"glyphicon glyphicon-trash\"></span></a></p>`,\n `</div>`,\n `<hr>`].join(\"\\n\")\n return post;\n}//E N D function createPost", "function CrearEnlace(url) {\n location.href=url;\n}", "function createLinkElement(link) {\n var linktitle = document.createElement(\"a\");\n linktitle.href = link.url;\n linktitle.style.color = \"#428bca\";\n linktitle.style.textDecoration = \"none\";\n linktitle.style.marginRight = \"5px\";\n linktitle.appendChild(document.createTextNode(link.title));\n\n var linkUrl = document.createElement(\"span\");\n linkUrl.appendChild(document.createTextNode(link.url));\n\n var titleLine = document.createElement(\"h4\");\n titleLine.style.margin = \"0px\";\n titleLine.appendChild(linktitle);\n titleLine.appendChild(linkUrl);\n\n var detailsLine = document.createElement(\"span\");\n detailsLine.appendChild(document.createTextNode(\"Added by \" + link.author));\n\n var linkDiv = document.createElement(\"div\");\n linkDiv.classList.add(\"link\");\n linkDiv.appendChild(titleLine);\n linkDiv.appendChild(detailsLine);\n\n return linkDiv;\n}" ]
[ "0.79330873", "0.77881384", "0.7000295", "0.68960154", "0.6393846", "0.6296471", "0.62498486", "0.6001344", "0.5988778", "0.58598423", "0.57202786", "0.56535584", "0.563193", "0.56004936", "0.5586757", "0.55185944", "0.55019873", "0.5462223", "0.54512304", "0.54414064", "0.54306364", "0.5425677", "0.5422502", "0.54026085", "0.54007864", "0.5398798", "0.5388899", "0.53822815", "0.5380045", "0.53723806", "0.5359695", "0.5346353", "0.5345005", "0.532801", "0.53242844", "0.53233945", "0.5312211", "0.52980953", "0.5289249", "0.5280012", "0.52654964", "0.52564377", "0.5237279", "0.523213", "0.52218056", "0.5209065", "0.5202613", "0.5201324", "0.5181364", "0.5180858", "0.51479137", "0.51478636", "0.5136897", "0.5122016", "0.5104584", "0.5101785", "0.5096968", "0.50949544", "0.5094254", "0.50799096", "0.50722456", "0.5057327", "0.50546825", "0.50478065", "0.5045354", "0.5045043", "0.50437194", "0.50333774", "0.50301665", "0.5025678", "0.5020332", "0.50133324", "0.50100017", "0.5009341", "0.50090885", "0.5007818", "0.5006403", "0.5004737", "0.50044525", "0.50009716", "0.5000569", "0.4991487", "0.499039", "0.4985479", "0.49756858", "0.49732938", "0.4968734", "0.4966053", "0.49635893", "0.49624595", "0.49605235", "0.49594563", "0.49433938", "0.49423996", "0.49402556", "0.49365112", "0.49329445", "0.4931529", "0.49290007", "0.49255225" ]
0.68169504
4
apply initial exclusive layer groups: only a single layer of a group may be active, or none
function initExclusiveLayerGroups() { if (wmsLoader.projectSettings.capability.exclusiveLayerGroups.length == 0) { // no exclusive layer groups return; } // collect initially active layers var activeLayers = []; layerTree.root.firstChild.cascade(function(node) { if (node.isLeaf() && node.attributes.checked) { activeLayers.push(wmsLoader.layerTitleNameMapping[node.text]); } }); // collect layers of exclusive layer groups var layersToUncheck = []; for (var i=0; i<wmsLoader.projectSettings.capability.exclusiveLayerGroups.length; i++) { var exclusiveGroup = wmsLoader.projectSettings.capability.exclusiveLayerGroups[i]; // get first group layer from active layers var activeLayerName = null; for (var l=0; l<exclusiveGroup.length; l++) { var groupLayerName = exclusiveGroup[l]; if (activeLayers.indexOf(groupLayerName) != -1) { activeLayerName = groupLayerName; break; } } // collect inactive group layers for (var l=0; l<exclusiveGroup.length; l++) { var groupLayerName = exclusiveGroup[l]; if (groupLayerName != activeLayerName) { // add layer to uncheck if not yet in list if (layersToUncheck.indexOf(groupLayerName) == -1) { layersToUncheck.push(groupLayerName); } } } } if (layersToUncheck.length > 0) { // update layer tree layerTree.root.firstChild.cascade(function(node) { if (node.isLeaf() && node.attributes.checked) { // uncheck layer node if (layersToUncheck.indexOf(wmsLoader.layerTitleNameMapping[node.text]) != -1) { node.getUI().toggleCheck(false); } } }); layerTree.fireEvent("leafschange"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "triggerToggleLayerGroup() {\n const datasetID = this.props.dataset.id;\n const addLayerGroup = !this.props.isLayerGroupAdded(datasetID);\n this.props.toggleLayerGroup(datasetID, addLayerGroup);\n }", "function ungroupLayerSet() { //拆散图层组\n\n\tvar desc = new ActionDescriptor(),\n\t\tref = new ActionReference();\n\n\tref.putEnumerated(charIDToTypeID(\"Lyr \"), charIDToTypeID(\"Ordn\"), charIDToTypeID(\"Trgt\"));\n\tdesc.putReference(charIDToTypeID(\"null\"), ref);\n\ttry {\n\n\t\texecuteAction(stringIDToTypeID(\"ungroupLayersEvent\"), desc, DialogModes.NO);\n\n\t} catch (e) {}\n}", "function ungroupAllLayerSets(wrkDoc) { //拆散所有图层组\n\n\tvar setLen = wrkDoc.layerSets.length,\n\t\tidx = setLen - 1;\n\n\twhile (setLen) {\n\n\t\twrkDoc.activeLayer = wrkDoc.layerSets[idx];\n\t\tungroupLayerSet();\n\t\tsetLen = wrkDoc.layerSets.length;\n\t\tidx = setLen - 1;\n\t}\n}", "function toggle_a_layergroup(uid) {\n var i;\n var found=find_layer_from_list(uid);\n if(found) {\n var group=found['group'];\n var h=found['highlight'];\n if(h==EYE_NORMAL) {\n highlight_layergroup(group);\n found['highlight']=EYE_HIGHLIGHT;\n $('#ucvm_layer_'+uid).addClass('ucvm-active');\n } else if (h==EYE_HIGHLIGHT) {\n hide_layergroup(group);\n found['highlight']=EYE_HIDE;\n $('#ucvm_layer_'+uid).removeClass('ucvm-active');\n $('#ucvm_layer_'+uid).removeClass('glyphicon-eye-open');\n $('#ucvm_layer_'+uid).addClass('glyphicon-eye-close');\n } else if (h==EYE_HIDE) {\n unhighlight_layergroup(group);\n found['highlight']=EYE_NORMAL;\n $('#ucvm_layer_'+uid).addClass('glyphicon-eye-open');\n $('#ucvm_layer_'+uid).removeClass('glyphicon-eye-close');\n }\n } else {\n window.console.log(\"toggle_a_layergroup.. can not find this uid \",uid);\n }\n}", "componentWillReceiveProps(nextProps) {\n let allGroups = [];\n let allLayers = this.state.allLayers;\n const nextLayers = allLayers[nextProps.group.value];\n if (nextProps.sortAlpha !== this.props.sortAlpha) {\n this.sortLayers(this.state.layers, nextProps.sortAlpha);\n }\n\n if (nextProps.group.value !== this.props.group.value) {\n const layers = this.state.allLayers[this.props.group.value];\n if (layers !== undefined) {\n // DISABLE LAYER VISIBILITY FROM PREVIOUS GROUP\n TOCHelpers.disableLayersVisiblity(layers, newLayers => {\n allLayers[this.props.group.value] = newLayers;\n this.setState({ allLayers: allLayers }, () => {\n // ENABLE LAYER VISIBILITY FROM PREVIOUS GROUP\n\n if (nextLayers !== undefined) {\n TOCHelpers.enableLayersVisiblity(nextLayers, newLayers => {\n let allLayers = this.state.allLayers;\n allLayers[nextProps.group.value] = newLayers;\n this.setState({ layers: newLayers, allLayers: allLayers, allGroups: allGroups }, () => {\n this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n });\n });\n } else {\n this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n }\n });\n });\n } else this.refreshLayers(nextProps.group, nextProps.sortAlpha, nextProps.allGroups);\n }\n }", "function updateGroupMcs() {\n if (!p._keepSelected) {\n p._disabled = true;\n }\n updateState('_down');\n var i;\n if (p._keepSelected) {\n for (i = 0; i < p._groupMcs.length; i++) {\n //this.parent[p._groupMcs[i]].disabled = false;\n p.updateEvent({\n elemId: p._groupMcs[i],\n state: true\n });\n // bindEvents(p._groupMcs[i])\n }\n } else if (p._visitedState) {\n for (i = 0; i < p._groupMcs.length; i++) {\n //if (this.parent[p._groupMcs[i]].visited) {\n if (p.visited) {\n //this.parent[p._groupMcs[i]].updateState(\"_visited\");\n p.dispatchEventUpdateState({\n state: '_visited',\n elemId: p._groupMcs[i]\n });\n } else {\n //this.parent[p._groupMcs[i]].updateState(\"_normal\");\n p.dispatchEventUpdateState({\n state: '_normal',\n elemId: p._groupMcs[i]\n });\n }\n //this.parent[p._groupMcs[i]].disabled = false;\n\n // bindEvents(p._groupMcs[i])\n p.updateEvent({\n elemId: p._groupMcs[i],\n state: true\n });\n }\n } else {\n for (i = 0; i < p._groupMcs.length; i++) {\n //this.parent[p._groupMcs[i]].disabled = false;\n //this.parent[p._groupMcs[i]].updateState(\"_normal\");\n\n p.dispatchEventUpdateState({\n state: '_normal',\n elemId: p._groupMcs[i]\n });\n //bindEvents(p._groupMcs[i])\n p.updateEvent({\n elemId: p._groupMcs[i],\n state: true\n });\n }\n }\n }", "function setAggregateGroup(groupBySelectedIndex, selectedRadio){\n\n if (selectedRadio == 'radio1'){\n var layerArrayValue;\n switch (groupBySelectedIndex){\n case 0:\n if( $(\"#st-select\")[0].selectedIndex > 0){\n layerArrayValue = 4; //grp3 w/ state splits\n } else{\n layerArrayValue = 0;\n }\n break;\n case 1:\n if( $(\"#st-select\")[0].selectedIndex > 0){\n layerArrayValue = 5; //grp2 w/ state splits\n } else{\n layerArrayValue = 1;\n }\n \n break;\n case 2: \n if( $(\"#st-select\")[0].selectedIndex > 0){\n layerArrayValue = 6; //grp1 w/state splits\n } else{\n layerArrayValue = 2;\n }\n break;\n case 3:\n layerArrayValue = 3;\n break;\n }\n } else if (selectedRadio == 'radio2'){\n var layerArrayValue;\n switch (groupBySelectedIndex){\n case 0:\n if( $(\"#st-select\")[0].selectedIndex > 0){\n layerArrayValue = 11; //grp3 w/ state splits\n } else{\n layerArrayValue = 7;\n }\n break;\n case 1:\n if( $(\"#st-select\")[0].selectedIndex > 0){\n layerArrayValue = 12; //grp2 w/ state splits\n } else{\n layerArrayValue = 8;\n }\n break;\n case 2: \n if( $(\"#st-select\")[0].selectedIndex > 0){\n layerArrayValue = 13; //grp1 w/ state splits\n } else{\n layerArrayValue = 9;\n }\n break;\n case 3:\n layerArrayValue = 10;\n break;\n }\n }\n var visibleLayerIds = [layerArrayValue];\n var sparrowRanking = app.map.getLayer('SparrowRanking');\n sparrowRanking.setVisibleLayers(visibleLayerIds);\n\n\n //generateRenderer();\n \n \n} //END setAggregateGroup()", "function LayerControlGroup(layerControlItems, name, base) {\n this.layerControlItems = layerControlItems;\n this.name = name;\n this.base = !!base;\n\n this._anyLayerVisible = function (map) {\n for (var i in this.layerControlItems) {\n if (map.hasLayer(this.layerControlItems[i].layer)) return true;\n }\n return false;\n };\n\n this.anyLabelable = function () {\n for (var i in this.layerControlItems) {\n if (this.layerControlItems[i].labelable) return true;\n }\n return false;\n };\n\n // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)\n this.createVisibleInputElement = function (map) {\n var checked = this._anyLayerVisible(map);\n if (this.base) {\n var radioHtml = '<input type=\"radio\" class=\"leaflet-control-layers-selector\" name=\"leaflet-base-layers\"';\n //var radioHtml = '<input type=\"radio\" class=\"leaflet-control-layers-selector\" name=\"leaflet-exclusive-group-layer-' + this.group + '\"';\n if (checked) {\n radioHtml += ' checked=\"checked\"';\n }\n radioHtml += '/>';\n var radioFragment = document.createElement('div');\n radioFragment.innerHTML = radioHtml;\n radioFragment.firstChild.layerControlElementType = LayerControlElementType.VisibilityRadio;\n radioFragment.firstChild.groupName = this.name;\n return radioFragment.firstChild;\n } else {\n var input = document.createElement('input');\n input.type = 'checkbox';\n input.className = 'leaflet-control-layers-selector';\n input.defaultChecked = checked;\n input.layerControlElementType = LayerControlElementType.VisibilityCheckbox;\n input.groupName = this.name;\n return input;\n }\n };\n\n this.createLabelInputElement = function () {\n var input = document.createElement('input');\n input.type = 'checkbox';\n input.className = 'leaflet-control-layers-selector';\n input.defaultChecked = false;\n input.layerControlType = \"label\";\n input.layerControlElementType = LayerControlElementType.LabelCheckbox;\n input.groupName = this.name;\n return input;\n };\n\n this.createNameSpanElement = function () {\n var span = document.createElement('span');\n span.innerHTML = ' ' + this.name;\n span.groupName = name;\n return span;\n };\n\n // IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)\n this.createSelectElement = function (map) {\n // NOTE: Opening the select element and displaying the options list fires the select.onmouseout event which \n // propagates to the div container and collapses the layer control. The onmouseout handler below will\n // stop this event from propagating. It has an if-else clause because IE handles this differently than other browsers.\n var selectHtml = '<select class=\"leaflet-control-layers-selector\" onmouseout=\"if (arguments[0]) {arguments[0].stopPropagation();} else {window.event.cancelBubble();}\">';\n\n for (var i = 0; i < this.layerControlItems.length; i++) {\n selectHtml += '<option value=\"' + this.layerControlItems[i].name + '\"';\n if (map.hasLayer(this.layerControlItems[i].layer)) {\n selectHtml += \" selected='selected'\";\n }\n selectHtml += '>' + this.layerControlItems[i].name + \"</option>\";\n }\n selectHtml += '</select>';\n\n var selectFragment = document.createElement('div');\n selectFragment.innerHTML = selectHtml;\n selectFragment.firstChild.layerControlElementType = LayerControlElementType.LayerSelect;\n selectFragment.firstChild.groupName = this.name;\n return selectFragment.firstChild;\n };\n}", "function applyGroupFilter(data) {\n if (indiciaData.filter_group_id) {\n if (typeof indiciaData.filter_group_implicit === 'undefined') {\n // Apply default, strictest mode.\n indiciaData.filter_group_implicit = false;\n }\n // Proxy will be responsible for filter setup.\n data.group_filter = {\n id: indiciaData.filter_group_id,\n implicit: indiciaData.filter_group_implicit\n };\n }\n }", "function advancedMergeLayersAndAutoFill()\n{\n\tvar idmergeAlignedLayers = stringIDToTypeID( \"mergeAlignedLayers\" );\n\tvar desc4 = new ActionDescriptor();\n\tvar idAply = charIDToTypeID( \"Aply\" );\n\tvar idautoBlendType = stringIDToTypeID( \"autoBlendType\" );\n\tvar idpanorama = stringIDToTypeID( \"panorama\" );\n\tdesc4.putEnumerated( idAply, idautoBlendType, idpanorama );\n\tvar idClrC = charIDToTypeID( \"ClrC\" );\n\tdesc4.putBoolean( idClrC, true );\n\tvar idautoTransparencyFill = stringIDToTypeID( \"autoTransparencyFill\" );\n\tdesc4.putBoolean( idautoTransparencyFill, true );\n\texecuteAction( idmergeAlignedLayers, desc4, DialogModes.NO );\n}", "initializeBeginnerMode () {\n for (var i = this.layers.length - 1; i >= 0; i--) {\n for (var j = 0; j < this.layers[i].length; j++) {\n for (var k = 0; k < this.layers[i][j].length; k++) {\n if(this.layers[i][j][k] !== null && !this.layers[i][j][k].selectable) {\n this.layers[i][j][k].dimTile(gameSession.colours.dim)\n } \n }\n }\n }\n }", "function checkLayers() {\n if (recentGroup.hasLayer() != true) {\n recentPop();\n } else clearRecents();\n }", "function change_map_layer(el) {\n if (el.value === \"lock\") {\n conf_layer.remove();\n conf_num_group.remove();\n lock_layer.addTo(map);\n toggle_map_legend(0);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n } else if (el.value === \"conf\") {\n lock_layer.remove();\n conf_layer.addTo(map);\n conf_num_group.addTo(map);\n toggle_map_legend(1);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n }\n}", "function closeGroup(layerSet) {\r \r try {\r \r var layerSetName = layerSet.name; \r var layerSetOpacity = layerSet.opacity; \r var layerSetBlendMode = layerSet.blendMode; \r \r docRef.activeLayer = layerSet; \r ungroup(); \r groupSelected(layerSetName); \r\r var closedLayerSet = activeDocument.activeLayer; \r closedLayerSet.opacity = layerSetOpacity; \r closedLayerSet.blendMode = layerSetBlendMode; \r }\r catch(e) {\r \r ; // Do nothing\r\t}\r}", "addToChangeLayers(){\n let _to = this.props.toVersion.key;\n //attribute change in protected areas layers\n this.addLayer({id: window.LYR_TO_CHANGED_ATTRIBUTE, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.4)\", \"fill-outline-color\": \"rgba(99,148,69,0.8)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //geometry change in protected areas layers - to\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_POINT_COUNT_CHANGED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_GEOMETRY_SHIFTED_POLYGON_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_TO_CHANGED_GEOMETRY_LINE, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //added protected areas layers\n this.addLayer({id: window.LYR_TO_NEW_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(63,127,191,0.2)\", \"fill-outline-color\": \"rgba(63,127,191,0.6)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_NEW_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(63,127,191)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_SELECTED_POLYGON});\n \n }", "function resetGroups() {\n for (let gName in $scope.selectionGroups) {\n let g = $scope.selectionGroups[gName];\n const t = g.trueVal;\n const m = g.modelKey;\n g.val = appState.models.columnInfo[m].every(function (v) {\n return v === t;\n });\n }\n }", "turnOnLayer(layer) {\n\n let newLayers = {}\n if (layer) {\n Object.keys(this.state.layers).forEach((key) => {\n newLayers[key] = this.state.layers[key]\n if (newLayers[key].title === layer.title) {\n newLayers[key].checked = true\n }\n else {\n newLayers[key].checked = false\n }\n })\n this.props.updateAnalysisLayers([layer])\n }\n else {\n // make sure all layers are off\n Object.keys(this.state.layers).forEach((key) => {\n newLayers[key] = this.state.layers[key]\n newLayers[key].checked = false\n })\n this.props.updateAnalysisLayers([])\n }\n this.setState({\n layers: newLayers\n })\n }", "function makeBaseLyrGroups() {\r\n for (var key in lyrGroups) {\r\n var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {\r\n //attribution: '&copy; <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\r\n });\r\n\r\n var Esri_NatGeoWorldMap = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', {\r\n //attribution: 'Tiles &copy; Esri &mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC',\r\n });\r\n\r\n var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\r\n //attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'\r\n });\r\n\r\n lyrGroups[key].base = L.layerGroup([Esri_WorldImagery, Esri_NatGeoWorldMap, osm])\r\n }\r\n}", "toggleGroup() {\n this['group'] = !this['group'];\n this.getEntry()['filterGroup'] = this['group'];\n var children = /** @type {Array<ComboNode>} */ (this.node_.getChildren());\n\n if (children) {\n for (var i = 0, n = children.length; i < n; i++) {\n var node = /** @type {ComboNode} */ (children[i]);\n\n if (node) {\n var entry = node.getEntry();\n\n if (entry && entry['filterId']) {\n entry['filterGroup'] = this['group'];\n }\n }\n }\n }\n\n this.scope_.$emit('dirty');\n }", "function InitLayers()\n{\n LayerCollection.push(new RenderLayer(LayerCollection.length));\n CurrentLayer = LayerCollection[0];\n CurrentLayer.IsSelected = true;\n}", "restack (){\n this._layers.forEach( (layer, key, index) => {\n layer.setDepth(index);\n //layer.objects.forEach(obj => {\n //if (obj.active)\n //obj.depth = index;\n //});\n });\n }", "function advancedMergeLayers()\n{\n\tvar idmergeAlignedLayers = stringIDToTypeID( \"mergeAlignedLayers\" );\n\tvar desc4 = new ActionDescriptor();\n\tvar idAply = charIDToTypeID( \"Aply\" );\n\tvar idautoBlendType = stringIDToTypeID( \"autoBlendType\" );\n\tvar idpanorama = stringIDToTypeID( \"panorama\" );\n\tdesc4.putEnumerated( idAply, idautoBlendType, idpanorama );\n\tvar idClrC = charIDToTypeID( \"ClrC\" );\n\tdesc4.putBoolean( idClrC, true );\n\tvar idautoTransparencyFill = stringIDToTypeID( \"autoTransparencyFill\" );\n\tdesc4.putBoolean( idautoTransparencyFill, false );\n\texecuteAction( idmergeAlignedLayers, desc4, DialogModes.NO );\n\n//\tusing the following line will be using the sticky settings of blendtype and autofill in PS, which is not what we want\n//\texecuteAction( kmergeAlignedLayersStr, undefined, DialogModes.NO );\n}", "_updateActiveLayersModel(availableLayers, inputFields) {\n inputFields = inputFields.filter(input => input.checked);\n\n if (!this._allowMultiple && inputFields.length > 1) {\n inputFields = inputFields.slice(1);\n }\n\n let _tempActiveLayers = inputFields.map(input =>\n availableLayers.find(layer => input.value === layer.layerId)\n );\n\n // Capture the active layers.\n this._activeLayersModel.setLayers(_tempActiveLayers);\n }", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "function groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}", "disableAllLayers() {\n var layerToggles = this.layerSection.querySelectorAll('layer-toggle');\n for(let i = 0; i < layerToggles.length; i++) {\n layerToggles[i].deactivate();\n }\n }", "function copyAndMergeSelectedLayer( __selectedLayer, __collectedLayers )\n{\n\tfor ( var i = 0; i < __collectedLayers.length; i++ )\n\t{\n\t\tvar duplicatedLayer = __selectedLayer.duplicate( __collectedLayers[ i ],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tElementPlacement.PLACEBEFORE );\n\t\tduplicatedLayer.grouped = true;\n\t\tduplicatedLayer.merge( );\n\t}\n}", "getLayers (deep) {\n let out = []\n if (deep) {\n this.ol.getLayers().forEach((lyr) => {\n if (!(lyr instanceof openlayers.layer.Group)) {\n out.push(lyr)\n }\n })\n } else {\n this.ol.getLayers().forEach((lyr) => {\n if (lyr instanceof openlayers.layer.Group) {\n lyr.getLayers().forEach((sublyr) => {\n out.push(sublyr)\n })\n } else {\n out.push(lyr)\n }\n })\n }\n return out\n }", "toggleEmpty () {\n for (let depth = this.maxDepth; depth >= 0; --depth) {\n for (const group of this.groups) {\n if (group.depth === depth) {\n group.toggleEmpty();\n }\n }\n }\n }", "function LayerGroupView(base) {\n var GMapsCartoDBLayerGroupView = function(layerModel, gmapsMap) {\n var self = this;\n var hovers = [];\n\n _.bindAll(this, 'featureOut', 'featureOver', 'featureClick');\n\n var opts = _.clone(layerModel.attributes);\n\n opts.map = gmapsMap;\n\n var // preserve the user's callbacks\n _featureOver = opts.featureOver,\n _featureOut = opts.featureOut,\n _featureClick = opts.featureClick;\n\n var previousEvent;\n var eventTimeout = -1;\n\n opts.featureOver = function(e, latlon, pxPos, data, layer) {\n if (!hovers[layer]) {\n self.trigger('layerenter', e, latlon, pxPos, data, layer);\n }\n hovers[layer] = 1;\n _featureOver && _featureOver.apply(this, arguments);\n self.featureOver && self.featureOver.apply(this, arguments);\n\n // if the event is the same than before just cancel the event\n // firing because there is a layer on top of it\n if (e.timeStamp === previousEvent) {\n clearTimeout(eventTimeout);\n }\n eventTimeout = setTimeout(function() {\n self.trigger('mouseover', e, latlon, pxPos, data, layer);\n self.trigger('layermouseover', e, latlon, pxPos, data, layer);\n }, 0);\n previousEvent = e.timeStamp;\n };\n\n opts.featureOut = function(m, layer) {\n if (hovers[layer]) {\n self.trigger('layermouseout', layer);\n }\n hovers[layer] = 0;\n if(!_.any(hovers)) {\n self.trigger('mouseout');\n }\n _featureOut && _featureOut.apply(this, arguments);\n self.featureOut && self.featureOut.apply(this, arguments);\n };\n\n opts.featureClick = _.debounce(function() {\n _featureClick && _featureClick.apply(this, arguments);\n self.featureClick && self.featureClick.apply(opts, arguments);\n }, 10);\n\n \n //CartoDBLayerGroup.call(this, opts);\n base.call(this, opts);\n cdb.geo.GMapsLayerView.call(this, layerModel, this, gmapsMap);\n };\n\n _.extend(\n GMapsCartoDBLayerGroupView.prototype,\n cdb.geo.GMapsLayerView.prototype,\n base.prototype,\n {\n\n _update: function() {\n this.setOptions(this.model.attributes);\n },\n\n reload: function() {\n this.model.invalidate();\n },\n\n remove: function() {\n cdb.geo.GMapsLayerView.prototype.remove.call(this);\n this.clear();\n },\n\n featureOver: function(e, latlon, pixelPos, data, layer) {\n // dont pass gmaps LatLng\n this.trigger('featureOver', e, [latlon.lat(), latlon.lng()], pixelPos, data, layer);\n },\n\n featureOut: function(e, layer) {\n this.trigger('featureOut', e, layer);\n },\n\n featureClick: function(e, latlon, pixelPos, data, layer) {\n // dont pass leaflet lat/lon\n this.trigger('featureClick', e, [latlon.lat(), latlon.lng()], pixelPos, data, layer);\n },\n\n error: function(e) {\n if(this.model) {\n //trigger the error form _checkTiles in the model\n this.model.trigger('error', e?e.errors:'unknown error');\n this.model.trigger('tileError', e?e.errors:'unknown error');\n }\n },\n\n ok: function(e) {\n this.model.trigger('tileOk');\n },\n\n tilesOk: function(e) {\n this.model.trigger('tileOk');\n },\n\n loading: function() {\n this.trigger(\"loading\");\n },\n\n finishLoading: function() {\n this.trigger(\"load\");\n }\n\n\n });\n return GMapsCartoDBLayerGroupView;\n}", "function reduce(add, remove, initial) {\n\t reduceAdd = add;\n\t reduceRemove = remove;\n\t reduceInitial = initial;\n\t resetNeeded = true;\n\t return group;\n\t }", "showFeatureGroup (groupId, map) {\n this.currentLayer = this.indexedFeatures()[groupId]\n map.addLayer(this.currentLayer)\n }", "function groupTransition(g1, g2, animatableModel) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n x: el.x,\n y: el.y,\n rotation: el.rotation\n };\n\n if (isPath(el)) {\n obj.shape = Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_26__[/* extend */ \"m\"])({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (isNotGroup(el) && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, Object(_innerStore__WEBPACK_IMPORTED_MODULE_27__[/* getECData */ \"a\"])(el).dataIndex);\n }\n }\n });\n}", "selectDeselectAllLayers() {\n me.btnSelectDeseletClicked = !me.btnSelectDeseletClicked;\n me.compoData.layers.forEach(layer => layer.checked = me.btnSelectDeseletClicked);\n }", "function switchGroup(flag) {\n\tvar trGroupFilter = \"trGroupFilter\";\n\tElement[flag ? 'show' : 'hide'](trGroupFilter);\n\tgroupsMultiDropDown.render();\n}", "function applyLayerMask()\n{\n\tvar desc = new ActionDescriptor();\n\tvar ref = new ActionReference();\n\tref.putEnumerated( typeChannel, typeOrdinal, enumTarget );\n\tdesc.putReference( typeNULL, ref );\n\tdesc.putBoolean( keyApply, true );\n\texecuteAction( eventDelete, desc, DialogModes.NO );\n}", "function processChecked(layers) {\n let allChecked = 0;\n let allIndeterminate = 0;\n // set indeterminate states, start from the bottom and work up\n layers.forEach((facdomain) => {\n let facdomainChecked = 0;\n let facdomainIndeterminate = 0;\n\n facdomain.children.forEach((group) => {\n let groupChecked = 0;\n\n group.children.forEach((subgroup) => {\n if (subgroup.checked) groupChecked += 1;\n });\n\n group.checked = (groupChecked === group.children.length);\n group.indeterminate = (groupChecked < group.children.length) && groupChecked > 0;\n\n if (group.checked) facdomainChecked += 1;\n if (group.indeterminate) facdomainIndeterminate += 1;\n });\n\n facdomain.checked = (facdomainChecked === facdomain.children.length);\n if (facdomain.checked) allChecked += 1;\n\n facdomain.indeterminate = (facdomainIndeterminate > 0) || ((facdomainChecked < facdomain.children.length) && facdomainChecked > 0);\n if (facdomain.indeterminate) allIndeterminate += 1;\n });\n\n let checkStatus;\n // figure out whether all, none, or some are checked\n if (allChecked === layers.length) {\n checkStatus = 'all';\n } else if (allChecked === 0 && allIndeterminate === 0) {\n checkStatus = 'none';\n } else {\n checkStatus = null;\n }\n\n return { layers, checkStatus };\n}", "function removeAllLayers() {\n currentLayer = \"none\";\n map.removeLayer(otherLayer);\n map.removeLayer(todoLayer);\n map.removeLayer(foodLayer);\n map.removeLayer(shelterLayer);\n map.removeLayer(eventsLayer);\n }", "preInit() {\n this.createGroups();\n }", "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }", "function pushLayers(){\t\r\n\tif(oldLayer.features[0] != null){ oldLayer.removeAllFeatures();\t}\r\n\tif(currentLayer.features[0] != null){\r\n\t\toldLayer.features = currentLayer.features \t// old layer is set to current\r\n\t\tcurrentLayer.removeAllFeatures();\t\t\t// remove all features from current layer\r\n\t\toldLayer.redraw();\r\n\t}\r\n}", "function transitionGroup() {\n vis.selectAll(\"g.layer rect\")\n .transition()\n .duration(500)\n .delay(function(d, i) { return (i % m) * 10; })\n .attr(\"x\", function(d, i) { return x({x: .9 * ~~(i / m) / n}); })\n .attr(\"width\", x({x: .9 / n}))\n .each(\"end\", transitionEnd);\n\n function transitionEnd() {\n d3.select(this)\n .transition()\n .duration(500)\n .attr(\"y\", function(d) { return height - y2(d); })\n .attr(\"height\", y2);\n }\n }", "function checkFlattenGroups() {\n flattenGroups = !flattenGroups;\n\n checkGroupsSidebar();\n getAllGroups();\n}", "function toggleGroupingL2(disable){var noGroupingL2=$('#noGroupingL2');if(disable){noGroupingL2.prop('checked',true);}noGroupingL2.prop('disabled',disable);$('#groupByIntersectionSizeL2').prop('disabled',disable);$('#groupBySetL2').prop('disabled',disable);$('#groupByRelevanceMeasureL2').prop('disabled',disable);$('#groupByOverlapDegreeL2').prop('disabled',disable);}", "function groupTransition(g1, g2, animatableModel) {\n\t if (!g1 || !g2) {\n\t return;\n\t }\n\t\n\t function getElMap(g) {\n\t var elMap = {};\n\t g.traverse(function (el) {\n\t if (isNotGroup(el) && el.anid) {\n\t elMap[el.anid] = el;\n\t }\n\t });\n\t return elMap;\n\t }\n\t\n\t function getAnimatableProps(el) {\n\t var obj = {\n\t x: el.x,\n\t y: el.y,\n\t rotation: el.rotation\n\t };\n\t\n\t if (isPath(el)) {\n\t obj.shape = extend({}, el.shape);\n\t }\n\t\n\t return obj;\n\t }\n\t\n\t var elMap1 = getElMap(g1);\n\t g2.traverse(function (el) {\n\t if (isNotGroup(el) && el.anid) {\n\t var oldEl = elMap1[el.anid];\n\t\n\t if (oldEl) {\n\t var newProp = getAnimatableProps(el);\n\t el.attr(getAnimatableProps(oldEl));\n\t updateProps(el, newProp, animatableModel, getECData(el).dataIndex);\n\t }\n\t }\n\t });\n\t }", "function highlightGroupUngroup() {\n if (selectedBlocks.length >= 1) {\n\t var tileCount = 0;\n\t var stripCount = 0;\n\t var matCount = 0;\n\t for (i = 0; i < selectedBlocks.length; i++) {\n\t\tif (selectedBlocks[i].name == 'tile') {\n\t\t tileCount = tileCount + 1;\n\t\t} else if (selectedBlocks[i].name == 'strip') {\n\t\t stripCount = stripCount + 1;\n\t\t} else if (selectedBlocks[i].name == 'mat') {\n\t\t matCount = matCount + 1;\n\t\t}\n\t }\n\t $(\"#toolbar\").addClass(\"deselected_toolbar_number_group deselected_toolbar_number_ungroup\");\n\t if(stripCount > 0 || matCount > 0){\n\t\t$(\"#toolbar\").removeClass(\"deselected_toolbar_number_ungroup\");\n\t }\n\t if(stripCount >=10 || tileCount >= 10){\n\t\t$(\"#toolbar\").removeClass(\"deselected_toolbar_number_group\");\n\t }\n }else{\n\t if(!$(\"#toolbar\").hasClass(\"deselected_toolbar_number_group\")){\n\t $(\"#toolbar\").addClass(\"deselected_toolbar_number_group\");\n\t }\n\t if(!$(\"#toolbar\").hasClass(\"deselected_toolbar_number_ungroup\")){\n\t $(\"#toolbar\").addClass(\"deselected_toolbar_number_ungroup\");\n\t }\n\t}\n }", "_updateLayers() {\n const {tileset3d, layerMap} = this.state;\n const {selectedTiles} = tileset3d;\n\n const tilesWithoutLayer = selectedTiles.filter(tile => !(tile.contentUri in layerMap));\n\n for (const tile of tilesWithoutLayer) {\n this._unpackTile(tile);\n\n const layer = this._create3DTileLayer(tile);\n\n tileset3d.addTileToCache(tile); // Add and remove on main thread\n\n layerMap[tile.contentUri] = {\n layer,\n tile\n };\n }\n }", "function reduce(add, remove, initial) {\n\t reduceAdd = add;\n\t reduceRemove = remove;\n\t reduceInitial = initial;\n\t resetNeeded = true;\n\t return group;\n\t }", "function makeDataLyrGroups() {\r\n var earlyYear = $(\".earlyYear\").first().val();\r\n var lateYear = $(\".lateYear\").first().val();\r\n for (var key in lyrGroups) {\r\n if (key === 'map') {\r\n var lateLayer = getDataTileLyr(lateYear);\r\n lyrGroups[key].data = L.layerGroup([lateLayer]);\r\n } else if (key === 'flickerMap') {\r\n var earlyLayer = getDataTileLyr(earlyYear);\r\n var lateLayer = getDataTileLyr(lateYear);\r\n lyrGroups[key].data = L.layerGroup([earlyLayer, lateLayer]);\r\n } else if (key === 'map1') {\r\n var earlyLayer = getDataTileLyr(earlyYear);\r\n lyrGroups[key].data = L.layerGroup([earlyLayer]);\r\n } else if (key === 'map2') {\r\n var lateLayer = getDataTileLyr(lateYear);\r\n lyrGroups[key].data = L.layerGroup([lateLayer]);\r\n } else if (key === 'map3') {\r\n var earlyLayer = getDataTileLyr(earlyYear);\r\n var lateLayer = getDataTileLyr(lateYear);\r\n lyrGroups[key].data = L.layerGroup([earlyLayer, lateLayer]);\r\n }\r\n }\r\n}", "function baseMapControl() {\n\n //initial basemap toggle value\n var baseName = $('#togGroup input').val();\n\n $('#togGroup input').change(function (e) {\n\n map.removeLayer(tileLayer);\n\n if (baseLabels) {\n map.removeLayer(baseLabels);\n }\n\n baseName = $(this).val();\n console.log(baseName);\n\n tileLayer = L.esri.basemapLayer(baseName);\n tileLayer.addTo(map);\n\n if (baseName != 'Topographic') {\n baseLabels = L.esri.basemapLayer(baseName + 'Labels');\n baseLabels.addTo(map);\n }\n });\n }", "function resetOne() {\n\t var i,\n\t g = groups[0];\n\n\t // Reset the singleton group values.\n\t g.value = reduceInitial();\n\n\t // Add any selected records.\n\t for (i = 0; i < n; ++i) {\n\t if (!(filters[i] & zero)) {\n\t g.value = reduceAdd(g.value, data[i]);\n\t }\n\t }\n\t }", "function decorateGroupsWithCells(){var nonLogicGroups=groupRows.filter(function(d){return \"combinedSets\" in d.data; //!(d.data instanceof QueryGroup) &&\n\t});var combinationGroups=nonLogicGroups.selectAll('g.combination').data(function(d){ // binding in an array of size one\n\treturn [d.data.combinedSets];});combinationGroups.enter().append('g').attr({class:'combination'});combinationGroups.exit().remove();var cells=combinationGroups.selectAll('.cell').data(function(d){return d.map(function(dd,i){return {data:usedSets[i],value:dd};});}); // ** init\n\tcells.enter().append('circle').on({'mouseover':function mouseover(d,i){mouseoverCell(d3.select(this).node().parentNode.parentNode.__data__,i);},'mouseout':mouseoutCell});cells.exit().remove(); //** update\n\tcells.attr('cx',function(d,i){return ctx.cellWidth*i+ctx.cellWidth/2;}).attr({r:ctx.cellSize/2-3,cy:ctx.cellSize/2,class:'cell'}).style('fill',function(d){switch(d.value){case 0: //logicState.NOT\n\treturn ctx.grays[0];break;case 1: //logicState.MUST\n\treturn ctx.grays[1];break;default: // logicState.DONTCARE\n\treturn \"url(#DontCarePattern)\";}}).style({\"stroke\":function stroke(d){if(d.value==0)return ctx.grays[1];else return \"none\";} //ctx.grays[1]\n\t});}", "updateCurrentLayersStyle () {\n const determineStyle = _.bind(this.determineStyle, this)\n const styleLayer = _.bind(this.styleLayer, this)\n\n if (this.currentLayer) {\n this.currentLayer.eachLayer((layer) => {\n styleLayer(layer, determineStyle(layer))\n })\n }\n }", "function collectLayers()\n{\n var layers = [],\n visibleLayers = [],\n layerCount = 0,\n ref = null,\n desc = null;\n \n const idOrdn = charIDToTypeID(\"Ordn\");\n \n // Get layer count reported by the active Document object - it never includes the background.\n ref = new ActionReference();\n ref.putEnumerated(charIDToTypeID(\"Dcmn\"), charIDToTypeID(\"Ordn\"), charIDToTypeID(\"Trgt\"));\n desc = executeActionGet(ref);\n layerCount = desc.getInteger(charIDToTypeID(\"NmbL\"));\n\n if (layerCount == 0) {\n // This is a flattened image that contains only the background (which is always visible).\n activeDocument.backgroundLayer.locked = false;\n var bg = activeDocument.backgroundLayer;\n layers.push(bg);\n visibleLayers.push(bg);\n }\n else {\n // There are more layers that may or may not contain a background. The background is always at 0;\n // other layers are indexed from 1.\n \n const idLyr = charIDToTypeID(\"Lyr \");\n const idLayerSection = stringIDToTypeID(\"layerSection\");\n const idVsbl = charIDToTypeID(\"Vsbl\");\n const idNull = charIDToTypeID(\"null\");\n const idSlct = charIDToTypeID(\"slct\");\n const idMkVs = charIDToTypeID(\"MkVs\");\n \n ref = new ActionReference();\n ref.putEnumerated(idLyr, idOrdn, charIDToTypeID(\"Trgt\"));\n var selectionDesc = executeActionGet(ref);\n \n try {\n // Collect normal layers.\n var visibleInGroup = [true];\n var layerVisible;\n for (var i = layerCount; i >= 1; --i) {\n // check if it's an art layer (not a group) that can be selected\n ref = new ActionReference();\n ref.putIndex(idLyr, i);\n desc = executeActionGet(ref);\n layerVisible = desc.getBoolean(idVsbl);\n layerSection = typeIDToStringID(desc.getEnumerationValue(idLayerSection));\n if (layerSection == \"layerSectionContent\") {\n // select the layer and then retrieve it via Document.activeLayer\n desc.clear();\n desc.putReference(idNull, ref); \n desc.putBoolean(idMkVs, false); \n executeAction(idSlct, desc, DialogModes.NO);\n \n var activeLayer = activeDocument.activeLayer;\n layers.push(activeLayer);\n if (layerVisible && visibleInGroup[visibleInGroup.length - 1]) {\n visibleLayers.push(activeLayer);\n } \n }\n else if (layerSection == \"layerSectionStart\") {\n visibleInGroup.push(layerVisible && visibleInGroup[visibleInGroup.length - 1]);\n }\n else if (layerSection == \"layerSectionEnd\") {\n visibleInGroup.pop();\n } \n }\n \n // Collect the background.\n ref = new ActionReference();\n ref.putIndex(idLyr, 0);\n try {\n desc = executeActionGet(ref);\n var bg = activeDocument.backgroundLayer;\n layers.push(bg);\n if (bg.visible) {\n visibleLayers.push(bg);\n }\n\n }\n catch (e) {\n // no background, move on\n } \n }\n catch (e) {\n if (e.message != \"cancel\") throw e;\n }\n\n // restore selection (unfortunately CS2 doesn't support multiselection, so only the topmost layer is re-selected)\n desc.clear();\n ref = new ActionReference();\n const totalLayerCount = selectionDesc.getInteger(charIDToTypeID(\"Cnt \"));\n ref.putIndex(idLyr, selectionDesc.getInteger(charIDToTypeID(\"ItmI\")) - (totalLayerCount - layerCount));\n desc.putReference(idNull, ref); \n desc.putBoolean(idMkVs, false); \n executeAction(idSlct, desc, DialogModes.NO);\n }\n \n return {layers: layers, visibleLayers: visibleLayers};\n}", "function update_groups(x,y){\n d3.selectAll(\".group\").remove();\n create_groups();\n // This code is tested and works to update. It's here if needed.\n // var area = d3.area()\n // .curve(d3.curveBasisOpen)\n // .x(function(d) { return x(d.x); })\n // .y0(function(d) { return y(d.y); })\n // .y1(function(d) { return y(d.height); });\n //\n // d3.selectAll(\".group\")\n // .transition()\n // .attr(\"d\", area);\n}", "function resetOne() {\n var i,\n g = groups[0];\n\n // Reset the singleton group values.\n g.value = reduceInitial();\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }", "function createGroupFilters(node) {\r\n var icons = new Array('complete','finished','ongoing','stalled','dropped','specials only','all');\r\n for (var i = 0; i < icons.length; i++) {\r\n var icon = icons[i];\r\n var desc = (icon != 'all') ? 'toggle group rows with state: '+icon : 'reset group filter';\r\n var ico = createIcon(null, icon, 'removeme', filterGroups, desc, 'i_gstate_'+icon.substring(0,(icon.indexOf(' ') >= 0) ? icon.indexOf(' ') : icon.length));\r\n node.appendChild(ico);\r\n }\r\n}", "toggleBaseLayer(layer) {\n for (var i = 0; i < this.baseLayers.length; i++) {\n this.baseLayers[i].setVisible(false)\n }\n\n layer.setVisible(true)\n this.selectedBaseLayer = layer.get('title');\n\n }", "function addLayer(active, layer, gridlayer, name, zIndex) {\n if (active === 1) {\n\tlayer\n .setZIndex(zIndex)\n .addTo(map);\n gridlayer\n .addTo(map);\n\t}\n // add the gridControl the active gridlayer\n var gridControl = L.mapbox.gridControl(gridlayer, {follow: true}).addTo(map);\n \n// Create a simple layer switcher that toggles layers on and off.\n var item = document.createElement('li');\n var link = document.createElement('a');\n\n link.href = '#';\n\tif (active === 1) {\n \tlink.className = 'active';\n\t} else {link.className = '';}\n link.innerHTML = name;\n\n link.onclick = function(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (map.hasLayer(layer)) {\n map.removeLayer(layer);\n map.removeLayer(gridlayer);\n this.className = '';\n } else {\n map.addLayer(layer);\n map.addLayer(gridlayer);\n this.className = 'active';\n }\n };\n item.appendChild(link);\n ui.appendChild(item);\n}", "function add_layer() {\n var layer_num = (layer_divs.length + 1).toString();\n var layer_name = \"layer_\" + layer_num;\n var layer_type = $('#layer_type').val();\n layer_divs.push(layer_name);\n var layer_html = [\n '<div id=\"' + layer_name + '\" class=\"single_layer_controls\">',\n '<span style=\"font-style: italic;\">layer ' + \n layer_num + ' (' + layer_type + ')' +\n '</span>&#160;&#160;'\n ];\n var checkbox_name = \"square_switchboard_\" + layer_num;\n layer_html.push('<input type=\"checkbox\" id=\"' + checkbox_name +\n '\" checked=\"checked\" />');\n layer_html.push('<label for=\"' + checkbox_name + '\" id=\"' + checkbox_name\n + '_label\">square</label>&#160;&#160;');\n layer_types.push(layer_type);\n var layer_params = layer_type_params[layer_type];\n var i_param;\n var param_name;\n var param_id;\n var sync_fields = [];\n for (i_param = 0; i_param < layer_params.length; i_param += 1) {\n param_name = layer_params[i_param];\n if (ends_with(param_name, \"_xy\")) {\n param_name = param_name.substr(0, param_name.length - 3);\n param_id = param_name + \"_\" + layer_num;\n layer_html = layer_html.concat([\n '<label for=\"' + param_id + '_x\">' + param_name + ': </label>',\n '<input type=\"text\" id=\"' + param_id + '_x\" value=\"1\"' +\n ' class=\"number\" />',\n '<input type=\"text\" id=\"' + param_id + '_y\" value=\"1\"' +\n ' class=\"number\" />',\n '&#160;&#160;'\n ]);\n sync_fields.push(param_id);\n } else {\n param_id = param_name + \"_\" + layer_num;\n layer_html = layer_html.concat([\n '<label for=\"' + param_id + '\">' + param_name + ': </label>',\n '<input type=\"text\" id=\"' + param_id + '\" value=\"1\"' +\n ' class=\"number\" />',\n '&#160;&#160;'\n ]);\n }\n }\n layer_html = layer_html.concat(['</div>']);\n $(\"#layer_controls\").append(layer_html.join(\"\\n\"));\n $(\"#\" + layer_name).hide().slideDown('normal');\n if (sync_fields.length > 0) {\n $(\"#\" + checkbox_name).change(function(){\n var i;\n for (i in sync_fields) {\n if ($(this).is(':checked')) {\n $(\"#\" + sync_fields[i] + \"_x\").keyup(\n _get_sync_function(sync_fields[i]));\n $(\"#\" + sync_fields[i] + \"_y\").attr('disabled', true);\n }\n else {\n $(\"#\" + sync_fields[i] + \"_x\").unbind();\n $(\"#\" + sync_fields[i] + \"_y\").removeAttr('disabled');\n }\n }\n });\n $(\"#\" + checkbox_name).change();\n } else {\n $(\"#\" + checkbox_name).remove();\n $(\"#\" + checkbox_name + \"_label\").remove();\n }\n}", "disolveRotateGroup() {\n for (let componentCube in this.cubes) {\n this.groupCubes.add(this.cubes[componentCube]);\n } \n this.groupRotate.rotation.x = 0;\n this.groupRotate.rotation.y = 0;\n this.groupRotate.rotation.z = 0;\n this.currRotate = 0;\n }", "function resetMany() {\n\t var i,\n\t g;\n\n\t // Reset all group values.\n\t for (i = 0; i < k; ++i) {\n\t groups[i].value = reduceInitial();\n\t }\n\n\t // Add any selected records.\n\t for (i = 0; i < n; ++i) {\n\t if (!(filters[i] & zero)) {\n\t g = groups[groupIndex[i]];\n\t g.value = reduceAdd(g.value, data[i]);\n\t }\n\t }\n\t }", "function makeOverlayLyrGroups() {\r\n\r\n for (var key in lyrGroups) {\r\n // create the ardLayer\r\n map.doubleClickZoom.disable();\r\n\r\n function style(feature) { // this is the styling for the ARD grid\r\n return {\r\n //weight: 2,\r\n opacity: 1,\r\n color: '#51b9ff',\r\n dashArray: '1,1,1',\r\n fillOpacity: 0.0,\r\n fillColor: '#ffffff'\r\n };\r\n }\r\n\r\n function highlightFeature(e) {\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 5,\r\n color: '#666',\r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\r\n layer.bringToFront();\r\n }\r\n\r\n }\r\n\r\n var ardLayer;\r\n\r\n function markFeature(e) { // this is the style for that show if a tile is selected.\r\n\r\n a = 2;\r\n var layer = e.target;\r\n layer.setStyle({\r\n weight: 7,\r\n \r\n dashArray: '',\r\n fillOpacity: 0.7\r\n });\r\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { // this brings styling to the front\r\n layer.bringToFront();\r\n }\r\n // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n\r\n\r\n }\r\n\r\n function resetHighlight(e) { // resets the the style when the tile is unselected\r\n ardLayer.resetStyle(e.target);\r\n a = 1; // information for the dataListcontrol function\r\n dataListControl(e, a)\r\n //$(\".hvcount\").remove()\r\n //$('#download').append(\"<span class='hvcount'> \"+hvlist.length+\" selected</span>\")\r\n }\r\n\r\n\r\n function dataListControl(e, a) {\r\n var e_info = e.target.label; // gets the the <pre>h00v00</pre>\r\n if (a === 2) {\r\n hvlist.push(e_info); // adds the e_info to the hvlist list\r\n hvlist.filter(function (value, index) {\r\n return hvlist.indexOf(value) == index\r\n }); // removes any double values\r\n } else if (a === 1) {\r\n for (p in hvlist) {\r\n if (e_info === hvlist[p]) {\r\n hvlist.splice(hvlist.indexOf(hvlist[p]), 1); // removes a value from hvList if unselected\r\n } else {\r\n // nothing\r\n }\r\n }\r\n }\r\n\r\n if (hvlist.length < 1) {\r\n $('#download').removeClass('w3-green').addClass('w3-grey').css('cursor', 'not-allowed').text('Select Tile(s)')\r\n } else {\r\n $('#download').removeClass('w3-grey').addClass('w3-green').css('cursor', 'pointer').text(\"Download: \" + hvlist.length + \" tile(s)\")\r\n }\r\n return hvlist\r\n }\r\n\r\n function onEachFeature(feature, layer) {\r\n //layer.bindTooltip(feature.properties.name, {permanent: true, direction: 'center'})//.openTooltip();\r\n //layer.bindPopup('<pre>'+JSON.stringify(feature.properties,null,' ').replace(/[\\{\\}\"]/g,'')+'</pre>');\r\n // //layer.bindPopup(label);\r\n\r\n layer['label'] = '<pre>' + JSON.stringify(feature.properties.ARD_tile, null, ' ').replace(/[\\{\\}\"]/g, '') + '</pre>';\r\n\r\n //layer.on({mouseover: highlightFeature});//high ligths layer when mouse is over it\r\n\r\n //layer.on({mouseout: resetHighlight});\r\n\r\n\r\n layer.on({dblclick: markFeature});\r\n\r\n layer.on({click: resetHighlight});\r\n }\r\n\r\n var ardLayer = L.geoJSON(ard, {\r\n style: style,\r\n onEachFeature: onEachFeature\r\n });\r\n overlays.ard.maps[key] = {'layer': ardLayer}\r\n }\r\n\r\n}", "function controlLayers(map){\n var overlayMaps = {\n \"Population\": newLayer\n };\n//toggle population points on and off\n L.control.layers(null, overlayMaps).addTo(map);\n}", "function addLayerToMap1(element, layer) {\n\t\n if (element.checked){\n\t\tlayer.addTo(map);\n } else {\n\t\tlayer.remove();\t\t\t\t\t\n\t};\n}", "toggleGroupLines(args) {\n\n let groups = this.state.groups;\n\n if (args.isGroup) {\n if (args.expanded) {\n //collapse recrods, ie remove grouipLines from the groups object\n let groupLineCount = this.state.groups[args.index].ChildRows;\n //remove child rows\n groups.splice(args.index + 1, groupLineCount);\n //reset checkbox to unchecked state\n groups[args.index].expanded = false;\n\n //update state\n this.setState({groups: groups})\n\n }\n else {\n // show records , if for the first time then fetch recrods\n let selectedGroup = this.state.groups[args.index];\n //if grouplines are not fetched yet\n if (selectedGroup.groupLines === undefined) {\n this.fetchData({type: \"FETCH_GROUPLINES\", args: {groupEZID: groups[args.index].EZID}})\n }\n else {\n //add grouplines records from selected groups object to groups\n groups.splice(args.index + 1, 0, ...selectedGroup.groupLines);\n groups[args.index].expanded = true;\n this.setState({groups: groups})\n }\n\n }\n }\n else {\n groups[args.index].expanded = !groups[args.index].expanded;\n this.setState({groups: groups})\n }\n }", "function resetMany() {\n var i,\n g;\n\n // Reset all group values.\n for (i = 0; i < k; ++i) {\n groups[i].value = reduceInitial();\n }\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g = groups[groupIndex[i]];\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }", "function setLayerVisibility() {\n var layers = svc.layers;\n for (var i = 0; i < layers.length; i++) {\n var el = document.getElementById('layer' + layers[i].id);\n if (el) {\n layers[i].visible = (el.checked === true);\n }\n }\n ov.refresh();\n}", "function updateOpacity() {\r\n var opacity = $(\"#alphaSlider\").val();\r\n mapList.forEach(function (key) { //for(key in lyrGroups){\r\n lyrGroups[key].data.eachLayer(function (layer) { // TODO: this is throwing errors until all keys have data groups - right now only single and flicker do\r\n layer.setOpacity(opacity);\r\n });\r\n });\r\n}", "function SetGrouping(params){var width=params.width+10;var gQuery=params.queryElement;var vis=params.visElement;var cellSize=params.cellSize;var usedSets=params.usedSets; // console.log(globalContext);\n\t// to be bound !!\n\tvar grays=['#f0f0f0','#636363'];var groupingByList=[{name:\"by set size\",groupFunction:function groupFunction(){console.log(\"by set size\");}},{name:\"by sets\",groupFunction:function groupFunction(){console.log(\"by size\");}},{name:\"by weather\",groupFunction:function groupFunction(){console.log(\"by size\");}}];var collapseHeight=cellSize+5;var uncollapseHeight=70;var isCollapsed=true;var toggleState={};var init=function init(){ // vis.attr({\n\t// \"transform\":\"translate(\"+0+\",\"+(collapseHeight+6)+\")\"\n\t// })\n\tgQuery.append(\"rect\").attr({class:\"menuPlaceholder menuPlaceholderRect\",width:width,height:collapseHeight}).style({fill:\"none\",stroke:grays[1]});gQuery.append(\"rect\").attr({class:\"menuPlaceholder collapseButton\",x:width/2-50,y:2,width:100,height:collapseHeight-4}).style({\"fill\":\"white\"}).on({\"click\":function click(d){toggleMenu();}});gQuery.append(\"text\").text(\"vvvv detail\").attr({class:\"menuPlaceholder menuPlaceholderText columnLabel\",\"text-anchor\":\"middle\",\"transform\":\"translate(\"+(width-10)+\",\"+collapseHeight/2+\")\"}).style({ // \"font-size\":\"8pt\",\n\t\"text-anchor\":\"end\"}).on({\"click\":function click(d){toggleMenu();}});var patternDef=gQuery.append(\"defs\").append(\"pattern\").attr({id:\"HalfSelectPattern\",patternUnits:\"userSpaceOnUse\",x:\"0\",y:\"0\",width:cellSize,height:cellSize});patternDef.append(\"rect\").attr({x:cellSize/2,y:\"0\",width:cellSize/2,height:cellSize}).style({fill:grays[1]});patternDef.append(\"rect\").attr({x:0,y:\"0\",width:cellSize/2,height:cellSize}).style({fill:grays[0]});var groupSelector=gQuery.append(\"g\").attr({class:\"groupSelector\",\"transform\":\"translate(\"+5+\",\"+2+\")\"});usedSets.forEach(function(d){toggleState[d.id]=2;});groupSelector.selectAll(\".selectorCircle\").data(usedSets.map(function(d){return d.id;})).enter().append(\"circle\").attr({class:\"selectorCircle\",cx:function cx(d,i){return i*cellSize+cellSize/2;},cy:function cy(d,i){return cellSize/2;},r:cellSize/2-1}).style({ // stroke:grays[1],\n\tfill:function fill(d){switch(toggleState[d]){case 0:return grays[0];break;case 1:return grays[1];break;default:return \"url(#HalfSelectPattern)\";}}}).on({\"click\":function click(d){toggleCircle(d);}});var xoffset=usedSets.length*cellSize+5;var buttonWidth=70;groupSelector.append(\"text\").text(\"filter\").attr({class:\"columnLabel\",x:xoffset,y:cellSize/2}).style({\"text-anchor\":\"start\"});groupSelector.selectAll(\".groupAction\").data(groupingByList).enter().append(\"text\").text(function(d){return d.name;}).attr({class:\"groupAction columnLabel\",x:function x(d,i){return xoffset+(i+1)*(buttonWidth+3);},y:cellSize/2});};init();var toggleCircle=function toggleCircle(id){toggleState[id]=(toggleState[id]+1)%3;gQuery.selectAll(\".selectorCircle\").style({fill:function fill(d){ // console.log(d);\n\tswitch(toggleState[d]){case 0:return grays[0];break;case 1:return grays[1];break;default:return \"url(#HalfSelectPattern)\";}}});};var toggleMenu=function toggleMenu(){if(isCollapsed){gQuery.select(\".menuPlaceholderRect\").transition().attr({height:uncollapseHeight});gQuery.select(\".menuPlaceholderText\").text(\" ^^^^ detail\");vis.transition().attr({\"transform\":\"translate(\"+0+\",\"+(uncollapseHeight+2)+\")\"});isCollapsed=false;}else {gQuery.select(\".menuPlaceholderRect\").transition().attr({height:collapseHeight});gQuery.select(\".menuPlaceholderText\").text(\"vvvv detail\");vis.transition().attr({\"transform\":\"translate(\"+0+\",\"+(collapseHeight+2)+\")\"});isCollapsed=true;}}; // vis.append(\"rect\").attr({\n\t//\n\t//\n\t//\n\t// })\n\t//\n\t}", "function wmsLoaded()\n{\n\t//Set Initial Values\n\tvar subLayers = wmsLayer.getSubLayerWDim();\n\tif(subLayers.length > 0)\n\t{\n\t\tvar groupElement = document.getElementById('radioButtonGroup');\n\t\t//Removing all old Radio Boxes\n\t\tgroupElement.innerHTML = '';\n\t\t\n\t\t//Adding a radio button for each layer that contains at least one dimension\n\t\tfor(layerIndex = 0; layerIndex < subLayers.length; layerIndex++)\n\t\t{\n\t\t\tvar layerName = subLayers[layerIndex];\n\t\t\t\n\t\t\tvar dimensions = wmsLayer.getDimensions(layerName);\n\t\t\t\n\t\t\tif(dimensions.length != 0)\n\t\t\t{\n\t\t\t\tvar dimNames = \"&nbsp;&nbsp;(\" + dimensions.toString() + \")\";\n\n\t\t\t\tvar label = document.createElement(\"label\");\n\t var element = document.createElement(\"input\");\n\t element.setAttribute(\"type\", \"radio\");\n\t element.setAttribute(\"value\", layerName);\n\t element.setAttribute(\"name\", 'rbGroup');\n\t element.setAttribute(\"id\", 'rb' + layerName);\n\t element.style = 'margin:5px;';\n\t if (layerIndex==0)\n\t element.setAttribute(\"checked\", true);\n\n\t\t\t\tlabel.appendChild(element);\n \tlabel.innerHTML += layerName + dimNames;\n \tlabel.innerHTML += '<br />'; \n \tgroupElement.appendChild(label);\n }\n\t\t}\n\t\t\n\t\t//Display the layerSelector\n\t\tvar layerSelecterDiv = document.getElementById('layerSelector');\n\t\tlayerSelecterDiv.style.visibility = 'visible';\n\t}\n\telse\n\t{\n\t\talert(\"Web Map Service loaded does not have any multi-dimensional layers contained within it.\");\n\t}\n}", "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"geomap\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />': mapnik,\r\n 'Mapquest open <img src=\"./lib/images/external.png\" />': mapquestopen,\r\n 'Mapquest aerial <img src=\"./lib/images/external.png\" />': mapquest\r\n }; \r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />': maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />': boundaries,\r\n 'Radwege <img src=\"./lib/images/external.png\" />': cycling\r\n };\r\n }\r\n \r\n else if (maptype == \"gpxmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"monmap\") {\r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik, \r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Denkmäler <img src=\"./lib/images/wv-logo-12.png\" />' : monuments\r\n };\r\n }\r\n\r\n else if (maptype == \"poimap2\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik,\r\n 'Mapnik s/w <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnikbw,\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapquest Aerial <img src=\"./lib/images/external.png\" />' : mapquest,\r\n 'Verkehrsliniennetz <img src=\"./lib/images/external.png\" />' : transport,\r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />' : maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />' : boundaries,\r\n 'Schummerung <img src=\"./lib/images/wmf-logo-12.png\" />' : hill,\r\n 'Radwege <img src=\"./lib/images/external.png\" />' : cycling,\r\n 'Wanderwege <img src=\"./lib/images/external.png\" />' : hiking,\r\n 'Sehenswürdigkeiten <img src=\"./lib/images/wv-logo-12.png\" />' : markers,\r\n 'Reiseziele <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles,\r\n 'GPX Spuren / Kartenmaske <img src=\"./lib/images/wv-logo-12.png\" />' : tracks\r\n };\r\n }\r\n}", "function clearLayers() {\n\t\tfor (let i = 0; i < layerList.length; i++) {\n\t\t\tif (map.hasLayer(layerList[i])) {\n\t\t\t\tmap.removeLayer(layerList[i]);\n\t\t\t\t// console.log(\"Removed layer\")\n\t\t\t}\n\t\t}\n\t}", "addLayer(details){\n //if the layer already exists then delete it\n if (this.map.getLayer(details.id)){\n this.map.removeLayer(details.id);\n } \n this.map.addLayer({\n 'id': details.id,\n 'type': details.type,\n 'source': details.sourceId,\n 'source-layer': details.sourceLayer,\n 'paint': details.paint\n }, (details.beforeId) ? details.beforeId : undefined);\n //set a filter if one is passed\n if (details.hasOwnProperty('filter')) this.map.setFilter(details.id, details.filter);\n if (this.props.view === 'country'){\n //set the visibility of the layer depending on the visible property of the status \n let status = this.props.statuses.filter(status => {\n return (status.layers.indexOf(details.id) !== -1);\n })[0];\n if (status) this.map.setLayoutProperty(details.id, \"visibility\", (status.visible) ? \"visible\" : \"none\" );\n }\n }", "function add_effect_group(elem) {\n $(elem).siblings('.effectGroupControls').append($(elem).siblings('.effectGroupControls').find('div[name=effectgroup]:first').clone().show());\n}", "function updateDimAndGroups(data){\r\n \r\n ndx = crossfilter(data);\r\n\r\n counryDim = ndx.dimension(function(d) { return d.location; });\r\n countryGroup = counryDim.group().reduceSum(function(d) {return d.new_cases;});\r\n\r\n moveDays = ndx.dimension(d => d.day);\r\n volumeByDayGroup = moveDays.group().reduceSum(d => d.new_cases);\r\n indexAvgByDayGroup = moveDays.group().reduce(\r\n (p, v) => {\r\n ++p.days;\r\n p.total += v.new_cases;\r\n p.g_total += v.total_cases;\r\n p.type = \"newCases\";\r\n return p;\r\n },\r\n (p, v) => {\r\n --p.days;\r\n p.total -= v.new_cases;\r\n p.g_total -= v.total_cases;\r\n p.avg = p.days ? Math.round(p.total / p.days) : 0;\r\n p.type = \"newCases\";\r\n return p;\r\n },\r\n () => ({days: 0, total: 0, g_total:0, type:\"newCases\"})\r\n );\r\n indexAvgByDayDeathsGroup = moveDays.group().reduce(\r\n (p, v) => {\r\n ++p.days;\r\n p.total += v.new_deaths;\r\n p.g_total += v.total_deaths;\r\n p.type = \"newDeaths\";\r\n return p;\r\n },\r\n (p, v) => {\r\n --p.days;\r\n p.total -= v.new_deaths;\r\n p.g_total -= v.total_deaths;\r\n p.type = \"newDeaths\";\r\n return p;\r\n },\r\n () => ({days: 0, total: 0, g_total:0, type: \"newDeaths\"})\r\n );\r\n dayNewCasesGroupData = indexAvgByDayGroup.all();\r\n dayNewDeathsGroupData = indexAvgByDayDeathsGroup.all();\r\n moveWeeks = ndx.dimension(d => d.week);\r\n volumeByWeeksGroup = moveWeeks.group().reduceSum(d => d.new_cases);\r\n indexAvgByWeeksGroup = moveWeeks.group().reduce(\r\n (p, v) => {\r\n ++p.weeks;\r\n p.total += v.new_cases;\r\n p.g_total += v.total_cases;\r\n p.type = \"newCases\";\r\n return p;\r\n },\r\n (p, v) => {\r\n --p.weeks;\r\n p.total -= v.new_cases;\r\n p.g_total -= v.total_cases;\r\n p.type = \"newCases\";\r\n return p;\r\n },\r\n () => ({weeks: 0, total: 0, g_total: 0, type:\"newCases\"})\r\n );\r\n indexAvgByWeeksDeathsGroup = moveWeeks.group().reduce(\r\n (p, v) => {\r\n ++p.weeks;\r\n p.total += v.new_deaths;\r\n p.g_total += v.total_deaths;\r\n p.type = \"newDeaths\";\r\n return p;\r\n },\r\n (p, v) => {\r\n --p.weeks;\r\n p.total -= v.new_deaths;\r\n p.g_total -= v.total_deaths;\r\n p.type = \"newDeaths\";\r\n return p;\r\n },\r\n () => ({weeks: 0, total: 0, g_total: 0, type:\"newDeaths\"})\r\n );\r\n weekNewCasesGroupData = indexAvgByWeeksGroup.all();\r\n weekNewDeathsGroupData = indexAvgByWeeksDeathsGroup.all();\r\n \r\n\r\n}", "fillGroups(cb) {\n me.statusData.groups = [];\n if (config.advancedForm) {\n $http({\n url: statusManagerService.endpointUrl(),\n method: 'GET',\n data: {\n request: 'getGroups'\n }\n }).\n then(function (response) {\n var j = response.data;\n if (j.success) {\n me.statusData.groups = j.result;\n angular.forEach(me.statusData.groups, function (g) {\n g.w = false;\n g.r = false;\n });\n }\n cb();\n }, function (err) {\n\n });\n } else {\n cb();\n }\n }", "function filter_group() {\n var filters = get_checkbox_filters('groups');\n\n // If there are no group filters, move on to the next set of filters.\n if (Object.keys(filters).length <= 0) {\n Y.log('Group filter list is empty, moving on to next.');\n return false;\n }\n\n var filtered = {};\n Y.Object.each(addons, function(addon, key) {\n filtered[key] = true;\n });\n\n var i = 0;\n // Only loop through the filters that are actually set\n Y.Object.each(filters, function(value, index) {\n if (index in M.local_rlsiteadmin.data_groups) {\n for (i = 0; i < M.local_rlsiteadmin.data_groups[index].plugins.length; i += 1) {\n filtered[M.local_rlsiteadmin.data_groups[index].plugins[i]] = false;\n }\n }\n });\n\n Y.Object.each(filtered, function(value, key) {\n if (value && !addons[key].filtered) {\n addons[key].filtered = true;\n }\n });\n\n return true;\n }", "function toggleLayer(element, layer) {\n // set initial checked status\n ol.control.LayerSwitcher.forEachRecursive(layerGroup, function(lyr) {\n\t\tif (lyr.get('name') === layer && lyr.getVisible()) {\n\t\t\t$(element).addClass('settingsCheckboxChecked');\n\t\t}\n\t});\n\t$(element).on('click', function() {\n\t\tvar visible = false;\n\t\tif ($(element).hasClass('settingsCheckboxChecked')) {\n\t\t\tvisible = true;\n\t\t}\n\t\tol.control.LayerSwitcher.forEachRecursive(layerGroup, function(lyr) {\n\t\t\tif (lyr.get('name') === layer) {\n\t\t\t\tif (visible) {\n\t\t\t\t\tlyr.setVisible(false);\n\t\t\t\t\t$(element).removeClass('settingsCheckboxChecked');\n\t\t\t\t} else {\n\t\t\t\t\tlyr.setVisible(true);\n\t\t\t\t\t$(element).addClass('settingsCheckboxChecked');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "function setTransportLayers(/*key container control*/ctrl, /*Map layer state*/layerState, /*map widget*/map) {\n \n var tableCtrl = document.getElementById(ctrl + transportTable);\n\n var transportCheckBoxes = tableCtrl.getElementsByTagName(\"input\");\n\n var transportAllCheckBox = document.getElementById(ctrl + transportSelectAllPartial);\n\n var isAllSelected = transportAllCheckBox.src.toLowerCase().indexOf(transportImageUnSelectedPartial) < 0;\n\n for (var checkboxid in transportCheckBoxes) {\n if (transportCheckBoxes[checkboxid].type == \"checkbox\") {\n\n var code = getLayerCode(transportCheckBoxes[checkboxid].name);\n \n // if code is for Car park set car park layer visible\n if (code == \"CPK\") {\n layerState.carparkLayerVisible = transportCheckBoxes[checkboxid].checked & isAllSelected;\n }\n else {\n // otherwise iterate through the stop layers in the layerstate object and set the layer if the name is same as code\n for(var i=0;i<layerState.stops.length;i++){\n if (code == layerState.stops[i].name) {\n if (code == \"BCX\") {\n if (map) {\n try {\n if (map.getMapProperties().scale <= maxBusSymbolMapScale) {\n transportCheckBoxes[checkboxid].disabled = false;\n layerState.stops[i].visible = transportCheckBoxes[checkboxid].checked & isAllSelected;\n }\n else {\n transportCheckBoxes[checkboxid].disabled = true;\n layerState.stops[i].visible = false;\n }\n } catch (err) {\n }\n }\n else {\n transportCheckBoxes[checkboxid].disabled = true;\n layerState.stops[i].visible = false;\n }\n }\n else {\n layerState.stops[i].visible = transportCheckBoxes[checkboxid].checked & isAllSelected;\n }\n break;\n }\n }\n \n }\n }\n }\n}", "updateLayer() {\n /* This layer is always reloaded */\n return;\n }", "function clearAllLayers() {\n map.eachLayer(function(layer) {\n if (layer instanceof L.MarkerClusterGroup || layer instanceof L.Marker) {\n map.removeLayer(layer);\n }\n });\n }", "function layersUnlockAll(activeDoc, layerStatusLocked, layerStatusVisible) {\n // stores lock status for all layers in document in an array\n for (var v = 0; v < activeDoc.layers.length; v++) {\n if (activeDoc.layers[v].locked == true) {\n layerStatusLocked[v] = true;\n } else if (activeDoc.layers[v].locked == false) {\n layerStatusLocked[v] = false;\n }\n \n if (activeDoc.layers[v].visible == true) {\n layerStatusVisible[v] = true;\n } else if (activeDoc.layers[v].visible == false) {\n layerStatusVisible[v] = false;\n } \n }\n\n // unlocks all layers\n for (var v = 0; v < activeDoc.layers.length; v++) {\n activeDoc.layers[v].locked = false;\n activeDoc.layers[v].visible = true;\n }\n}", "function changeLayer() {\n var str = $('#queryLayers').val();\n //map.removeLayer(countiesLyr);\n //map.removeLayer(regionsLyr);\n //map.removeLayer(outageLyr);\n //map.removeLayer(customerOutagesLyr);\n\n countiesLyr.hide();\n regionsLyr.hide();\n outageLyr.hide();\n customerOutagesLyr.hide();\n\n getOutages();\n if (app.locations) {\n getOutageCustomerLocations(app.locations);\n }\n //if (str == \"Region\") {\n if ($('#rRegion').is(':checked')){\n getRegions();\n// map.addLayer(regionsLyr);\n// map.addLayer(outageLyr);\n // map.addLayer(customerOutagesLyr);\n regionsLyr.show();\n outageLyr.show();\n customerOutagesLyr.show();\n $('#rCounty').removeAttr(\"checked\");\n dojo.forEach(regionsLyr.graphics, function (graphic) {\n graphic.setSymbol(defaultRegionsSymbol);\n });\n } else if ($('#rCounty').is(':checked')) {\n getCounties();\n// map.addLayer(countiesLyr);\n// map.addLayer(outageLyr);\n // map.addLayer(customerOutagesLyr);\n countiesLyr.show();\n outageLyr.show();\n customerOutagesLyr.show();\n dojo.forEach(countiesLyr.graphics, function (graphic) {\n graphic.setSymbol(defaultCountiesSymbol);\n });\n } else {\n// map.addLayer(outageLyr);\n // map.addLayer(customerOutagesLyr);\n outageLyr.show();\n customerOutagesLyr.show();\n }\n}", "function groupSelected() {\r\n rot.group = that.surface.createGroup().moveToFront();\r\n for (var i in that.pieces) {\r\n var piece = that.pieces[i];\r\n if (that.selection.isPieceSelected(piece)) {\r\n that.drawPiece(rot.group, piece);\r\n piece.shape.removeShape();\r\n }\r\n }\r\n }", "function updateLayerMix() {\n\n if (meshLayerMix) {\n var resetLayerMix = function resetLayerMix() {\n sceneLayerMix.remove(meshLayerMix);\n meshLayerMix.material.dispose();\n meshLayerMix.material = null;\n meshLayerMix.geometry.dispose();\n meshLayerMix.geometry = null;\n };\n\n var addMeshToLayerMix = function addMeshToLayerMix() {\n var geometry = stackHelper.slice.geometry;\n var material = materialLayerMix;\n meshLayerMix = new THREE.Mesh(geometry, material);\n };\n\n var convertCoordinateSystemFromIJKToLeftPosteriorSuperior = function convertCoordinateSystemFromIJKToLeftPosteriorSuperior() {\n meshLayerMix.applyMatrix(stackHelper.stack._ijk2LPS);\n };\n\n resetLayerMix();\n\n addMeshToLayerMix();\n\n convertCoordinateSystemFromIJKToLeftPosteriorSuperior();\n\n sceneLayerMix.add(meshLayerMix);\n }\n }", "addFromLayers(){\n let _from = this.props.fromVersion.key;\n //add the sources\n this.addSource({id: window.SRC_FROM_POLYGONS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_FROM_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_points\" + window.TILES_SUFFIX]}});\n //add the layers\n this.addLayer({id: window.LYR_FROM_DELETED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(255,0,0, 0.2)\", \"fill-outline-color\": \"rgba(255,0,0,0.5)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_DELETED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n //geometry change in protected areas layers - from\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.5}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_COUNT_CHANGED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_SHIFTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_FROM_SELECTED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n }", "toggleSelectionGroupLine(args) {\n let currentGroup = this.state.newGroups.filter(g => g.GroupEZID === args.groupEZID * 1)[0],\n currentGroupLines = currentGroup.groupLines;\n\n //update checked status in selected group lines\n currentGroupLines = currentGroupLines.map(gl => {\n if (gl.EZID === args.groupLine * 1) {\n return Object.assign({}, gl, {checked: args.checked})\n }\n return gl\n })\n\n //update group with udpated gouplines status\n let newGroups = this.state.newGroups.map(g => {\n if (g.GroupEZID === args.groupEZID * 1) {\n return Object.assign({}, g, {groupLines: currentGroupLines});\n }\n return g;\n })\n\n this.setState({newGroups: newGroups});\n }", "function toggleGroup($ele) {\r\n\tvar $parent = $ele.closest(\"[data-transition='parent']\");\r\n\tvar transClass = $ele.attr(\"data-transition\");\r\n\tvar removeClass = $ele.attr(\"data-remove\").split(\"|\");\r\n\tfor(index in removeClass) {\r\n\t\t$parent.removeClass(removeClass[index]);\r\n\t}\r\n\tsetTimeout(function(){ $parent.addClass(transClass); },0);\r\n}", "removeToChangeLayers(){\n if (this.map && !this.map.isStyleLoaded()) return;\n this.props.statuses.forEach(status => {\n if (status.key !== 'no_change'){\n status.layers.forEach(layer => {\n if (this.map.getLayer(layer)) {\n this.map.removeLayer(layer);\n }\n });\n }\n });\n }", "function filterGroups() {\r\n\tvar state = this.className;\r\n\tvar active = (state.indexOf(' f_selected') >= 0);\r\n\tstate = state.substring(state.indexOf('gstate_')+7,(active) ? state.indexOf(' f_selected') : state.length);\r\n\tfor (var g in groups) {\r\n\t\tvar group = groups[g];\r\n\t\tif (!group) continue;\r\n\t\tif (group.id == 0) continue;\r\n\t\tvar gstate = group.state.substring(0,(group.state.indexOf(' ') >= 0) ? group.state.indexOf(' ') : group.state.length);\r\n\t\t//alert('state: '+state+'\\nactive: '+active+'\\ngstate: '+gstate+'\\nequal: '+(gstate == state));\r\n\t\tif (state != 'all') {\r\n\t\t\tif (gstate == state) {\r\n\t\t\t\tif (!active) group.filtered = true;\r\n\t\t\t\telse group.filtered = false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (active) continue;\r\n\t\t\tgroup.filtered = false;\r\n\t\t}\r\n\t\tvar row = document.getElementById('gid_'+group.id);\r\n\t\tif (!row) continue;\r\n\t\telse {\r\n\t\t\tif (expandAllG) row.style.display = (group.filtered) ? 'none' : '';\r\n\t\t\telse {\r\n\t\t\t\tif (group.defaultVisible) row.style.display = (group.filtered) ? 'none' : '';\r\n\t\t\t\telse row.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (state == 'all' && !active) { // reset the icons\r\n\t\tvar div = this.parentNode;\r\n\t\tvar spans = div.getElementsByTagName('a');\r\n\t\tfor (var i = 0; i < spans.length; i++) {\r\n\t\t\tvar span = spans[i];\r\n\t\t\tspan.className = span.className.replace(' f_selected','');\r\n\t\t\tspan.title = span.title.replace('show','hide');\r\n\t\t}\r\n\t} else {\r\n\t\tif (active) {\r\n\t\t\tthis.className = this.className.replace(' f_selected','');\r\n\t\t\tthis.title = this.title.replace('show','hide');\r\n\t\t} else {\r\n\t\t\tthis.className += ' f_selected';\r\n\t\t\tthis.title = this.title.replace('hide','show');\r\n\t\t}\r\n\t}\r\n\tforceFileTableRedraw();\r\n}", "makeMarkerLayerGroup() {\n this._markerLayerGroup = new L.layerGroup().addTo(this.getMap());\n }" ]
[ "0.63897187", "0.6238217", "0.59500057", "0.5940096", "0.58018565", "0.5796252", "0.575776", "0.5668572", "0.566853", "0.5607042", "0.5525891", "0.5509979", "0.55065703", "0.55026186", "0.5478508", "0.5455876", "0.5426737", "0.54110414", "0.53863806", "0.5379702", "0.53762865", "0.53734154", "0.5373121", "0.5290918", "0.5290918", "0.5290918", "0.5290918", "0.5290918", "0.5290918", "0.5290918", "0.5290918", "0.5290918", "0.5285643", "0.52759635", "0.5270094", "0.5267452", "0.5261714", "0.52532506", "0.52467734", "0.5220624", "0.5209359", "0.5207352", "0.51994675", "0.51968855", "0.51922226", "0.5174824", "0.51668274", "0.516632", "0.5164314", "0.5162075", "0.5159004", "0.5155996", "0.5150934", "0.5135588", "0.5133973", "0.5131103", "0.51303065", "0.51101506", "0.5098007", "0.50962174", "0.5087059", "0.50780845", "0.50749445", "0.5064717", "0.5059606", "0.5053997", "0.50493455", "0.5045839", "0.50422853", "0.50420314", "0.50353086", "0.5034155", "0.50217557", "0.50169724", "0.50155765", "0.50151503", "0.5015105", "0.49969357", "0.4987939", "0.49872947", "0.49751928", "0.4972422", "0.49591807", "0.49502122", "0.49465126", "0.49459985", "0.49353132", "0.49298128", "0.49244937", "0.49234498", "0.49182355", "0.49154133", "0.49138528", "0.49125814", "0.49047238", "0.49038914", "0.48952714", "0.48932928", "0.48926342", "0.4889811" ]
0.7612339
0
get best image format for a list of layers
function imageFormatForLayers(layers) { var format = origFormat; if (layerImageFormats.length > 0 && origFormat.match(/8bit/)) { for (var f = 0; f < layerImageFormats.length; f++) { var layerImageFormat = layerImageFormats[f]; for (var l = 0; l < layerImageFormat.layers.length; l++) { if (layers.indexOf(layerImageFormat.layers[l]) != -1) { format = layerImageFormat.format; break; } } if (format != origFormat) { break; } } } return format; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBestLayer(layers = []) {\n //finde den besten Layer (z.B. mit den meisten Eyetracking- und Mausdaten)\n // let bestLayerHelper = {};\n // for (let layerNumber in layers) {\n // //der in dem Schleifendurchlauf betrachtete Layer\n // const layer = layers[layerNumber];\n // // bestLayerHelper[layer] = 0;\n // bestLayerHelper[layer] = 0 - layer.length;\n // }\n let bestLayerHelper = layers.sort((a, b) => a.length - b.length);\n //suche Layer mit der hoechsten Zahl in bestLayerHelper\n //wenn es einen bestLayer gibt schreibe ihn in result\n if (bestLayerHelper.length > 0) {\n //gebe besten Layer zurueck\n return bestLayerHelper[0];\n }\n //wenn keine Layer in Layers gebe null zurueck\n return null;\n}", "function getFormat(input) {\n var ext = input.substring(input.lastIndexOf('.') + 1).toLowerCase();\n if (ext == 'jpeg') {\n return 'jpg';\n }\n\n return ext.toLowerCase();\n}", "function imageDataFormat() {\n return 'channelsLast';\n}", "function imageDataFormat() {\n return 'channelsLast';\n}", "function imageDataFormat() {\n return 'channelsLast';\n}", "function imageDataFormat() {\n return 'channelsLast';\n}", "function getFormat(f) {\n switch (f) {\n case '.jpg': return 'jpeg'\n case '.gif': return 'gif'\n default: return 'png'\n }\n}", "getBestImageForType(srcType) {\n let imageSrc = this.props[srcType];\n let fitSizes = {};\n\n if (this.isImageLoaded(imageSrc)) {\n // Use full-size image if available\n fitSizes = this.getFitSizes(\n this.imageCache[imageSrc].width,\n this.imageCache[imageSrc].height\n );\n } else if (this.isImageLoaded(this.props[`${srcType}Thumbnail`])) {\n // Fall back to using thumbnail if the image has not been loaded\n imageSrc = this.props[`${srcType}Thumbnail`];\n fitSizes = this.getFitSizes(\n this.imageCache[imageSrc].width,\n this.imageCache[imageSrc].height,\n true\n );\n } else {\n return null;\n }\n\n return {\n src: imageSrc,\n height: this.imageCache[imageSrc].height,\n width: this.imageCache[imageSrc].width,\n targetHeight: fitSizes.height,\n targetWidth: fitSizes.width,\n };\n }", "getBestImageForType (srcType) {\n let imageSrc = this.props[srcType]\n let fitSizes = {}\n\n if (this.isImageLoaded(imageSrc)) {\n // Use full-size image if available\n fitSizes = this.getFitSizes(this.imageCache[imageSrc].width, this.imageCache[imageSrc].height)\n } else if (this.isImageLoaded(this.props[`${srcType}Thumbnail`])) {\n // Fall back to using thumbnail if the image has not been loaded\n imageSrc = this.props[`${srcType}Thumbnail`]\n fitSizes = this.getFitSizes(this.imageCache[imageSrc].width, this.imageCache[imageSrc].height, true)\n } else {\n return null\n }\n\n return {\n src: imageSrc\n , height: fitSizes.height\n , width: fitSizes.width\n }\n }", "getBestImageSize(sizes) {\n let bestSize = false;\n\n for (let size in sizes) {\n if (sizes[size][1] >= this.windowWidth) {\n bestSize = size;\n break;\n }\n }\n\n if (!bestSize) {\n // Get last key in sizes object\n bestSize = Object.keys(sizes)[Object.keys(sizes).length - 1];\n }\n\n return bestSize;\n }", "function getImageOutputFormat(options = {}) {\n const imageOptions = options.image || {};\n const type = imageOptions.type || 'auto';\n\n switch (type) {\n case 'imagebitmap':\n case 'html':\n case 'ndarray':\n // Check that it is actually supported\n if (!isImageTypeSupported(type)) {\n throw new Error(`Requested image type ${type} not available in current environment`);\n }\n return type;\n\n case 'auto':\n return getDefaultImageType();\n\n default:\n // Note: isImageTypeSupported throws on unknown type\n throw new Error(`Unknown image format ${type}`);\n }\n}", "function minMaxLayers(layers) {\n var layer;\nfunction minMaxObj1(w) {\n const length = Object.keys(w).length;\n for (let i = 1; i < length; i += 2) {\n minmax[0] = minmax[0] ? Math.max(w[i], minmax[0]) : w[i];\n minmax[1] = minmax[1] ? Math.min(w[i], minmax[1]) : w[i];\n }\n}\n\nfunction minMaxObj2(w) {\n const length = Object.keys(w).length;\n for (let i = 0; i < length; i++) {\n // (w[i] - min) / (max - min);\n w[i] = (w[i] - minmax[1]) / (minmax[0] - minmax[1]);\n }\n}\n\n const minmax = [undefined, undefined];\n if (layers) {\n let i;\n for (i = 0; i < layers.length; i++) {\n layer = layers[i];\n\n if (\"filters\" in layer) {\n layer.filters.forEach(filter => {\n minMaxObj1(filter.w);\n });\n }\n if (\"biases\" in layer) minMaxObj1(layer.biases.w);\n }\n for (i = 0; i < layers.length; i++) {\n layer = layers[i];\n\n if (\"filters\" in layer) {\n layer.filters.forEach(filter => {\n minMaxObj2(filter.w, minmax);\n });\n }\n if (\"biases\" in layer) minMaxObj2(layer.biases.w);\n }\n console.log(\"minMax\", minmax);\n }\n return JSON.parse(JSON.stringify(layers));\n}", "function getDefaultImageType() {\n if (IMAGE_BITMAP_SUPPORTED) {\n return 'imagebitmap';\n }\n if (IMAGE_SUPPORTED) {\n return 'image';\n }\n if (DATA_SUPPORTED) {\n return 'data';\n }\n\n // This should only happen in Node.js\n throw new Error(`Install '@loaders.gl/polyfills' to parse images under Node.js`);\n}", "function getImageType(image) {\n const jpeg = \"JFIF\";\n if (\n image[6] === jpeg.charCodeAt(0) &&\n image[7] === jpeg.charCodeAt(1) &&\n image[8] === jpeg.charCodeAt(2) &&\n image[9] === jpeg.charCodeAt(3)\n ) {\n return \"image/jpeg\";\n }\n\n const png = \"PNG\";\n if (\n image[1] === png.charCodeAt(0) &&\n image[2] === png.charCodeAt(1) &&\n image[3] === png.charCodeAt(2)\n ) {\n return \"image/png\";\n }\n\n return undefined;\n}", "static get ImageFormat() {\n return enums.ImageFormat;\n }", "function getSupportedFormat(gl, internalFormat, format, type) {\n if(!supportRenderTextureFormat(gl, internalFormat, format, type)) {\n switch (internalFormat) {\n case gl.R16F:\n return getSupportedFormat(gl, gl.RG16F, gl.RG, type);\n case gl.RG16F:\n return getSupportedFormat(gl, gl.RGBA16F, gl.RGBA, type);\n default:\n return null;\n }\n }\n\n return {internalFormat, format};\n}", "get acceptedFormats() {\n return ['.png', '.jpg', '.jpeg'];\n }", "function getSupportedBlendFactors(value, defaultValue) {\n if (!defined(value)) {\n return defaultValue;\n }\n\n for (let i = 0; i < 4; i++) {\n if (supportedBlendFactors.indexOf(value[i]) === -1) {\n return defaultValue;\n }\n }\n\n return value;\n}", "function getFormat() {\n if (document.getElementById('sqlite_format')) {\n return resultFormats.sqlite\n } else if (document.getElementById('json_format')) {\n return resultFormats.json\n }\n return resultFormats.invalid\n}", "findPic(prop){\n switch(prop){\n case 140:\n return KD;\n case 192:\n return JH;\n default:\n return KI;\n };\n }", "function getImgType() {\n\t\tvar src = $('#img').attr('src'); \n\t\tif( src.indexOf( 'data' ) !== -1 ) { \n\t\t\treturn 'png'; \n\t\t} \n\t\telse { \n\t\t\treturn 'jpeg'; \n\t\t}\n\t}", "getLayer(utilityNetworkUsageType) {\n\n let domainNetworks = this.dataElement.domainNetworks;\n let layers = []\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n \n for (let j = 0; j < domainNetwork.junctionSources.length; j ++)\n if (domainNetwork.junctionSources[j].utilityNetworkFeatureClassUsageType === utilityNetworkUsageType)\n layers.push(domainNetwork.junctionSources[j].layerId);\n }\n\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n \n for (let j = 0; j < domainNetwork.edgeSources.length; j ++)\n if (domainNetwork.edgeSources[j].utilityNetworkFeatureClassUsageType === utilityNetworkUsageType)\n layers.push(domainNetwork.edgeSources[j].layerId)\n }\n\n return layers;\n }", "function getSupportedImageType(imageType = null) {\n return Object(_lib_category_api_image_type__WEBPACK_IMPORTED_MODULE_3__[\"getDefaultImageType\"])();\n}", "selectImage(imageArray) {\n const idealSize = 300;\n let bestImage;\n let bestScore;\n imageArray.forEach((image) => {\n if (image.height < 200 || image.width < 200) return;\n const score = Math.abs(image.height - idealSize) + Math.abs(image.width - idealSize);\n if (score < bestScore || bestScore === undefined) {\n bestScore = score;\n bestImage = image;\n }\n });\n return bestImage;\n }", "function guessFormat(tag, src, type) {\n // An explicit type is always best.\n if (type) {\n return type;\n }\n // Try to match based on file extension.\n var extensionMatch = (/\\.([a-z1-9]+)(\\?|#|\\s|$)/i).exec(src);\n if (extensionMatch) {\n var format = fileExtensions[tag][extensionMatch[1]];\n if (format) {\n return format;\n }\n }\n return assumedFormats[tag];\n }", "function guessFormat(tag, src, type) {\r\n // An explicit type is always best.\r\n if (type) {\r\n return type;\r\n }\r\n // Try to match based on file extension.\r\n var extensionMatch = (/\\.([a-z1-9]+)(\\?|#|\\s|$)/i).exec(src);\r\n if (extensionMatch) {\r\n var format = fileExtensions[tag][extensionMatch[1]];\r\n if (format) {\r\n return format;\r\n }\r\n }\r\n return assumedFormats[tag];\r\n }", "function getImageType(content) {\n // Classify the contents of a file based on starting bytes (aka magic number:\n // tslint:disable-next-line:max-line-length\n // https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files)\n // This aligns with TensorFlow Core code:\n // tslint:disable-next-line:max-line-length\n // https://github.com/tensorflow/tensorflow/blob/4213d5c1bd921f8d5b7b2dc4bbf1eea78d0b5258/tensorflow/core/kernels/decode_image_op.cc#L44\n if (content.length > 3 && content[0] === 255 && content[1] === 216 &&\n content[2] === 255) {\n // JPEG byte chunk starts with `ff d8 ff`\n return ImageType.JPEG;\n }\n else if (content.length > 4 && content[0] === 71 && content[1] === 73 &&\n content[2] === 70 && content[3] === 56) {\n // GIF byte chunk starts with `47 49 46 38`\n return ImageType.GIF;\n }\n else if (content.length > 8 && content[0] === 137 && content[1] === 80 &&\n content[2] === 78 && content[3] === 71 && content[4] === 13 &&\n content[5] === 10 && content[6] === 26 && content[7] === 10) {\n // PNG byte chunk starts with `\\211 P N G \\r \\n \\032 \\n (89 50 4E 47 0D 0A\n // 1A 0A)`\n return ImageType.PNG;\n }\n else if (content.length > 3 && content[0] === 66 && content[1] === 77) {\n // BMP byte chunk starts with `42 4d`\n return ImageType.BMP;\n }\n else {\n throw new Error('Expected image (JPEG, PNG, or GIF), but got unsupported image type');\n }\n}", "function getLayerGroupsFromStyle(style) {\n return _defaultSettings.DEFAULT_LAYER_GROUPS.filter(function (lg) {\n return style.layers.filter(lg.filter).length;\n });\n}", "get compressionFormat() {}", "function multi_classifier(img, ft, multiseed, multiclass, watermask, type)\n{\n \n var name = multiclass===true ? classifier_array[type[0]] : ee.Classifier.cart(); \n var water = ee.Image(\"MOD44W/MOD44W_005_2000_02_24\").select([\"water_mask\"]);\n var classified, classified1, classified2, classified3;\n\n if(multiseed===true)\n {\n classified1 = classifier(img, ft[0], name);\n //Map.addLayer(classified1, {palette: '000000, ff0000'}, 'Classified1', false);\n classified2 = classifier(img, ft[1], name);\n //Map.addLayer(classified2, {palette: '000000, ff00ff'}, 'Classified2', false);\n classified3 = classifier(img, ft[2], name);\n //Map.addLayer(classified3, {palette: '000000, 00ff00'}, 'Classified3', false);\n classified = ee.ImageCollection([classified1, classified2, classified3]).median();\n }\n else\n classified = classifier(img, ft, name);\n\n if(multiclass===true) // multi classifiers\n { \n var tmp1, tmp2, tmp3;\n\n tmp1 = classified;\n Map.addLayer(ee.Image(0).mask(tmp1), {palette: '000000, ff0000'}, classifier_names[type[0]],false);\n tmp2 = classifier(img, ft, classifier_array[type[1]]);\n Map.addLayer(ee.Image(0).mask(tmp2), {palette: '000000, 00ff00'}, classifier_names[type[1]],false);\n tmp3 = classifier(img, ft, classifier_array[type[2]]);\n Map.addLayer(ee.Image(0).mask(tmp3), {palette: '000000, ff00ff'}, classifier_names[type[2]],false);\n classified = ee.ImageCollection([tmp1, tmp2, tmp3]).median();\n\n }\n \n if(watermask===true)\n {\n classified = classified.where(water,0);\n }\n \n return classified;\n}", "function inferOutputFormat(file, inputFormat) {\n var ext = getFileExtension(file).toLowerCase(),\n format = null;\n if (ext == 'shp') {\n format = 'shapefile';\n } else if (ext == 'dbf') {\n format = 'dbf';\n } else if (ext == 'svg') {\n format = 'svg';\n } else if (/json$/.test(ext)) {\n format = 'geojson';\n if (ext == 'topojson' || inputFormat == 'topojson' && ext != 'geojson') {\n format = 'topojson';\n } else if (ext == 'json' && inputFormat == 'json') {\n // .json -> json table is not always the best inference...\n // additional logic should be applied downstream\n format = 'json'; // JSON table\n }\n } else if (couldBeDsvFile(file)) {\n format = 'dsv';\n } else if (inputFormat) {\n format = inputFormat;\n }\n return format;\n }", "function convertOpt(imgs) {\n var imgs, img, meta, result, imgData, css;\n result = '';\n for (var i = 0, length = imgs.length; i < length; i++) {\n var img = imgs[i],\n meta = analyse(img);\n if (!meta) {\n errlog('not_img', img);\n process.exit(0);\n }\n if (!checkFormat(meta.format)) {\n errlog('format', img);\n process.exit(0);\n }\n imgData = img2data(img);\n if (!imgData) {\n process.exit(0);\n }\n css = getCSS(meta, imgData);\n result += css;\n \n }\n util.print(result);\n}", "function getTypeImage(tipo) {\n\n return \"tipo/\"+tipo.toString()+\".png\";\n}", "function computePackInfo(imgInfoList, cb) {\n\n var compute = function(width, height, imgInfoList) {\n\n var out = false;\n\n for (var n = 0; n < imgInfoList.length; n++) {\n var f = imgInfoList[n];\n delete f.fit;\n }\n\n var packer = new Packer(width, height);\n packer.fit(imgInfoList);\n for (var n = 0; n < imgInfoList.length; n++) {\n var f = imgInfoList[n];\n if (f.fit) {\n // 'image Over 100,100 225,225 image.jpg'\n var x = f.fit.x + Config.imgSpace / 2,\n y = f.fit.y + Config.imgSpace / 2;\n // var w = f.fit.w - Config.imgSpace,\n // h = f.fit.h - Config.imgSpace;\n f.x = f.fit.x;\n f.y = f.fit.y;\n delete f.fit;\n } else {\n out = true;\n break;\n }\n }\n return out;\n };\n\n var width = Config.packageWidth;\n var height = Config.packageHeight;\n\n\n\n do {\n var expanded = false,\n out = false;\n\n imgInfoList.sort(function(a, b) {\n return b.h - a.h;\n });\n out = compute(width, height, imgInfoList);\n\n if (out) {\n imgInfoList.sort(function(a, b) {\n return b.w - a.w;\n });\n out = compute(width, height, imgInfoList);\n }\n\n if (out) {\n if (width <= height) {\n width = width * 2;\n } else {\n height = height * 2;\n }\n expanded = true;\n }\n } while (expanded);\n return [width, height];\n}", "function getLoadableImageType(type) {\n switch (type) {\n case 'auto':\n case 'data':\n // Browser: For image data we need still need to load using an image format\n // Node: the default image type is `data`.\n return Object(_category_api_image_type__WEBPACK_IMPORTED_MODULE_1__[\"getDefaultImageType\"])();\n default:\n // Throw an error if not supported\n Object(_category_api_image_type__WEBPACK_IMPORTED_MODULE_1__[\"isImageTypeSupported\"])(type);\n return type;\n }\n}", "function largestImage(img_els){\n\n var image_areas = [].map.call(img_els, function(node) {\n var bounds = node.getBoundingClientRect();\n return {tag: node.outerHTML, area: bounds.width * bounds.height, height: bounds.height, width: bounds.width};\n }).sort(function(x, y) {\n var a = x.area, b= y.area;\n return a > b ? -1 : a < b ? 1 : 0;\n });\n\n\n\treturn image_areas[0];\n}", "function getLayerPaintType(layer) {\r\n var layerType = map.getLayer(layer).type;\r\n return layerTypes[layerType];\r\n}", "function textureLevelSize(format, width, height) {\n switch (format) {\n case COMPRESSED_RGB_S3TC_DXT1_EXT:\n case COMPRESSED_RGB_ATC_WEBGL:\n case COMPRESSED_RGB_ETC1_WEBGL:\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n\n case COMPRESSED_RGBA_S3TC_DXT3_EXT:\n case COMPRESSED_RGBA_S3TC_DXT5_EXT:\n case COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:\n case COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 16;\n\n case COMPRESSED_RGB_PVRTC_4BPPV1_IMG:\n case COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:\n return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);\n\n case COMPRESSED_RGB_PVRTC_2BPPV1_IMG:\n case COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:\n return Math.floor((Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8);\n\n \t//ASTC formats, https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\n case COMPRESSED_RGBA_ASTC_4x4_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; \n case COMPRESSED_RGBA_ASTC_5x4_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:\n return Math.floor((width + 4) / 5) * Math.floor((height + 3) / 4) * 16;\n case COMPRESSED_RGBA_ASTC_5x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:\n return Math.floor((width + 4) / 5) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_6x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:\n return Math.floor((width + 5) / 6) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_6x6_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:\n return Math.floor((width + 5) / 6) * Math.floor((height + 5) / 6) * 16;\n case COMPRESSED_RGBA_ASTC_8x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:\n return Math.floor((width + 7) / 8) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_8x6_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:\n return Math.floor((width + 7) / 8) * Math.floor((height + 5) / 6) * 16;\n case COMPRESSED_RGBA_ASTC_8x8_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:\n return Math.floor((width + 7) / 8) * Math.floor((height + 7) / 8) * 16;\n case COMPRESSED_RGBA_ASTC_10x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_10x6_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 5) / 6) * 16;\n case COMPRESSED_RGBA_ASTC_10x8_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 7) / 8) * 16;\n case COMPRESSED_RGBA_ASTC_10x10_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 9) / 10) * 16;\n case COMPRESSED_RGBA_ASTC_12x10_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:\n return Math.floor((width + 11) / 12) * Math.floor((height + 9) / 10) * 16;\n case COMPRESSED_RGBA_ASTC_12x12_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:\n return Math.floor((width + 11) / 12) * Math.floor((height + 11) / 12) * 16; \n\n default:\n return 0;\n }\n}", "function getLayerPaintType(layer) {\n var layerType = map.getLayer(layer).type;\n return layerTypes[layerType];\n}", "function getFileType() {\n\n\t//reg for image/video\n\tvar imageType = /image.*/;\n\tvar videoType = /video.*/;\n\t\n\t//check the file type\n\tif (file.type.match(imageType)) {\n\t\treturn(\"IMAGE\");\n\t} else if (file.type.match(videoType)){\n\t\treturn(\"VIDEO\");\n\t} else {\n\t\treturn(\"NONE\");\n\t}\n\t\n}", "function get_preview(source) {\r\n var position = (source.length - 5) // appends the _HD suffix at the -4th index : before the .png\r\n return source.substring(0, position) + \"_HD\" + source.substring(position);\r\n}", "function isImageTypeSupported(type) {\n switch (type) {\n case 'auto':\n // Should only ever be false in Node.js, if polyfills have not been installed...\n return IMAGE_BITMAP_SUPPORTED || IMAGE_SUPPORTED || DATA_SUPPORTED;\n\n case 'imagebitmap':\n return IMAGE_BITMAP_SUPPORTED;\n case 'image':\n return IMAGE_SUPPORTED;\n case 'data':\n return DATA_SUPPORTED;\n\n // DEPRECATED types\n case 'html':\n return IMAGE_SUPPORTED;\n case 'ndarray':\n return DATA_SUPPORTED;\n\n default:\n throw new Error(`@loaders.gl/images: image ${type} not supported in this environment`);\n }\n}", "function layersInDrawingOrder(layers) {\n\t\tvar layerDrawingOrder = wmsLoader.projectSettings.capability.layerDrawingOrder;\n\t\tif (layerOrderPanel != null) {\n\t\t\t// override project settings (after first load)\n\t\t\tif (enableWmtsBaseLayers) {\n\t\t\t\t// prepend ordered WMTS layers\n\t\t\t\tvar orderedLayers = layerOrderPanel.orderedLayers();\n\t\t\t\tvar wmtsLayers = [];\n\t\t\t\tfor (var i = 0; i < layerDrawingOrder.length; i++) {\n\t\t\t\t\tvar layer = layerDrawingOrder[i];\n\t\t\t\t\tif (orderedLayers.indexOf(layer) == -1) {\n\t\t\t\t\t\twmtsLayers.push(layer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlayerDrawingOrder = wmtsLayers.concat(orderedLayers);\n\t\t\t}\n\t\t\telse {\n\t\t\tlayerDrawingOrder = layerOrderPanel.orderedLayers();\n\t\t}\n\t\t}\n\n\t\tif (layerDrawingOrder != null) {\n\t\t\tvar orderedLayers = [];\n\t\t\tfor (var i = 0; i < layerDrawingOrder.length; i++) {\n\t\t\t\tvar layer = layerDrawingOrder[i];\n\t\t\t\tif (layers.indexOf(layer) != -1) {\n\t\t\t\t\torderedLayers.push(layer);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn orderedLayers;\n\t\t}\n\t\telse {\n\t\t\treturn layers.reverse();\n\t\t}\n\t}", "function computeConv2DInfo(inShape, filterShape, strides, dilations, pad, roundingMode, depthwise = false, dataFormat = 'channelsLast') {\n let [batchSize, inHeight, inWidth, inChannels] = [-1, -1, -1, -1];\n if (dataFormat === 'channelsLast') {\n [batchSize, inHeight, inWidth, inChannels] = inShape;\n }\n else if (dataFormat === 'channelsFirst') {\n [batchSize, inChannels, inHeight, inWidth] = inShape;\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n const [filterHeight, filterWidth, , filterChannels] = filterShape;\n const [strideHeight, strideWidth] = parseTupleParam(strides);\n const [dilationHeight, dilationWidth] = parseTupleParam(dilations);\n const effectiveFilterHeight = getEffectiveFilterSize(filterHeight, dilationHeight);\n const effectiveFilterWidth = getEffectiveFilterSize(filterWidth, dilationWidth);\n const { padInfo, outHeight, outWidth } = getPadAndOutInfo(pad, inHeight, inWidth, strideHeight, strideWidth, effectiveFilterHeight, effectiveFilterWidth, roundingMode, dataFormat);\n const outChannels = depthwise ? filterChannels * inChannels : filterChannels;\n let outShape;\n if (dataFormat === 'channelsFirst') {\n outShape = [batchSize, outChannels, outHeight, outWidth];\n }\n else if (dataFormat === 'channelsLast') {\n outShape = [batchSize, outHeight, outWidth, outChannels];\n }\n return {\n batchSize,\n dataFormat,\n inHeight,\n inWidth,\n inChannels,\n outHeight,\n outWidth,\n outChannels,\n padInfo,\n strideHeight,\n strideWidth,\n filterHeight,\n filterWidth,\n effectiveFilterHeight,\n effectiveFilterWidth,\n dilationHeight,\n dilationWidth,\n inShape,\n outShape,\n filterShape\n };\n}", "function get_hinet_config() {\n var image_size_x = parseInt($(\"#image_size_x\").val());\n var image_size_y = parseInt($(\"#image_size_y\").val());\n var layer_configs = [];\n var layer_data = {};\n var layer_num;\n var layer_type;\n var layer_params;\n var i_layer;\n var i_param;\n for (i_layer = 0; i_layer < layer_divs.length; i_layer += 1) {\n layer_num = (i_layer + 1).toString();\n layer_type = layer_types[i_layer]\n layer_params = layer_type_params[layer_type];\n layer_data = {\"layer_type\": layer_type};\n for (i_param = 0; i_param < layer_params.length; i_param += 1) {\n param_name = layer_params[i_param];\n if (ends_with(param_name, \"_xy\")) {\n param_id = param_name.substr(0, param_name.length - 3) + \"_\" +\n (i_layer+1).toString();\n layer_data[param_name] = [\n parseInt($(\"#\" + param_id + \"_x\").val()),\n parseInt($(\"#\" + param_id + \"_y\").val())\n ];\n } else {\n param_id = param_name + \"_\" + layer_num;\n layer_data[param_name] = parseInt($(\"#\" + param_id).val());\n }\n }\n layer_configs.push(layer_data);\n }\n return {\n \"image_size\": [image_size_x, image_size_y],\n \"layer_configs\": layer_configs\n }\n}", "function getObjNN4(obj,name)\r\n{\r\n\tvar x = obj.layers;\r\n\tvar foundLayer;\r\n\tfor (var i=0;i<x.length;i++)\r\n\t{\r\n\t\tif (x[i].id == name)\r\n\t\t \tfoundLayer = x[i];\r\n\t\telse if (x[i].layers.length)\r\n\t\t\tvar tmp = getObjNN4(x[i],name);\r\n\t\tif (tmp) foundLayer = tmp;\r\n\t}\r\n\treturn foundLayer;\r\n}", "get importBlendShapes() {}", "function paramThreeToGL( p ) {\n\t\n\t\t\t\tvar extension;\n\t\n\t\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\t\n\t\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\t\n\t\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\t\n\t\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\t\n\t\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\t\n\t\t\t\tif ( p === HalfFloatType ) {\n\t\n\t\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\t\n\t\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\t\n\t\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\t\n\t\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\t\n\t\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\t\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\t\n\t\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\t\n\t\t\t\t\tif ( extension !== null ) {\n\t\n\t\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\t\t p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\t\n\t\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\t\n\t\t\t\t\tif ( extension !== null ) {\n\t\n\t\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( p === RGB_ETC1_Format ) {\n\t\n\t\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\t\n\t\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\t\n\t\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\t\n\t\t\t\t\tif ( extension !== null ) {\n\t\n\t\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( p === UnsignedInt248Type ) {\n\t\n\t\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\t\n\t\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\t\n\t\t\t\t}\n\t\n\t\t\t\treturn 0;\n\t\n\t\t\t}", "isSupportedImageType(image) {\n \t//Supported html display types = jpg, jpeg, gift, png, svg\n \t//Wikidata query may return other types. Not displaying currently\n \tvar fileExtension = image.substr( (image.lastIndexOf('.') +1) ).toLowerCase();\n \treturn (fileExtension == \"jpg\" || fileExtension == \"jpeg\" || fileExtension == \"gif\" || fileExtension == \"png\" || fileExtension == \"svg\");\n }", "function getFileTypeBySuffix(suffix) {\n var img = [\"bmp\", \"jpg\", \"jpeg\", \"png\", \"tiff\", \"gif\", \"pcx\", \"tga\", \"exif\", \"fpx\", \"svg\", \"psd\",\n \"cdr\", \"pcd\", \"dxf\", \"ufo\", \"eps\", \"ai\", \"raw\", \"wmf\"\n ];\n var document = [\"txt\", \"doc\", \"docx\", \"xls\",\"xlsx\", \"htm\", \"html\", \"jsp\", \"rtf\", \"wpd\", \"pdf\", \"ppt\"];\n\n var video = [\"mp4\", \"avi\", \"mov\", \"wmv\", \"asf\", \"navi\", \"3gp\", \"mkv\", \"f4v\", \"rmvb\", \"webm\"];\n\n var music = [\"mp3\", \"wma\", \"wav\", \"mod\", \"ra\", \"cd\", \"md\", \"asf\", \"aac\", \"vqf\", \"ape\", \"mid\", \"ogg\",\n \"m4a\", \"vqf\"\n ];\n\n if ($.inArray(suffix, img) >= 0) {\n return \"image\"\n }\n\n if ($.inArray(suffix, document) >= 0) {\n return \"document\"\n }\n\n if ($.inArray(suffix, video) >= 0) {\n return \"video\"\n }\n\n if ($.inArray(suffix, music) >= 0) {\n return \"music\"\n }\n\n return suffix;\n}", "function convertConv2DDataFormat(dataFormat) {\n if (dataFormat === 'NHWC') {\n return 'channelsLast';\n }\n else if (dataFormat === 'NCHW') {\n return 'channelsFirst';\n }\n else {\n throw new Error(`Unknown dataFormat ${dataFormat}`);\n }\n}", "function helper(size, platType) {\n switch (size) {\n case 's':\n return {img: ASSET_MANAGER.getAsset(\"./img/platform-small-\" + platType + \".png\"), width: 85, height: 50};\n case'm':\n return {img: ASSET_MANAGER.getAsset(\"./img/platform-medium-\" + platType + \".png\"), width: 155, height: 50};\n case'l':\n return {img: ASSET_MANAGER.getAsset(\"./img/platform-large-\" + platType + \".png\"), width: 240, height: 50};\n case'ground':\n return {img: ASSET_MANAGER.getAsset(\"./img/transparent_pixel.png\"), width: 800, height: 70};\n default:\n break;\n }\n}", "static getPatternType(pattern) {\n if (!ChromaTheme._PATTERN_TYPE_DEFINED) {\n ChromaTheme.PATTERN_TYPE_COL = 'color'\n ChromaTheme.PATTERN_TYPE_ICO = 'icon'\n ChromaTheme.PATTERN_TYPE_DAT = 'dataURL'\n ChromaTheme.PATTERN_TYPE_STO = 'storage' // the data is in storage and not retrieved yet\n ChromaTheme._PATTERN_TYPE_DEFINED = true\n }\n\n if (pattern.startsWith('presets/icons/')) {\n return ChromaTheme.PATTERN_TYPE_ICO\n } else if (pattern.startsWith('data:image/')) {\n return ChromaTheme.PATTERN_TYPE_DAT\n } else if (pattern.startsWith('storage:')) {\n return ChromaTheme.PATTERN_TYPE_STO\n } else if (pattern.match(Theme.COLOR_REG)) {\n return ChromaTheme.PATTERN_TYPE_COL\n }\n }", "function getTextureLayersTreeModel() {\n // Generate model,\n\n const out = [];\n\n const texture_layers = ss.getArray('texture_layers');\n if (texture_layers.isDefined()) {\n out.push(\n { type:'branch', path:[], name:'Art', uid:'Art' }\n );\n texture_layers.forEach( (layer_ob) => {\n const layer_type = layer_ob.get('type');\n if (layer_type === 'group') {\n out.push({\n type: 'branch', path: layer_ob.get('path'),\n name: layer_ob.get('name'), uid: layer_ob.get('uid'),\n layer_type: 'group', draggable: true\n });\n }\n else if (layer_type === 'layer') {\n out.push({\n type: 'leaf', path: layer_ob.get('path'),\n name: layer_ob.get('name'), uid: layer_ob.get('uid'),\n layer_type: 'layer', draggable: true\n });\n }\n else {\n throw Error(\"Unknown layer type: \" + layer_type);\n }\n });\n }\n\n return out;\n\n }", "function getExportLayerString( layer, deepIndex ){\n if(isTxt (layer)){\n return getTxtString(layer, deepIndex)\n }\n else if(isScaleImage (layer)){\n return getScaleImageString(layer, deepIndex)\n }\n else if(isUIPicture (layer)){\n return getImageComponentString(layer, deepIndex)\n }\n}", "function getOutputLayer(src, opts) {\n return opts && opts.no_replace ? {geometry_type: src.geometry_type} : src;\n }", "function getImageType(pic){\n\tif(typeof(pic) === \"string\"){\n\t\t//splits String by using delimiter '.' for example: example.png -> [0]: example, [1]: png\n\t\tvar res = pic.split(\".\");\n\t\treturn res[1];\n\t}\n\telse{\n\t\t//Gute Idee?????\n\t\tthrow TypeError;\n\t}\n}", "function _getMediaType(data) {\n for (var type in mediaTypeDetection) {\n if (mediaTypeDetection[type](data)) {\n return type;\n }\n }\n \n return null;\n }", "function getBlendMode(name) {\n if (!name) return pixi.BLEND_MODES.NORMAL;\n name = name.toUpperCase();\n\n while (name.indexOf(' ') >= 0) {\n name = name.replace(' ', '_');\n }\n\n return pixi.BLEND_MODES[name] || pixi.BLEND_MODES.NORMAL;\n }", "function findLayers (comp) {\n var res = [];\n \n (function recurseLayers (comp, res) {\n for (var c = 1; c <= comp.numLayers; c++) {\n var lyr = comp.layer(c);\n if (lyr.source instanceof CompItem) {\n recurseLayers(lyr.source,res);\n };\n var safeLyrName = noExt(lyr.name); // strips extensions, if any\n \n if (match(res,safeLyrName)) $.writeln(\"Layer \"+safeLyrName+\" in the comp \"+lyr.containingComp.name+\" is not unique.\");\n if (safeLyrName.match(\"-\"))res.push(safeLyrName);\n };\n })(comp,res);\n return res;\n }", "function BuildLayerList(container){\r \r $.writeln(\"layers: \"+container.layers.length);\r // IDAllLayers, IDTopLayers, IDArtLayers, IDVisibleLayers, IDVisibleTopLayers, IDVisibleArtLayers;\r currentPath = (currentPath == 'undefined')?\"/\":currentPath;\r \r // store layer ID's for each set\r // if we loop the other way on OSX, no layers are found: m++ doesn't work??\r // talk about bug hunting.... do it.\r for (var m = container.layers.length-1; m >= 0; m--) {\r \r var l = container.layers[m];\r $.writeln(\"layertype : \" + l.typename);\r // this line includes the layer groups;\r if(l.typename == \"LayerSet\" || l.typename == \"ArtLayer\" || l.typename == \"TextLayer\" ){\r IDXLayers = IDXLayers.concat(l.id);\r if(l.visible){\r IDXVLayers = IDXVLayers.concat(l.id);\r } //endif \r }//endif\r \r // build list of topLevel layers\r if(l.parent == workingDoc.ref ){\r currentPath = \"/\";\r IDXTopLayers = IDXTopLayers.concat(l.id);\r if(l.visible){\r IDXVTopLayers = IDXVTopLayers.concat(l.id);\r }\r }\r \r // build list of ArtLayers and update list of AllLayers\r if (l.typename == \"ArtLayer\" || l.typename == \"TextLayer\") {\r IDXArtLayers = IDXArtLayers.concat(l.id);\r //currentPath = \"\";\r if(l.visible){\r IDXVArtLayers = IDXVArtLayers.concat(l.id);\r }\r $.writeln(l.name + \": \" + currentPath);\r } \r \r // this calls an recursive loop which does a bottom-to-top depth first \r // search of all groups in the document. \r if(l.typename == \"LayerSet\" ){\r\r // build a dirty path \r if(m == 0){\r currentPath = currentPath + String( l.name + \"/\");\r }\r \r // get some clean values from it\r var parentEnd = currentPath.indexOf ( l.parent.name, 1) + l.parent.name.length;\r var parentPath = currentPath.substr ( 0, parentEnd );\r \r // build a clean path\r if(parentPath == \"/\"){\r currentPath = parentPath + l.name+ \"/\"\r }else{\r currentPath = parentPath + \"/\" + l.name+ \"/\" ;\r }\r \r // recurse\r BuildLayerList(l);\r }\r \r // store path for each layer\r FolderPaths[l.id] = currentPath;\r \r }//endfor\r}", "function paramThreeToGL( p ) {\n\n\t\t\t\tvar extension;\n\n\t\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t\t}\n\n\t\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t\t}\n\n\t\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t\t}\n\n\t\t\t\treturn 0;\n\n\t\t\t}", "function mapFormat(requestedFormat) {\n switch (requestedFormat) {\n // These two cmds produce identical output, so we assume that encoding \"ipod\" means encoding m4a\n // ffmpeg -i example.aac -c copy OutputFile2.m4a\n // ffmpeg -i example.aac -c copy -f ipod OutputFile.m4a\n // See also https://github.com/mifi/lossless-cut/issues/28\n case 'm4a': return 'ipod';\n case 'aac': return 'ipod';\n default: return requestedFormat;\n }\n}", "function paramThreeToGL( p ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t}\n\n\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t}\n\n\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t}\n\n\t\t\treturn 0;\n\n\t\t}", "function paramThreeToGL( p ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t}\n\n\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t}\n\n\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t}\n\n\t\t\treturn 0;\n\n\t\t}", "function paramThreeToGL( p ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t}\n\n\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t}\n\n\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t}\n\n\t\t\treturn 0;\n\n\t\t}", "function paramThreeToGL( p ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t}\n\n\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t}\n\n\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t}\n\n\t\t\treturn 0;\n\n\t\t}", "function paramThreeToGL( p ) {\n\n\t\t\tvar extension;\n\n\t\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\t\tif ( p === IntType ) return _gl.INT;\n\t\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\t\tif ( p === HalfFloatType ) {\n\n\t\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t\t}\n\n\t\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t\t}\n\n\t\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t\t}\n\n\t\t\treturn 0;\n\n\t\t}", "function paramThreeToGL(_gl, p) {\n\n\t\tlet extension;\n\n\t\tif (p === RepeatWrapping) return _gl.REPEAT;\n\t\tif (p === ClampToEdgeWrapping) return _gl.CLAMP_TO_EDGE;\n\t\tif (p === MirroredRepeatWrapping) return _gl.MIRRORED_REPEAT;\n\n\t\tif (p === NearestFilter) return _gl.NEAREST;\n\t\tif (p === NearestMipMapNearestFilter) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif (p === NearestMipMapLinearFilter) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif (p === LinearFilter) return _gl.LINEAR;\n\t\tif (p === LinearMipMapNearestFilter) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif (p === LinearMipMapLinearFilter) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif (p === UnsignedByteType) return _gl.UNSIGNED_BYTE;\n\t\tif (p === UnsignedShort4444Type) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif (p === UnsignedShort5551Type) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif (p === UnsignedShort565Type) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif (p === ByteType) return _gl.BYTE;\n\t\tif (p === ShortType) return _gl.SHORT;\n\t\tif (p === UnsignedShortType) return _gl.UNSIGNED_SHORT;\n\t\tif (p === IntType) return _gl.INT;\n\t\tif (p === UnsignedIntType) return _gl.UNSIGNED_INT;\n\t\tif (p === FloatType) return _gl.FLOAT;\n\n\t\tif (p === HalfFloatType) {\n\n\t\t\textension = extensions.get('OES_texture_half_float');\n\n\t\t\tif (extension !== null) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif (p === AlphaFormat) return _gl.ALPHA;\n\t\tif (p === RGBFormat) return _gl.RGB;\n\t\tif (p === RGBAFormat) return _gl.RGBA;\n\t\tif (p === LuminanceFormat) return _gl.LUMINANCE;\n\t\tif (p === LuminanceAlphaFormat) return _gl.LUMINANCE_ALPHA;\n\t\tif (p === DepthFormat) return _gl.DEPTH_COMPONENT;\n\t\tif (p === DepthStencilFormat) return _gl.DEPTH_STENCIL;\n\n\t\tif (p === AddEquation) return _gl.FUNC_ADD;\n\t\tif (p === SubtractEquation) return _gl.FUNC_SUBTRACT;\n\t\tif (p === ReverseSubtractEquation) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif (p === ZeroFactor) return _gl.ZERO;\n\t\tif (p === OneFactor) return _gl.ONE;\n\t\tif (p === SrcColorFactor) return _gl.SRC_COLOR;\n\t\tif (p === OneMinusSrcColorFactor) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif (p === SrcAlphaFactor) return _gl.SRC_ALPHA;\n\t\tif (p === OneMinusSrcAlphaFactor) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif (p === DstAlphaFactor) return _gl.DST_ALPHA;\n\t\tif (p === OneMinusDstAlphaFactor) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif (p === DstColorFactor) return _gl.DST_COLOR;\n\t\tif (p === OneMinusDstColorFactor) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif (p === SrcAlphaSaturateFactor) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif (p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format) {\n\n\t\t\textension = extensions.get('WEBGL_compressed_texture_s3tc');\n\n\t\t\tif (extension !== null) {\n\n\t\t\t\tif (p === RGB_S3TC_DXT1_Format) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif (p === RGBA_S3TC_DXT1_Format$1) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif (p === RGBA_S3TC_DXT3_Format) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif (p === RGBA_S3TC_DXT5_Format$1) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format) {\n\n\t\t\textension = extensions.get('WEBGL_compressed_texture_pvrtc');\n\n\t\t\tif (extension !== null) {\n\n\t\t\t\tif (p === RGB_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif (p === RGB_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif (p === RGBA_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif (p === RGBA_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (p === RGB_ETC1_Format) {\n\n\t\t\textension = extensions.get('WEBGL_compressed_texture_etc1');\n\n\t\t\tif (extension !== null) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif (p === MinEquation || p === MaxEquation) {\n\n\t\t\textension = extensions.get('EXT_blend_minmax');\n\n\t\t\tif (extension !== null) {\n\n\t\t\t\tif (p === MinEquation) return extension.MIN_EXT;\n\t\t\t\tif (p === MaxEquation) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (p === UnsignedInt248Type) {\n\n\t\t\textension = extensions.get('WEBGL_depth_texture');\n\n\t\t\tif (extension !== null) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function getBlendOrder(style, xyzLayers, xyzLayerIndex) {\n var tgBlendOrderBase = 1;\n var tgBlendOrderMultiplier = 0.001;\n var blendOrder = style.zIndex * tgBlendOrderMultiplier + (xyzLayers.length - xyzLayerIndex) + tgBlendOrderBase;\n return Number(blendOrder.toFixed(3)); // cap digit precision\n }", "getImageStyle(config) {\n var _a;\n let width;\n let height;\n const image = config.image;\n if (image) {\n if (image.width === undefined && image.height === undefined) {\n height = 40;\n }\n else {\n width = image.width;\n height = image.height;\n }\n }\n // const fill = image.fill !== undefined ? image.fill : (image.width !== undefined && image.height !== undefined ? true : false)\n const fill = (_a = image.fill) !== null && _a !== void 0 ? _a : false;\n return {\n [fill ? 'width.px' : 'max-width.px']: width,\n [fill ? 'height.px' : 'max-height.px']: height,\n };\n }", "function decideNumShapes() {\n console.log(\"level from num shapes:\" + level);\n if (level > 3)\n return 2;\n if (level > 4)\n return 3;\n return 1;\n}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function paramThreeToGL( p ) {\n\n\t\tvar extension;\n\n\t\tif ( p === RepeatWrapping ) return _gl.REPEAT;\n\t\tif ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;\n\t\tif ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;\n\n\t\tif ( p === NearestFilter ) return _gl.NEAREST;\n\t\tif ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;\n\t\tif ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;\n\n\t\tif ( p === LinearFilter ) return _gl.LINEAR;\n\t\tif ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;\n\t\tif ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;\n\n\t\tif ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;\n\n\t\tif ( p === ByteType ) return _gl.BYTE;\n\t\tif ( p === ShortType ) return _gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return _gl.INT;\n\t\tif ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return _gl.FLOAT;\n\n\t\tif ( p === HalfFloatType ) {\n\n\t\t\textension = extensions.get( 'OES_texture_half_float' );\n\n\t\t\tif ( extension !== null ) return extension.HALF_FLOAT_OES;\n\n\t\t}\n\n\t\tif ( p === AlphaFormat ) return _gl.ALPHA;\n\t\tif ( p === RGBFormat ) return _gl.RGB;\n\t\tif ( p === RGBAFormat ) return _gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return _gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;\n\n\t\tif ( p === AddEquation ) return _gl.FUNC_ADD;\n\t\tif ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;\n\t\tif ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;\n\n\t\tif ( p === ZeroFactor ) return _gl.ZERO;\n\t\tif ( p === OneFactor ) return _gl.ONE;\n\t\tif ( p === SrcColorFactor ) return _gl.SRC_COLOR;\n\t\tif ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;\n\t\tif ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;\n\t\tif ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;\n\t\tif ( p === DstAlphaFactor ) return _gl.DST_ALPHA;\n\t\tif ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;\n\n\t\tif ( p === DstColorFactor ) return _gl.DST_COLOR;\n\t\tif ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;\n\t\tif ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||\n\t\t\tp === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||\n\t\t\tp === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === RGB_ETC1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc1' );\n\n\t\t\tif ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;\n\n\t\t}\n\n\t\tif ( p === MinEquation || p === MaxEquation ) {\n\n\t\t\textension = extensions.get( 'EXT_blend_minmax' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === MinEquation ) return extension.MIN_EXT;\n\t\t\t\tif ( p === MaxEquation ) return extension.MAX_EXT;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( p === UnsignedInt248Type ) {\n\n\t\t\textension = extensions.get( 'WEBGL_depth_texture' );\n\n\t\t\tif ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;\n\n\t\t}\n\n\t\treturn 0;\n\n\t}", "function getMediaTypePriority(type,accepted,index){var priority={o:-1,q:0,s:0};for(var i=0;i<accepted.length;i++){var spec=specify(type,accepted[i],index);if(spec&&(priority.s-spec.s||priority.q-spec.q||priority.o-spec.o)<0){priority=spec;}}return priority;}", "function standardizeImageObjects(data, filters) {\n const shouldShowGray = filters.shouldShowGray;\n const images = data.map(image => {\n const imageUrl = image.url;\n return {\n baseUrl: image.url,\n imageUrl: shouldShowGray ? `${image.url}?grayscale=true` : image.url,\n domain: imageUrl.split('/')[2],\n id: imageUrl.split('/')[4],\n width: imageUrl.split('/')[5],\n height: imageUrl.split('/')[6],\n params: shouldShowGray ? `?grayscale=true` : '',\n }\n });\n\n // Get rid of duplicate images\n let uniqueImages = [];\n images.forEach(function (image) {\n let i = uniqueImages.findIndex(x => x.id == image.id);\n if (i <= -1) {\n uniqueImages.push(image);\n }\n });\n\n return uniqueImages;\n}", "getAssetType(layerId, assetGroupCode, assetTypeCode)\n {\n\n let domainNetworks = this.dataElement.domainNetworks;\n let layerObj = undefined;\n\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n for (let j = 0; j < domainNetwork.junctionSources.length; j ++)\n if (domainNetwork.junctionSources[j].layerId == layerId)\n { \n let assetGroup = domainNetwork.junctionSources[j].assetGroups.find( ag => ag.assetGroupCode === assetGroupCode);\n if (assetGroup instanceof Object)\n {\n let assetType = assetGroup.assetTypes.find(at => at.assetTypeCode === assetTypeCode);\n assetType.assetGroupName = assetGroup.assetGroupName;\n assetType.utilityNetworkFeatureClassUsageType = domainNetwork.junctionSources[j].utilityNetworkFeatureClassUsageType;\n if(assetType instanceof Object) return assetType;\n } \n }\n\n for (let j = 0; j < domainNetwork.edgeSources.length; j ++)\n if (domainNetwork.edgeSources[j].layerId == layerId)\n { \n let assetGroup = domainNetwork.edgeSources[j].assetGroups.find( ag => ag.assetGroupCode === assetGroupCode);\n if (assetGroup instanceof Object)\n {\n let assetType = assetGroup.assetTypes.find(at => at.assetTypeCode === assetTypeCode);\n assetType.assetGroupName = assetGroup.assetGroupName;\n assetType.utilityNetworkFeatureClassUsageType = domainNetwork.edgeSources[j].utilityNetworkFeatureClassUsageType;\n if(assetType instanceof Object) return assetType;\n } \n }\n }\n \n return undefined; \n }", "function getPixelColor(layers, index) {\n\tlet layerIndex = 0;\n\n\twhile (layerIndex < layers.length) {\n\t\tlet pixel = layers[layerIndex][index];\n\n\t\tif (pixel !== 2) {\n\t\t\treturn pixel;\n\t\t}\n\n\t\tlayerIndex++;\n\t}\n\n\treturn 2; // default return value\n}", "function getImgDarker(s) {\n\t\tvar result = \"\";\n\t\tfor (var i=0; i<s.length; i++) {\n\t\t\tresult += \"<img src=\\\"alphabet/darker/\" + getName(s.substring(i,i+1)) + \".jpg\\\">\";\n\t\t}\n\t\treturn result;\n\t}", "function imageFormat(randomNumber) {\r\n return (\"images/dice\" + randomNumber + \".png\")\r\n}", "function getQuality(quality)\n{\n\tquality=decodeURIComponent(quality);\n\tif(quality.toLowerCase()==\"small\")\n\t\treturn \"240p\";\n\tif(quality.toLowerCase()==\"medium\")\n\t\treturn \"360p\";\n\tif(quality.toLowerCase()==\"large\")\n\t\treturn \"480p\";\n\tif(quality.toLowerCase()==\"hd720\")\n\t\treturn \"720p\";\n\tif(quality.toLowerCase()==\"hd1080\")\n\t\treturn \"1080p\";\n}", "function fixType(type) {\n if (!type) {\n return \"png\";\n }\n\n if (type === \"image/svg+xml\") {\n return \"svg\";\n }\n\n type = type.split(\"/\");\n return type[type.length - 1];\n}", "function finish() {\n for (var _i2 = 0; _i2 < layers.length; _i2++) {\n var layer = layers[_i2];\n var clip = layer.clip || {\n height: height,\n width: width,\n x: 0,\n y: 0\n };\n\n switch (layer.type) {\n case \"img\":\n context.save();\n context.beginPath();\n context.translate(options.padding + clip.x, options.padding + clip.y);\n context.rect(0, 0, clip.width, clip.height);\n context.clip();\n context.drawImage(layer.value, layer.x + clip.x, layer.y + clip.y, layer.width, layer.height);\n context.restore();\n break;\n\n case \"html\":\n context.save();\n context.beginPath();\n context.translate(options.padding, options.padding);\n context.drawImage(layer.value, layer.x, layer.y, layer.width, layer.height);\n context.restore();\n break;\n\n case \"text\":\n var parent = d3Selection.select(layer.style);\n var title = layer.value.replace(/&/g, \"&amp;\").replace(/\"/g, \"&quot;\").replace(/'/g, \"&#039;\");\n var fC = parent.style(\"color\"),\n fS = parent.style(\"font-size\");\n var fF = parent.style(\"font-family\").split(\",\")[0];\n if (fF.indexOf(\"'\") !== 0) fF = \"'\".concat(fF, \"'\");\n var text = \"<text stroke='none' dy='\".concat(fS, \"' fill='\").concat(fC, \"' font-family=\").concat(fF, \" font-size='\").concat(fS, \"'>\").concat(title, \"</text>\");\n context.save();\n context.translate(options.padding, options.padding);\n canvg(canvas, text, Object.assign({}, canvgOptions, {\n offsetX: layer.x,\n offsetY: layer.y\n }));\n context.restore();\n break;\n\n case \"svg\":\n var outer = IE ? new XMLSerializer().serializeToString(layer.value) : layer.value.outerHTML;\n context.save();\n context.translate(options.padding + clip.x + layer.x, options.padding + clip.y + layer.y);\n context.rect(0, 0, clip.width, clip.height);\n context.clip();\n canvg(canvas, outer, Object.assign({}, canvgOptions, {\n offsetX: layer.x + clip.x,\n offsetY: layer.y + clip.y\n }));\n context.restore();\n break;\n\n default:\n console.warn(\"uncaught\", layer);\n break;\n }\n }\n\n options.callback(canvas);\n }", "getBaseImage(input) {\n if (input === \"clear-day\" || input === \"partly-cloudy-day\" || input === \"cloudy\") {\n return \"day\";\n } else if (input === \"clear-night\" || input === \"partly-cloudy-night\") {\n return \"night\";\n } else if (input === \"rain\" || input === \"thunderstorm\") {\n return \"rain\";\n } else if (input === \"snow\" || input === \"sleet\" || input === \"flurries\") {\n return \"snow\";\n } else {\n return \"day\";\n }\n }", "function detectSourceFormat(data) {\n var sourceFormat = _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_UNKNOWN */ \"h\"];\n\n if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isTypedArray */ \"E\"])(data)) {\n sourceFormat = _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_TYPED_ARRAY */ \"g\"];\n } else if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isArray */ \"t\"])(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_ARRAY_ROWS */ \"c\"];\n }\n\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n\n if (item == null) {\n continue;\n } else if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isArray */ \"t\"])(item)) {\n sourceFormat = _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_ARRAY_ROWS */ \"c\"];\n break;\n } else if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isObject */ \"z\"])(item)) {\n sourceFormat = _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_OBJECT_ROWS */ \"e\"];\n break;\n }\n }\n } else if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isObject */ \"z\"])(data)) {\n for (var key in data) {\n if (Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ \"q\"])(data, key) && Object(zrender_lib_core_util__WEBPACK_IMPORTED_MODULE_0__[/* isArrayLike */ \"u\"])(data[key])) {\n sourceFormat = _util_types__WEBPACK_IMPORTED_MODULE_1__[/* SOURCE_FORMAT_KEYED_COLUMNS */ \"d\"];\n break;\n }\n }\n }\n\n return sourceFormat;\n}", "firstFilter() {\n var redColors = []\n var blueColors = []\n var greenColors = []\n for(var varx = 0; varx < this.image.width; varx +=5) {\n for(var vary = 0; vary < this.image.height; vary +=5) {\n var position1 = 4 * (vary * this.image.width + varx)\n var red = this.imageData[position1 + 0]\n var green = this.imageData[position1 + 1]\n var blue = this.imageData[position1 + 2]\n var alpha = this.imageData[position1 + 3]\n if (alpha > 200) {\n if ((red >= green) && (red >= blue)) redColors.push({\n 'red' : red,\n 'green' : green,\n 'blue' : blue\n })\n if ((green >= red) && (green >= blue)) greenColors.push({\n 'red' : red,\n 'green' : green,\n 'blue' : blue\n })\n if ((blue >= red) && (blue >= green)) blueColors.push({\n 'red' : red,\n 'green' : green,\n 'blue' : blue\n })\n }\n }\n }\n\n var max = Math.max(redColors.length, greenColors.length, blueColors.length)\n if (redColors.length == max) return redColors\n if (greenColors.length == max) return greenColors\n if (blueColors.length == max) return blueColors\n }", "function getLayerByName(comp_object,layer_name){\n for (i = 1;i<=comp_object.numLayers;i++){\n var layer = comp_object.layer(i)\n if (layer.name === layer_name){\n return layer\n }\n }\n}", "getLayerIdfromSourceId(sourceId)\n { \n let domainNetworks = this.dataElement.domainNetworks;\n let layerObj = undefined;\n\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n for (let j = 0; j < domainNetwork.junctionSources.length; j ++)\n if (domainNetwork.junctionSources[j].sourceId == sourceId)\n { \n layerObj = {type: domainNetwork.junctionSources[j].shapeType, layerId: domainNetwork.junctionSources[j].layerId}\n break;\n }\n\n for (let j = 0; j < domainNetwork.edgeSources.length; j ++)\n if (domainNetwork.edgeSources[j].sourceId == sourceId)\n { \n layerObj = {type: domainNetwork.edgeSources[j].shapeType, layerId: domainNetwork.edgeSources[j].layerId} \n break;\n }\n }\n\n if (layerObj != undefined)\n layerObj.type = layerObj.type.replace(\"esriGeometry\", \"\").toLowerCase();\n\n return layerObj;\n }", "function getImage(img){\n\tif(img[0].value == 'Hot'){\n\t\tif(img[1].value == 'Coffee'){\n\t\t\tif(img[2].value == 'Macchiato'){\n\t\t\t\treturn \"assets/image/img1-1-1.png\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Latte'){\n\t\t\t\treturn \"assets/image/img1-1-2.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Mocha'){\n\t\t\t\treturn \"assets/image/img1-1-3.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(img[1].value == 'Chocolate'){\n\t\t\tif(img[2].value == 'Hot Chocolate'){\n\t\t\t\treturn \"assets/image/img1-2-1.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Caramel Chocolate'){\n\t\t\t\treturn \"assets/image/img1-2-2.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Hot Cocoa-Nut'){\n\t\t\t\treturn \"assets/image/img1-2-3.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(img[1].value == 'Fruit Drink'){\n\t\t\tif(img[2].value == 'Pumpkin Spice'){\n\t\t\t\treturn \"assets/image/img1-3-1.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Steamed Apple Juice'){\n\t\t\t\treturn \"assets/image/img1-3-2.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Tea and Cider'){\n\t\t\t\treturn \"assets/image/img1-3-3.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\telse if(img[0].value == 'Cold'){\n\t\tif(img[1].value == 'Milkshake'){\n\t\t\tif(img[2].value == 'Vanilla'){\n\t\t\t\treturn \"assets/image/img2-1-1.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Strawberry'){\n\t\t\t\treturn \"assets/image/img2-1-2.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Caramel'){\n\t\t\t\treturn \"assets/image/img2-1-3.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(img[1].value == 'Tea'){\n\t\t\tif(img[2].value == 'Black Tea'){\n\t\t\t\treturn \"assets/image/img2-2-1.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Green Tea'){\n\t\t\t\treturn \"assets/image/img2-2-2.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Milk Tea'){\n\t\t\t\treturn \"assets/image/img2-2-3.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(img[1].value == 'Sode'){\n\t\t\tif(img[2].value == 'Pepsi'){\n\t\t\t\treturn \"assets/image/img2-3-1.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Sprite'){\n\t\t\t\treturn \"assets/image/img2-3-2.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(img[2].value == 'Fanta'){\n\t\t\t\treturn \"assets/image/img2-3-3.jpg\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\t\n\t\n}", "function serializeLayers() {\n\t\t\tvar layers = this.theMap.layers;\n\t\t\tvar baseLayer = this.theMap.baseLayer;\n\t\t\tvar str = '';\n\t\t\tfor (var i = 0, len = layers.length; i < len; i++) {\n\t\t\t\tvar layer = layers[i];\n\t\t\t\tif (layer.isBaseLayer) {\n\t\t\t\t\tstr += (layer == baseLayer) ? \"B\" : \"0\";\n\t\t\t\t} else {\n\t\t\t\t\tstr += (layer.getVisibility()) ? \"T\" : \"F\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn str;\n\t\t}", "function getGroupLayer(layers) {\n grouplayers=[],\n grouplayers.push({'group': '', 'children':['']}),\n indexgrouplayer=0,\n nlayers=layers.length-1;\n \n for (let i = nlayers; i>=0 ; i--) {\n let data=(layers[i].titlelayers).substring(1).replace('?','$'),\n aux_data= data.split('$'),\n group=aux_data[0],\n titlelayer=aux_data[1];\n\n if(group!=grouplayers[indexgrouplayer].group){\n let layer=[{'layers': titlelayer.replace(/\\?/g,' / '), 'service':layers[i].service, 'fields': layers[i].fields}];\n if(i==nlayers){\n grouplayers[0].group=group;\n grouplayers[0].children=layer;\n }else{\n grouplayers.push({'group': group,'children':layer});\n indexgrouplayer++\n }\n }else{\n let layer={'layers': titlelayer.replace(/\\?/g,' / '), 'service':layers[i].service, 'fields': layers[i].fields};\n grouplayers[indexgrouplayer].children.push(layer);\n }\n }\n return grouplayers;\n }", "function get_layers(slices) {\r\n let layers = [];\r\n\r\n for (let i = 0; i < slices.length; i++) {\r\n let current_frame = new Image();\r\n current_frame.src = slices[i];\r\n layers.push(current_frame);\r\n }\r\n\r\n return layers;\r\n}", "function loadImages() {\r\n\r\n let blocks = ['black_concrete', 'black_terracotta', 'netherrack', 'nether_wart_block', 'red_concrete_powder', 'dark_oak_log', 'green_terracotta', 'brown_concrete', 'melon_top', 'orange_concrete', 'green_concrete', 'green_wool', 'green_concrete_powder', 'oak_log', 'orange_concrete_powder', 'lime_concrete', 'lime_concrete', 'lime_concrete_powder', 'hay_block_top', 'yellow_concrete', 'lime_wool', 'lime_concrete', 'lime_concrete_powder', 'melon_top', 'yellow_concrete', 'black_wool', 'gravel', 'spruce_planks', 'pink_terracotta', 'red_concrete_powder', 'cyan_terracotta', 'coarse_dirt', 'bricks', 'light_gray_terracotta', 'red_concrete_powder', 'brown_concrete_powder', 'dark_prismarine', 'acacia_log', 'acacia_planks', 'acacia_planks', 'dark_prismarine', 'lime_terracotta', 'lime_terracotta', 'oak_planks', 'yellow_concrete_powder', 'slime_block', 'slime_block', 'lime_wool', 'melon_top', 'yellow_concrete', 'blue_concrete', 'mycelium_top', 'mycelium_top', 'pink_terracotta', 'red_concrete_powder', 'lapis_block', 'blue_terracotta', 'magenta_terracotta', 'magenta_terracotta', 'magenta_concrete', 'cyan_concrete', 'cracked_stone_bricks', 'andesite', 'granite', 'jungle_planks', 'dark_prismarine', 'green_concrete', 'green_concrete_powder', 'hay_block_top', 'birch_planks', 'slime_block', 'slime_block', 'slime_block', 'slime_block', 'yellow_concrete_powder', 'blue_concrete', 'blue_wool', 'magenta_concrete', 'magenta_concrete', 'pink_concrete', 'blue_wool', 'blue_concrete_powder', 'purple_concrete', 'magenta_concrete_powder', 'magenta_concrete_powder', 'light_blue_concrete', 'blue_concrete_powder', 'purpur_block', 'pink_concrete', 'pink_wool', 'cyan_concrete_powder', 'cobblestone', 'clay', 'birch_log', 'diorite', 'prismarine_bricks', 'prismarine_bricks', 'prismarine_bricks', 'end_stone', 'end_stone', 'blue_concrete', 'blue_concrete', 'purple_concrete', 'purple_concrete_powder', 'pink_concrete', 'blue_concrete_powder', 'blue_concrete_powder', 'purple_concrete', 'purple_wool', 'pink_concrete', 'light_blue_concrete', 'light_blue_wool', 'lapis_block', 'purpur_block', 'pink_concrete', 'light_blue_concrete_powder', 'light_blue_concrete_powder', 'blue_ice', 'packed_ice', 'white_concrete', 'light_blue_concrete_powder', 'light_blue_concrete_powder', 'light_blue_concrete_powder', 'packed_ice', 'bone_block_side'];\r\n\r\n for (let block of blocks) {\r\n blockImages[block] = new Image();\r\n blockImages[block].src = block + \".png\";\r\n blockImages[block].onload = function() {\r\n console.log(\"Loaded \" + block + \".png\");\r\n }\r\n }\r\n}", "function buildLayersList(layers){\r\n\r\n //layers arg is response.itemInfo.itemData.operationalLayers;\r\n var layerInfos = [];\r\n dojo.forEach(layers, function (mapLayer, index) {\r\n var layerInfo = {};\r\n if (mapLayer.featureCollection && mapLayer.type !== \"CSV\") {\r\n if (mapLayer.featureCollection.showLegend === true) {\r\n dojo.forEach(mapLayer.featureCollection.layers, function (fcMapLayer) {\r\n if (fcMapLayer.showLegend !== false) {\r\n layerInfo = {\r\n \"layer\": fcMapLayer.layerObject,\r\n \"title\": mapLayer.title,\r\n \"defaultSymbol\": false\r\n };\r\n if (mapLayer.featureCollection.layers.length > 1) {\r\n layerInfo.title += \" - \" + fcMapLayer.layerDefinition.name;\r\n }\r\n layerInfos.push(layerInfo);\r\n }\r\n });\r\n }\r\n } else if (mapLayer.showLegend !== false && mapLayer.layerObject) {\r\n var showDefaultSymbol = false;\r\n if (mapLayer.layerObject.version < 10.1 && (mapLayer.layerObject instanceof esri.layers.ArcGISDynamicMapServiceLayer || mapLayer.layerObject instanceof esri.layers.ArcGISTiledMapServiceLayer)) {\r\n showDefaultSymbol = true;\r\n }\r\n layerInfo = {\r\n \"layer\": mapLayer.layerObject,\r\n \"title\": mapLayer.title,\r\n \"defaultSymbol\": showDefaultSymbol\r\n };\r\n //does it have layers too? If so check to see if showLegend is false\r\n if (mapLayer.layers) {\r\n var hideLayers = dojo.map(dojo.filter(mapLayer.layers, function (lyr) {\r\n return (lyr.showLegend === false);\r\n }), function (lyr) {\r\n return lyr.id;\r\n });\r\n if (hideLayers.length) {\r\n layerInfo.hideLayers = hideLayers;\r\n }\r\n }\r\n layerInfos.push(layerInfo);\r\n }\r\n });\r\n return layerInfos;\r\n }", "function MatchingFeatureTypes() {\n\tfor (var i=0; i < checkedLayers.length-1; i++) {\n\t\tfor (var j=i+1; j < checkedLayers.length; j++) {\n\t\t\tif (checkedLayers[i].protocol.featureType != checkedLayers[j].protocol.featureType)\n\t\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\t\t\n}" ]
[ "0.6525973", "0.62801224", "0.5884315", "0.5884315", "0.5884315", "0.5884315", "0.5813669", "0.5790409", "0.5781936", "0.57566226", "0.56323624", "0.56116", "0.5567938", "0.5496423", "0.5426627", "0.54193187", "0.5376723", "0.5269856", "0.5190717", "0.51744556", "0.5173934", "0.5171986", "0.5149453", "0.5099848", "0.5093624", "0.5079035", "0.5037297", "0.50356734", "0.5010292", "0.5003636", "0.49835992", "0.49673212", "0.49671587", "0.4965235", "0.49410877", "0.49046773", "0.49043867", "0.48857495", "0.48855266", "0.4882585", "0.48656508", "0.4852568", "0.48295146", "0.48248023", "0.48241988", "0.48144442", "0.47954735", "0.4787501", "0.47861165", "0.47825715", "0.47813666", "0.47708473", "0.47613078", "0.47512808", "0.47505182", "0.47482488", "0.47439173", "0.47366217", "0.473602", "0.47351146", "0.47322407", "0.4729676", "0.4722407", "0.4717407", "0.4717407", "0.4717407", "0.4717407", "0.4717407", "0.46929455", "0.46921808", "0.46857595", "0.467969", "0.46750915", "0.46750915", "0.46750915", "0.46750915", "0.46750915", "0.46750915", "0.46750915", "0.4673184", "0.46728548", "0.46677408", "0.46524385", "0.46510926", "0.46505806", "0.46491924", "0.46478435", "0.46312174", "0.46219382", "0.4621617", "0.4610163", "0.46087587", "0.46042213", "0.45996848", "0.45984605", "0.45915556", "0.45905656", "0.45863643", "0.457743", "0.45740244" ]
0.76829535
0
export functions , draw and modify version
function setExportBoxHeight(newValue, oldValue) { if (oldValue != '') { exportBoxValues.height = Math.round(newValue * (exportBoxValues.dpi / 25.4)); var scale = newValue / oldValue; if (exportBoxValues.lockaspectratio) { var ratio = 1; exportBoxValues.width = exportBoxValues.width * scale; Ext.getCmp('ExportWidthField').setValue(Ext.getCmp('ExportWidthField').getValue() * scale); } else { var ratio = 1 / scale; } var origin = exportLayer.features[0].geometry.getCentroid(); exportLayer.features[0].geometry.resize(scale, origin, ratio); exportLayer.redraw(); } else if (Ext.getCmp('ExportWidthField').getValue() != '') { drawExportBox(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw () { //change name to generate?? also need to redo\n return null;\n }", "function draw() {}", "function draw() {}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function drawOnDemand(){\n\n\n}", "_draw() {\n\n }", "function updateDraw(){\r\n //ToDo\r\n }", "function DrawInterface()\n{\n}", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "draw() { }", "draw() { }", "draw() { }", "function draw() {\n \n\n \n}", "function draw()\n{\n}", "function finalDraw() {\n\t Registry.getComponentMethod('shapes', 'draw')(gd);\n\t Registry.getComponentMethod('images', 'draw')(gd);\n\t Registry.getComponentMethod('annotations', 'draw')(gd);\n\t Registry.getComponentMethod('legend', 'draw')(gd);\n\t Registry.getComponentMethod('rangeslider', 'draw')(gd);\n\t Registry.getComponentMethod('rangeselector', 'draw')(gd);\n\t Registry.getComponentMethod('sliders', 'draw')(gd);\n\t Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\t }", "function draw()\n{\n \n}", "function draw() {\n \n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function drawExtraDecalsFn() {\n }", "function drawExtraDecalsFn() {\n }", "function Draw() {\n}", "draw() {\n }", "function draw(\n\n) {}", "draw() {\n\n }", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\r\n \r\n}", "function ProceduralRenderer3() {}", "function ProceduralRenderer3() {}", "function ProceduralRenderer3() {}", "function ProceduralRenderer3(){}", "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }", "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }", "function ProceduralRenderer3() { }", "function ProceduralRenderer3() { }", "function draw() {\n \n}", "draw(){\n }", "function visualise(){\r\n//sets the background to grey to hide any text that was previously on it\r\n background(80);\r\n\r\n//creates a button that calls the function priceDraw when pressed\r\n visPrice = createButton('Prices');\r\n visPrice.position(10,630);\r\n visPrice.size(100,30);\r\n visPrice.mousePressed(priceDraw);\r\n\r\n//creates a button that calls the function quanDraw when pressed\r\n visQuan = createButton('Quantity');\r\n visQuan.position(10,600);\r\n visQuan.size(100,30);\r\n visQuan.mousePressed(quanDraw);\r\n\r\n//hides the other buttons so they don't interfere\r\n listButtons.hide();\r\n graphButton.hide();\r\n visButton.hide();\r\n }", "function main() {\r\n init();\r\n draw();\r\n}", "function plotFunction(functionText,functionDerivativeText,xbasis,ybasis,start,end,stepSize){\n var shapeLayer = app.project.activeItem.layers.addShape();\n var path = shapeLayer.content.addProperty(\"ADBE Vector Shape - Group\");\n var length = Math.floor((((end-start)*xbasis)/stepSize)+2);\n var k = (100/stepSize) * 3;\n var approx = 10000;\n var vertices=[];\n var inTangents=[];\n var outTangents=[];\n var shape = new Shape();\n var generator = new Function(\"x\",\"return \"+functionText+\";\");\n var generatorDeriv = new Function(\"x\",\"return \"+functionDerivativeText+\";\");\n\n for(var i =0;i<length;i++){\n x = ((stepSize * i) + start* xbasis);\n y = (-ybasis) * Math.round(approx*generator(((stepSize * i) + start* xbasis)/xbasis))/approx;\n y0 = (ybasis/k) * Math.round(approx*generatorDeriv(((stepSize * i) + start* xbasis)/xbasis))/approx;\n vertices.push([x,y]);\n inTangents.push([-100/k,y0]);\n outTangents.push([100/k,-y0]);\n }\n\n shape.vertices=vertices;\n shape.inTangents = inTangents;\n shape.outTangents = outTangents;\n shape.closed=false;\n\n path.path.setValue(shape);\n addStroke(shapeLayer,5);\n shapeLayer.name = functionText;\n shapeLayer.comment = functionText;\n shapeLayer.effect.addProperty(\"xAxis\");\n\n return shapeLayer;\n }", "function drawMethod() {\n startupView = 1;\n \n // gl draw parameters\n var count;\n var primitiveType;\n var offset = 0;\n\n // Clear out the position arrays that will be changed by generate functions\n bezierPos = [];\n bezierPos2 = [];\n bezier3dPos = [];\n bezier3dPos2 = [];\n ans = [];\n ans2 = [];\n \n // Clear out the viewport with solid black color\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n //draws the dotted horizontal axis lines\n var primitiveType = gl.LINES;\n var count = axisRotation.length/2;\n gl.lineWidth(2);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(axisRotation), gl.STATIC_DRAW);\n gl.uniform4f(colorLocation, 0, 0, 0, 1);\n gl.drawArrays(primitiveType, offset, count);\n\n //If a point is being moved then draw the current highlighted point\n if(moveMode == 1)\n {\n count = 1;\n primitiveType = gl.POINTS;\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(highlightPoint), gl.STATIC_DRAW);\n gl.uniform4f(colorLocation, 1, 0, 1, 1);\n gl.drawArrays(primitiveType, offset, count);\n }\n\n //draws the control points\n primitiveType = gl.POINTS;\n count = positions.length/2;\n gl.uniform4f(colorLocation, 0.47, 0.47, 0.47, 1);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n gl.drawArrays(primitiveType, offset, count);\n\n //draws the dotted lines\n generateDottedLine();\n gl.lineWidth(1);\n primitiveType = gl.LINES;\n count = dottedLinePoints.length/2;\n gl.uniform4f(colorLocation, 0, 0, 0, 1);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(dottedLinePoints), gl.STATIC_DRAW);\n gl.drawArrays(primitiveType, offset, count);\n\n //generate and draw the bezier curve everytime the control points are moved\n generateBezierCurve();\n gl.lineWidth(3);\n gl.uniform4f(colorLocation, 1, 0, 0, 1);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(bezierPos), gl.STATIC_DRAW);\n count = subdivisions+1;\n primitiveType = gl.LINE_STRIP;\n gl.drawArrays(primitiveType, offset, count);\n\n //draw the 2nd bezier curve that we just generated\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(bezierPos2), gl.STATIC_DRAW);\n count = subdivisions+1;\n primitiveType = gl.LINE_STRIP;\n gl.drawArrays(primitiveType, offset, count);\n} // End of drawMethod()", "function draw() {\n\n\n\n}", "function drawCompWin(){\n\n}", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "function gd(){}", "draw(){ //define a function within an object by dropping the function keyword\n console.log('draw');\n }", "draw(){ //define a function within an object by dropping the function keyword\n console.log('draw');\n }", "draw(){ //define a function within an object by dropping the function keyword\n console.log('draw');\n }", "function Paper_format_other(){\n\n}", "draw5() { // draw5 -> Method\n console.log('Drawing 5...');\n }", "function main() { //入口函数\n\tvar docName = '',\n\t\tdupDoc,\n\t\texportInfo = {},\n\t\tlayerCount = 0,\n\t\tlayerSetsCount = 0;\n\n\tif (app.documents.length <= 0) {\n\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\talert(strAlertDocumentMustBeOpened);\n\t\t}\n\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t}\n\n\tinitExportInfo(exportInfo);\n\n\t// kpedt this was where descriptorToObject calls were in 'Export layers to files.jsx'\n\n\tif (DialogModes.ALL == app.playbackDisplayDialogs) {\n\t\tif (cancelButtonID == settingDialog(exportInfo)) {\n\t\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t\t}\n\t}\n\n\ttry {\n\n\t\tdocName = app.activeDocument.name; // save the app.activeDocument name before duplicate.\n\n\t\tlayerCount = app.documents[docName].layers.length;\n\t\tlayerSetsCount = app.documents[docName].layerSets.length;\n\n\t\tif ((layerCount <= 1) && (layerSetsCount <= 0)) {\n\n\t\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\t\talert(strAlertNeedMultipleLayers);\n\t\t\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t\t\t}\n\t\t} else {\n\n\t\t\tapp.activeDocument = app.documents[docName];\n\n\t\t\tsetExportHeader(app.activeDocument, exportInfo);\n\n\t\t\tdupDoc = app.activeDocument.duplicate();\n\n\t\t\tungroupAllLayerSets(dupDoc);\n\n\t\t\tremoveInvisibleArtLayers(dupDoc);\n\n\t\t\tdupDoc.activeLayer = dupDoc.layers[dupDoc.layers.length - 1];\n\n\t\t\tsetInvisibleAllArtLayers(dupDoc);\n\t\t\texportChildren(dupDoc, exportInfo);\n\t\t\tdupDoc.close(SaveOptions.DONOTSAVECHANGES);\n\n\t\t\tif (DialogModes.ALL == app.playbackDisplayDialogs) {\n\n\t\t\t\twriteTxtFiles();\n\t\t\t\tapp.preferences.rulerUnits = originalUnit;\n\n\t\t\t\talert('导出IMG/CSS/HTML' + strAlertWasSuccessful);\n\t\t\t}\n\n\t\t\tapp.playbackDisplayDialogs = DialogModes.ALL;\n\t\t}\n\n\t} catch (e1) {\n\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\talert(e1);\n\t\t}\n\n\t\tapp.preferences.rulerUnits = originalUnit;\n\n\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t}\n}", "function module_interface_display(){\n\n $('#main_description').html(g.module_lang.text[g.module_lang.current].main_description);\n\n g.viz_keylist.forEach(function(key){\n interface_titlesscreate(key);\n interface_buttonscreate(key,g.viz_definition[key].buttons_list);\n interface_buttoninteraction(key,g.viz_definition[key].buttons_list);\n });\n\n interface_menucreate();\n interface_menuinteractions();\n\n\n function interface_titlesscreate(key){\n $('#chart_'+key+'_title').html('<b>' + g.module_lang.text[g.module_lang.current]['chart_'+key+'_title'] + '</b><br>' + g.module_lang.text[g.module_lang.current].filtext + ' ' );\n }\n\n function interface_buttonscreate(key,buttons) {\n var html = '';\n buttons.forEach(function(button){\n switch(button){\n case 'reset': \n var icon = '↻';\n break;\n case 'help':\n var icon = '?'; \n break;\n case 'parameters':\n var icon = '⚙';\n break;\n case 'lockcolor': // to be implemented\n var icon = '⬙';\n break;\n case 'expand': // to be implemented\n var icon = '◰';\n break;\n case 'toimage': // to be implemented\n var icon = 'I';\n break;\n\n }\n html += '<button class=\"btn btn-primary btn-sm button '+button+'\" id=\"'+button+'-'+key+'\">'+icon+'</button>';\n });\n $('#buttons-'+key).html(html);\n }\n\n function interface_buttoninteraction(key1,buttons) {\n buttons.forEach(function(button){\n switch(button){\n case 'reset': \n $('#'+button+'-'+key1).click(function(){\n if(key1 == g.viz_timeline){menu_pausePlay();}\n if(key1 == 'multiadm'){\n if ($('#select-'+g.geometry_keylist[0]).val() == 'NA') {\n zoomToGeom(g.geometry_data[g.geometry_keylist[0]],g.viz_definition.multiadm.maps[g.geometry_keylist[0]]);\n }else{\n $('#select-'+g.geometry_keylist[0]).val('NA').change();\n }\n g.geometry_keylist.forEach(function(key2,key2num){\n g.viz_definition[key1].charts[key2].filterAll();\n });\n }else{\n g.viz_definition[key1].chart.filterAll();\n }\n dc.redrawAll(); \n });\n break;\n case 'help':\n $('#'+button+'-'+key1).click(function(){\n g.intro_definition.goToStep(g.intro_step[key1]).start();\n }); \n break;\n case 'parameters': // to be implemented\n $('#'+button+'-'+key1).click(function(){\n window.scrollTo(0, 0);\n \n if(g.medical_datatype == 'outbreak'){\n $('.modal-dialog').css('width','30%'); \n $('.modal-dialog').css('margin-right','2.5%'); \n }else{\n $('.modal-dialog').css('height','7%'); \n $('.modal-dialog').css('width','90%'); \n $('.modal-dialog').css('margin-top','1.5%'); \n $('.modal-dialog').css('margin-left','10%'); \n }\n\n var html = '<div class=\"row\">';\n\n \n // Load Optional Module: module-colorscale.js\n //------------------------------------------------------------------------------------\n html += '<div class=\"col-md-12\">';\n html += module_colorscale_display();\n html += '</div>';\n html += '<div class=\"btn btn-primary btn-sm button\" id=\"gobacktodashboard\"><b>X</b></div>';\n\n html += '</div>';\n $('.modal-content').html(html);\n module_colorscale_interaction();\n $('#modal').modal('show');\n\n $('#gobacktodashboard').click(function(){\n $('#modal').modal('hide');\n });\n });\n break;\n case 'expand': // to be implemented\n $('#'+button+'-'+key1).click(function(){\n g.geometry_keylist.forEach(function(key) {\n if ($('#map-' + key).height() <= 500) {\n setTimeout(function() {\n $('#map-' + key).css('height','845px');\n g.viz_definition.multiadm.maps[key].invalidateSize(true);\n }, 500);\n setTimeout(function() {\n zoomToGeom(g.geometry_data[key],g.viz_definition.multiadm.maps[key]);\n }, 1000);\n }else{\n setTimeout(function() {\n $('#map-' + key).css('height','410px');\n g.viz_definition.multiadm.maps[key].invalidateSize(true);\n }, 500);\n setTimeout(function() {\n zoomToGeom(g.geometry_data[key],g.viz_definition.multiadm.maps[key]);\n },1000); \n }; \n });\n });\n break;\n case 'lockcolor': // to be implemented\n $('#'+button+'-'+key1).click(function(){\n module_colorscale_lockcolor('Manual');\n });\n break;\n\n case 'toimage-a':\n $('#'+button+'-'+key1).click(function(){\n var temp_id = 'chart-' + key1;\n var html = d3.select('.container svg')\n .attr('title', 'some title here')\n .attr('version', 1.1)\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .node().parentNode.innerHTML;\n\n var img = new Image();\n // http://en.wikipedia.org/wiki/SVG#Native_support\n // https://developer.mozilla.org/en/DOM/window.btoa\n img.src = \"data:image/svg+xml;base64,\" + btoa(svg_xml);\n\n var canvas = document.getElementById('mycanvas');\n var img = canvas.toDataURL('image/png');\n document.write('<img src=\"' + img + '\"/>');\n });\n\n\n case 'toimage-b':\n var fs = require('fs');\n var db_new = document.getElementById(button+'-'+key1);\n \n function handleDbNewFile(e) {\n console.log(e);\n var files = e.target.files;\n var f = files[0];\n var name = f.name;\n var path = f.path;\n\n var map = g.viz_definition.multiadm.maps.admN1;\n leafletImage(map, doImage);\n\n function doImage(err, canvas) {\n var img = document.createElement('img');\n var dimensions = map.getSize();\n img.width = dimensions.x;\n img.height = dimensions.y;\n img.src = canvas.toDataURL();\n\n fs.writeFile('', img, function(err) {\n if(err) {\n console.log(err); //CONSOLE\n } else {\n console.log(\"exported\", new Date()); //CONSOLE\n }\n });\n }\n }\n if(db_new.addEventListener) db_new.addEventListener('click', handleDbNewFile);\n\n $('#'+button+'-').click(function(){\n\n var snapshot = document.getElementById('svgdataurl3');\n var map = g.viz_definition.multiadm.maps.admN1;\n\n leafletImage(map, doImage);\n\n function doImage(err, canvas) {\n var img = document.createElement('img');\n var dimensions = map.getSize();\n img.width = dimensions.x;\n img.height = dimensions.y;\n img.src = canvas.toDataURL();\n\n fs.writeFile('', img, function(err) {\n if(err) {\n console.log(err); //CONSOLE\n } else {\n console.log(\"onexport\", new Date()); //CONSOLE\n console.log(\"JSON saved to \" + outputFilename); //CONSOLE\n }\n }); \n snapshot.innerHTML = '';\n snapshot.appendChild(img);\n }\n\n var snapshot = document.getElementById('svgdataurl2');\n var chart = g.viz_definition.case_bar.chart;\n\n //dcImage(chart, doImage);\n\n /*function doImage(err, canvas) {\n var img = document.createElement('img');\n var dimensions = map.getSize();\n img.width = dimensions.x;\n img.height = dimensions.y;\n img.src = canvas.toDataURL();\n snapshot.innerHTML = '';\n snapshot.appendChild(img);\n }*/\n \n var encoresvg = g.viz_definition.case_bar.chart.svg();\n\n\n //get svg element.\n // var svg = document.getElementById(\"chart-case_bar\").getSVGDocument();\n //var svg = d3.select('#chart-case_bar').select(\"svg\");\n\n var foo = d3.select('#chart-case_bar').select(\"svg\");\n\n // later, where you don't have someDOM but you do have foo\n var svg = foo[0][0];\n //var svg = someDom.ownerSVGElement;\n\n //get svg source.\n var serializer = new XMLSerializer();\n var source = serializer.serializeToString(svg);\n\n //add name spaces.\n if(!source.match(/^<svg[^>]+xmlns=\"http\\:\\/\\/www\\.w3\\.org\\/2000\\/svg\"/)){\n source = source.replace(/^<svg/, '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n }\n if(!source.match(/^<svg[^>]+\"http\\:\\/\\/www\\.w3\\.org\\/1999\\/xlink\"/)){\n source = source.replace(/^<svg/, '<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"');\n }\n\n //add xml declaration\n source = '<?xml version=\"1.0\" standalone=\"no\"?>\\r\\n' + source;\n\n //convert svg source to URI data scheme.\n var url = \"data:image/svg+xml;charset=utf-8,\"+encodeURIComponent(source);\n\n function importSVG(sourceSVG, targetCanvas) {\n // https://developer.mozilla.org/en/XMLSerializer\n svg_xml = (new XMLSerializer()).serializeToString(sourceSVG);\n var ctx = targetCanvas.getContext('2d');\n\n // this is just a JavaScript (HTML) image\n var img = new Image();\n // http://en.wikipedia.org/wiki/SVG#Native_support\n // https://developer.mozilla.org/en/DOM/window.btoa\n img.src = \"data:image/svg+xml;base64,\" + btoa(svg_xml);\n\n img.onload = function() {\n // after this, Canvas’ origin-clean is DIRTY\n \n ctx.drawImage(img,100, 200);\n }\n }\n console.log(encoresvg);\n \n var test = document.getElementById(\"svgdataurl\");\n\n console.log(test);\n\n importSVG(encoresvg[0][0],test);\n\n var html = encoresvg[0][0]\n .attr('title', 'some title here')\n .attr('version', 1.1)\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .node().parentNode.innerHTML;\n\n var img = new Image();\n // http://en.wikipedia.org/wiki/SVG#Native_support\n // https://developer.mozilla.org/en/DOM/window.btoa\n img.src = \"data:image/svg+xml;base64,\" + btoa(svg_xml);\n\n var canvas = document.getElementById('svgdataurl2');\n var img = canvas.toDataURL('image/png');\n document.write('<img src=\"' + img + '\"/>');\n hiddenDiv.remove();\n\n }); \n break;\n }\n });\n }\n\n function interface_menucreate(){\n\n // Menu title\n var html = '<div id=\"menu_title\" style=\"font-size:1.2em; text-align:center;\"><b>'+g.module_lang.text[g.module_lang.current].interface_menutitle+'</b></div>';\n\n // Reset button\n html += '<a id=\"menu_reset\" class=\"menu_button btn btn-primary btn-sm\" href=\"javascript:menu_reset();\">'+g.module_lang.text[g.module_lang.current].interface_menureset+'</a>';\n \n // Reload button\n html += '<a id=\"menu_reload\" class=\"menu_button btn btn-primary btn-sm\" href=\"javascript:history.go(0)\">'+g.module_lang.text[g.module_lang.current].interface_menureload+'</a>';\n\n // Help button\n html += '<button id=\"menu_help\" class=\"menu_button btn btn-primary btn-sm\">'+g.module_lang.text[g.module_lang.current].interface_menuhelp+'</button>';\n\n // Quick access to epiweeks button\n html += '<div id=\"menu_epiwk\"><p>'+g.module_lang.text[g.module_lang.current].interface_menuepiwk+'</p>';\n html +='<button class=\"menu_button_epiwk btn btn-primary btn-sm\" id=\"menu_epi4\">4</button>';\n html +='<button class=\"menu_button_epiwk btn btn-primary btn-sm\" id=\"menu_epi8\">8</button>';\n html +='<button class=\"menu_button_epiwk btn btn-primary btn-sm\" id=\"menu_epi12\">12</button>';\n html +='<div>';\n\n // Autoplay button\n html += '<button id=\"menu_autoplay\" class=\"menu_button btn btn-primary btn-sm\">'+g.module_lang.text[g.module_lang.current].interface_menuautoplay.play+'</button>'\n\n // Record count\n //html += '<div id=\"menu_count\"><b><span class=\"filter-count \"></span></b><br>'+g.module_lang.text[g.module_lang.current].interface_menucount[0]+'<br><b><span class=\"total-count \"></span></b><br>'+g.module_lang.text[g.module_lang.current].interface_menucount[1]+'</div>';\n html += '<div id=\"menu_count\">'+g.module_lang.text[g.module_lang.current].interface_menucount[2]+'<br><span id=\"case-info\">'+g.module_lang.text[g.module_lang.current].interface_menucount[3]+' <b><span class=\"filter-count headline\"></span></span></b><br><span id=\"death-info\">'+g.module_lang.text[g.module_lang.current].interface_menucount[4]+' <b><span class=\"filter-count headline\"></span></span></b><br></div>';\n\n /*<span style=\"font-size:2em;\">Chiffres clés :\n <span id=\"casetotal\">Cas : <span class=\"filter-count headline\"></span></span>\n <span id=\"deathtotal\"> | Décès : <span class=\"filter-count headline\"></span></span></span>*/\n\n $('#menu').html(html);\n }\n\n function interface_menuinteractions(){\n\n g.interface_autoplayon = false;\n g.interface_autoplaytime = 0;\n g.interface_autoplaytimer = 0;\n\n $('#menu_autoplay').on('click',function(){\n if (g.interface_autoplayon) {\n menu_pausePlay();\n dc.redrawAll();\n }else{\n g.viz_definition[ g.viz_timeline].chart.filterAll();\n module_colorscale_lockcolor('Auto'); \n g.interface_autoplayon = true;\n $('#menu_autoplay').html(g.module_lang.text[g.module_lang.current].interface_menuautoplay.pause);\n $('#chart-'+ g.viz_timeline).addClass(\"noclick\");\n if(g.viz_timeshare){\n g.viz_timeshare.forEach(function(key) {\n $('#chart-'+ key).addClass(\"noclick\");\n });\n }\n g.interface_autoplaytime = 0;\n g.interface_autoplaytimer = setInterval(function(){menu_autoPlay()}, 500);\n };\n });\n\n $('#menu_help').click(function(){\n g.intro_definition.start();\n });\n\n // Quick epiweeks access\n var quick_filter_list = [4,8,12];\n quick_filter_list.forEach(function(wknumber){\n $('#menu_epi'+wknumber).on('click',function(){\n var temp_mode = g.colorscale_modecurrent;\n g.colorscale_modecurrent = 'Manual';\n menu_pausePlay();\n var temp_domain = g.viz_definition[ g.viz_timeline].domain.slice(Math.max(g.viz_definition[ g.viz_timeline].domain.length - wknumber - 1, 2));\n temp_domain.pop();\n temp_domain.forEach(function(wk){\n g.viz_definition[g.viz_timeline].chart.filter(wk);\n if(g.viz_timeshare){\n g.viz_timeshare.forEach(function(key) {\n g.viz_definition[key].chart.filter(wk);\n });\n }\n });\n g.colorscale_modecurrent = temp_mode;\n module_colorscale_lockcolor('Auto');\n dc.redrawAll();\n });\n });\n }\n}", "function Expt() {\r\n}", "draw() {\n console.log(\"draw\"); //we can omit a word function inside of another function\n }", "draw() {\n console.log(\"Draw\");\n }", "onExport() {\n\t\t// you can do work before running the export using this method\n\t\t// (e.g. re-ordering paths for plotting)\n\t}", "function b2Draw()\r\n{\r\n}", "function main(mode) {\n\tvar code = \"\";\n\tvar Result;\n\tvar svgout = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n\n\n\tvar Inobj = Cleanup(10);\n\tvar svgheader = '<?xml version=\"1.0\" standalone=\"no\"?> \\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"' + Inobj[0].cw + 'px\" height=\"' + Inobj[0].ch + 'px\"> \\n';\n\tif (Inobj != false) {\n\t\tvar pretext = document.getElementById(\"SVGCode\");\n\t\tvar picobj = document.getElementById(\"pic\");\n\t\tif (mode == 0) {\n\t\t\tcode = svgheader;\n\n\t\t\t//var oldsvg=document.getElementById(\"pic\");\n\t\t\tsvgout.setAttribute(\"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\n\t\t\tsvgout.setAttribute(\"width\", (Inobj[0].cw + \"px\"));\n\t\t\tsvgout.setAttribute(\"height\", (Inobj[0].ch + \"px\"));\n\t\t\tsvgout.setAttribute(\"version\", \"1.1\");\n\t\t\tsvgout.setAttribute(\"style\", \"display:inline\");\n\t\t\tsvgout.setAttribute(\"id\", \"pic\");\n\t\t} //mode 1 action\n\t\telse //mode 2 action\n\t\t{\n\t\t\tcode = pretext.value;\n\t\t\tcode = code.substring(0, (code.length - 6));\n\t\t\tvar oldsvg = document.getElementById(\"pic\");\n\t\t\tsvgout = oldsvg;\n\t\t}\n\n\t\tif (Inobj[0].bbon) {\n\t\t\tResult = DrawCircle(Inobj);\n\t\t\tcode += Result[0];\n\t\t\tsvgout.appendChild(Result[1]);\n\t\t} //draw backbone\n\t\tfor (var i = 1; i < Inobj.length; i++) //draw features\n\t\t{\n\t\t\tif (Inobj[i].visible) {\n\t\t\t\tif (Inobj[i].arrowon) {\n\t\t\t\t\tResult = DrawArrow(Inobj, i);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t} else {\n\t\t\t\t\tResult = DrawBox(Inobj, i);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Inobj[0].txton) {\n\t\t\tif (Inobj[0].plasmidnameon) {\n\t\t\t\tResult = ShowPlasmidName(Inobj);\n\t\t\t\tcode += Result[0];\n\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t}\n\t\t\tif (Inobj[0].plasmidsizeon) {\n\t\t\t\tResult = DrawPlasmidSize(Inobj);\n\t\t\t\tcode += Result[0];\n\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t}\n\t\t\tfor (var j = 1; j < Inobj.length; j++) {\n\t\t\t\tif (Inobj[j].visible) {\n\t\t\t\t\tResult = ShowFeatureLabel(Inobj, j);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tif (Result.length == 2) {\n\t\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsvgout.appendChild(Result[2]);\n\t\t\t\t\t\tsvgout.appendChild(Result[1]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcode += \"</svg>\";\n\t\tpretext.value = code;\n\t\tpicobj.parentNode.replaceChild(svgout, picobj);\n\t\t//alert(svgout.childNodes[5].nodeName+\" has childs: \"+svgout.childNodes[5].childNodes.length);\n\t\t//alert(svgout.childNodes[5].firstChild.nodeName);\n\t\t//alert(\"the ref link: \"+svgout.childNodes[5].firstChild.getAttribute(\"xlink:href\"));\n\t\t//alert(svgout.childNodes[5].firstChild.firstChild.nodeValue);\n\n\n\t}\n}", "function main(){\n // Same functions used in class for moveTo and lineTo\n function moveToTx(x,y,z,Tx) {\n var loc = [x,y,z];\n var locTx = m4.transformPoint(Tx,loc);\n context.moveTo(locTx[0],locTx[1]);\n }\n function lineToTx(x,y,z,Tx) {\n var loc = [x,y,z];\n var locTx = m4.transformPoint(Tx,loc);\n context.lineTo(locTx[0], locTx[1]);\n }\n function drawAxes(Tx){\n context.beginPath();\n moveToTx(-50, 0, 0, Tx);\n lineToTx(50, 0, 0, Tx);\n context.stroke(); // x-axis\n moveToTx(0, -50, 0, Tx);\n lineToTx(0, 50, 0, Tx);\n context.stroke(); // y-axis\n moveToTx(0, 0, -50, Tx);\n lineToTx(0, 0, 50, Tx);\n context.stroke(); // z-axis\n }\n /**\n Itterates through the 2d array of points (x,y,z), drawing a line\n between each. Points have already been transformed to exist in the world\n coordinate system from the point at which they were added.\n **/\n function drawPicture(Tx, vectArray, toMouse){\n context.beginPath();\n vectArray.forEach(function(point,i){\n if(i === 0){\n moveToTx(point[0],point[1],point[2],Tx);\n }else{\n lineToTx(point[0],point[1],point[2],Tx);\n }\n context.stroke();\n });\n if(toMouse){\n lineToTx(currMousePos[0],currMousePos[1],0,m4.identity());\n }\n context.stroke();\n }\n /**\n Draws a grid on the y=0 plane\n **/\n function drawGrid(Tx){\n context.beginPath();\n var dim = 10;\n var length = 500;\n // Draw from the negative width to pos\n for(var i=-(dim/2); i<=(dim/2); i++){\n iScaled = i * 50;\n moveToTx(iScaled, 0, -length/2, Tx); lineToTx(iScaled, 0, length/2, Tx);\n moveToTx(-length/2, 0, iScaled, Tx); lineToTx(length/2, 0, iScaled, Tx);\n }\n context.stroke();\n }\n // Animation loop\n function draw(){\n // Quick clear for re-draw as well as resize in event of window change\n canvas.width = window.innerWidth; canvas.height = window.innerHeight;\n context.strokeStyle = PRIMARY_TEXT_COLOR;\n\n // Transforms\n var TrotX = m4.rotationX(thetaXSpindle*Math.PI); // Spindle spins independantly of the world.\n var TrotY = m4.rotationY(thetaYSpindle*Math.PI);\n var Ttrans = m4.translation([spindleX,0,spindleZ]);\n Tspindle = m4.multiply(TrotX, TrotY);\n Tspindle = m4.multiply(Tspindle, Ttrans);\n\n var eye = [Math.sin(theta*Math.PI)*radius, camPosY, Math.cos(theta*Math.PI)*radius];\n var target = [0,0,0];\n var up = [0,1,0];\n var TlookAt = m4.lookAt(eye, target, up);\n var Tcamera = m4.inverse(TlookAt);\n Tcamera = m4.multiply(Tcamera, m4.scaling([1,-1,1])); // flip to point Y up\n Tcamera = m4.multiply(Tcamera, m4.translation([canvas.width/2, canvas.height/2, 0]));\n\n context.strokeStyle = 'rgba(255, 255, 255, .15)';\n drawGrid(Tcamera);\n context.strokeStyle = \"lightblue\";\n commits.forEach(function(curr){\n curr.draw(Tcamera);\n });\n // Animation transforms\n thetaYSpindle += rotSpeedY;\n thetaXSpindle += rotSpeedX;\n TspindleMod = m4.multiply(Tspindle, Tcamera);\n // Update the global variable\n mouseToWorld = m4.inverse(TspindleMod);\n\n context.strokeStyle = \"white\";\n drawAxes(TspindleMod);\n context.strokeStyle = \"lightblue\";\n drawPicture(TspindleMod, vectArray, true);\n context.translate(canvas.width/2, canvas.height/2); // Move orgin for UI\n ui.showManual();\n ui.showStats(rotSpeedX, rotSpeedY, spindleX, spindleZ);\n window.requestAnimationFrame(draw);\n }\n draw();\n\n\n // EVENT LISTENERS\n document.onmousemove = function(e){\n currMousePos = [e.pageX, e.pageY, 0];\n }\n document.onmousedown = function(event){\n if(currPos){\n prevPos = currPos\n }\n currPos = [event.clientX, event.clientY, 0];\n currPos = m4.transformPoint(mouseToWorld, currPos);\n vectArray.push(currPos);\n }\n document.addEventListener('keydown', (event) => {\n const keyName = event.key;\n if(keyName === \"c\"){\n // Store drawing\n var drawing = new Drawing(Tspindle, vectArray);\n drawing.rotSpeedY = rotSpeedY;\n drawing.rotSpeedX = rotSpeedX;\n commits.push(drawing);\n // Clear drawing\n vectArray = [];\n currPos = null;\n }\n if(keyName === \"x\"){\n // pop last commit\n commits.pop();\n // Clear drawing\n vectArray = [];\n currPos = null;\n }\n // Controll axis'\n if(keyName === \"ArrowUp\"){\n event.preventDefault();\n rotSpeedX += stepSize;\n }\n if(keyName === \"ArrowDown\"){\n event.preventDefault();\n rotSpeedX -= stepSize;\n }\n if(keyName === \"ArrowLeft\"){\n event.preventDefault();\n rotSpeedY -= stepSize;\n }\n if(keyName === \"ArrowRight\"){\n event.preventDefault();\n rotSpeedY += stepSize;\n }\n if(keyName === \"w\"){\n event.preventDefault();\n camPosY += 1;\n }\n if(keyName === \"s\"){\n event.preventDefault();\n camPosY -= 1;\n }\n if(keyName === \"d\"){\n event.preventDefault();\n theta += .05;\n }\n if(keyName === \"a\"){\n event.preventDefault();\n theta -= .05;\n }\n if(keyName === \"l\"){\n event.preventDefault();\n spindleX += 5;\n }\n if(keyName === \"j\"){\n event.preventDefault();\n spindleX -= 5;\n }\n if(keyName === \"i\"){\n event.preventDefault();\n spindleZ += 5;\n }\n if(keyName === \"k\"){\n event.preventDefault();\n spindleZ -= 5;\n }\n });\n /** Drawing **/\n function Drawing(Tmod, array){\n this.Tmod = Tmod;\n this.array = array;\n // Animation transforms\n this.rotSpeedY;\n this.rotSpeedX;\n // Drawing\n this.draw = function(Tcamera){\n var rot = m4.rotationX(Math.PI*this.rotSpeedX);\n this.Tmod = m4.multiply(rot,this.Tmod);\n rot = m4.rotationY(Math.PI*this.rotSpeedY);\n this.Tmod = m4.multiply(rot, this.Tmod);\n var Tx = m4.multiply(this.Tmod, Tcamera);\n drawPicture(Tx, this.array, false);\n }\n }\n}", "function Renderer(args) {\n\n\n}", "function functionDelegator() {\n colorCalc();\n showColors();\n displayHex();\n displayRGB();\n displayHSL();\n}", "function _onOpen() {\n\tdraw();\n}", "function _onOpen() {\n\tdraw();\n}", "draw() {\n console.log(\"draw\");\n }", "function freeDraw() {\n mainDiagram.toolManager.panningTool.isEnabled = false;\n // create drawing tool for mainDiagram, defined in FreehandDrawingTool.js\n var tool = new FreehandDrawingTool();\n // provide the default JavaScript object for a new polygon in the model\n tool.archetypePartData =\n { stroke: \"black\", strokeWidth: 5, category: \"FreehandDrawing\", key: uuidv4() };\n // install as last mouse-move-tool\n mainDiagram.toolManager.mouseMoveTools.add(tool);\n globalState.tool = tool;\n this.onclick = cancelFreeDraw;\n document.getElementById(\"freedraw\").innerHTML = '<img id=\"freedraw_img\" width=\"20\" height=\"20\" style=\"margin:2px\"/>' + \" 完成\"\n document.getElementById(\"freedraw_img\").src = APPLICATION_ROOT + \"Content/done.png\";\n\n}", "draw() {\n var p = window.p;\n\n let col= this.col ? this.p.color(this.col.r, this.col.g , this.col.b) : this.p.color(255,255,255);\n\n //we draw line\n this.p.stroke(col); //it's for campability with old clients\n this.p.strokeWeight(this.sw);\n this.p.line(this.a.x, this.a.y, this.b.x, this.b.y);\n\n }", "function ObjectOrientedRenderer3() {}", "function ObjectOrientedRenderer3() {}", "function ObjectOrientedRenderer3() {}", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "function execute_control()\r\n{\r\n\tdrawModule_genre();\r\n\tdrawModule_month();\r\n\tdrawModule_table();\r\n\tdrawModule_mpaaRating();\r\n}", "function paint() {\n}", "function ObjectOrientedRenderer3(){}", "exportBitmap(selectedLines){\n \n // This is the default, will try to look at selected lines and \n // see if var name that can be used. If one can be used, will\n // overwrite and not output framebuffer line\n var varName = \"bitmap\";\n var foundName = false; // Used to set true so framebuffer line not output if name found\n\n // String that holds all export information for editor\n var str = \"\";\n\n // If selected lines doesn't equal any of the below, and there is only one equals sign \n // (meaning just the array selected) then use existing name from editor (splits into 2 elements)\n // Also ensure no newlines before the equals because that means user has selected line before name\n // and now don't know where start of name is otherwise\n if( selectedLines != undefined && selectedLines != \"\" && \n selectedLines != \" \" && selectedLines != \"\\n\" && \n selectedLines.indexOf('=') != -1 && selectedLines.split(\"=\").length == 2 && \n (selectedLines.indexOf('\\n') == -1 || selectedLines.indexOf('\\n') > selectedLines.indexOf('='))){\n\n // Do one more check, th\n var startExtractNameIndex = 0;\n var endExtractNameIndex = selectedLines.indexOf('=') - 1; // Get rid of the space at the end, it will be re-added\n varName = selectedLines.substring(startExtractNameIndex, endExtractNameIndex);\n foundName = true;\n }else{\n // just use the default generated name since no names were found\n varName = varName + this.BITMAP_EXPORT_COUNT.toString(); // Add index to make name unique when a name was NOT found\n\n // Add dimensions of bitmap to a comment above the buffer (if selected on import, will use these instead of asking user), only on not finding name\n str = str + \"# BITMAP: width: \" + this.COLUMN_COUNT.toString() + \", height: \" + this.ROW_COUNT.toString() + \"\\n\";\n }\n\n // Start the actual array\n str = str + varName + \" = (\";\n\n // Track number of spaces needed to offset (EX spaces needed = len('bitmap33 = (')))\n var spaceIndentCount = (varName + \" = (\").length;\n\n // Loop through grid data in pages COLUMN_COUNT long but 8 thick (each column of 8 is a byte for buffer)\n for(var scanRow=0; scanRow<this.ROW_COUNT; scanRow+=8){\n for(var column=0; column<this.COLUMN_COUNT; column++){\n\n // Byte for column where each bit will be set from grid data\n var byte = 0;\n \n // Make the byte\n for(var i=0; i<8 && scanRow+i < this.ROW_COUNT; i++){\n var value = document.getElementById( ((scanRow+i) * this.COLUMN_COUNT) + column).style.backgroundColor;\n if(value == \"white\"){\n value = 1;\n }else{\n value = 0;\n }\n\n byte = byte | value<<i;\n }\n\n // Add the byte to Python array string\n str = str + byte.toString();\n\n // As long not at last position in array to print, add a comma after each entry\n if(column != this.COLUMN_COUNT-1 || scanRow+8 < this.ROW_COUNT){\n str = str + \",\";\n }\n }\n\n // At the end of a page, before and formatting next add newline when not on last line of array\n if(scanRow+8 < this.ROW_COUNT){\n str = str + \"\\n\";\n\n // Indent next lines to be even with the top-most line\n for(var indent=0; indent<spaceIndentCount; indent++){\n str = str + \" \";\n }\n }\n }\n\n // Finish up the array Python syntax and setup the framebuffer for the user to use\n str = str + \")\";\n\n // Only output framebuffer if name was NOT found (don't want to do it twice++)\n if(!foundName){\n // str = str + \"\\n\" + varName + \"FBuffer = FrameBuffer(bytearray(\" + varName + \"), \" + this.COLUMN_COUNT.toString() + \", \" + this.ROW_COUNT.toString() + \", MONO_VLSB)\";\n // Keep track of the number of times bitmaps exported, used in name (but only when name was not found)\n this.BITMAP_EXPORT_COUNT++;\n }\n\n return str;\n }", "function createWelcomeGraphic() {\n\n}", "function drawFunctionPoints(func) {\n \n var point_options = {\n style: 6,\n withLabel: false\n };\n \n var xvals = $.map(func.data, function(o,i) { return pointFilter(o)[0]; });\n var yvals = $.map(func.data, function(o,i) { return pointFilter(o)[1]; });\n var x_min = Math.min.apply(this, xvals);\n var x_max = Math.max.apply(this, xvals);\n \n // create and bind event handler for each point\n var points = $.map(func.data, function(o,i) {\n \n var p = optimalApp.board.create('point', pointFilter(o), point_options);\n \n // mousemove highlight of data table\n JXG.addEvent(p.rendNode, 'click', function(e) {\n //selectFunction(func);\n }, p);\n \n // display tooltip when mouse is over function\n JXG.addEvent(p.rendNode, 'mouseover', function(e) {\n if (optimalApp.copyMode === true) {\n setTooltip('Drag to copy and edit function');\n } else {\n setTooltip('Drag to edit');\n }\n }, p);\n \n // clear tooltip when mouse is not over function\n JXG.addEvent(p.rendNode, 'mouseout', function(e) {\n setTooltip();\n }, p);\n \n // handle copying of functions\n JXG.addEvent(p.rendNode, 'mousedown', function(e) {\n if (!optimalApp.copyMode) return;\n addFunction(deepcopy(func.data));\n }, p);\n \n // handle editing of functions\n JXG.addEvent(p.rendNode, 'mouseup', function(e) {\n var newpoint = [p.coords.usrCoords[1], p.coords.usrCoords[2]];\n func.dataTable.setDataAtCell(i, 0, pointInvFilter(newpoint)[0]);\n func.dataTable.setDataAtCell(i, 1, pointInvFilter(newpoint)[1]);\n func.data[i][0] = pointInvFilter(newpoint)[0];\n func.data[i][1] = pointInvFilter(newpoint)[1];\n }, p);\n \n return p;\n });\n \n return points;\n}", "startPaint(){\n this.toolbarHolder.forEach((tool)=>{\n tool.addEventListener(\"click\", (e)=>{\n this.addTool(e.target);\n // if(this.toolss == \"f\"){}\n if(this.toolss == \"cut\"){\n this.cut() \n }\n else if(this.toolss == \"copy\"){\n this.copy() \n }\n else if(this.toolss == \"paste\"){\n this.paste() \n }\n else if(this.toolss == \"text\"){\n this.textss();\n this.draw();\n }\n else if(this.toolss == \"resize\"){\n this.resize();\n this.draw();\n }\n else if(this.toolss == \"fillers\"){\n this.filler();\n this.draw();\n }\n else if(this.toolss == \"rotate-flip-ver\" || this.toolss == \"rotate-flip-hor\"){\n this.flip(this.toolss);\n this.draw();\n }\n else if(this.toolss == \"rotate-right-90-deg\" || this.toolss == \"rotate-left-90-deg\" || this.toolss == \"rotate-180-deg\"){\n this.rotate(this.toolss);\n this.draw();\n }\n else if(this.toolss == \"size-1\" || this.toolss == \"size-2\" || this.toolss == \"size-3\" || this.toolss == \"size-4\"){\n this.isDrawing = false; \n this.isMoving = false;\n if(this.toolss == \"size-1\"){this.lineSize = 4}\n if(this.toolss == \"size-2\"){this.lineSize = 6}\n if(this.toolss == \"size-3\"){this.lineSize = 8}\n if(this.toolss == \"size-4\"){this.lineSize = 10}\n }\n else if(this.toolss == \"fills-no-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.fillColor = \"rgba(255, 255, 255, 0)\";\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"fills-solid-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.fillColor = document.querySelector(\".color-two-bg\").style.background;\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"fills-marker\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.fillColor = document.querySelector(\".color-two-bg\").style.background;\n this.ctx.globalAlpha = 0.7;\n }\n else if(this.toolss == \"outline-no-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.strokeColor = \"rgba(255, 255, 255, 0)\";\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"outline-solid-color\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.strokeColor = document.querySelector(\".color-One-bg\").style.background;\n this.ctx.globalAlpha = 1;\n }\n else if(this.toolss == \"file-open\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.draw();\n }\n else if(this.toolss == \"file-save\"){\n this.isDrawing = false; \n this.isMoving = false;\n this.draw();\n }\n else{\n this.draw();\n } \n })\n })\n }", "function gLyphsCreateExperimentExpressExportWidget() {\n var g1 = document.createElementNS(svgNS,'g'); \n if(!current_region.exportSVGconfig) {\n g1.setAttributeNS(null, \"onclick\", \"gLyphsToggleExpressionSubpanel('export');\");\n g1.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n g1.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\"); \n // poly.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n }\n \n var rect = g1.appendChild(document.createElementNS(svgNS,'rect'));\n rect.setAttributeNS(null, 'x', '0px');\n rect.setAttributeNS(null, 'y', '0px');\n rect.setAttributeNS(null, 'width', '11px');\n rect.setAttributeNS(null, 'height', '11px');\n rect.setAttributeNS(null, 'fill', 'rgb(240,240,255)');\n rect.setAttributeNS(null, 'stroke', 'rgb(100,100,100)');\n //if(!current_region.exportSVGconfig) {\n // rect.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n // rect.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n // rect.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n //}\n \n var poly = g1.appendChild(document.createElementNS(svgNS,'polygon'));\n poly.setAttributeNS(null, 'points', '4,2 7,2 7,5 9.5,5 5.5,9.5 1.5,5 4,5 4,2');\n //poly.setAttributeNS(null, 'fill', 'blue');\n poly.setAttributeNS(null, 'fill', 'gray');\n //if(!current_region.exportSVGconfig) {\n // poly.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n // poly.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n // poly.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n //}\n g1.setAttributeNS(null, 'transform', \"translate(\" + (current_region.display_width-45) + \",0)\");\n return g1;\n}", "function exports() {}", "function exports() {}", "function exports() {}", "function render() {\n var createNodes = __webpack_require__(877);\n var createClusters = __webpack_require__(880);\n var createEdgeLabels = __webpack_require__(881);\n var createEdgePaths = __webpack_require__(882);\n var positionNodes = __webpack_require__(883);\n var positionEdgeLabels = __webpack_require__(884);\n var positionClusters = __webpack_require__(885);\n var shapes = __webpack_require__(886);\n var arrows = __webpack_require__(887);\n\n var fn = function(svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, \"output\");\n var clustersGroup = createOrSelectGroup(outputGroup, \"clusters\");\n var edgePathsGroup = createOrSelectGroup(outputGroup, \"edgePaths\");\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, \"edgeLabels\"), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, \"nodes\"), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function(value) {\n if (!arguments.length) return createNodes;\n createNodes = value;\n return fn;\n };\n\n fn.createClusters = function(value) {\n if (!arguments.length) return createClusters;\n createClusters = value;\n return fn;\n };\n\n fn.createEdgeLabels = function(value) {\n if (!arguments.length) return createEdgeLabels;\n createEdgeLabels = value;\n return fn;\n };\n\n fn.createEdgePaths = function(value) {\n if (!arguments.length) return createEdgePaths;\n createEdgePaths = value;\n return fn;\n };\n\n fn.shapes = function(value) {\n if (!arguments.length) return shapes;\n shapes = value;\n return fn;\n };\n\n fn.arrows = function(value) {\n if (!arguments.length) return arrows;\n arrows = value;\n return fn;\n };\n\n return fn;\n}", "function plot() {\n\n}", "draw(context) {\n //TO-DO\n }", "function draw() {\n clear();\n leg();\n}" ]
[ "0.6704778", "0.6581565", "0.6581565", "0.6471182", "0.64127046", "0.6407515", "0.6339987", "0.63242733", "0.6276098", "0.6276098", "0.6276098", "0.6276098", "0.6242511", "0.6242511", "0.6242511", "0.6172286", "0.61575127", "0.6153804", "0.61525553", "0.61419815", "0.6132425", "0.6132425", "0.6132425", "0.6132425", "0.6132425", "0.61248904", "0.61248904", "0.6120491", "0.6107903", "0.61003846", "0.60967404", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.60942286", "0.6084234", "0.60834754", "0.60834754", "0.60834754", "0.6072067", "0.60441536", "0.60441536", "0.60058254", "0.60058254", "0.59942895", "0.59826285", "0.59810615", "0.5975643", "0.5968305", "0.59589183", "0.5953865", "0.59508264", "0.593056", "0.58951473", "0.5893734", "0.5893734", "0.5893734", "0.5893027", "0.5883027", "0.5862658", "0.5840291", "0.583063", "0.58132666", "0.5795097", "0.57763886", "0.5761858", "0.57551706", "0.57532513", "0.5744719", "0.57207406", "0.5703977", "0.5703977", "0.5703767", "0.5672658", "0.5664675", "0.566409", "0.566409", "0.566409", "0.5656923", "0.56548744", "0.56500065", "0.5647892", "0.563246", "0.56245506", "0.5612696", "0.5601591", "0.55670244", "0.55538976", "0.55538976", "0.55538976", "0.55526674", "0.5551386", "0.5550769", "0.5550516" ]
0.0
-1
this function checks if layers and layergroups are outside scalelimits. if a layer is outside scalelimits, its label in the TOC is being displayed in a light gray
function setGrayNameWhenOutsideScale() { if ( grayLayerNameWhenOutsideScale ) { //only if global boolean is set //layers //------ var allLayersWithIDs = new Array(); //iterate layer tree to get title and layer-id layerTree.root.firstChild.cascade( function (n) { if (n.isLeaf()) { allLayersWithIDs.push([n.text,n.id]); } } ); //iterate ProjectSettings for (var i=0;i<wmsLoader.projectSettings.capability.layers.length;i++){ MaxScale = Math.round(wmsLoader.projectSettings.capability.layers[i].maxScale); //if no MaxScale is defined if (MaxScale < 1){ MaxScale = 1; } MinScale = Math.round(wmsLoader.projectSettings.capability.layers[i].minScale); //if no MinScale is defined if (MinScale < 1){ //if not defined, this value is very small MinScale = 150000000; //within terrestrial dimensions big enough } //set content gray if (wmsLoader.projectSettings.capability.layers[i].maxScale > geoExtMap.map.getScale() || wmsLoader.projectSettings.capability.layers[i].minScale < geoExtMap.map.getScale()) { for (var j=0;j<allLayersWithIDs.length;j++){ //comparison layerTree and info from getProjectsettings if (allLayersWithIDs[j][0] == wmsLoader.projectSettings.capability.layers[i].title) { layerTree.root.findChild('id', allLayersWithIDs[j][1], true).setCls('outsidescale');//add css for outside scale strTOCTooltip = tooltipLayerTreeLayerOutsideScale[lang] + ' 1:' + MaxScale + ' - 1:' + MinScale layerTree.root.findChild('id', allLayersWithIDs[j][1], true).setTooltip(strTOCTooltip); layerTree.root.findChild('id', allLayersWithIDs[j][1], true).isOutsideScale = true; layerTree.root.findChild('id', allLayersWithIDs[j][1], true).MinScale = MinScale; layerTree.root.findChild('id', allLayersWithIDs[j][1], true).MaxScale = MaxScale; } } // reset gray } else { for (var j=0;j<allLayersWithIDs.length;j++){ if (allLayersWithIDs[j][0] == wmsLoader.projectSettings.capability.layers[i].title) { layerTree.root.findChild('id', allLayersWithIDs[j][1], true).setTooltip(''); //empty tooltip node = layerTree.root.findChild('id', allLayersWithIDs[j][1], true); //remove css class node.ui.removeClass('outsidescale'); //remove css class layerTree.root.findChild('id', allLayersWithIDs[j][1], true).isOutsideScale = false; layerTree.root.findChild('id', allLayersWithIDs[j][1], true).MinScale = MinScale; layerTree.root.findChild('id', allLayersWithIDs[j][1], true).MinScale = MaxScale; } } } } // layer-groups // ------------ var arrLayerGroups = new Array(); //array containing all layer-groups var arrOutsideScale = new Array(); //array with the state of all layers within the group var arrMaxScale = new Array(); //array with the defined max-scale of the group var arrMinScale = new Array(); //array with the defined min-scale of the group //iterate layer tree layerTree.root.firstChild.cascade( function (n) { if (!(n.isLeaf())) { layerTree.root.findChild('id', n.id, true).cascade( function (m) { // has to be a leaf and outside scale if (m.isLeaf()){ arrOutsideScale.push(m.isOutsideScale); arrMaxScale.push(m.MaxScale); arrMinScale.push(m.MinScale); } }); //arrLayerGroups: layer-id, layer-name, boolean if currently outside scale, maxscale, minscale arrLayerGroups.push([n.id, n.text, arrOutsideScale, arrMaxScale, arrMinScale]); } // empty arrays for next iteration arrOutsideScale = []; arrMaxScale = []; arrMinScale = []; }); //iterate all leaf layers within a group for (var i=0;i<arrLayerGroups.length;i++){ bolGroupOutsideScale = true; MinScale = 0; //set an extreme minscale MaxScale = 150000000; //set an extreme maxscale for (var j=0;j<arrLayerGroups[i][2].length;j++){ //in each iteration take the bigger minscale if (MinScale < arrLayerGroups[i][4][j]){ MinScale = arrLayerGroups[i][4][j]; } //in each iteration take the smallest maxscale if (MaxScale > arrLayerGroups[i][3][j]){ MaxScale = arrLayerGroups[i][3][j]; } //if one single leaf layer is visible, the group has as well to be visible if ( !arrLayerGroups[i][2][j] ){ //[2] = arrOutsideScale bolGroupOutsideScale = false; } } //the group is invisible if ( bolGroupOutsideScale ) { layerTree.root.findChild('id', arrLayerGroups[i][0], true).setCls('outsidescale'); // add css class strTOCTooltip = tooltipLayerTreeLayerOutsideScale[lang] + ' 1:' + MaxScale + ' - 1:' + MinScale layerTree.root.findChild('id', arrLayerGroups[i][0], true).setTooltip(strTOCTooltip); //the group is visible } else { node = layerTree.root.findChild('id', arrLayerGroups[i][0], true); //remove css class node.ui.removeClass('outsidescale'); //remove css class layerTree.root.findChild('id', arrLayerGroups[i][0], true).setTooltip(''); } } } if (enableWmtsBaseLayers) { updateScaleBasedWmtsLayersVisibility(geoExtMap.map.getScale()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function e(e,n,i){if(n.flatten((({sublayers:e})=>e)).length!==e.length)return!0;return!!e.some((e=>e.originIdOf(\"minScale\")>i||e.originIdOf(\"maxScale\")>i||e.originIdOf(\"renderer\")>i||e.originIdOf(\"labelingInfo\")>i||e.originIdOf(\"opacity\")>i||e.originIdOf(\"labelsVisible\")>i||e.originIdOf(\"source\")>i))||!r(e,n)}", "_visibilityOfLayerByZoom() {\n let mainLayer = this.get('mainLayer');\n if (Ember.isNone(mainLayer) || Ember.isNone(mainLayer._leafletObject)) {\n return;\n }\n\n if (!this._checkAndSetVisibility(mainLayer)) {\n mainLayer.get('innerLayers').forEach((layer) => {\n if (this._checkAndSetVisibility(layer)) {\n return;\n }\n });\n }\n }", "function isLayerVisible(layer) {\n var mapScale = Math.round(esri.geometry.getScale(layer._map)); \n var isWithinScaleRange;\n\n isWithinScaleRange = (layer.minScale > mapScale) && (layer.maxScale < mapScale);\n\n return isWithinScaleRange;\n}", "_zoomEndEvent(){\n\t\tlet zoom = this.map.getZoom();\n\n\t\tObject.keys(this.layers).forEach(layer => {\n\t\t\tlet el = this.layers[layer].options.pane;\n\n\t\t\tif(zoom >= 4){\n\t\t\t\tPrototypeElement.removeClassName(el, 'half');\n\t\t\t}\n\t\t\telse if(zoom < 4 && zoom >= 2){\n\t\t\t\tPrototypeElement.removeClassName(el, 'quarter');\n\t\t\t\tPrototypeElement.addClassName(el, 'half');\n\t\t\t}\n\t\t\telse if(zoom < 2 && zoom >= 1){\n\t\t\t\tPrototypeElement.removeClassName(el, 'half');\n\t\t\t\tPrototypeElement.removeClassName(el, 'invis');\n\t\t\t\tPrototypeElement.addClassName(el, 'quarter');\n\t\t\t}\n\t\t\telse if(zoom < 1){\n\t\t\t\tPrototypeElement.removeClassName(el, 'quarter');\n\t\t\t\tPrototypeElement.addClassName(el, 'invis');\n\t\t\t}\n\n\t\t\t// i hate this.\n\t\t\tif(['map_label', 'sector_label'].includes(layer)){\n\t\t\t\tObject.keys(el.children).forEach(c => {\n\t\t\t\t\tlet origin = window.getComputedStyle(el.children[c]).perspectiveOrigin.split(' ');\n\n\t\t\t\t\tel.children[c].style.left = '-'+origin[0];\n\t\t\t\t\tel.children[c].style.top = '-'+origin[1];\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t}", "beforeDatasetsDraw(chart) {\n if (!this._enabled(chart)) {\n return;\n }\n const scale = this._findScale(chart);\n const flat = chart.data.flatLabels;\n const visible = chart.data.labels;\n const roots = chart.data.rootNodes;\n const visibles = new Set(visible);\n const ctx = chart.ctx;\n const hor = scale.isHorizontal();\n\n const boxSize = scale.options.hierarchyBoxSize;\n const boxSize05 = boxSize * 0.5;\n const boxSize01 = boxSize * 0.1;\n const boxRow = scale.options.hierarchyBoxLineHeight;\n const boxColor = scale.options.hierarchyBoxColor;\n const boxWidth = scale.options.hierarchyBoxWidth;\n const boxSpanColor = scale.options.hierarchySpanColor;\n const boxSpanWidth = scale.options.hierarchySpanWidth;\n const renderLabel = scale.options.hierarchyLabelPosition;\n const groupLabelPosition = scale.options.hierarchyGroupLabelPosition;\n\n const scaleLabel = scale.options.scaleLabel;\n const scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, defaults.global.defaultFontColor);\n const scaleLabelFont = parseFontOptions(scaleLabel);\n\n ctx.save();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n ctx.fillStyle = scaleLabelFontColor; // render in correct color\n ctx.font = scaleLabelFont.font;\n\n const renderHorLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n // expand button\n ctx.strokeRect(node.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(node.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n ctx.fillRect(node.center - 1, offset + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles, groupLabelPosition);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n if (renderLabel === 'below') {\n ctx.fillText(node.label, groupLabelCenter, offset + boxSize);\n } else if (renderLabel === 'above') {\n ctx.fillText(node.label, groupLabelCenter, offset - boxSize);\n }\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(leftVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(leftVisible.center - boxSize05 + 2, offset + boxSize05 - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus button\n ctx.strokeRect(rightVisible.center - boxSize05, offset + 0, boxSize, boxSize);\n ctx.fillRect(rightVisible.center - 2, offset + boxSize05 - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(leftVisible.center + boxSize05, offset + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(leftVisible.center, offset + boxSize01);\n ctx.lineTo(leftVisible.center, offset + boxSize05);\n } else {\n // just a line\n ctx.moveTo(leftVisible.center, offset + boxSize05);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(rightVisible.center - boxSize05, offset + boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n ctx.lineTo(rightVisible.center, offset + boxSize01);\n } else {\n ctx.lineTo(rightVisible.center, offset + boxSize05);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n const renderVertLevel = (node) => {\n if (node.children.length === 0) {\n return false;\n }\n const offset = node.level * boxRow * -1;\n\n if (!node.expand) {\n if (visibles.has(node)) {\n ctx.strokeRect(offset - boxSize, node.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, node.center - 1, boxSize - 4, 2);\n ctx.fillRect(offset - boxSize05 - 1, node.center - boxSize05 + 2, 2, boxSize - 4);\n }\n return false;\n }\n const r = spanLogic(node, flat, visibles);\n if (!r) {\n return false;\n }\n const {\n hasFocusBox,\n hasCollapseBox,\n leftVisible,\n rightVisible,\n leftFirstVisible,\n rightLastVisible,\n groupLabelCenter\n } = r;\n\n // render group label\n ctx.fillText(node.label, offset - boxSize, groupLabelCenter);\n\n if (hasCollapseBox) {\n // collapse button\n ctx.strokeRect(offset - boxSize, leftVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize + 2, leftVisible.center - 1, boxSize - 4, 2);\n }\n\n if (hasFocusBox) {\n // focus\n ctx.strokeRect(offset - boxSize, rightVisible.center - boxSize05, boxSize, boxSize);\n ctx.fillRect(offset - boxSize05 - 2, rightVisible.center - 2, 4, 4);\n }\n\n if (leftVisible !== rightVisible) {\n // helper span line\n ctx.strokeStyle = boxSpanColor;\n ctx.lineWidth = boxSpanWidth;\n ctx.beginPath();\n if (hasCollapseBox) {\n // stitch to box\n ctx.moveTo(offset - boxSize05, leftVisible.center + boxSize05);\n } else if (leftFirstVisible) {\n // add starting group hint\n ctx.moveTo(offset - boxSize01, leftVisible.center);\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n } else {\n // just a line\n ctx.lineTo(offset - boxSize05, leftVisible.center);\n }\n\n if (hasFocusBox) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n } else if (rightLastVisible) {\n ctx.lineTo(offset - boxSize05, rightVisible.center - boxSize05);\n ctx.lineTo(offset - boxSize01, rightVisible.center - boxSize05);\n } else {\n ctx.lineTo(offset - boxSize05, rightVisible.center);\n }\n ctx.stroke();\n ctx.strokeStyle = boxColor;\n ctx.lineWidth = boxWidth;\n }\n\n return true;\n };\n\n if (hor) {\n ctx.textAlign = 'center';\n ctx.textBaseline = renderLabel === 'above' ? 'bottom' : 'top';\n ctx.translate(scale.left, scale.top + scale.options.padding);\n roots.forEach((n) => preOrderTraversal(n, renderHorLevel));\n } else {\n ctx.textAlign = 'right';\n ctx.textBaseline = 'center';\n ctx.translate(scale.left - scale.options.padding, scale.top);\n\n roots.forEach((n) => preOrderTraversal(n, renderVertLevel));\n }\n\n ctx.restore();\n }", "function o(e,r){return !e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "function o(e,r){return!e.visible||0!==e.minScale&&r>e.minScale||0!==e.maxScale&&r<e.maxScale}", "applyLayoutVisibility() {\n const { visible } = this;\n const { mbMap } = this.mapboxLayer;\n\n if (!mbMap) {\n return;\n }\n\n const style = mbMap.getStyle();\n\n if (!style) {\n return;\n }\n\n if (this.styleLayersFilter) {\n const visibilityValue = visible ? 'visible' : 'none';\n for (let i = 0; i < style.layers.length; i += 1) {\n const styleLayer = style.layers[i];\n if (this.styleLayersFilter(styleLayer)) {\n if (mbMap.getLayer(styleLayer.id)) {\n mbMap.setLayoutProperty(\n styleLayer.id,\n 'visibility',\n visibilityValue,\n );\n }\n }\n }\n }\n }", "function checkLayers() {\n if (recentGroup.hasLayer() != true) {\n recentPop();\n } else clearRecents();\n }", "onChangeVisible() {\n const { mbMap } = this.mapboxLayer;\n if (!mbMap) {\n return;\n }\n const currentLayer = this.getCurrentLayer();\n const filterRegex = new RegExp(`^ipv_(${currentLayer})$`);\n this.getDvLayers()?.forEach((stylelayer) => {\n mbMap.setLayoutProperty(\n stylelayer.id,\n 'visibility',\n filterRegex.test(getTrafimageFilter(stylelayer)) ? 'visible' : 'none',\n );\n });\n }", "function checkLabels(theDoc) {\n\tvar labels = theDoc.layers.itemByName(layerName).textFrames;\n\tcheckForDuplicate(labels);\n\t\tfor (var i = 0; i < labels.length; i++){\n \t\t\tvar theLabel = labels[i];\n \t\t checkLabelOverlap(theLabel);\n \t\t\tcheckBounds(theLabel);\n\t\t\tcheckLabelOverlap(theLabel);\n \t\t};\n}", "function clickOutsideBounds(e) {\n if (status() === 2 /* Preview */ && !$element.is(e.target) && $element.has(e.target).length === 0) {\n status(1 /* Collapsed */);\n }\n }", "function hideLayerTitles() {\n svg.selectAll('.Layer').remove();\n }", "function checkBounds(theLabel) {\n\t var fixedBounds = theLabel.geometricBounds;\n\t var theDoc = app.documents[0];\n\t //Maybe check to see if parentPage + 1 has the same bounds? Checks both the length and the value at once.\n\t if (theDoc.pages.length > 1) {\n\t\tvar pageBounds = [theDoc.pages[0].bounds[0], theDoc.pages[0].bounds[1], theDoc.pages[1].bounds[2], theDoc.pages[1].bounds[3] ];}\n\t else {\n\t \tvar pageBounds = theDoc.pages[0].bounds;\n\t }\n\t if (fixedBounds[0] < pageBounds[0]){\n\t \tfixedBounds[2] = fixedBounds[2] + Math.abs((pageBounds[0] - fixedBounds[0]));\n\t \tfixedBounds[0] = pageBounds[0];\n\t };\n\t if (fixedBounds[2] > pageBounds[2]){\n\t \tfixedBounds[0] = fixedBounds[0] - (pageBounds[2] - fixedBounds[2]);\n\t \tfixedBounds[2] = pageBounds[2];\n\t };\n\t if (fixedBounds[1] < pageBounds[1]) {\n\t \tfixedBounds[3] = fixedBounds[3] + Math.abs((fixedBounds[1] - pageBounds[1]));\n\t \tfixedBounds[1] = pageBounds[1];\n\t };\n\t if (fixedBounds[3] > pageBounds[3]) {\n\t \tfixedBounds[1] = fixedBounds[1] - (fixedBounds[3] - pageBounds[3]);\n\t \tfixedBounds[3] = pageBounds[3];\n\t };\n\t \ttheLabel.geometricBounds = fixedBounds;\n}", "checkZoomLevel() {\n\t\tlet newBounds = this.searchRadius ? this.searchRadius.getBounds() : new google.maps.LatLngBounds();\n\t\tthis.markers.forEach( m => { newBounds.extend( m.marker.getPosition() ) } );\n\t\tthis.map.fitBounds( newBounds );\n\t\tif( this.map.getZoom() > locsearch.map_attributes.max_zoom ) {\n\t\t\tthis.map.setZoom( locsearch.map_attributes.max_zoom );\n\t\t}\n\t}", "function checkFlattenGroups() {\n flattenGroups = !flattenGroups;\n\n checkGroupsSidebar();\n getAllGroups();\n}", "function setThresholdClipAttributes() {\n \n var yMinMax = yScale.domain();\n var min = yMinMax[0];\n var max = yMinMax[1];\n if (typeof min == undefined|| typeof max == undefined) {\n // min/max is not set because there is no data for plottype\n return;\n }\n \n svg.select(\"#clip-good\").select(\"rect\")\n .transition().duration(DURATION)\n .attr(\"y\", function(d) { \n var y = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n // Bottom of plot\n y = yScale(scope.thresholddata.marginalData[scope.plottype]);\n }\n else {\n // Top of plot\n y = yScale(max); \n }\n return y; }) \n .attr(\"width\", WIDTH)\n .attr(\"height\", function(d) { \n var height = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n height = yScale(min) - yScale(scope.thresholddata.marginalData[scope.plottype]);\n }\n else {\n // Top of plot\n height = yScale(scope.thresholddata.marginalData[scope.plottype]) - yScale(max);\n }\n return height; });\n \n svg.select(\"#clip-marginal\").select(\"rect\")\n .transition().duration(DURATION)\n .attr(\"y\", function(d) { \n var y = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n y = yScale(scope.thresholddata.severeData[scope.plottype]);\n }\n else {\n y = yScale(scope.thresholddata.marginalData[scope.plottype]);\n }\n return y;})\n .attr(\"width\", WIDTH)\n .attr(\"height\", Math.abs(yScale(scope.thresholddata.severeData[scope.plottype]) - yScale(scope.thresholddata.marginalData[scope.plottype])));\n\n svg.select(\"#clip-severe\").select(\"rect\")\n .transition().duration(DURATION)\n .attr(\"y\", function(d) { \n var y = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n // Top of plot\n y = yScale(max); \n }\n else {\n y = yScale(scope.thresholddata.severeData[scope.plottype]);\n }\n return y;})\n .attr(\"width\", WIDTH)\n .attr(\"height\", function(d) { \n var height = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n height = yScale(scope.thresholddata.severeData[scope.plottype]) - yScale(max);\n }\n else {\n // Bottom of plot\n height = yScale(min) - yScale(scope.thresholddata.severeData[scope.plottype]);\n }\n return height; });\n \n }", "function griddZoomCheck() {\n\tlet zoomddIn = document.getElementById('zoomdd-in');\n\tlet zoomddOut = document.getElementById('zoomdd-out');\n\tif (zoomGridd > 175) {\n\t\tzoomddIn.innerHTML = 'max';\n\t} else if (zoomGridd < 75) {\n\t\tzoomddOut.innerHTML = 'min';\n\t} else {\n\t\tzoomddIn.innerHTML = '+';\n\t\tzoomddOut.innerHTML = '-';\n\t};\n}", "function getMapLevelByScale(map, mapScale) {\nvar nearLODs = dojo.filter(map.__tileInfo.lods, function (lod) {\n return (parseInt(lod.scale, 10) <= parseInt(mapScale, 10));\n});\nif (nearLODs.length > 0) {\n return nearLODs[0].level;\n} else {\n return null;\n}\n}", "function zoom_actions() {\r\n\r\n var transform = d3.event.transform;\r\n g.attr(\"transform\", transform.toString())\r\n d3.selectAll('.node-text')\r\n .style('font-size', d => font_size(d.freq) / transform.k)\r\n .style(\"stroke-width\", function (d) { return font_size(d.freq)*.015/transform.k;})\r\n\r\n .style('opacity', d => {\r\n return font_size(d.freq) * transform.k < 18 ? 0 : 1;\r\n })\r\n /* svg.selectAll(\".legend\")\r\n .attr(\"transform\",transform.toString())*/\r\n\r\n\r\n\r\n if (transform.k < 1.5) {\r\n }\r\n else {\r\n var hull = d3.selectAll('.edgelabel')\r\n hull.attr(\"visibility\", \"visible\")\r\n\r\n }\r\n\r\n\r\n }", "function vizToggleCleanup(){\n setRangeSliderThumbOpacity();\n layerObj[id].visible = layer.visible;\n layerObj[id].opacity = layer.opacity;\n }", "function isWithinSafeBounds(){\n const value = parseFloat(\"0.\" + String( $( window ).width() / $(\".result-container:first\").outerWidth(true) ).split(\".\")[1])\n if( (0.3 < value && value < 0.7) ) { return true; }\n else { return false; }\n }", "function zoom_actions() {\r\n\r\n var transform = d3.event.transform;\r\n g.attr(\"transform\", transform.toString())\r\n d3.selectAll('.zoomed-node-text')\r\n .style('font-size', d => font_size(d.freq) / transform.k)\r\n .style(\"stroke-width\", function (d) { return font_size(d.freq) * .015 / transform.k; })\r\n .style('opacity', d => {\r\n return font_size(d.freq) * transform.k < 18 ? 0 : 1;\r\n })\r\n\r\n \r\n\r\n if (transform.k < 1.5) {\r\n }\r\n else {\r\n var hull = d3.selectAll('.edgelabel_d')\r\n hull.attr(\"visibility\", \"visible\")\r\n\r\n }\r\n\r\n\r\n }", "_setLayerVisibility() {\n let layerVisibility = this.get('layerVisibility');\n if (this.get('visibility')) {\n this._visibilityOfLayerByZoom();\n } else if (!Ember.isNone(layerVisibility)) {\n layerVisibility.set('visibility', false);\n this.set('layerVisibility', null);\n }\n }", "function clean_cut(_layer_, pr_second_side_bool) {\n if (there_is_at_least_one_cut) {\n var bounds, www, hhh;\n var parsed_offset = parseFloat(offset);\n for (var j = 0; j < configuration_object[i].sides.length; j++) {\n var t_obj = configuration_object[i].sides[j];\n if (t_obj.type == finishings[0]) { // is 'cut | dociecie'\n app.activeDocument.activeLayer = _layer_;\n switch (t_obj.side) {\n case \"top\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www, hhh + parsed_offset,\n AnchorPosition.BOTTOMCENTER);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.BOTTOMCENTER, 'VERTICAL');\n }\n break;\n case \"left\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www + parsed_offset, hhh,\n AnchorPosition.MIDDLERIGHT);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.MIDDLELEFT, 'HORIZONTAL');\n }\n break;\n case \"right\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www + parsed_offset, hhh,\n AnchorPosition.MIDDLELEFT);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.MIDDLERIGHT, 'HORIZONTAL');\n }\n break;\n case \"bottom\":\n bounds = app.activeDocument.activeLayer.bounds;\n www = bounds[2].value - bounds[0].value;\n hhh = bounds[3].value - bounds[1].value;\n resize_layer(app.activeDocument.activeLayer, www, hhh + parsed_offset,\n AnchorPosition.TOPCENTER);\n if (pr_second_side_bool) {\n sec_side_resize(AnchorPosition.TOPCENTER, 'VERTICAL');\n }\n break;\n }\n }\n }\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 updateVisibleBounds(newBounds, resetMarkers, zoomLevel, resetSearch) {\n if (newBounds == null) {\n map.zoomToExtent(calculateInitialBounds(kiezatlas.mapTopics).transform(map.displayProjection, map.projection));\n // map.zoomTo(11);\n } else {\n // map.zoomToExtent(newBounds.transform(map.displayProjection, map.projection));\n map.panTo(newBounds.getCenterLonLat());\n map.zoomTo(zoomLevel);\n }\n // render all markers as \"delete\" and deselect all categories\n if (resetMarkers == true) {\n reSetMarkers();\n }\n // reset the sidebar to the latest critIndex\n if (resetSearch) updateCategoryList(crtCritIndex);\n }", "function shiftGeo(){\n if(isLimitPolygon){ //if geografical LIMIT criteria is on\n document.getElementById(\"layerComponents\").style.display = \"\";\n document.getElementById(\"layerLimitComponents\").style.display = \"none\";\n isLimitPolygon = false;\n }\n else{ //if geografical LIMIT criteria is off\n document.getElementById(\"layerComponents\").style.display = \"none\";\n document.getElementById(\"layerLimitComponents\").style.display = \"\";\n isLimitPolygon = true;\n }\n}", "function snapOut(focus) {\n var keys = Object.keys(visibles);\n if (keys.length > 2 || keys.length < 1) throw \"PLOT: expected 1-2 layers\";\n\n if (Math.abs(10000 - visibles[Object.keys(visibles)[0]].scale.x) > 4) {\n this.zoom(focus, 5);\n return false;\n } else {\n for (var key in visibles) {\n visibles[key].scale.x = 10000;\n }\n return true;\n }\n }", "function Visibility(layer){\n if (layer.id == \"vision_pipe\"){\n //For default layer pipeline\n if (layer.checked){\n pipeline.setVisible(true);\n return;\n }else{\n pipeline.setVisible(false);\n return;\n }\n }\n if (layer.id == \"vision_comm\"){\n //For default layer comments\n if (layer.checked){\n comments.setVisible(true);\n return;\n }else{\n comments.setVisible(false);\n return;\n }\n }\n //Get number of the layer to hide or show\n var num = layer.id.slice(15,16);\n if (layer.id.length>16){\n //In case num has 2 digit\n num = layer.id.slice(15,17);\n }\n if (layer.checked){\n customLayers[num].setVisible(true);\n }else{\n customLayers[num].setVisible(false);\n }\n}", "function calculateOpacity(scale) {\n var xScale = scale.x;\n if (xScale < scaleRangeInWhichHigherZoomLayerIsTransparent[1]) {\n // layer with higher zoom level (on top in current html)\n return mapValueOntoRange(xScale, scaleRangeInWhichHigherZoomLayerIsTransparent, [.2, 1]);\n } else if (xScale > scaleRangeInWhichLowerZoomLayerIsTransparent[0]) {\n // layer with lower zoom level (below in current html)\n return mapValueOntoRange(xScale, scaleRangeInWhichLowerZoomLayerIsTransparent, [1, .2]);\n } else {\n return 1;\n }\n }", "hideLower() {\n const filteredTiles = this._filterForLower();\n if (!filteredTiles || !filteredTiles.length) {\n this._error(`No islands found buying for below ${this.minimumBells}.`);\n return;\n }\n\n filteredTiles.forEach((tag) => {\n const parent = tag.parentElement.parentElement.parentElement;\n if (parent) parent.setAttribute('style', 'display: none;'); \n });\n this._info(`Hidden islands lower than ${this.minimumBells}.`);\n }", "function reflectBinSizeColorOnLegend() {\n\tif(viewerVars.userFixedBinSize) {\n\t\t$(\".xtitle\").addClass(\"fixedBinSize\");\n\t} else {\n\t\t$(\".xtitle\").removeClass(\"fixedBinSize\");\n\t}\n}", "function lineLabelsVisible() {\n return axesDef.y1.length > 1 &&\n (axesDef.y1.length < 15 || chart.hasHighlight()) &&\n c.w >= theme.minWidth;\n }", "function setLayerVisibilityFalse(myDoc,name,progressWindow){\n\tmyLayer = myDoc.layers.item(name);\n\tif(myLayer.isValid){\n\t\tmyLayer.visible = false;\n\t\tprogressWindow.processStatus.text += \"Layer \" + name + \" visibility set to false\\r\\n\";\n\t\treturn 1;\n\t} else {\n\t\talert(\"Set Layer Visibility FALSE Error\\nNo layer named \" + name + \" was found.\");\n\t\treturn 0;\n\t}\n}", "function can_visualize() {\n return inputObject.network_archeticture.length > 0 && inputObject.dataset.length > 0\n && (inputObject.horizontal.length > 0 || inputObject.vertical.length > 0)\n && inputObject.depth.length > 0 && inputObject.width.length > 0;\n}", "function checkMinMaxValues(that){\n //make the values move\n if(that._prvt.currentMax === that._prvt.currentMin){\n //make the items hidden\n that._prvt.maxLabel.hide();\n that._prvt.handleMin.hide();\n }else{\n that._prvt.maxLabel.show();\n that._prvt.handleMin.show();\n }\n }", "function scaleClip(model) {\n var xScale = model.getScaleComponent('x');\n var yScale = model.getScaleComponent('y');\n return xScale && xScale.get('selectionExtent') || yScale && yScale.get('selectionExtent') ? true : undefined;\n }", "_calculateBounds() {\n // FILL IN//\n }", "label() {\n if(this.props.columnType === Constants.getIn(['columnTypes', 'SIDEBAR'])) {\n return null\n }\n\n let labelLines = this.labelLines()\n\n // Clip long names, and append an ellipsis\n if (labelLines.length > 3) {\n labelLines = [labelLines[0], labelLines[1], labelLines[2]]\n labelLines[2] += '…'\n }\n\n const labelLengthExceed = labelLines.length * Constants.get('singleLineCategoryLabelHeight') > this.props.height\n\n let labelClassName = 'inactiveCategoryLabels'\n\n if(labelLengthExceed === true && this.checkHoverState() === false && this.filterboxActive() === false) {\n return null\n }\n\n if(this.checkHoverState() === true) {\n labelClassName = 'activeCategoryLabels'\n }\n\n let currentY = (this.props.height/2)\n let lineCount = 0\n currentY += (1 - (labelLines.length/2)) * \n Constants.get('singleLineCategoryLabelHeight')\n\n // Decrement just before it's increcemented inside the map.\n currentY -= Constants.get('singleLineCategoryLabelHeight')\n\n return <g>\n <text\n >\n {labelLines.map((line) => {\n currentY += Constants.get('singleLineCategoryLabelHeight')\n lineCount += 1\n return <tspan fill={this.fill} className={labelClassName} \n key={this.props.categoryName + 'CategoryLabelLine' + lineCount}\n y={currentY}\n x={this.props.width + Constants.get('categoryLabelOffset')}>\n {line}\n </tspan>\n })}\n </text>\n { this.filterbox(currentY) }\n </g>\n }", "function testLimits() {\n // var bg;\n now = new Date();\n\n // console.log(`testlimits high=${BGHigh}`);\n if ((bgHigher(BGHigh) && now.getTime() >= BGHighSnooze)||\n (bgLower(BGLow) && now.getTime() >= BGLowSnooze) ||\n (bgHigher(BGUrgentHigh) && now.getTime() >= BGUrgentHighSnooze) ||\n (bgLower(BGUrgentLow) && now.getTime() >= BGUrgentLowSnooze)) {\n return (warnBG());\n } else {\n // dismissBG();\n if (BGgraphButton.style.display == \"inline\") {\n dismissBG();\n }\n if (snoozeBGTimes.style.display == \"inline\") {\n snoozeBGTimes.style.display = \"none\";\n }\n // if (graphWindow.style.display == \"inline\" && graphReturn == warnBG) {\n // dismissGraph();\n // }\n return 0;\n }\n}", "function dhtml_hideLayer(name, displayNone) {\t\t\r\n var layer = dhtml_getLayerStyle(name);\r\n if (layer) {\r\n if (document.layers) {\r\n layer.visibility = \"hide\";\r\n } else {\r\n layer.visibility = \"hidden\";\r\n }\r\n if (displayNone) {\r\n layer.display = 'none';\r\n }\r\n }\r\n}", "checkMaximized () {\n if (this.shadowRoot.getElementById('canvas').hasChildNodes()) {\n for (let i = 0; i < this.shadowRoot.getElementById('canvas').children.length; i++) {\n if (this.shadowRoot.getElementById('canvas').children[i].isMaximized) {\n return true\n }\n }\n return false\n }\n }", "function upScaleLabel(i){\n\tvar currentScale = $(\"#size_group_\" + i).attr(\"size_scale\");\n\tvar currentX = $(\"#size_group_\" + i).attr(\"translate_x\");\n\tvar currentY = $(\"#size_group_\" + i).attr(\"translate_y\");\n\t\n\tvar newScale = parseFloat(currentScale) + filterScale;\n\tvar newX = parseFloat(currentX) - filterTransformX;\n\tvar newY = parseFloat(currentY) - filterTransformY;\n\tif(parseFloat(newScale).toFixed(3) > parseFloat(minimumSize).toFixed(3)){\n\t\tnewTransform = \"translate(\" + newX + \" \" + newY + \") scale(\" + newScale + \")\";\n\t\t$(\"#size_group_\" + i).attr(\"translate_x\", newX);\n\t\t$(\"#size_group_\" + i).attr(\"translate_y\", newY);\n\t}\n\telse{\n\t\tnewTransform = \"translate(\" + currentX + \" \" + currentY + \") scale(\" + minimumSize + \")\";\n\t}\t\t\n\t$(\"#size_group_\" + i).attr(\"transform\", newTransform);\n\t$(\"#size_group_\" + i).attr(\"size_scale\", newScale);\n}", "createVisualBoundaries() {\n this.groups.forEach(item => {\n if (item.id != ID_GROUP_TOTAL) {\n this.items.add({\n group: item.id,\n start: item.end,\n end: item.end,\n type: \"background\"\n });\n }\n });\n }", "warning () { return this._ignEllipse.backDist() < this.bounds().xSpacing() }", "hide_labels() {\n let labels;\n return labels = this.vis.selectAll(\".top_labels\").remove();\n }", "function hideLayers(evt) {\n dialogLayer.style.display = \"none\";\n maskLayer.style.display = \"none\";\n }", "function validateLayer( __layer )\n{\n\tif ( ( __layer.kind == LayerKind.NORMAL ) &&\n\t\t\t ( __layer.typename == \"ArtLayer\" ) &&\n\t\t\t ( __layer.visible == true) ) {\n\t\t\t\t\treturn true;\n\t}\n\treturn false;\n}", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "function ZoomToLayersExtent() {\n\t// Create the bounding box with the max bounds\n\tvar maxBoundsBox = new OpenLayers.Bounds(maxLeftB, maxBottomB, maxRightB, maxTopB);\n\t// Zoom to the max bounds\n\tmap.zoomToExtent(maxBoundsBox);\n\t//console.log(maxLeftB + \", \" + maxBottomB + \", \" + maxRightB + \", \" + maxTopB);\n}", "function checkCircleAgainstAllFilters() {\n d3.selectAll('circle')\n .classed('hide', function(d) {\n var isHide = false;\n for (var dimension in filterCollection) {\n var checkingDomain = filterCollection[dimension].domain\n // once one dimension doesn't match the selection, we hide it\n if (typeof(checkingDomain[0]) === 'number' && isOutsideNumberDomain(d, dimension)) {\n getLegendCounts(d)\n return true;\n } else if (typeof(checkingDomain[0]) === 'string' && isOutsideStringDomain(d, dimension)) {\n getLegendCounts(d)\n return true;\n }\n }\n updateSensitivityCount(d, true);\n return isHide;\n })\n}", "function setNewPointLayerStyle(Layer, analysis_params){\n max_min = getMaxMin(Layer, analysis_params.energy, analysis_params.moisture, analysis_params.content, analysis_params.potential, analysis_params.year);\n max = max_min[0]\n min = max_min[1]\n var rs = d3.scaleLinear()\n .domain([0, max])\n .range([2,7]);\n\n Layer.setStyle(function(feature) {\n type = feature.getProperty(\"Type\");\n // As thermochemical facilities do not have a tag but are listed as dry we need to do the step below\n if (analysis_params.energy == '_dry'){\n moisture = '_dry'\n }\n else{\n moisture = analysis_params.moisture\n }\n if (type == 'crop'){\n if (moisture == ''){\n res_val = getTotalBiomass(feature, analysis_params.energy, '_dry', analysis_params.content, analysis_params.potential, analysis_params.year);\n cull_val = getTotalBiomass(feature, analysis_params.energy, '_wet', analysis_params.content, analysis_params.potential, analysis_params.year);\n size = rs(res_val+cull_val)\n if (res_val == 0 && cull_val == 0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n else{\n biomass_val = getTotalBiomass(feature, analysis_params.energy, analysis_params.moisture, analysis_params.content, analysis_params.potential, analysis_params.year);\n size = rs(biomass_val)\n if (biomass_val == 0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n }\n else{\n biomass_val = getTotalBiomass(feature, analysis_params.energy, analysis_params.moisture, analysis_params.content, analysis_params.potential, analysis_params.year);\n size = rs(biomass_val)\n if (biomass_val == 0){\n opacity = 0\n }\n else{\n opacity = 1\n }\n }\n if (size>7){\n size=7\n }\n return ({cursor: 'pointer',\n icon: { \n path: google.maps.SymbolPath.CIRCLE,\n strokeWeight: 0.5,\n strokeColor: 'black',\n strokeOpacity: opacity,\n scale: size,\n fillColor: 'red',\n fillOpacity: opacity,\n }\n })\n });\n}", "limity() { return (this.scale - 1) * this.sizey / 2; }", "drawlabels() {\n \n if (this.internal.volume===null)\n return;\n \n var context=this.internal.layoutcontroller.context;\n var dw=context.canvas.width;\n var dh=context.canvas.height;\n context.clearRect(Math.floor(this.cleararea[0]*dw),0,Math.floor(this.cleararea[1]*dw),dh);\n let cdim=$(context.canvas).css(['width','height','left','top' ]);\n \n // Add R&L s\n var labels = [ [ 'A','P', 'S','I' ] ,\n [ 'R','L', 'S','I' ] ,\n [ 'R','L', 'A','P' ] ];\n var names = [ 'Sagittal','Coronal','Axial'];\n var axes = [ '-jk','-ik','-ij' ];\n \n var fnsize=0;\n if (this.internal.simplemode)\n fnsize=Math.round(2*webutil.getfontsize(context.canvas)/3);\n else\n fnsize=Math.round(webutil.getfontsize(context.canvas)*this.cleararea[1]);\n\n context.font=fnsize+\"px Arial\";\n\n if (this.internal.simplemode)\n context.fillStyle = \"#884400\";\n else\n context.fillStyle = \"#cc6600\";\n\n\n let arrowsize=this.createarrowbuttons($(context.canvas).parent().parent(),fnsize);\n this.createmidline(context.canvas,dw,dh);\n\n if (this.internal.showdecorations===false) {\n this.hidearrowbuttons();\n return;\n }\n \n var invorientaxis = this.internal.volume.getOrientation().invaxis;\n var orientaxis = this.internal.volume.getOrientation().axis;\n let maxpl=2;\n if (this.internal.subviewers[3])\n maxpl=3;\n\n \n for (var pl=0;pl<=maxpl;pl++) {\n var trueplane=invorientaxis[pl];\n var lab=labels[trueplane];\n var vp =this.internal.subviewers[pl].getNormViewport();\n \n //console.log('Lab=',lab,(vp.x1-vp.x0)*dw,this.minLabelWidth);\n \n if ((vp.x1-vp.x0)*dw>this.minLabelWidth) {\n if (pl<=2) {\n \n let dx=0.25*vp.shiftx*dw;\n if (dx>120)\n dx=120;\n \n let dy=0.25*vp.shifty*dh;\n if (dy>50)\n dy=50;\n \n let xshift=[ -(2+dx),dx-(arrowsize+1)];\n let xshift0=[-(2+dx),(dx+2)];\n \n let ymid=Math.round( dh*(1.0-0.5*(vp.y0+vp.y1))+6);\n let xmin=vp.x0*dw+xshift0[0];\n if (xmin<2)\n xmin=2;\n let xmax=vp.x1*dw+xshift0[1];\n if (xmax>(dw-2))\n xmax=dw-2;\n \n context.textBaseline=\"middle\";\n context.textAlign=\"start\"; context.fillText(lab[0],xmin,ymid);\n context.textAlign=\"end\"; context.fillText(lab[1],xmax,ymid);\n \n let xmid=Math.round( dw*0.5*(0.5*vp.x0+1.5*vp.x1)-6);\n let ymin=Math.round((1.0-vp.y1)*dh)-dy;\n if (ymin<(fnsize+2))\n ymin=(fnsize+2);\n let ymax=Math.round((1.0-vp.y0)*dh)+dy;\n if (ymax>0.9*dh)\n ymax=0.9*dh;\n \n if (!this.internal.simplemode) {\n context.textAlign=\"center\";\n context.textBaseline=\"top\";\n context.fillText(lab[2],xmid,ymin);\n context.textBaseline=\"alphabetic\";\n context.fillText(lab[3],xmid,ymax);\n } else {\n context.textBaseline=\"alphabetic\";\n }\n \n let name=names[trueplane]+axes[orientaxis[trueplane]];\n context.textAlign=\"start\";\n context.fillText(name,xmin,ymin);\n \n if (!this.internal.simplemode) {\n let wd=Math.round(parseInt(cdim['width']));\n let lf=Math.round(parseInt(cdim['left']));\n let left=this.internal.layoutcontroller.getviewerleft();\n let l= [ Math.round(vp.x0*wd+lf+xshift[0]+left),\n Math.round(vp.x1*wd+lf+xshift[1])+left];\n if (l[0]<0)\n l[0]=0;\n \n \n \n let h=Math.round((1-(0.75*vp.y1+0.25*vp.y0))*parseInt(cdim['height']))+parseInt(cdim['top']);\n \n for (let k=0;k<=1;k++) {\n this.internal.arrowbuttons[pl*2+k].css({ 'left' : `${l[k]}px`,\n 'top' : `${h}px`,\n 'visibility' : 'visible'});\n }\n }\n }\n if (!this.internal.layoutcontroller.isCanvasDark())\n context.strokeStyle = \"#dddddd\";\n else\n context.strokeStyle = \"#222222\";\n \n \n \n context.lineWidth=1;\n context.beginPath();\n \n if (pl===3)\n vp=this.internal.subviewers[pl].getNormViewport().old;\n \n \n context.moveTo(vp.x0*dw,(1-vp.y0)*dh);\n context.lineTo(vp.x0*dw,(1-vp.y1)*dh);\n context.lineTo(vp.x1*dw,(1-vp.y1)*dh);\n context.lineTo(vp.x1*dw,(1-vp.y0)*dh);\n context.lineTo(vp.x0*dw,(1-vp.y0)*dh);\n context.stroke();\n } else if (pl<3) {\n for (let ia=0;ia<=1;ia++)\n if (this.internal.arrowbuttons[pl*2+ia])\n this.internal.arrowbuttons[pl*2+ia].css({'visibility':'hidden'});\n }\n }\n \n\n\n // Movie Stuff\n if (!this.internal.simplemode) {\n\n //console.log(\"Checking on arrows\",this.internal.maxnumframes);\n if (this.internal.maxnumframes<2 || dw<500) {\n \n for (let ia=6;ia<=11;ia++)\n if (this.internal.arrowbuttons[ia])\n this.internal.arrowbuttons[ia].css({'visibility':'hidden'});\n \n } else {\n \n let lh=this.internal.layoutcontroller.getviewerheight();\n let left=this.internal.layoutcontroller.getviewerleft();\n let y0=0.92*lh+parseInt(cdim['top']);\n for (let k=0;k<=5;k++) {\n let extra=0;\n if (k>3)\n extra=20;\n this.internal.arrowbuttons[6+k].css({ 'left' : `${50+40*k+left+extra}px`,\n 'top' : `${y0}px`,\n 'visibility' : 'visible'});\n }\n }\n }\n \n }", "function _updateLayers() {\n for(var i in map._layers) {\n\tif(map._layers[i]._latlng) {\n\t if(map._layers[i]._latlng.level) {\n\t if(map._layers[i]._latlng.level == map.getLevel()) {\n\t if(map._layers[i].setOpacity) {\n\t map._layers[i].setOpacity(1);\n\t } else if(map._layers[i]._container) {\n\t $(map._layers[i]._container).show();\n\t }\n } else {\n\t if(map._layers[i].setOpacity) {\n\t map._layers[i].setOpacity(0);\n\t } else if(map._layers[i]._container) {\n\t $(map._layers[i]._container).hide();\n\t }\n\t }\n\t }\n\t}\n }\n }", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var fixMin = min != null;\n var fixMax = max != null;\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return [min, max];\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var fixMin = min != null;\n var fixMax = max != null;\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return [min, max];\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var fixMin = min != null;\n var fixMax = max != null;\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return [min, max];\n}", "function grid(scaleType, fieldDef) {\n return !scale_1.hasDiscreteDomain(scaleType) && !fieldDef.bin;\n}", "function displayCheck(face) {\n //if in bounds\n if (!inBounds(face.x,face.y)) {\n return false;\n }\n\n return true;\n\n }", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n var fixMin = min != null;\n var fixMax = max != null;\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: fixMin,\n fixMax: fixMax\n };\n}", "function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\n } // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n var fixMin = min != null;\n var fixMax = max != null;\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: fixMin,\n fixMax: fixMax\n };\n}", "function toggleScalebarObject(){\n //Si le style cliquer est celui qui est deplie\n //alert(classe+\" \"+style+\" \"+mapFile.currentStyle);\n \n if(mapFile.scalebarObject.expand){\n mapFile.scalebarObject.expand=false;\n mapFile.scalebarObject.clearGUI();\n $(mapFile.scalebarObject.id+'_attr').style.display=\"none\";\n }else{\n mapFile.scalebarObject.expand=true;\n $(mapFile.scalebarObject.id+'_attr').style.display=\"block\";\n mapFile.scalebarObject.initGUI();\n }\n}", "function zoomTo(_layer) {\n var map_crs = map.spatialReference;\n var layExtent, extent;\n\n\n if (_layer.fullExtent) {\n var lay_crs = _layer.fullExtent.spatialReference;\n\n if (sameCRS(map_crs, lay_crs)) {\n console.log(\"same CRS\");\n console.log(\"fullExtent\");\n\n if ( typeof map_crs.wkid === \"string\" || typeof lay_crs.wkid === \"number\") {\n console.log(\"arcgis BUG\");\n //console.log(_layer);\n lay_crs.wkid = lay_crs.wkid.toString();\n layExtent = _layer.fullExtent;\n extent = new Extent(layExtent);\n map.setExtent(extent, !0);\n } else {\n //console.log(_layer);\n layExtent = _layer.fullExtent;\n extent = new Extent(layExtent);\n map.setExtent(extent, !0);\n }\n\n } else {\n console.log(\"different CRS\");\n console.log(_layer);\n ProjectExtent(_layer, _layer.fullExtent, map_crs);\n }\n } else if (_layer.declaredClass == \"esri.layers.KMLLayer\") {\n console.log(\"KML\");\n var _extent = getKmlExtent(_layer);\n var lay_crs = _extent.spatialReference;\n\n if (sameCRS(map_crs, lay_crs)) {\n console.log(\"same CRS\");\n console.log(\"fullExtent\");\n\n if ( typeof map_crs.wkid === \"string\" || typeof lay_crs.wkid === \"number\") {\n console.log(\"arcgis BUG\");\n console.log(_layer);\n lay_crs.wkid = lay_crs.wkid.toString();\n layExtent = _extent;\n extent = new Extent(layExtent);\n map.setExtent(extent, !0);\n } else {\n layExtent = _extent;\n extent = new Extent(layExtent);\n map.setExtent(extent, !0);\n }\n } else {\n console.log(\"different CRS\");\n ProjectExtent(_layer, _extent, map_crs);\n }\n\n } else {\n console.log(\"Layer Type not defined\");\n\n }\n\n //--------------------------------------------------\n\n function sameCRS(crs1, crs2) {\n var same;\n if (crs1.isWebMercator() == crs2.isWebMercator()) {\n same = true;\n } else if (crs1.wkid == crs2.wkid) {\n same = true;\n } else {\n same = false;\n }\n return same;\n }\n\n function getKmlExtent(layer) {\n var _ext;\n\n if (layer._fLayers) {\n\n for (var l in layer._fLayers) {\n _ext = layer._fLayers[l].fullExtent;\n console.log(_ext);\n console.log(layer._fLayers[l]._zoomConnect);\n }\n } else if (layer.getLayers()) {\n _layArr = layer.getLayers();\n for (var i in _layArr) {\n _lay = _layArr[i];\n\n if (_lay._fLayers) {\n for (var l in _lay._fLayers) {\n _ext = _lay._fLayers[l].fullExtent;\n console.log(_ext);\n }\n }\n }\n }\n return _ext;\n }\n\n }", "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"geomap\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />': mapnik,\r\n 'Mapquest open <img src=\"./lib/images/external.png\" />': mapquestopen,\r\n 'Mapquest aerial <img src=\"./lib/images/external.png\" />': mapquest\r\n }; \r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />': maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />': boundaries,\r\n 'Radwege <img src=\"./lib/images/external.png\" />': cycling\r\n };\r\n }\r\n \r\n else if (maptype == \"gpxmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"monmap\") {\r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik, \r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Denkmäler <img src=\"./lib/images/wv-logo-12.png\" />' : monuments\r\n };\r\n }\r\n\r\n else if (maptype == \"poimap2\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik,\r\n 'Mapnik s/w <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnikbw,\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapquest Aerial <img src=\"./lib/images/external.png\" />' : mapquest,\r\n 'Verkehrsliniennetz <img src=\"./lib/images/external.png\" />' : transport,\r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />' : maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />' : boundaries,\r\n 'Schummerung <img src=\"./lib/images/wmf-logo-12.png\" />' : hill,\r\n 'Radwege <img src=\"./lib/images/external.png\" />' : cycling,\r\n 'Wanderwege <img src=\"./lib/images/external.png\" />' : hiking,\r\n 'Sehenswürdigkeiten <img src=\"./lib/images/wv-logo-12.png\" />' : markers,\r\n 'Reiseziele <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles,\r\n 'GPX Spuren / Kartenmaske <img src=\"./lib/images/wv-logo-12.png\" />' : tracks\r\n };\r\n }\r\n}", "function uncheckedHandle(layerID) {\n\n\t/*$(\"#\" + layerID + \"-metadata\").off(\"click\");\n\t$(\"#\" + layerID + \"-legend\").off(\"click\");\n\t$('#' + layerID + \"-slider\").off(\"rangeslider\");\n\t$('#' + layerID + \"-checkbox\").off(\"change\");\n\t$(\"#\" + layerID + \"-slider\").off(\"input\"); //turn off the eventhandler*/\n\n\tdeletelegend = document.getElementById(\"legend-\" + layerID + \"-collapse\")\n\tdeletelegend.innerHTML = ''\n\n\t/*$(\"#\" + layerID + \"-listItem\").animate({\n\t\theight: \"0px\"\n\t}, 100, function () {\n\t\tdocument.getElementById(layerID + \"-listItem\").parentElement.remove();\n\t});*/\n\n\t//map.removeLayer(eval(layerID + \"Layer\"));\n\teval('map.removeLayer(' + layerID + 'Layer);')\n\n\n\tvar Sibling = getLayerChildren(getLayerParent(layerID));\n\n\n\tdelete flagList[layerID];\n\tif (POIFlagList[layerID]) {\n\t\tdelete POIFlagList[layerID];\n\t}\n\n\tif (isPined) {\n\t\treSortHandle();\n\t}\n\t//adjust the status of buttons\n\t/*\n\tif (Sibling.length == 1) {\n\t\tchangeButtonStatus(getLayerParent(layerID));\n\t\tdelete mapFlagList[getLayerParent(layerID)];\n\t\treturn false;\n\t}\n\tfor (var otherSibling in Sibling) {\n\t\tif (flagList[Sibling[otherSibling]]) {\n\t\t\tbreak;\n\t\t}\n\t\tif (Sibling[otherSibling] == Sibling[Sibling.length - 1]) {\n\t\t\tchangeButtonStatus(getLayerParent(layerID));\n\t\t\tdelete mapFlagList[getLayerParent(layerID)];\n\t\t}\n\t}*/\n\tsyncSidebar();\n}", "get shouldLabelFloat() {\n return this._panelOpen || !this.empty;\n }", "function validateScale()\n{\n var fMin = parseFloat($('scaleMin').value);\n var fMax = parseFloat($('scaleMax').value);\n if (isNaN(fMin))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMin').value = scaleMinVal;\n }\n else if (isNaN(fMax))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMax').value = scaleMaxVal;\n }\n else if (fMin >= fMax)\n {\n alert('Minimum scale value must be less than the maximum');\n // Reset to the old values\n $('scaleMin').value = scaleMinVal;\n $('scaleMax').value = scaleMaxVal;\n }\n else \n {\n $('scaleMin').value = fMin;\n $('scaleMax').value = fMax;\n scaleMinVal = fMin;\n scaleMaxVal = fMax;\n updateMap();\n }\n}", "function validateScale()\n{\n var fMin = parseFloat($('scaleMin').value);\n var fMax = parseFloat($('scaleMax').value);\n if (isNaN(fMin))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMin').value = scaleMinVal;\n }\n else if (isNaN(fMax))\n {\n alert('Scale limits must be set to valid numbers');\n // Reset to the old value\n $('scaleMax').value = scaleMaxVal;\n }\n else if (fMin >= fMax)\n {\n alert('Minimum scale value must be less than the maximum');\n // Reset to the old values\n $('scaleMin').value = scaleMinVal;\n $('scaleMax').value = scaleMaxVal;\n }\n else \n {\n $('scaleMin').value = fMin;\n $('scaleMax').value = fMax;\n scaleMinVal = fMin;\n scaleMaxVal = fMax;\n updateMap();\n }\n}", "function boxplotVisual(ecModel, api) {\n\t ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {\n\t seriesModel.getData().setVisual('legendSymbol', 'roundRect');\n\t });\n\t }", "function zoomed() {\n var t = [d3.event.transform.x, d3.event.transform.y];\n var s = d3.event.transform.k;\n var h = 0;\n\n //Limit translation to map cannot be moved off screen\n t[0] = Math.min(\n (mapWidth / mapHeight) * (s - 1),\n Math.max(mapWidth * (1 - s), t[0])\n );\n\n t[1] = Math.min(\n h * (s - 1) + h * s,\n Math.max(mapHeight * (1 - s) - h * s, t[1])\n );\n\n // Only show labels with filter information\n var meetsFiltered = mapData.features.filter(function (element) {\n return meetsFilters(element);\n });\n //Display labels of all countries\n var zoomFiltered1 = meetsFiltered.filter(function (element) {\n var c = path.bounds(element);\n var x = Math.abs(c[0][0] - c[1][0]);\n var y = Math.abs(c[0][1] - c[1][1]);\n var area = x;\n return x * y > 10;\n });\n //Display labels of some countries\n var zoomFiltered2 = meetsFiltered.filter(function (element) {\n var c = path.bounds(element);\n var x = Math.abs(c[0][0] - c[1][0]);\n var y = Math.abs(c[0][1] - c[1][1]);\n var area = x;\n return area > 10;\n });\n // Display labels of largest countries\n var zoomFiltered3 = meetsFiltered.filter(function (element) {\n var c = path.bounds(element);\n var x = Math.abs(c[0][0] - c[1][0]);\n var y = Math.abs(c[0][1] - c[1][1]);\n var area = x;\n return area > 30;\n });\n //Display labels accordingly\n if (s > 2.1 && s <= 3) {\n removeLabels();\n drawLabels(zoomFiltered3)\n } else if (s > 3 && s <= 8) {\n removeLabels();\n drawLabels(zoomFiltered2)\n } else if (s > 8) {\n removeLabels();\n drawLabels(zoomFiltered1)\n } else {\n removeLabels()\n }\n //Translate and scale texts and country features\n d3.select(\"#map\").select(\".worldmap\").selectAll(\"path\")\n .attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\n d3.select(\"#map\").select(\".worldmap\").selectAll(\"text\")\n .attr(\"transform\", \"translate(\" + t + \")scale(\" + s + \")\");\n\n //Draw labels for each country\n function drawLabels(data) {\n mapsvg.select(\".worldmap\")\n .selectAll(\"text\")\n .data(data)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"map-text\")\n .style(\"pointer-events\", \"none\")\n .attr(\"x\", function (d) {\n let c = path.bounds(d);\n var x = c[0][0] + (Math.abs(c[0][0] - c[1][0]) / 2);\n var y = c[0][1] + (Math.abs(c[0][1] - c[1][1]) / 2);\n return x;\n })\n .attr(\"y\", function (d) {\n let c = path.bounds(d);\n var y = c[0][1] + (Math.abs(c[0][1] - c[1][1]) / 1.5);\n return y;\n })\n .text(function (d) {\n return d.properties.name;\n })\n .style(\"font-size\", function (d) {\n var min = 2;\n var size = ((Math.abs((path.bounds(d))[0][0] - (path.bounds(d))[1][0]) / (d.properties.name).length * 0.5));\n return min > size ? min + \"px\" : size + \"px\";\n })\n .attr(\"text-anchor\", \"middle\")\n .style(\"text-shadow\", \"stroke: white\");\n }\n\n //Remove country labels for all countries\n function removeLabels() {\n mapsvg\n .select(\".worldmap\")\n .selectAll(\"text\")\n .remove()\n }\n}", "function addBoundaryLayer(object) {\n\n var points = ['airports-extended', 'healthsites', 'volcano_list', 'glopal_power_plant', 'world_port_index']\n\n\n var k = Object.keys(object); //what layer is being added\n var v = Object.values(object)[0]; //true or false if clicked\n\n var clicked = k[0]\n\n console.log(v)\n console.log(clicked)\n\n\n if(points.includes(clicked)) {\n\n if(map.getLayer(clicked)) {\n map.removeLayer(clicked)\n } else {\n\n\n map.addLayer({\n 'id': clicked,\n 'type': 'circle',\n 'source': 'points-source',\n 'filter': ['==', 'layer', clicked],\n 'layout': {\n 'visibility': 'visible'\n },\n 'paint': {\n 'circle-color': pointColors[clicked],\n 'circle-radius': 7,\n 'circle-opacity': 0.7\n }\n })\n\n }\n console.log(clicked)\n\n map.on('click', clicked, (e) => {\n const coordinates = e.features[0].geometry.coordinates.slice();\n const description = e.features[0].properties[pointDesc[clicked]];\n\n //console.log(coordinates);\n getIso(coordinates)\n\n new mapboxgl.Popup({\n className: 'popupCustom'\n })\n .setLngLat(coordinates)\n .setHTML(description)\n .addTo(map);\n\n })\n\n \n\n //map.setFilter('points', ['==', 'layer', clicked])\n //addPointLayer($(this))\n\n }\n else if (clicked === 'underwater-overlay') {\n addCables()\n\n } else if (!v) {\n \n map.removeLayer(clicked)\n console.log('uncheck: ' + clicked);\n \n } else {\n\n var slayer;\n var color;\n var source;\n\n if (clicked === 'admin1-overlay') {\n source = 'admin1'\n slayer = 'admin1'\n color = 'red'\n } else if (clicked === 'admin2-overlay') {\n source = 'admin2'\n slayer = 'admin2'\n color = '#003399'\n } else if (clicked === 'allsids') {\n //console.log('sids!')\n source = 'allsids'\n slayer = 'allSids'\n color = 'orange'\n } else {\n //source = 'pvaph'\n\n //layer == 'airports=extended', 'healthsites', 'volcano-list', 'glopal_power_plant', ''\n console.log($(this).val());\n //console.log($(this).id())\n console.log($(this))\n }\n\n map.addLayer({\n 'id': clicked,\n 'type': 'line',\n 'source': source,\n 'source-layer': slayer,\n 'layout': {\n 'visibility': 'visible'\n },\n\n 'paint': {\n 'line-color': color,\n 'line-width': 1\n\n }\n }, firstSymbolId);\n\n if (map.getLayer('admin1-overlay')) {\n map.moveLayer(clicked, 'admin1-overlay')\n\n }\n\n map.on('mouseover', function () {\n\n\n\n })\n\n }\n\n\n}", "function createMap(quakeLayer, faultLayer){\n var baseMaps = {\n \"Outdoor Map\": outdoorsMap,\n \"Grayscale Map\": lightMap,\n \"Satelite Map\": satelliteMap\n };\n\nvar overlayMaps = {\n \"Earthquakes\": quakeLayer,\n \"Fault Lines\": faultLayer\n \n };\nvar mymap = L.map('mapid', {\n center: [42.877742, -97.380979],\n zoom: 2.5,\n minZoom: 2.5,\n layers: [lightMap, faultLayer, quakeLayer],\n maxBounds: L.latLngBounds([90, -180], [-90, 180]),\n maxBoundsViscosity: 1,\n scrollWheelZoom: false\n \n}); \n\nvar legend = L.control({position: 'bottomright'});\n\nlegend.onAdd = function (mymap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [];\n\n div.innerHTML += '<p><u>Magnitude</u></p>'\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n};\n\nlegend.addTo(mymap);\n\nL.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(mymap);\n}", "hideAllLayerObjects() {\n let mainLayer = this.get('mainLayer');\n if (Ember.isNone(mainLayer) || Ember.isNone(mainLayer._leafletObject)) {\n return;\n }\n\n mainLayer._leafletObject.baseHideAllLayerObjects();\n mainLayer.get('innerLayers').forEach((layer) => {\n layer._leafletObject.hideAllLayerObjects();\n });\n }", "removeToChangeLayers(){\n if (this.map && !this.map.isStyleLoaded()) return;\n this.props.statuses.forEach(status => {\n if (status.key !== 'no_change'){\n status.layers.forEach(layer => {\n if (this.map.getLayer(layer)) {\n this.map.removeLayer(layer);\n }\n });\n }\n });\n }", "function setHmapLegendScale() {\n maxEmissions = 0;\n minmaxEmissions = Number.POSITIVE_INFINITY;\n var data = perCapita ? carbonPerCapitaData : carbonData;\n for (var i = 1850; i <= 2014; i++) {\n var maxData = data.filter(d => d.Year === String(i) && d.Country !== \"World\" && d.Country !== \"European Union (28)\")\n var maxYearEmissions = maxData.reduce((acc, l) => acc.Emissions > l.Emissions ? acc : l).Emissions\n maxEmissions = maxYearEmissions > maxEmissions ? maxYearEmissions : maxEmissions;\n minmaxEmissions = maxYearEmissions < minmaxEmissions ? maxYearEmissions : minmaxEmissions;\n }\n\n yearTitleScale.domain([minmaxEmissions, maxEmissions])\n heatmapLegendWidthScale.domain([minmaxEmissions, maxEmissions])\n}", "get canZoom () { return this.zoomsRemaining > 0; }", "function enforceTextboxLimits() {\n\tif (inputPixelsWide.value() < 1) inputPixelsWide.value(1); //Pixels Wide\n\telse if (inputPixelsWide.value() > MAX_PIX_WIDE) inputPixelsWide.value(MAX_PIX_WIDE);\n\tif (inputBlocksWide.value() < 1) inputBlocksWide.value(1); //Blocks Wide\n\tif (inputBlocksWide.value() > MAX_BLOCKS_WIDE) inputBlocksWide.value(MAX_BLOCKS_WIDE);\n\tif (inputBlocksHigh.value() < 1) inputBlocksHigh.value(1); //Blocks High\n\tif (inputBlocksHigh.value() > MAX_BLOCKS_WIDE) inputBlocksHigh.value(MAX_BLOCKS_WIDE);\n}", "_isMaxLevelExceeded(groupId) {\n const that = this,\n valueFlat = that._valueFlat;\n\n if (that.maxLevel === null || valueFlat.length < 1) {\n return;\n }\n\n //NOTE: 2 because - 1 is for the 0th (root) group, and -1 because we want to start from 0\n\n //Checks a specific item\n if (groupId) {\n return groupId.split('.').length - 2 >= that.maxLevel;\n }\n\n //Checks the whole structure\n for (let i = 0; i < valueFlat.length; i++) {\n const data = valueFlat[i];\n\n if (data.nodeId.split('.').length - 2 > that.maxLevel) {\n return true;\n }\n }\n }", "function hideAllLayers(doc) {\r\n\tvar len = doc.layers.length;\r\n\tfor (var i = 0; i < len; i++) {\r\n\t\tdoc.layers[i].visible = false;\r\n\t}\r\n}", "function grid(scaleType, fieldDef) {\n return !hasDiscreteDomain(scaleType) && !fieldDef.bin;\n }", "function calculateSpacing(){\n\t\t\tvar max_label = '';\n\t\t\tfor(var i = 0; i < yaxis.ticks.length; ++i){\n\t\t\t\tvar l = yaxis.ticks[i].label.length;\n\t\t\t\tif(l > max_label.length){\n\t\t\t\t\tmax_label = yaxis.ticks[i].label;\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tvar dummyDiv = target.insert('<div style=\"position:absolute;top:-10000px;font-size:smaller\" class=\"flotr-grid-label\">' + max_label + '</div>').down(0).next(1);\n\t\t\tlabelMaxWidth = dummyDiv.getWidth();\n\t\t\tlabelMaxHeight = dummyDiv.getHeight();\n\t\t\tdummyDiv.remove();\n\t\n\t\t\t/**\n\t\t\t * Grid outline line width.\n\t\t\t */\n\t\t\tvar maxOutset = 2;\n\t\t\tif(options.points.show){\n\t\t\t\tmaxOutset = Math.max(maxOutset, options.points.radius + options.points.lineWidth/2);\n\t\t\t}\n\t\t\tfor(var j = 0; j < series.length; ++j){\n\t\t\t\tif (series[j].points.show){\n\t\t\t\t\tmaxOutset = Math.max(maxOutset, series[j].points.radius + series[j].points.lineWidth/2);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tplotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset;\n\t\t\tplotOffset.left += labelMaxWidth + options.grid.labelMargin;\n\t\t\tplotOffset.bottom += labelMaxHeight + options.grid.labelMargin;\t\t\t\n\t\t\tplotWidth = canvasWidth - plotOffset.left - plotOffset.right;\n\t\t\tplotHeight = canvasHeight - plotOffset.bottom - plotOffset.top;\n\t\t\thozScale = plotWidth / (xaxis.max - xaxis.min);\n\t\t\tvertScale = plotHeight / (yaxis.max - yaxis.min);\n\t\t}", "function scaleAll2(newScale){\r\n if(newScale>MIN_SCALE && newScale<MAX_SCALE){\r\n canvas.forEachObject(function(item, index, arry){\r\n if(!item.isTag){\r\n item.scale(newScale);\r\n if(item != fabImg){\r\n //When scaling move element so that distance of elements for center is always in portion wiht scale\r\n var x = ((item.getLeft() - AnnotationTool.originX)/AnnotationTool.SCALE) * newScale + AnnotationTool.originX;\r\n var y = ((item.getTop() - AnnotationTool.originY)/AnnotationTool.SCALE) * newScale + AnnotationTool.originY;\r\n if(item.elementObj){\r\n item.elementObj.setItemPos(x, y, newScale);\r\n }\r\n }\r\n \r\n }\r\n });\r\n canvas.renderAll();\r\n AnnotationTool.SCALE = newScale;\r\n }\r\n }", "get isConstrained() {\n return !!((this.fixed && this.layout) ||\n (this.controlNodes && this.controlNodes.length > 0) ||\n (this.hostedBy && this.hostedBy.isVisible) ||\n (this.internalIn && this.internalIn.isVisible));\n }", "function handleZoom(inOutAmount) {\r\n var beforeZoom = zoomLevel,\r\n afterZoom = beforeZoom + inOutAmount;\r\n\r\n // Disallow zoomLevel outside allowable range\r\n if (afterZoom < minZoom) {\r\n afterZoom = minZoom;\r\n } else if (afterZoom > maxZoom) {\r\n afterZoom = maxZoom;\r\n }\r\n\r\n if(beforeZoom != afterZoom) {\r\n zoomLevel = afterZoom;\r\n // FIXME ----------------------------------------------------------------\r\n // zoom by keeping location of \"lastLocation\" in the same screen position\r\n // FIXME ----------------------------------------------------------------\r\n }\r\n }", "function computeSlopeMask(threshold) {\n var minWaterMask = mndwiMax.gt(ndwiMinWater) // maximum looks like water\n var maxLandMask = mndwiMin.lt(ndwiMaxLand) // minimum looks like land\n\n if(options.debugMapLayers) {\n var change = scale.unmask().abs().gt(threshold);\n var changeVis = scale.mask(change).visualize({\n min: -slopeThreshold * slopeThresholdRatio,\n max: slopeThreshold * slopeThresholdRatio,\n palette: ['00ff00', '000000', '00d8ff'],\n })\n\n Map.addLayer(changeVis, {}, 'scale thresholded, unmasked', false)\n }\n \n var mask = scale.unmask().abs().gt(threshold)\n .multiply(minWaterMask) \n .multiply(maxLandMask) \n\n if(ndviFilter > -1) {\n var ndviMask = ndviMin.lt(ndviFilter)\n mask = mask.multiply(ndviMask) // deforestation?\n }\n\n if(filterCount > 0) {\n var countMask = annualPercentile.select('count').min().gt(filterCount)\n mask = mask.multiply(countMask);\n }\n \n if(options.useSwbdMask) {\n mask = mask.multiply(swbdMask)\n }\n \n // add eroded original scale mask (small scale-friendly erosion, avoid kernel too large)\n var erodedScaleMask = scaleMask\n .focal_min(10000, 'square', 'meters').reproject('EPSG:4326', null, 1000)\n\n mask = mask.multiply(erodedScaleMask)\n\n if(options.debugMapLayers) {\n Map.addLayer(minWaterMask.not().mask(minWaterMask.not()), {}, 'min water mask', false)\n Map.addLayer(maxLandMask.not().mask(maxLandMask.not()), {}, 'max land mask', false)\n \n if(ndviFilter > -1) {\n Map.addLayer(ndviMask.not().mask(ndviMask.not()), {}, 'ndvi mask', false)\n }\n if(filterCount > 0) {\n Map.addLayer(countMask.not().mask(countMask.not()), {}, 'count mask', false)\n }\n \n if(options.useSwbdMask) {\n Map.addLayer(swbdMask.not().mask(swbdMask.not()), {}, 'swbd mask', false)\n }\n \n Map.addLayer(erodedScaleMask.not().mask(erodedScaleMask.not()), {}, 'scale original mask (eroded)', false)\n }\n\n return mask;\n }", "function computeSlopeMask(threshold) {\n var minWaterMask = mndwiMax.gt(ndwiMinWater) // maximum looks like water\n var maxLandMask = mndwiMin.lt(ndwiMaxLand) // minimum looks like land\n\n if(options.debugMapLayers) {\n var change = scale.unmask().abs().gt(threshold);\n var changeVis = scale.mask(change).visualize({\n min: -slopeThreshold * slopeThresholdRatio,\n max: slopeThreshold * slopeThresholdRatio,\n palette: ['00ff00', '000000', '00d8ff'],\n })\n\n Map.addLayer(changeVis, {}, 'scale thresholded, unmasked', false)\n }\n \n var mask = scale.unmask().abs().gt(threshold)\n .multiply(minWaterMask) \n .multiply(maxLandMask) \n\n if(ndviFilter > -1) {\n var ndviMask = ndviMin.lt(ndviFilter)\n mask = mask.multiply(ndviMask) // deforestation?\n }\n\n if(filterCount > 0) {\n var countMask = annualPercentile.select('count').min().gt(filterCount)\n mask = mask.multiply(countMask);\n }\n \n if(options.useSwbdMask) {\n mask = mask.multiply(swbdMask)\n }\n \n // add eroded original scale mask (small scale-friendly erosion, avoid kernel too large)\n var erodedScaleMask = scaleMask\n .focal_min(10000, 'square', 'meters').reproject('EPSG:4326', null, 1000)\n\n mask = mask.multiply(erodedScaleMask)\n\n if(options.debugMapLayers) {\n Map.addLayer(minWaterMask.not().mask(minWaterMask.not()), {}, 'min water mask', false)\n Map.addLayer(maxLandMask.not().mask(maxLandMask.not()), {}, 'max land mask', false)\n \n if(ndviFilter > -1) {\n Map.addLayer(ndviMask.not().mask(ndviMask.not()), {}, 'ndvi mask', false)\n }\n if(filterCount > 0) {\n Map.addLayer(countMask.not().mask(countMask.not()), {}, 'count mask', false)\n }\n \n if(options.useSwbdMask) {\n Map.addLayer(swbdMask.not().mask(swbdMask.not()), {}, 'swbd mask', false)\n }\n \n Map.addLayer(erodedScaleMask.not().mask(erodedScaleMask.not()), {}, 'scale original mask (eroded)', false)\n }\n\n return mask;\n }", "function checkZoomLevel(level, controller) {\n // we need to disable the zoom up button now\n if (magzoom == 9) {\n controller.magup.src = 'img/img_magupoff.gif';\n controller.magdown.src = 'img/img_magdown.gif';\n } else if (magzoom == 2) {\n controller.magdown.src = 'img/img_magdownoff.gif';\n controller.magup.src = 'img/img_magup.gif';\n } else {\n controller.magdown.src = 'img/img_magdown.gif';\n controller.magup.src = 'img/img_magup.gif';\n }\n\n if (magzoom > 4) {\n controller.buttonMag.src = 'img/img_magoff.gif';\n controller.buttonMag.enabled = false;\n } else {\n controller.buttonMag.src = 'img/img_mag.gif';\n controller.buttonMag.enabled = true;\n }\n}", "function handleResizeIE() {\n var wrapers = document.getElementsByClassName(\"title-wrap\");\n for (var i = 0; i < wrapers.length; i++) {\n var title = wrapers[i].getElementsByClassName(\"title-thumbnail\");\n if (title[0].scrollHeight > wrapers[i].clientHeight) {\n wrapers[i].getElementsByClassName(\"clamp\")[0].style.visibility =\n \"visible\";\n } else {\n if (\n wrapers[i].getElementsByClassName(\"clamp\")[0].style.visibility ===\n \"visible\"\n ) {\n wrapers[i].getElementsByClassName(\"clamp\")[0].style.visibility =\n \"hidden\";\n }\n }\n }\n}", "function _getBounds ( collection, bounds ) {\n var clipGroupElems, i, j;\n\n if ( collection.typename != 'GroupItem' ) { // ����� ��������� ������� �����������\n return collection.geometricBounds;\n }\n if ( collection.clipped ) { // ������ � ������ => ���� �����\n clipGroupElems = collection.pathItems;\n\n for ( i = 0; i < clipGroupElems.length; i++ ) {\n if ( clipGroupElems[ i ].clipping ) {\n if ( bounds == '' ) {\n bounds = clipGroupElems[ i ].geometricBounds;\n continue;\n }\n bounds = _compareBounds ( clipGroupElems[ i ], bounds );\n }\n }\n return bounds;\n }\n\n // ������ ��� ����������� ����� => ���� �� ��������� ������\n for ( j = 0; j < collection.pageItems.length; j++ ) {\n\n var el = collection.pageItems [ j ];\n\n if ( el.typename != 'GroupItem' ) { // ����� pageItem ����� ������\n if ( bounds == '' ) {\n bounds = el.geometricBounds;\n continue;\n }\n bounds = _compareBounds ( el, bounds );\n }\n\n if ( el.typename == 'GroupItem' && el.clipped ) { // ������ � ������ => ���� �����\n clipGroupElems = el.pathItems;\n for ( i = 0; i < clipGroupElems.length; i++ ) {\n if ( clipGroupElems[ i ].clipping ) {\n if ( bounds == '' ) {\n bounds = clipGroupElems[ i ].geometricBounds;\n continue;\n }\n bounds = _compareBounds ( clipGroupElems[ i ], bounds );\n }\n }\n continue;\n }\n\n if ( el.typename == 'GroupItem' && !el.groupItems && !el.clipped ) { // ������ ��� ����� � ��� �����\n if ( bounds == '' ) {\n bounds = el.geometricBounds;\n// bounds = getBoundsExtend ( el.pageItems, bounds );\n continue;\n }\n bounds = _compareBounds ( el.geometricBounds, bounds );\n continue;\n }\n\n if ( el.typename == 'GroupItem' && el.groupItems ) { // ������ ��� �����, �� � �������� => ��������\n for ( var l = 0; l < el.pageItems.length; l++ ) {\n /* if ( bounds == '' ) {\n bounds = getBoundsExtend ( el.pageItems[l], '' );\n }*/\n bounds = getBoundsExtend ( el.pageItems[ l ], bounds );\n }\n continue;\n }\n }\n return bounds;\n\n // �������� � ������� ����� ������� geometricBounds ��������\n function _compareBounds ( elem, boundsToCompare ) {\n var elemBounds = elem.geometricBounds;\n elemBounds[ 0 ] < boundsToCompare[ 0 ] ? boundsToCompare[ 0 ] = elemBounds[ 0 ] : '';\n elemBounds[ 1 ] > boundsToCompare[ 1 ] ? boundsToCompare[ 1 ] = elemBounds[ 1 ] : '';\n elemBounds[ 2 ] > boundsToCompare[ 2 ] ? boundsToCompare[ 2 ] = elemBounds[ 2 ] : '';\n elemBounds[ 3 ] < boundsToCompare[ 3 ] ? boundsToCompare[ 3 ] = elemBounds[ 3 ] : '';\n return boundsToCompare;\n }\n }", "function scaleClip(model) {\n var xScale = model.getScaleComponent('x');\n var yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('domainRaw')) ||\n (yScale && yScale.get('domainRaw')) ? true : false;\n }", "function pass1(structureControl) {\n if (!structureControl) {\n return;\n }\n\n /////\n // Get the structure controls minimum viable size.\n /////\n function getMinSize(dimension) {\n if (!structureControl || !dimension) {\n return;\n }\n\n var cssMinHeight;\n var cssMinWidth;\n\n if (dimension === dimensions.horizontal) {\n cssMinWidth = structureControl.domElement.css('min-width');\n\n if (!structureControl.domElement[0].originalMinWidth) {\n structureControl.domElement[0].originalMinWidth = cssMinWidth;\n }\n }\n\n if (dimension === dimensions.vertical) {\n cssMinHeight = structureControl.domElement.css('min-height');\n\n if (!structureControl.domElement[0].originalMinHeight) {\n structureControl.domElement[0].originalMinHeight = cssMinHeight;\n }\n }\n\n var min;\n var childIndex = 0;\n var child;\n var aggregateMin = 0;\n var parentPadding = 0;\n\n if (dimension === dimensions.vertical) {\n min = parseFloat(structureControl.domElement[0].originalMinHeight) || 0;\n\n if (structureControl.children && structureControl.children.length) {\n\n parentPadding = structureControl.domElement.outerHeight() - structureControl.domElement.height();\n\n if (structureControl.lineBreakClass) {\n var lineBreak = structureControl.domElement.find(structureControl.lineBreakClass).first();\n\n if (lineBreak && lineBreak.length) {\n parentPadding += 17;\n }\n }\n\n var alias = structureControl.control.type.getAlias();\n\n if (structureControl.isExplicitContainer && !structureControl.control.hideLabel && alias !== spFormBuilderService.containers.screen && alias !== spFormBuilderService.containers.form) {\n if (structureControl.titleClass) {\n var label = structureControl.domElement.find(structureControl.titleClass).first();\n\n if (label && label.length) {\n parentPadding += label.outerHeight();\n }\n }\n }\n\n if (structureControl.isHorizontalContainer || structureControl.isTabContainer) {\n\n for (childIndex = 0; childIndex < structureControl.children.length; childIndex++) {\n child = structureControl.children[childIndex];\n\n if (child.minSize.height + parentPadding > min) {\n min = child.minSize.height + parentPadding;\n }\n }\n } else {\n for (childIndex = 0; childIndex < structureControl.children.length; childIndex++) {\n child = structureControl.children[childIndex];\n\n aggregateMin += child.minSize.height;\n }\n\n if (aggregateMin + parentPadding > min) {\n min = aggregateMin + parentPadding;\n }\n }\n }\n\n return min;\n } else {\n min = parseFloat(structureControl.domElement[0].originalMinWidth) || 0;\n\n if (structureControl.children && structureControl.children.length) {\n\n parentPadding = structureControl.domElement.outerWidth() - structureControl.domElement.width();\n\n for (childIndex = 0; childIndex < structureControl.children.length; childIndex++) {\n child = structureControl.children[childIndex];\n\n if (child.minSize.width + parentPadding > min) {\n min = child.minSize.width + parentPadding;\n }\n }\n }\n\n return min;\n }\n }\n\n /////\n // Temporarily disable overflow. (prefix)\n /////\n if (structureControl.isContainer) {\n\n structureControl.domElement.css('overflow-x', 'hidden');\n\n if (structureControl.firstContentControl) {\n structureControl.firstContentControl.css('overflow-x', 'hidden');\n }\n }\n\n /////\n // Recursive.\n /////\n if (structureControl.children && structureControl.children.length) {\n for (var childIndex = 0; childIndex < structureControl.children.length; childIndex++) {\n var child = structureControl.children[childIndex];\n\n pass1(child);\n }\n }\n\n /////\n // Calculate the controls minimum size. (postfix)\n /////\n structureControl.minSize.height = getMinSize(dimensions.vertical) || 0;\n structureControl.minSize.width = getMinSize(dimensions.horizontal) || 0;\n\n if (structureControl.isField) {\n structureControl.minSize.height += (structureControl.domElement.outerHeight() - structureControl.domElement.height());\n structureControl.minSize.width += (structureControl.domElement.outerWidth() - structureControl.domElement.width());\n }\n }", "function adjustBubbles() {\n\n // make sure the low value bubble is actually within the slider\n fitToBar(refs.currBub);\n\n if(gap(refs.minBub, refs.currBub) < 5) {\n // the low bubble overlaps the minLimit bubble\n\n // so hide the minLimit bubble\n hide(refs.minBub);\n } else {\n // the low bubble doesn't overlap the minLimit bubble\n\n // single knob slider\n\n // so show the minLimit slider\n show(refs.minBub);\n\n }\n\n if(gap(refs.currBub, refs.maxBub) < 5) {\n // the low bubble overlaps the maxLimit bubble\n\n // so hide the maxLimit bubble\n hide(refs.maxBub);\n } else {\n // the low bubble doesn't overlap the maxLimit bubble\n\n // no overlap\n\n // so show the maxLimit bubble\n show(refs.maxBub);\n }\n }", "function opacity(zoomlvl, hide) {\n if (zoomlvl >= 15) {\n if (hide) return 0;\n else return 0.5;\n } else {\n return 1;\n }\n}", "function onChangeLimitLayer(dropdown,checkbox)\n{\n var selectedIndex = dropdown.selectedIndex;\n layerLimitIndex = selectedIndex+1; //+1 is because of google layer\n layerLimitId = layersList[selectedIndex][0];\n layerLimitName = layersList[selectedIndex][1];\n document.getElementById('infoLimit').innerHTML = \"\";\n currentPolygonLimitId = null;\n currentPolygonLimitName = null;\n polygonsList = null;\n checkbox.checked = false;\n return true;\n}", "handleMouseOver (vis, event, d) {\n // console.log(\"hover over\", d);\n let leftPosition = event.pageX + 10 + \"px\";\n if (window.innerWidth - event.pageX < 500) {\n leftPosition = event.pageX - 300 + \"px\";\n }\n let census = vis.insights[d.count];\n let censusCount = d.count;\n let peopleCount = census ? census.total : 0;\n let censusPercent = vis.legendData.find(c => c.censusCount == d.count);\n censusPercent = censusPercent? censusPercent.censusPercent : 0;\n if ((d.count === 0 && vis.filters.length === 0) || !census) {\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n </div>`\n );\n } else if (d.count === 0) {\n let tipText = `<div>${peopleCount.toLocaleString(\"en\")} people with filter attribute</div> `;\n vis.filters.forEach(f => {\n tipText += `<div>${v2CheckBoxGuide[f].title}.</div> `;\n })\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census (${peopleCount.toLocaleString(\"en\")})</h5>\n ${tipText}\n </div>`\n );\n } else {\n // They show up in a census\n let topPob = d3.greatest(census.pobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topAgeGroup = d3.greatest(census.ageMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCensus = d3.greatest(census.censusMap, (a, b) => d3.ascending(a[1], b[1]));\n let topGender = d3.greatest(census.genderMap, (a, b) => d3.ascending(a[1], b[1]));\n let topColor = d3.greatest(census.colorMap, (a, b) => d3.ascending(a[1], b[1]));\n let topJob = d3.greatest(census.jobMap, (a, b) => d3.ascending(a[1], b[1]));\n let topCounty = d3.greatest(census.countyMap, (a, b) => d3.ascending(a[1], b[1]));\n // console.log(topPob,topAgeGroup, topCensus );\n vis.tooltip\n .style(\"opacity\", 1)\n .style(\"left\", leftPosition)\n .style(\"top\", event.pageY + \"px\")\n .html(`\n <div class=\"toolTip\" >\n <h5>${censusPercent}% of people are in ${censusCount} census</h5>\n <div> The ${peopleCount.toLocaleString(\"en\")} people in ${censusCount} census are most likely</div>\n <div> to be born in ${topPob[0]} living in ${upperCaseFirstLetters(topCounty[0])}, Nevada. </div> \n <div> Their first census was at age ${topAgeGroup[0]} in year ${topCensus[0]}. </div> \n <div> Gender \"${topGender[0]}\", \"color ${topColor[0]}\",\n and job \"${upperCaseFirstLetters(topJob[0])}\".</div> \n </div>`\n );\n }\n }", "hideMiddleLayer() {\n super.hide();\n this.secondLayerOverlay.classList.add(\"hidden\");\n if (!this.detailPostPopup.classList.contains(\"hidden\")) {\n this.detailPostPopup.classList.remove(\"blur\");\n }\n if (this.menuView.classList.contains(\"open\")) {\n this.menuView.classList.remove(\"blur\");\n }\n }", "isOut() {\n if (this.offsetX < -this.limitx()) this.offsetX = -this.limitx();\n if (this.offsetX > this.limitx()) this.offsetX = this.limitx();\n if (this.offsetY < -this.limity()) this.offsetY = -this.limity();\n if (this.offsetY > this.limity()) this.offsetY = this.limity();\n }", "function boundCheck(pos, dim) {\n if (pos.y < 0) return 'top';\n if (pos.y > height - dim.height) return 'bottom';\n if (pos.x < 0) return 'left';\n if (pos.x > width - dim.width) return 'right';\n return 'none'; // just there so js wont complain\n}" ]
[ "0.6307542", "0.5996981", "0.59932214", "0.5752637", "0.5732391", "0.56810063", "0.5630802", "0.5493847", "0.54737294", "0.54506564", "0.5450406", "0.5376089", "0.530375", "0.53016484", "0.52903545", "0.5256135", "0.5247978", "0.5247314", "0.5242489", "0.52411246", "0.52382076", "0.52131885", "0.52085036", "0.5175701", "0.51712036", "0.5165206", "0.5151809", "0.5138229", "0.5111756", "0.5106284", "0.50841296", "0.507094", "0.5061443", "0.50507027", "0.5049202", "0.5043153", "0.5039157", "0.5028823", "0.5005021", "0.5003263", "0.49932748", "0.49920696", "0.49882197", "0.4986575", "0.4982797", "0.49824774", "0.49800596", "0.49796596", "0.4973678", "0.49730584", "0.49647605", "0.49635273", "0.49596697", "0.4954117", "0.4953591", "0.49495414", "0.494929", "0.494929", "0.494929", "0.49484634", "0.4946362", "0.49458596", "0.49458596", "0.494571", "0.49397543", "0.49392512", "0.49301443", "0.49297154", "0.49028707", "0.49028707", "0.48976853", "0.48939672", "0.4890344", "0.48791614", "0.48777586", "0.4865507", "0.48641002", "0.4862186", "0.48585504", "0.48564786", "0.48530564", "0.48468506", "0.48455527", "0.4843582", "0.48379156", "0.4837493", "0.48321727", "0.48321727", "0.48267075", "0.482538", "0.4824795", "0.48239425", "0.48227835", "0.48142162", "0.48137474", "0.481365", "0.48118722", "0.4810299", "0.48061967", "0.4805404" ]
0.7099726
0
so far supports only Firefox, Chrome and Opera (buggy) could be extended in the future to use something like
function sourceFromStacktrace() { try { throw new Error(); } catch ( e ) { if (e.stacktrace) { // Opera return e.stacktrace.split("\n")[6]; } else if (e.stack) { // Firefox, Chrome return e.stack.split("\n")[4]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFirefox(){\n\treturn navigator.userAgent.indexOf('Gecko/')>0;\n}", "function hackUserAgent(){\n if (navigator.userAgent.search('Firefox')!==-1)\n active='mouseup.webcrawler';\n}", "function css_browser_selector(e){var r=e.toLowerCase(),i=function(e){return r.indexOf(e)>-1},t=\"gecko\",o=\"webkit\",a=\"safari\",n=\"chrome\",s=\"opera\",d=\"mobile\",c=0,l=window.devicePixelRatio?(window.devicePixelRatio+\"\").replace(\".\",\"_\"):\"1\",w=[!/opera|webtv/.test(r)&&/msie\\s(\\d+)/.test(r)&&(c=1*RegExp.$1)?\"ie ie\"+c+(6==c||7==c?\" ie67 ie678 ie6789\":8==c?\" ie678 ie6789\":9==c?\" ie6789 ie9m\":c>9?\" ie9m\":\"\"):/trident\\/\\d+.*?;\\s*rv:(\\d+)\\.(\\d+)\\)/.test(r)&&(c=[RegExp.$1,RegExp.$2])?\"ie ie\"+c[0]+\" ie\"+c[0]+\"_\"+c[1]+\" ie9m\":/firefox\\/(\\d+)\\.(\\d+)/.test(r)&&(re=RegExp)?t+\" ff ff\"+re.$1+\" ff\"+re.$1+\"_\"+re.$2:i(\"gecko/\")?t:i(s)?s+(/version\\/(\\d+)/.test(r)?\" \"+s+RegExp.$1:/opera(\\s|\\/)(\\d+)/.test(r)?\" \"+s+RegExp.$2:\"\"):i(\"konqueror\")?\"konqueror\":i(\"blackberry\")?d+\" blackberry\":i(n)||i(\"crios\")?o+\" \"+n:i(\"iron\")?o+\" iron\":!i(\"cpu os\")&&i(\"applewebkit/\")?o+\" \"+a:i(\"mozilla/\")?t:\"\",i(\"android\")?d+\" android\":\"\",i(\"tablet\")?\"tablet\":\"\",i(\"j2me\")?d+\" j2me\":i(\"ipad; u; cpu os\")?d+\" chrome android tablet\":i(\"ipad;u;cpu os\")?d+\" chromedef android tablet\":i(\"iphone\")?d+\" ios iphone\":i(\"ipod\")?d+\" ios ipod\":i(\"ipad\")?d+\" ios ipad tablet\":i(\"mac\")?\"mac\":i(\"darwin\")?\"mac\":i(\"webtv\")?\"webtv\":i(\"win\")?\"win\"+(i(\"windows nt 6.0\")?\" vista\":\"\"):i(\"freebsd\")?\"freebsd\":i(\"x11\")||i(\"linux\")?\"linux\":\"\",\"1\"!=l?\" retina ratio\"+l:\"\",\"js portrait\"].join(\" \");return window.jQuery&&!window.jQuery.browser&&(window.jQuery.browser=c?{msie:1,version:c}:{}),w}", "function e(a){var q=(a||u).toLowerCase();var A1=/(webkit)[ \\/]([\\w.]+)/;var B1=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var C1=/(mozilla)(?:.*? rv:([\\w.]+))?/;var D1=A1.exec(q)||B1.exec(q)||q.indexOf(\"compatible\")<0&&C1.exec(q)||[];var E1={browser:D1[1]||\"\",version:D1[2]||\"0\"};E1[E1.browser]=true;return E1;}", "function e(a){var q=(a||u).toLowerCase();var B1=/(webkit)[ \\/]([\\w.]+)/;var C1=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var D1=/(msie) ([\\w.]+)/;var E1=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var F1=/(edge)[ \\/]([\\w.]+)/;var G1=/(mozilla)(?:.*? rv:([\\w.]+))?/;var H1=F1.exec(q)||E1.exec(q)||B1.exec(q)||C1.exec(q)||D1.exec(q)||q.indexOf(\"compatible\")<0&&G1.exec(q)||[];var I1={browser:H1[1]||\"\",version:H1[2]||\"0\"};I1[I1.browser]=true;return I1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function isWebKit(){\n\treturn navigator.userAgent.indexOf('WebKit/')>0;\n}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function getBrowser (){\nif(jQuery.uaMatch(navigator.userAgent).browser == 'webkit'){\nvar userAgent = navigator.userAgent.toLowerCase();\nif ( userAgent.indexOf(\"chrome\") === -1 ) { \nreturn 'safari';\n}\nelse {\nreturn jQuery.uaMatch(navigator.userAgent).browser;\n}\n}\n}", "function isFireFox()\n{\n if(navigator.userAgent.indexOf(\"Firefox\")>0)\n {\n return true;\n } \n else\n {\n return false; \n } \n}", "function DetectaWebkit(){\n\n if (uagent.search(engineWebKit) > -1)\n\n return true;\n\n else\n\n return false;\n\n}", "function identifyBrowser() {\n\n var ua = navigator.userAgent.toLowerCase();\n if (ua.indexOf(\"mozilla\") != -1) {\n if (ua.indexOf(\"firefox\") != -1) {\n browserName = \"firefox\";\n return 4;\n } \n }\n}", "function sniffBrowsers() {\r\n\tns4 = document.layers;\r\n\top5 = (navigator.userAgent.indexOf(\"Opera 5\")!=-1) \r\n\t\t||(navigator.userAgent.indexOf(\"Opera/5\")!=-1);\r\n\top6 = (navigator.userAgent.indexOf(\"Opera 6\")!=-1) \r\n\t\t||(navigator.userAgent.indexOf(\"Opera/6\")!=-1);\r\n\t\r\n\tagt = navigator.userAgent.toLowerCase();\r\n\tmac = (agt.indexOf(\"mac\")!=-1);\r\n\tie = (agt.indexOf(\"msie\") != -1); \r\n\tmac_ie = mac && ie;\r\n\tffox = (agt.indexOf(\"firefox\") != -1);\r\n}", "function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.getElementsByTagName('html')[0],b=[(!(/opera|webtv/i.test(ua))&&/msie\\s(\\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\\/(\\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\\s|\\/)(\\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\\/(\\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}", "function o(){var a=u.toLowerCase();var b=/(webkit)[ \\/]([\\w.]+)/;var e=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var f=/(msie) ([\\w.]+)/;var i=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var q=/(mozilla)(?:.*? rv:([\\w.]+))?/;var Q=b.exec(a)||e.exec(a)||f.exec(a)||i.exec(a)||a.indexOf(\"compatible\")<0&&q.exec(a)||[];var s={browser:Q[1]||\"\",version:Q[2]||\"0\"};s[s.browser]=true;return s}", "function supportsGoWithoutReloadUsingHash(){return window.navigator.userAgent.indexOf('Firefox')===-1;}", "function k(){var a=u.toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(mozilla)(?:.*? rv:([\\w.]+))?/;var C=e.exec(a)||f.exec(a)||i.exec(a)||a.indexOf(\"compatible\")<0&&q.exec(a)||[];var s={browser:C[1]||\"\",version:C[2]||\"0\"};s[s.browser]=true;return s}", "function isFirefox() {\n return /rv\\:.*Gecko/.test(window.navigator.userAgent)\n }", "function y(a){var b=(a||u).toLowerCase();var e=/(webkit)[ \\/]([\\w.]+)/;var f=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var q=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var s=/(mozilla)(?:.*? rv:([\\w.]+))?/;var V=e.exec(b)||f.exec(b)||i.exec(b)||q.exec(b)||b.indexOf(\"compatible\")<0&&s.exec(b)||[];var t={browser:V[1]||\"\",version:V[2]||\"0\"};t[t.browser]=true;return t}", "function r(e){var t=(e||v).toLowerCase();var r=/(webkit)[ \\/]([\\w.]+)/;var n=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var i=/(msie) ([\\w.]+)/;var a=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var o=/(edge)[ \\/]([\\w.]+)/;var s=/(mozilla)(?:.*? rv:([\\w.]+))?/;var u=o.exec(t)||a.exec(t)||r.exec(t)||n.exec(t)||i.exec(t)||t.indexOf(\"compatible\")<0&&s.exec(t)||[];var l={browser:u[1]||\"\",version:u[2]||\"0\"};l[l.browser]=true;return l}", "function tryWebkitApproach() {\n // document.location = custom;\n document.location = \"epicollectplus://project?plus.epicollect.net/bestpint.xml\";\n timer = setTimeout(function () {\n document.location = alt;\n }, 2000);\n }", "function supportsGoWithoutReloadUsingHash() { // 72\n var ua = navigator.userAgent; // 73\n return ua.indexOf('Firefox') === -1; // 74\n}", "function css_browser_selector(u) {\n var ua = u.toLowerCase(),\n is = function(t) {\n return ua.indexOf(t) > -1\n }, g = 'gecko',\n w = 'webkit',\n s = 'safari',\n o = 'opera',\n m = 'mobile',\n h = document.documentElement,\n b = [(!(/opera|webtv/i.test(ua)) && /msie\\s(\\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3.6') ? g + ' ff3 ff3_6' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\\/(\\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\\s|\\/)(\\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('blackberry') ? m + ' blackberry' : is('android') ? m + ' android' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\\/(\\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('j2me') ? m + ' j2me' : is('iphone') ? m + ' iphone' : is('ipod') ? m + ' ipod' : is('ipad') ? m + ' ipad' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' + (is('windows nt 6.0') ? ' vista' : '') : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js'];\n c = b.join(' ');\n h.className += ' ' + c;\n return c;\n}", "function browser() {\n\t\n\tvar isOpera = !!(window.opera && window.opera.version); // Opera 8.0+\n\tvar isFirefox = testCSS('MozBoxSizing'); // FF 0.8+\n\tvar isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;\n\t // At least Safari 3+: \"[object HTMLElementConstructor]\"\n\tvar isChrome = !isSafari && testCSS('WebkitTransform'); // Chrome 1+\n\t//var isIE = /*@cc_on!@*/false || testCSS('msTransform'); // At least IE6\n\n\tfunction testCSS(prop) {\n\t return prop in document.documentElement.style;\n\t}\n\t\n\tif (isOpera) {\n\t\t\n\t\treturn false;\n\t\t\n\t}else if (isSafari || isChrome) {\n\t\t\n\t\treturn true;\n\t\t\n\t} else {\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n}", "function get_browser(){\n var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || []; \n if(/trident/i.test(M[1])){\n tem=/\\brv[ :]+(\\d+)/g.exec(ua) || []; \n return 'IE '+(tem[1]||'');\n } \n if(M[1]==='Chrome'){\n tem=ua.match(/\\bOPR\\/(\\d+)/)\n if(tem!=null) {return 'Opera '+tem[1];}\n } \n M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem=ua.match(/version\\/(\\d+)/i))!=null) {M.splice(1,1,tem[1]);}\n return M[0];\n }", "function index_browser_es_f() {}", "function getUsedResolutionFirefox() {\n return undefined;\n}", "function chrome(){\n is_chrome= navigator.userAgent.toLowerCase().indexOf('chrome') > -1;\n if(navigator.appName == \"Microsoft Internet Explorer\"){\n alert(\"Seras redireccionado a una pagina para descargar un navegador (Funcional)\");\n location.href=\"https://www.google.com/chrome?hl=es\";\n }else if(navigator.appName != \"Microsoft Internet Explorer\" && !is_chrome){\n alert(\"Para disfrutar mejor de nuestro sitio usa google chrome\");\n }\n}", "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "function isOldWebKit() {\n\t\t\t\tvar webKitChunks = navigator.userAgent.match(/WebKit\\/(\\d*)/);\n\t\t\t\treturn !!(webKitChunks && webKitChunks[1] < 536);\n\t\t\t}", "function supportsGoWithoutReloadUsingHash() {\r\n\t var ua = navigator.userAgent;\r\n\t return ua.indexOf('Firefox') === -1;\r\n\t}", "function DetectWebkit()\n{\n if (uagent.search(engineWebKit) > -1)\n return true;\n else\n return false;\n}", "function DetectWebkit()\n{\n if (uagent.search(engineWebKit) > -1)\n return true;\n else\n return false;\n}", "function printBrowserInformation(){\n\tuserAgent = navigator.userAgent;\n\talreadyDisplayed = \"\";\n\n\t//get the value of the cookie\n\talreadyDisplayed = get_cookie(\"palotas_cookie\");\n\t\n\t\n\tif (alreadyDisplayed.indexOf(\"true\") == -1)\n\t{\n\t\tif((userAgent.indexOf(\"Firefox\") == -1) && (userAgent.indexOf(\"Chrome\") == -1) && (userAgent.indexOf(\"Safari\") == -1))\n\t\t{\n\t\t\talert(\"This site was optimized for Chrome, Firefox and Safari browsers. It is possible that other browsers may not properly display the content of this site.\");\n\t\t}\n\t}\n\n\t\n}", "function browser_detection(){\n\tif(navigator.appName == \"Netscape\"){\n\t\treturn \"NET\";\t\n\t}else{\n\t\treturn \"IE\";\n\t}\t\n}", "function browserDetection() { \r\n\tif(navigator.userAgent.indexOf(\"Chrome\") != -1 ){\r\n\t\tdocument.getElementById(\"browser\").innerHTML=\"The browser you are using is : Chrome\";\r\n }\r\n else if(navigator.userAgent.indexOf(\"Opera\") != -1 ){\r\n\t\tdocument.getElementById(\"browser\").innerHTML=\"The browser you are using is : OPERA\";\r\n }\r\n else if(navigator.userAgent.indexOf(\"Firefox\") != -1 ){\r\n document.getElementById(\"browser\").innerHTML=\"The browser you are using is : FIREFOX\";\r\n }\r\n else if((navigator.userAgent.indexOf(\"MSIE\") != -1 ) || (!!document.documentMode == true )){\r\n document.getElementById(\"browser\").innerHTML=\"The browser you are using is : Internet\";\r\n } \r\n else{\r\n document.getElementById(\"browser\").innerHTML=\"The browser you are using is : Unknown\";\r\n }\r\n}", "function BrowserDetect() {}", "function __firefox() {\n HTMLElement.prototype.__defineGetter__(\"runtimeStyle\", __element_style);\n window.constructor.prototype.__defineGetter__(\"event\", __window_event);\n Event.prototype.__defineGetter__(\"srcElement\", __event_srcElement);\n}", "function ElemToWindow(elem,dummy){\r\nif(!elem) return null;\r\nvar bod = document.body, doc = document.documentElement, rtl = 0;\r\n\r\nif(elem.getBoundingClientRect && !TGNoIEClientRect){\r\n if(!elem.parentNode) return [0,0]; \r\n var A = elem.getBoundingClientRect();\r\n var x = A.left, y = A.top;\r\n if(BIEStrict || (BMozilla||BOpera)&&BStrict){\r\n x += doc.scrollLeft;\r\n y += doc.scrollTop;\r\n if(!BIEA8) { x -= doc.clientLeft; y -= doc.clientTop; }\r\n \r\n }\r\n else {\r\n if(BChrome){\r\n var B = doc.getBoundingClientRect();\r\n x -= B.left-doc.offsetLeft; y -= B.top-doc.offsetTop;\r\n }\r\n \r\n else {\r\n x += bod.scrollLeft;\r\n y += bod.scrollTop;\r\n }\r\n \r\n if(BSafariMac&&!BSafariWin){\r\n x -= doc.offsetLeft;\r\n y -= doc.offsetTop;\r\n }\r\n else if(!BIE && !BChrome && !BSafariWin){\r\n x += bod.clientLeft;\r\n y += bod.clientTop;\r\n }\r\n }\r\n \r\n return [x/CZoom,y/CZoom];\r\n }\r\nvar x=elem.offsetLeft, y=elem.offsetTop,p,lp = elem;\r\ntry { p = elem.offsetParent; } catch(e){ return [x,y]; } \r\nif(!p) return AbsoluteToWindow(); \r\nif(BIEA){\r\n if(BIEStrict && CZoom!=1 && lp.style.position==\"absolute\"){\r\n x += Math.floor(lp.offsetLeft/CZoom-lp.offsetLeft);\r\n y += Math.floor(lp.offsetTop/CZoom-lp.offsetTop);\r\n }\r\n while(p && p!=doc){ \r\n if(p==bod){ \r\n x+=p.offsetLeft+p.clientLeft;\r\n y+=p.offsetTop+p.clientTop; \r\n break;\r\n }\r\n if((!BIEA8||!BStrict) && p.tagName.toLowerCase()==\"table\"){ \r\n x-=p.clientLeft;\r\n y-=p.clientTop;\r\n }\r\n x+=p.offsetLeft+p.clientLeft-p.scrollLeft;\r\n y+=p.offsetTop+p.clientTop-p.scrollTop; \r\n p = p.offsetParent;\r\n }\r\n if(BIEA8 && BStrict){ x-=bod.clientLeft; y-=bod.clientTop; }\r\n if(BIEStrict && CZoom!=1){\r\n x+=Math.floor(p.offsetLeft/CZoom-p.offsetLeft);\r\n y+=Math.floor(p.offsetTop/CZoom-p.offsetTop);\r\n } \r\n }\r\nelse { \r\n var po = elem;\r\n while(1){\r\n \r\n while(po!=p){\r\n po = po.parentNode;\r\n if(!po || po==bod) break; \r\n \r\n if(po!=bod&&!rtl){\r\n x-=po.scrollLeft;\r\n y-=po.scrollTop;\r\n }\r\n \r\n if((BOpera8 || BOpera&&BOperaVer<9.5)&&po.tagName){\r\n var tag = po.tagName.toLowerCase();\r\n if(tag=='tr'){ y+=po.offsetTop; x+=po.scrollLeft; } \r\n else if(tag=='tbody') x+=po.scrollLeft;\r\n else if(BOpera && tag=='table' && po.style.borderCollapse!='collapse') y+=Math.floor((po.offsetHeight-po.clientHeight)/2); \r\n }\r\n\r\n if(BFF3 && po.tagName){\r\n var tag = po.tagName.toLowerCase();\r\n if(tag==\"td\"){ x+=po.clientLeft; y+=po.clientTop; }\r\n } \r\n if((BIPAD||BSafariWin) && po.tagName){\r\n var tag = po.tagName.toLowerCase();\r\n if(tag==\"table\" || tag==\"td\"){ x+=po.clientLeft; y+=po.clientTop; }\r\n } \r\n }\r\n \r\n if(!p || p==bod) break;\r\n x+=p.offsetLeft;\r\n y+=p.offsetTop;\r\n lp = p; \r\n p = p.offsetParent;\r\n if(p==bod){\r\n var abs = lp.Absolute; if(abs==null){ var s = GetStyle(lp); abs = s.position==\"absolute\"; lp.Absolute = abs; }\r\n if(abs) {\r\n \r\n break;\r\n }\r\n }\r\n }\r\n \r\n if(BOpera8 || BMozilla || BSafariWin || BSafariMac){\r\n var abs = lp.Absolute; if(abs==null){ var s = GetStyle(lp); abs = s.position==\"absolute\"; lp.Absolute = abs; }\r\n if(abs){\r\n var A = AbsoluteToWindow();\r\n x += A[0]; y += A[1]; \r\n return [x,y];\r\n }\r\n if(BMozilla||BSafariWin){\r\n if(doc.marginLeft==null){\r\n var s = GetStyle(doc);\r\n var ml = parseInt(s.marginLeft), mt = parseInt(s.marginTop);\r\n doc.marginLeft = ml?ml:0; doc.marginTop = mt?mt:0;\r\n }\r\n x += doc.marginLeft; y += doc.marginTop;\r\n }\r\n \r\n if(BFF3&&!BStrict){ x -= bod.offsetLeft; y -= bod.offsetTop; }\r\n \r\n if(BSafariMac&&!abs){ x += bod.offsetLeft; y += bod.offsetTop; }\r\n if(BMozilla||BSafariWin){\r\n if(bod.clientLeft==null) {\r\n var s = GetStyle(bod);\r\n var bl = parseInt(s.borderLeftWidth), bt = parseInt(s.borderTopWidth);\r\n bod.clientLeft = bl?bl:0; bod.clientTop = bt?bt:0;\r\n }\r\n x += bod.clientLeft; y += bod.clientTop; \r\n }\r\n if(BOpera8){\r\n x += bod.offsetLeft+bod.clientLeft;\r\n y += bod.offsetTop+bod.clientTop;\r\n }\r\n \r\n } \r\n if(BKonqueror){ x += doc.offsetLeft; y += doc.offsetTop; }\r\n \r\n }\r\n\r\nreturn [x,y];\r\n}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function isMozilla()\n{\n return __isMozilla;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n var ua = navigator.userAgent;\n return ua.indexOf('Firefox') === -1;\n}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}", "function i(){return(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()}" ]
[ "0.63365144", "0.6279534", "0.6122125", "0.6112479", "0.60847294", "0.58074266", "0.58074266", "0.58074266", "0.5801848", "0.5783436", "0.5783436", "0.5783436", "0.5783436", "0.5783436", "0.5783436", "0.57709545", "0.57705885", "0.5754153", "0.5750997", "0.5747006", "0.57442456", "0.5743043", "0.57412714", "0.5740744", "0.5738474", "0.57320106", "0.5720248", "0.56505936", "0.56274015", "0.56208384", "0.5581359", "0.55143905", "0.5503101", "0.55022746", "0.5500874", "0.54911053", "0.54911053", "0.54911053", "0.548374", "0.54451185", "0.5439636", "0.54336816", "0.5431677", "0.54300123", "0.54292935", "0.5429001", "0.5410117", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.540982", "0.5402122", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5398663", "0.5391626", "0.5391626", "0.5391626", "0.5391626" ]
0.0
-1
returns a new Array with the elements that are in a but not in b
function diff( a, b ) { var result = a.slice(); for ( var i = 0; i < result.length; i++ ) { for ( var j = 0; j < b.length; j++ ) { if ( result[i] === b[j] ) { result.splice(i, 1); i--; break; } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayDiff(a, b) {\n let result = []\n\n result = a.filter(ele => !b.includes(ele)) \n \n\n return result\n}", "function array_diff(a, b) {\r\n let finalArr = a.filter(function(a) {\r\n return !b.includes(a)});\r\n return finalArr;\r\n }", "function arrayDiff(a, b) {\n return a.filter((el) => !b.includes(el));\n}", "function arrayDiff(a, b) {\n\treturn a.filter(ar => !b.includes(ar));\n}", "function arrayDiff(a, b) {\n let result = []\n for (x in a) {\n if (!(b.includes(a[x]))) {\n result.push(a[x]);\n }\n }\n return result;\n}", "function arr_diff(a,b){\r\n\tvar c=[];//clone of a\r\n\tvar d=[];//Anything a does not include\r\n\tvar e=[];//Anything a *does* include\r\n\tfor(var an of a){\r\n\t\tc.push(an);\r\n\t}\r\n\tfor(var bn of b){\r\n\t\tif(c.indexOf(bn)===-1)d.push(bn);\r\n\t\telse e.push(bn);\r\n\t}\r\n\tfor(var en of e){\r\n\t\tc.splice(c.indexOf(en),1);\r\n\t}\r\n\treturn [c,d];\r\n}", "function array_diff(a, b) {\n return a.filter(function(v){\n return b.indexOf(v) === -1;\n });\n}", "function array_diff(a, b) {\n return a.filter(function(item) {\n if (b.indexOf(item)==-1) {\n return true;\n }\n return false;\n });\n}", "function arrayDiff(a, b) {\n let holder=[];\n \n for(let x=0;x<a.length;x++)\n {\n if(!b.includes(a[x]))\n {\n holder.push(a[x]);\n }\n }\n \n return holder;\n }", "function arraySubtract (a, b) {\n if (!Array.isArray(b)) b = [b];\n const res = [];\n for (let i = 0; i < a.length; i++) {\n if (!b.includes(a[i])) res.push(a[i]);\n }\n return res\n }", "function diff(a, b) {\n return [...new Set(a.filter(i => !new Set(b).has(i)))];\n}", "function diff(a, b){\n // iterate over elements in array a, return element only if it isn't in b\n return a.filter((el) => {\n return b.indexOf(el) < 0;\n });\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (!a.includes(b[i])) diff.push(b[i]);\n }\n\n return diff;\n}", "function array_diff(a, b) {\n var arr1 = a;\n var arr2 = b;\n return arr1.filter(function(elem){\n return arr2.indexOf(elem) == -1;\n })\n}", "function array_diff(a, b) {\na.map(function(element){\nfor(var i =0; i <b.length; i++){\nif(element === b[i]){\na[a.indexOf(element)]=null;\nbreak;\n}\n}});\na = a.filter(function(n){ return n !=null });\n\nreturn a;\n}", "function array_diff (a, b) {\n // If input length is 0 for a or b, return 'a' array value\n if (a.length === 0 || b.length === 0) return a\n let result = []\n // Do looping to check the occurence of b elements in a array\n for (let i = 0; i < a.length; i++) {\n let isNotOccur = true\n for (let j = 0; j < b.length; j++) {\n if (a[i] === b[j]) {\n isNotOccur = false\n }\n }\n if (isNotOccur) result.push(a[i])\n }\n return result\n}", "function diffArray(a, b) {\n var seen = [], diff = [];\n for ( var i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for ( var i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function difference(a, b) {\n var ret = [];\n for (var i = 0, len = a.length; i < len; i++) {\n if (b.indexOf(a[i]) < 0) {\n ret.push(a[i]);\n }\n }\n\n return ret;\n}", "function notInArray (arr1,arr2){\n return arr1.filter(function(x){return arr2.indexOf(x) == -1;});\n}", "function arrayDiff(a, b) {\n let arr = [...a];\n b.forEach(d => {\n arr = arr.filter(x => x != d);\n });\n return arr;\n}", "function arr_diff(a,b) {\n var seen = [],\n diff = [],\n i;\n for (i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for (i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function arr_diff(a,b) {\n var seen = [],\n diff = [],\n i;\n for (i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for (i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function arrayDiff(a, b) {\r\n //Go through each element in array 1\r\n //check if that element exists in array 2\r\n //if it exists in array 2, do nothing\r\n //if it doesn't exist in array 2 AND doesn't already exist in the answer, push to answer array\r\n //let's do this the old fashion way first, using loop even though i'm pretty sure this can be done with reduce\r\n let answer = []\r\n a.forEach((el)=>{\r\n if(!b.includes(el)){\r\n answer.push(el)\r\n }\r\n })\r\n return answer\r\n}", "function arrayIntersect(a, b) {\n return a.filter(function(v) {\n return ~b.indexOf(v);\n }).sort();\n}", "function arrDiff(a,b) {\n var seen = [], diff = [];\n for ( var i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for ( var i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function array_diff(a, b) {\n//loops through the elements in b\n for (i = 0; i < b.length; i++){\n \t\tvar j = 0;\n //checks against the elements of a\n \t\twhile (j < a.length){\n //if it finds the element, remove it\n \t\t\tif (a[j] === b[i]){\n\t \t\t\ta.splice(j, 1);\n\t \t\t}\n //if it doesnt find the element, increase the index of j\n\t \t\telse {\n\t \t\t\tj++;\n\t \t\t}\n \t\t}\n \t}\n \treturn a;\n}", "function array_diff(a, b) {\n // filter reates a new array with all elements that pass the test implemented by the provided callback function.\n // the callback is invoked w the 1. value of element 2. index of element 3. array object being traversed \n // x is the element in array a \n return a.filter(function(x) {\n // returns false for elements that are in a as well as b \n // thus, filter makes sure those are not included in the final array\n return !(b.indexOf(x) > -1);\n });\n}", "function array_diff(a, b) {\n if (a.length === 0 || b.length === 0) {\n return a;\n } else {\n while (b.length > 0) {\n a = a.filter(num => num != b[0])\n b.shift();\n }\n return a\n }\n}", "function arrayDiff(a, b) {\n var diff = [];\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "static difference(a, b) {\n const differenceSet = new XSet(a);\n for (const bValue of b) {\n if (a.has(bValue)) {\n differenceSet.delete(bValue);\n }\n }\n return differenceSet;\n }", "function diff( a, b ) {\n\tvar i, j,\n\t\tresult = a.slice();\n\n\tfor ( i = 0; i < result.length; i++ ) {\n\t\tfor ( j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice( i, 1 );\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function diff( a, b ) {\n\tvar i, j,\n\t\tresult = a.slice();\n\n\tfor ( i = 0; i < result.length; i++ ) {\n\t\tfor ( j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[ i ] === b[ j ] ) {\n\t\t\t\tresult.splice( i, 1 );\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function diff( a, b ) {\n var result = a.slice();\n\tfor ( var i = 0; i < result.length; i++ ) {\n\t\tfor ( var j = 0; j < b.length; j++ ) {\n\t\t\tif ( result[i] === b[j] ) {\n\t\t\t\tresult.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function getDifference(a,b){\n\n var a = [...new Set(a)];\n var b = [...new Set(b)];\n var c = a.concat(b);\n var d =[];\n \n \n for( var j = 0; j < c.length ;j++){\n if (c.slice(0,j).concat(c.slice(j+1)).includes(c[j])==false){\n d.push(c[j]);\n } \n }\n return d.sort();\n }", "function diff(a, b) {\n \tvar i,\n \t j,\n \t result = a.slice();\n\n \tfor (i = 0; i < result.length; i++) {\n \t\tfor (j = 0; j < b.length; j++) {\n \t\t\tif (result[i] === b[j]) {\n \t\t\t\tresult.splice(i, 1);\n \t\t\t\ti--;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \treturn result;\n }", "function xorArrays(a, b) {\n var xor = [], i;\n for (i=0; i<a.length; i++) {\n if (b.indexOf(a[i]) == -1) xor.push(a[i]);\n }\n for (i=0; i<b.length; i++) {\n if (a.indexOf(b[i]) == -1) xor.push(b[i]);\n }\n return xor;\n }", "function diffArray(arr1, arr2) {\r\n return arr1.filter(function (x) {\r\n return !arr2.includes(x); // same as arr2.indexOf(x) === -1\r\n }).concat(arr2.filter(function (x) {\r\n return !arr1.includes(x)\r\n }));\r\n}", "function diffArray(arr1, arr2) {\r\n return arr1.concat(arr2).filter(function (item) {\r\n return !arr1.includes(item) || !arr2.includes(item)\r\n });\r\n}", "function array_diff(arr1, arr2) {\n arr1 = arr1.filter(num => !arr2.includes(num)); // reassign cuz we need to mutate the array a\n return arr1;\n}", "function differentElements(arr1, arr2) {\n let set1 = [...new Set(arr1)];\n let set2 = [...new Set(arr2)];\n return [...set1.filter(o => !set2.includes(o)), ...set2.filter(o => !set1.includes(o))]\n}", "function diffArray(arr1, arr2) {\n \n let newArr = [];\n\n newArr = arr1.filter(x => ! new Set(arr2).has(x));\n\n const additional = arr2.filter(x => ! new Set(arr1).has(x));\n \n // combine these items\n newArr.push(...additional);\n \n return newArr;\n \n}", "function difference(a1, a2) {\n\t\treturn _.filter(a1, function ina2(r1) {\n\t\t\treturn !_.some(a2, function rina2(r2) {\n\t\t\t\treturn r1.id === r2.id;\n\t\t\t});\n\t\t});\n\t}", "function arrayDiff(a, b) {\n \n const newArray = [];\n \n for (var i = 0; i < b.length; i++){\n a.forEach(number => number !== b[i] ? newArray.push(number) : null)\n }\n \n if (b.length == \"\") { newArray.push(...a)}\n \n return newArray\n }", "function diffArray(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter(\n item => !arr1.includes(item) || !arr2.includes(item)\n )\n}", "function array_diff(a, b) {\n var arrA = a.slice()\n var arrB = b.slice()\n var res = []\n for (var i = 0; i < arrA.length; i++) {\n var found = false\n for (var j = 0; j < arrB.length; j++) {\n if (arrA[i] == arrB[i]) {\n found = true\n break\n }\n }\n if (found == false) {\n res.push(arrA[i])\n }\n }\n console.log(res)\n return res\n}", "function diffArray(arr1, arr2) {\n let newArr = [];\n newArr = arr1.filter(x => !arr2.includes(x)).concat(arr2.filter(x => !arr1.includes(x)));\n return newArr;\n}", "function diff(first, second) {\n const a = new Set(first);\n const b = new Set(second);\n \n return [\n ...first.filter(x => !b.has(x)),\n ...second.filter(x => !a.has(x))\n ];\n}", "function setDifference(a, b){\n var aset = {};\n // store items from a in an object (hastable)\n for(var i = 0; i<a.length; i++){\n aset[a[i].toString()] = a[i];\n }\n // remove matches in b\n for(var i = 0; i<b.length; i++){\n var bstr = b[i].toString();\n if(bstr in aset){\n delete aset[bstr];\n }\n }\n // extract the remaining items in an array\n var diff = [];\n for (var name in aset) {\n diff.push(aset[name]);\n }\n return diff;\n}", "function diffArray(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter(item => !arr1.includes(item) || !arr2.includes(item));\n}", "function diffArray(arr1, arr2) {\n return arr1.filter(e => !arr2.includes(e)).concat(arr2.filter(e => !arr1.includes(e)));\n}", "function diffArray(arr1, arr2) {\n var newArr = arr1.filter(n => !arr2.includes(n));\n var newArr1 = arr2.filter(n => !arr1.includes(n));\n return newArr.concat(newArr1);\n\n // or in one line\n // var newArr = arr1.filter(n=> !arr2.includes(n)).concat(arr2.filter(n=> !arr1.includes(n)))\n}", "function diffArray(arr1, arr2) {\n return arr1\n .filter(el => !arr2.includes(el))\n .concat(\n arr2.filter(el => !arr1.includes(el))\n )\n}", "function countNumbersNotInB(a, b) {\n if (!Array.isArray(a) || a.length === 0 || !Array.isArray(b)) return 0;\n\n const newArray = [];\n a.forEach((x) => {\n if (!b.includes(x)) newArray.push(x);\n });\n\n return newArray.length;\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n \n function onlyInFirst(first, second) {\n // Looping through an array to find elements that don't exist in another array\n for (var i = 0; i < first.length; i++) {\n if (second.indexOf(first[i]) === -1) {\n // Pushing the elements unique to first to newArr\n newArr.push(first[i]);\n }\n }\n }\n \n onlyInFirst(arr1, arr2);\n onlyInFirst(arr2, arr1);\n \n return newArr;\n }", "function arrDiff(a1, a2) {\n var a = [], diff = [];\n\n for (var i = 0; i < a1.length; i++) {\n a[a1[i]] = true;\n }\n\n for (var i = 0; i < a2.length; i++) {\n if (a[a2[i]]) {\n delete a[a2[i]];\n } else {\n a[a2[i]] = true;\n }\n }\n\n for (var k in a) {\n diff.push(k);\n }\n\n return diff;\n }", "function difference(a, b, fn) {\n fn = makeEqualsFunction(fn);\n return a.filter(function (x) {\n return b.every(function (y) {\n return !fn(x, y);\n });\n });\n}", "function arraySubtract(arr1, arr2) {\n return arr1.filter(function(elt) {\n return arr2.indexOf(elt) < 0;\n });\n}", "function arrayDiff(a, b) {\n newArray = a\n b.map(num => {\n for(i = 0; i < a.length; i++) {\n // console.log(i, a[i], b.find(num => num))\n if (a[i] === num) {\n newArray.splice(i, 1);\n i--;\n }\n }\n })\n return newArray\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n \n function onlyInFirst(first, second) {\n // Looping through an array to find elements that don't exist in another array\n for (var i=0;i<first.length;i++) {\n if (second.indexOf(first[i]) === -1) {\n // Pushing the elements unique to first to newArr\n newArr.push(first[i]);\n }\n }\n }\n onlyInFirst(arr1, arr2);\n onlyInFirst(arr2, arr1);\n \n return newArr;\n}", "function diffArray(arr1, arr2) {\n return arr1.filter(num => arr2.indexOf(num) == -1).concat(arr2.filter(num => arr1.indexOf(num) == -1));\n\n}", "function mergeArrays (a, b) {\n return a.concat(b.filter(function (item) {\n return a.indexOf(item) < 0;\n }))\n}", "function intersection_destructive(a, b)\n{\n var result = [];\n while( a.length > 0 && b.length > 0 )\n {\n if (a[0] < b[0] ){ a.shift(); }\n else if (a[0] > b[0] ){ b.shift(); }\n else /* they're equal */\n {\n result.push(a.shift());\n b.shift();\n }\n }\n\n return result;\n}", "function intersection(A, B) {\r\n let tmp = new Set(A);\r\n for(let elem of A) {\r\n if(!B.has(elem)) {\r\n tmp.delete(elem);\r\n }\r\n }\r\n return tmp;\r\n }", "static diffArray(arr1, arr2) {\n let unique1 = arr1.filter(item => arr2.indexOf(item) == -1);\n let unique2 = arr2.filter(item => arr1.indexOf(item) == -1);\n unique1.push(...unique2);\n return unique1;\n }", "function intersectArraysBackwards(a, b) // based on http://stackoverflow.com/a/1885660/4038307\n {\n var ai= a.length-1, bi= b.length-1;\n var result = [];\n\n while( ai >= 0 && bi >= 0 )\n {\n if (a[ai] < b[bi] ){ ai--; }\n else if (a[ai] > b[bi] ){ bi--; }\n else /* they're equal */\n {\n result.unshift(a[ai]);\n ai--;\n bi--;\n }\n }\n\n return result;\n }", "function intersection_destructive(a, b)\n{\n var result = [];\n while( a.length > 0 && b.length > 0 )\n { \n if (a[0] < b[0] ){ a.shift(); }\n else if (a[0] > b[0] ){ b.shift(); }\n else /* they're equal */\n {\n result.push(a.shift());\n b.shift();\n }\n }\n return result;\n}", "function diffArray2(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter(\n item => !arr1.includes(item) || !arr2.includes(item)\n )\n}", "function union(A, B){\n var result = A.slice();\n for (i = 0; i < B.length; i++) {\n if ($.inArray(B[i], result) === -1) {\n result.push(B[i]);\n }\n }\n return result;\n}", "function diffArray(arr1, arr2) {\n let newArr = [];\n // Same, same; but different.\n arr1.forEach(element => {\n if (!arr2.includes(element)) {\n newArr.push(element);\n }\n });\n arr2.forEach(element => {\n if (!arr1.includes(element)) {\n newArr.push(element);\n }\n });\n return newArr;\n}", "function xor(arr1, arr2) {\n\t arr1 = unique(arr1);\n\t arr2 = unique(arr2);\n\n\t var a1 = filter(arr1, function(item){\n\t return !contains(arr2, item);\n\t }),\n\t a2 = filter(arr2, function(item){\n\t return !contains(arr1, item);\n\t });\n\n\t return a1.concat(a2);\n\t }", "function differenceArray(arr1, arr2){\n let uniqueArray = [];\n\n for(let val of arr1) {\n if (!arr2.includes(val) && !uniqueArray.includes(val)) {\n uniqueArray.push(val);\n }\n }\n\n for(let val of arr2) {\n if (!arr1.includes(val) && !uniqueArray.includes(val)){\n uniqueArray.push(val);\n }\n }\n \n return uniqueArray;\n}", "function difference(arr1, arr2) {\n var diffArr=[];\n for (var i of arr1){\n if (arr2.indexOf(i)===-1) diffArr.push(i);\n }\n return diffArr;\n}", "function difference(array1, array2) {\r\n return array1.filter(function(x) {\r\n return array2.indexOf(x) < 0;\r\n });\r\n}", "function difference(arr) {\n\t var arrs = slice(arguments, 1),\n\t result = filter(unique(arr), function(needle){\n\t return !some(arrs, function(haystack){\n\t return contains(haystack, needle);\n\t });\n\t });\n\t return result;\n\t }", "function diffArray(arr1, arr2) {\n var newArr = [];\n // Same, same; but different.\n let symmetricDiff = arr1\n .filter(x => !arr2.includes(x))\n .concat(arr2.filter(x => !arr1.includes(x)));\n return symmetricDiff;\n}", "function diffArray (arr1, arr2) {\n var newArr = []\n .concat(\n arr1.filter(\n el1 => arr2.every(\n el2 => el2 !== el1))) // if ANY element of arr2 is equal to el1, el1 doesn't pass the filter.\n .concat(\n arr2.filter(\n el2 => arr1.every(\n el1 => el1 !== el2))); // if ANY element of arr1 is equal to el2, el2 doesn't pass the filter.\n console.log(newArr);\n\n return newArr;\n // Same, same; but different.\n}", "function arrayRemove(arr1, arr2) {\n return arr1.filter(ele1 => {\n return ele1 != arr2.filter(ele2 => {\n return ele2 == ele1;\n });\n });\n}", "function diffArray(arr1, arr2) {\r\n\tvar newArr = [];\r\n\r\n\tif (arr1.length === 0 || arr2.legth === 0) {\r\n\t\treturn arr1.length !== 0 ? arr1 : arr2;\r\n\t}\r\n\r\n\tnewArr = (arr1.filter(function (value) {\r\n\t\t\treturn arr2.indexOf(value) < 0;\r\n\t\t}));\r\n\r\n\tnewArr = newArr.concat(arr2.filter(function (value) {\r\n\t\t\t\treturn arr1.indexOf(value) < 0;\r\n\t\t\t}));\r\n\r\n\treturn newArr;\r\n}", "function difference(arr, other) {\n var index = arrayToIndex(other);\n return arr.filter(function(el) {\n return !Object.prototype.hasOwnProperty.call(index, el);\n });\n }", "function array_diff(a, b) {\n for(var i = 0; i < a.length; i++){\n // use indexOf to see if the character exists in the array a \n if(a.indexOf(b[0]) > -1){\n // indexOf gives you the index\n var index = a.indexOf(b[0]);\n console.log(index);\n // splice will remove the element at that index\n a.splice(index, 1);\n }\n }\n return a;\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n for (let i = 0; i < arr1.length; i++) {\n if (!arr2.includes(arr1[i])) {\n newArr.push(arr1[i]);\n }\n }\n for (let j = 0; j < arr2.length; j++) {\n if (!arr1.includes(arr2[j])) {\n newArr.push(arr2[j]);\n }\n }\nreturn newArr;\n}", "function filterNotUnique(compare) {\n return merged.filter(function(element){\n return element !== compare;\n })\n }", "array_new_items(in_array, not_in) {\n let result = [];\n for (let i = 0; i < in_array.length; i++) {\n if (not_in.indexOf(in_array[i]) === -1) {\n result.push(in_array[i]);\n }\n }\n return result;\n }" ]
[ "0.82911384", "0.82779413", "0.8142924", "0.8138582", "0.81050986", "0.81028783", "0.7998012", "0.79424125", "0.7909976", "0.7894401", "0.78242", "0.7797435", "0.77629966", "0.77026093", "0.76710844", "0.7670596", "0.7629665", "0.7611424", "0.7599579", "0.7599043", "0.7579853", "0.7577083", "0.75588536", "0.74295944", "0.7429032", "0.7426084", "0.7384277", "0.7351866", "0.7323773", "0.7323773", "0.7323773", "0.7278052", "0.7278052", "0.7278052", "0.7278052", "0.7278052", "0.7278052", "0.7278052", "0.7276852", "0.7276852", "0.7276852", "0.7276852", "0.7276852", "0.7276852", "0.72058344", "0.71881557", "0.7183139", "0.7175861", "0.7175697", "0.7174947", "0.71421945", "0.7105585", "0.7080371", "0.7070963", "0.7068491", "0.7067711", "0.70183563", "0.7014902", "0.700349", "0.6994777", "0.69937307", "0.6980054", "0.6978901", "0.6976328", "0.69527996", "0.69050413", "0.68823004", "0.68317664", "0.68302315", "0.6822658", "0.681499", "0.67855954", "0.67660654", "0.674806", "0.67427915", "0.67404026", "0.6724284", "0.67236644", "0.67150444", "0.6695356", "0.6677474", "0.6676585", "0.66674274", "0.66431046", "0.66409564", "0.6639834", "0.66354597", "0.662976", "0.6628261", "0.66127753", "0.66018736", "0.65889466", "0.65875995", "0.65821856", "0.6576478", "0.6575114", "0.6560683", "0.6542621" ]
0.7138789
53
stack to avoiding loops from circular referencing Call the o related callback with the given arguments.
function bindCallbacks(o, callbacks, args) { var prop = QUnit.objectType(o); if (prop) { if (QUnit.objectType(callbacks[prop]) === "function") { return callbacks[prop].apply(callbacks, args); } else { return callbacks[prop]; // or undefined } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detail(...args) {\n callback(...args);\n }", "call(callback, ...names) {\n const {\n stack\n } = this;\n const {\n length\n } = stack;\n let value = getLast(stack);\n\n for (const name of names) {\n value = value[name];\n stack.push(name, value);\n }\n\n const result = callback(this);\n stack.length = length;\n return result;\n }", "static performCallbacks(callbacks) {\n // This is my method of getting all the arguments except for the list of callbacks\n const args = Array.prototype.slice.call(arguments, 1);\n callbacks.forEach((callback) => {\n // To use the arguments I have to use the apply method of the function\n callback(...args);\n });\n }", "adoptedCallback() { }", "call( callback, ...names ) {\n\t\tconst { stack } = this;\n\t\tconst { length } = stack;\n\t\tlet value = getLast( stack );\n\n\t\tfor ( const name of names ) {\n\t\t\tvalue = value[ name ];\n\t\t\tstack.push( name, value );\n\t\t}\n\n\t\tconst result = callback( this );\n\t\tstack.length = length;\n\t\treturn result;\n\t}", "function callbackified(...args) {\n const maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('last argument', 'Function', maybeCb);\n }\n const cb = (...args) => { Reflect.apply(maybeCb, this, args); };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n Reflect.apply(original, this, args)\n .then((ret) => process.nextTick(cb, null, ret),\n (rej) => process.nextTick(callbackifyOnRejected, rej, cb));\n }", "function AckCallStack() {}", "function onRej(arg) {\n if (self.trace) {\n self.resolvedStackTrace = stack(1);\n }\n onTick();\n completed = true;\n rej(arg);\n }", "function sc_jsCall(o, fun) {\n var args = new Array();\n for (var i = 2; i < arguments.length; i++)\n\targs[i-2] = arguments[i];\n return fun.apply(o, args);\n}", "function pushOpArgs(args)\n {\n opFuncArgsStack.push(args);\n }", "runCallbacks(callbacks, args) {\r\n for (let i = 0; i < callbacks.length; i++) {\r\n if (typeof callbacks[i] !== 'function') continue;\r\n callbacks[i].apply(null, args);\r\n }\r\n }", "adoptedCallback() {\n\n }", "function Call({\n handle,\n params,\n hash\n}) {\n return [op(0\n /* PushFrame */\n ), op('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), op(16\n /* Helper */\n , handle), op(1\n /* PopFrame */\n ), op(35\n /* Fetch */\n , $v0)];\n}", "adoptedCallback() {}", "adoptedCallback() {}", "function createCurrentCallObject() {\n\n}", "function bindCallbacks(o, callbacks, args) {\n\t\tvar prop = hoozit(o);\n\t\tif (prop) {\n\t\t\tif (hoozit(callbacks[prop]) === \"function\") {\n\t\t\t\treturn callbacks[prop].apply(callbacks, args);\n\t\t\t} else {\n\t\t\t\treturn callbacks[prop]; // or undefined\n\t\t\t}\n\t\t}\n\t}", "function Call({\n handle,\n params,\n hash\n}) {\n return [Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(0\n /* PushFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(16\n /* Helper */\n , handle), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(1\n /* PopFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(36\n /* Fetch */\n , _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"])];\n}", "function Call({\n handle,\n params,\n hash\n}) {\n return [Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(0\n /* PushFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(16\n /* Helper */\n , handle), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(1\n /* PopFrame */\n ), Object(_encoder__WEBPACK_IMPORTED_MODULE_2__[\"op\"])(36\n /* Fetch */\n , _glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$v0\"])];\n}", "function resolve() {\n $apply(a.shift() || function () {}, arguments);\n }", "function callHooks(currentView,arr){for(var i=0;i<arr.length;i+=2){arr[i+1].call(currentView[arr[i]]);}}", "function bindCallbacks(o, callbacks, args) {\n var prop = getType(o);\n if (prop) {\n if (getType(callbacks[prop]) === \"function\") {\n return callbacks[prop].apply(callbacks, args);\n } else {\n return callbacks[prop]; // or undefined\n }\n }\n }", "static InvokeCallback(cb, ...args)\n\t{\n\t\tif (Boolean(cb) && typeof cb === 'function')\n\t\t{\n\t\t\tconst arg = Array.from ? Array.from(args) : [].slice.call(args);\n\t\t\tcb(...arg);\n\t\t}\n\t}", "function getCallbackFromArgs( argumentList ) {\n var callbackObject = [];\n\n if ( argumentList && argumentList.length ) {\n for ( var i in argumentList ) {\n switch( typeof argumentList[i] ) {\n case \"function\":\n throw new Error()\n case \"object\": \n case \"number\":\n case \"array\":\n default:\n // this does not check for other functions within objects...\n callbackObject.push(JSON.parse(JSON.stringify(argumentList[i])));\n break;\n }\n }\n \n }\n return callbackObject;\n }", "function $callFromDirect(f, thisObj, args)\n{\n var argArray = new Array;\n for(var idx = 0; idx < args.length; idx++)\n argArray[idx] = args[idx];\n return $trampoline(function() {\n return f.apply(thisObj, [$id].concat(argArray));\n });\n}", "function main(param1,param2,callBack){ \n console.log(param1, param2) \n callBack() \n }", "then(...args){\n utils.attachToPrevious(this.previous).then(x=>{\n var f = args[0];\n this.rl.close();\n f(x);\n })\n }", "function callbackified(...args) {\n const maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n // original\n // throw new errors.TypeError(\n // 'ERR_INVALID_ARG_TYPE',\n // 'last argument',\n // 'function');\n // modified\n throw makeNodeError(TypeError, 'ERR_INVALID_ARG_TYPE');\n }\n // @ts-ignore\n const cb = (...args) => { Reflect.apply(maybeCb, this, args); };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n // @ts-ignore\n Reflect.apply(original, this, args)\n .then((ret) => process.nextTick(cb, null, ret), \n // @ts-ignore\n (rej) => process.nextTick(callbackifyOnRejected, rej, cb));\n }", "function makeCaller(ko, callback) {\n return function() {\n return callback.apply(this, [ko].concat(Array.prototype.slice.call(arguments, 0)));\n };\n }", "function bindCallbacks( o, callbacks, args ) {\n\t\tvar prop = QUnit.objectType( o );\n\t\tif ( prop ) {\n\t\t\tif ( QUnit.objectType( callbacks[ prop ] ) === \"function\" ) {\n\t\t\t\treturn callbacks[ prop ].apply( callbacks, args );\n\t\t\t} else {\n\t\t\t\treturn callbacks[ prop ]; // or undefined\n\t\t\t}\n\t\t}\n\t}", "callCustom(userFn) {\n let sliced;\n\n sliced = Array.prototype.slice.call(arguments, 1);\n\n if (this.options.callbacks !== undefined && this.options.callbacks[userFn] !== undefined && typeof this.options.callbacks[userFn] === 'function'\n ) {\n this.options.callbacks[userFn].apply(this, sliced);\n }\n }", "function wrapper() {\n\t\tclbk.apply( null, args );\n\t}", "function example4() {\n\n var me = {\n name: \"Vlad\",\n surname: \"Argentum\"\n };\n\n function hi(_ref) {\n var _ref$name = _ref.name;\n var name = _ref$name === undefined ? \"Guest\" : _ref$name;\n var _ref$surname = _ref.surname;\n var s = _ref$surname === undefined ? \"Anon\" : _ref$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n\n hi({}); //Guest Anon\n hi(me); //Vlad Argentum\n\n //even can call without params\n function hi() {\n var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref2$name = _ref2.name;\n var name = _ref2$name === undefined ? \"No\" : _ref2$name;\n var _ref2$surname = _ref2.surname;\n var s = _ref2$surname === undefined ? \"Params\" : _ref2$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n hi(); //No Params\n}", "function PopArg() {\r\n}", "adoptedCallback () {\n //! Not sure what to do.\n }", "function exec_callback(args) {\n if (callback_func && (callback_force || !con || !con.log)) {\n callback_func.apply(window, args);\n }\n }", "function __applyUp(self, func, args)\r\n{\r\n func.apply(self, args);\r\n if (self.__parent) {\r\n __applyUp(self.__parent, func, args);\r\n }\r\n}", "function Stack() {\n var handle = function(req, res, next) { next() }\n ;[].slice.call(arguments).reverse().forEach(function(layer) {\n var child = handle\n handle = function (req, res, next) {\n layer(req, res, function () {\n child(req, res, next)\n })\n }\n })\n return handle\n}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function myPush(arr, ...args){\n//function myPush(arr, element){\n\n // could try to create a finction with just ...args\n // as the parameters\n // maybe then would work better\n\n // tried allowing multiple parameters\n\n\n // trying to allow for multiple arguments gets a little weird\n\n // the output says circular\n\n //var index = arr.length ;\n\n // maybe remove element\n\n\n\n //arr[index] = element;\n\n\n // attempt to try and accept multiple elements\n\n // fro some reason seems to create a circular array when I do this\n\n // will try and make better latter\n\n //\n\n\n\n\n\n for (var i=1; i < arguments.length; i++) {\n// need to ignore the first element\n// as that is the array\n// it now works properly\n var index = arr.length ;\n\n // maybe better way to do this to make more clear\n\n arr[index] = arguments[i];\n // I prefer this method\n // as I think it is more clear\n\n }\n\n\n\n\n\n\n return arr.length;\n\n\n // does not need to return anything\n // the premade function does return though\n // so I also return the length\n\n\n\n \n\n\n}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=getParent(inst);}var i=void 0;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function callback(){}", "function l(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}", "function l(a,b,c){var d=Array.prototype.slice.call(arguments,2);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(b,c)}}", "function foo() {\n\tconsole.log(arguments);\n\targuments.callee;\n\targuments.callee.caller;\n}", "function e(a,b){return function(){return a.apply(b,arguments)}}", "function guess_callback(argsi, array) {\n var callback = argsi[0], args = slice.call(argsi, 1), scope = array, attr;\n\n if (typeof(callback) === 'string') {\n attr = callback;\n if (array.length !== 0 && typeof(array[0][attr]) === 'function') {\n callback = function(object) { return object[attr].apply(object, args); };\n } else {\n callback = function(object) { return object[attr]; };\n }\n } else {\n scope = args[0];\n }\n\n return [callback, scope];\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0; ) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function GlobalCallInfo ()\n{\n this.top_down_view = call_info.CallInfo ();\n\n\n this.process_call_stack = function (call_list_obj)\n {\n var clo = call_list_obj;\n\n for (var key in clo)\n {\n if (clo.hasOwnProperty (key))\n {\n this.top_down_view.add_call (clo[key]);\n }\n }\n };\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i = void 0;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function tiCalls(content, tmpl, data, options) {\n if (!content) {\n return stack.pop();\n }\n stack.push({ _:content, tmpl:tmpl, item:this, data:data, options:options });\n }", "callParent (result) {\n this.parent.insertArgumentResult(this.position, result)\n if (this.parent.readyToBeInvoked()) {\n this.parent.call()\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i = void 0;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function prepCallBack(func) {\n game.callBack.push(func);\n }", "function Call(args, caller, index) {\n this.args = args; // the arguments\n this.caller = caller;\n this.index = index;\n}", "function exec_callback( args ) {\n if ( callback_func && (callback_force || !con || !con.log) ) {\n callback_func.apply( window, args );\n }\n }", "function args(original) {\n var result = {length: 0};\n pushMethod.apply(result, original);\n result.CLASS___ = 'Arguments';\n useGetHandler(result, 'callee', poisonArgsCallee);\n useSetHandler(result, 'callee', poisonArgsCallee);\n useGetHandler(result, 'caller', poisonArgsCaller);\n useSetHandler(result, 'caller', poisonArgsCaller);\n return result;\n }", "function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n \n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb, null, ret) },\n function(rej) { process.nextTick(callbackifyOnRejected, rej, cb) });\n }", "function async_call(){\n\tvar args = Array.prototype.slice.call(arguments);\n\tif(args.length==1){\n\t\t// Promise\n\t\tvar p = args[0];\n\t\treturn new Promise(function(resolve, reject){\n\t\t\tp.then(function(record) {\n\t\t\t\tresolve({\n\t\t\t\t result : record\n\t\t\t\t});\n\t\t\t}).catch(function(error) {\n\t\t\t\tresolve({\n\t\t\t\t err : error\n\t\t\t\t});\n\t\t\t});\n\t\t});\t\t\n\t}\n\tvar obj = args.shift();\n\t\n\tvar func = obj instanceof Function ? obj : obj[args.shift()];\n\t//console.log('async_call',func);\n\treturn new Promise(function(resolve, reject){\n\t\ttry{\n\t\t\tif(func){\n\t\t\t\targs.push(function (err, replay){\n\t\t\t\t\tif (replay) {\n\t\t\t\t\t resolve({\n\t\t\t\t\t\t result : replay\n\t\t\t\t\t });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\terr: err\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfunc.apply(obj, args);\n\t\t\t}\n\t\t\telse\n\t\t\t\tresolve({\n\t\t\t\t\terr : 'Not defined '+func\n\t\t\t\t});\n\t\t}catch(e){\n\t\t\tresolve({\n\t\t\t\terr:e\n\t\t\t});\n\t\t}\n\t\t\n\t});\n}", "function tiCalls( content, tmpl, data, options ) {\n\t\tif ( !content ) {\n\t\t\treturn stack.pop();\n\t\t}\n\t\tstack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });\n\t}", "function tiCalls( content, tmpl, data, options ) {\n\t\tif ( !content ) {\n\t\t\treturn stack.pop();\n\t\t}\n\t\tstack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function callback(ix, elem, obj, parents) {\n\t\tconsole.log(\" \" + ix + \" => \" + elem + \" : \" + (typeof obj == \"undefined\" ? \"undefined\"\n\t\t\t: (obj instanceof Array ? \"Array\" : \"Object\")) + \" (\" + parents.length + \")\");\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function hooks(){return hookCallback.apply(null,arguments)}", "function hooks(){return hookCallback.apply(null,arguments)}", "function greet(who) {\n //2. call stack here and runs console.log\n console.log(`Hello ${who}`)\n}", "adoptedCallback() {\n console.log('inside adoptedCallback');\n }", "call (name, ...args) {\n return new Promise((f, r)=> {\n let id = genUID();\n this.calls.push({ id, f, r });\n this.socket.emit(`__${this.namespace}_call__`, { id, name, args })\n });\n }", "function r(e,t,a){f(function(){e(t,a)})}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = getParent(inst);\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], 'captured', arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], 'bubbled', arg);\n\t }\n\t}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._nativeParent;}var i;for(i=path.length;i-->0;){fn(path[i],false,arg);}for(i=0;i<path.length;i++){fn(path[i],true,arg);}}", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._nativeParent;}var i;for(i=path.length;i-->0;){fn(path[i],false,arg);}for(i=0;i<path.length;i++){fn(path[i],true,arg);}}", "function executeInOrder() {\n var funcs = Array.prototype.concat.apply([], arguments);\n var func = function(callback) {\n funcs.shift();\n callback();\n };\n func(function() {\n if (funcs.length > 0) {\n executeInOrder.apply(this, funcs);\n }\n });\n}", "function xg(){for(var t,e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return\"object\"!==Object(Ei[\"a\"])(r[r.length-1])&&(e=r.pop()),xp()(t=bg()(r).call(r,1)).call(t,(function(t,n,r){return wg()(t,n,e)}),r[0])}", "fire(...args) {\n for (var sub in this.subscribers) {\n var subscriber = this.subscribers[sub];\n subscriber.handler.apply(subscriber.subref, args);\n }\n }", "function traverseTwoPhase(inst,fn,arg){var path=[];while(inst){path.push(inst);inst=inst._hostParent;}var i;for(i=path.length;i-->0;){fn(path[i],'captured',arg);}for(i=0;i<path.length;i++){fn(path[i],'bubbled',arg);}}", "function Stack_R() {\r\n}", "function StackFunctionSupport() {\r\n}", "adoptedCallback () {\n console.log('adopted')\n }", "function callbackified() {\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n\n var self = this;\n\n var cb = function cb() {\n return maybeCb.apply(self, arguments);\n }; // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n\n\n original.apply(this, args).then(function (ret) {\n process.nextTick(cb, null, ret);\n }, function (rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }", "function traverseTwoPhase(inst, fn, arg) {\n for (var path = []; inst; ) path.push(inst), inst = getParent(inst);\n var i;\n for (i = path.length; i-- > 0; ) fn(path[i], \"captured\", arg);\n for (i = 0; i < path.length; i++) fn(path[i], \"bubbled\", arg);\n}" ]
[ "0.6151141", "0.6016803", "0.57246983", "0.5700363", "0.5602306", "0.55900764", "0.5589768", "0.5587611", "0.5572122", "0.55470407", "0.5535641", "0.5521688", "0.5478867", "0.5468258", "0.5468258", "0.5448612", "0.5448032", "0.54171836", "0.54171836", "0.54130816", "0.5403996", "0.53965604", "0.5370214", "0.5367044", "0.5361182", "0.5339787", "0.53327876", "0.5321807", "0.53034663", "0.53011245", "0.5287235", "0.52813697", "0.52799124", "0.52642626", "0.52490646", "0.52112526", "0.52094364", "0.52068865", "0.5202017", "0.5202017", "0.5202017", "0.5202017", "0.5202017", "0.5202017", "0.5199551", "0.51933223", "0.51933223", "0.51933223", "0.51933223", "0.51929414", "0.51850206", "0.51850206", "0.51552606", "0.51532155", "0.51293766", "0.51270604", "0.5125206", "0.5120532", "0.51143646", "0.51143646", "0.5113211", "0.51107204", "0.51092577", "0.5105443", "0.5102885", "0.5101073", "0.5096365", "0.50962293", "0.5087936", "0.50816286", "0.50816286", "0.5077962", "0.5077962", "0.5077962", "0.5077962", "0.5077962", "0.5077962", "0.5074477", "0.5073779", "0.5073779", "0.5073779", "0.5073319", "0.5073319", "0.5067612", "0.50627315", "0.505803", "0.50439346", "0.50415516", "0.5026898", "0.5026898", "0.5018541", "0.501505", "0.501353", "0.50134486", "0.50121313", "0.5010382", "0.50006855", "0.5000425", "0.49950597" ]
0.55102986
13
for string, boolean, number and null
function useStrictEquality(b, a) { if (b instanceof a.constructor || a instanceof b.constructor) { // to catch short annotaion VS 'new' annotation of a declaration // e.g. var i = 1; // var j = new Number(1); return a == b; } else { return a === b; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n }", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n }", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n}", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n}", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n}", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n}", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n\t}", "function typecast(val) {\n\t var r;\n\t if ( val === null || val === 'null' ) {\n\t r = null;\n\t } else if ( val === 'true' ) {\n\t r = true;\n\t } else if ( val === 'false' ) {\n\t r = false;\n\t } else if ( val === UNDEF || val === 'undefined' ) {\n\t r = UNDEF;\n\t } else if ( val === '' || isNaN(val) ) {\n\t //isNaN('') returns false\n\t r = val;\n\t } else {\n\t //parseFloat(null || '') returns NaN\n\t r = parseFloat(val);\n\t }\n\t return r;\n\t }", "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function isPrimitive(value) {\r\n return (value === null ||\r\n typeof value === 'boolean' ||\r\n typeof value === 'number' ||\r\n typeof value === 'string');\r\n }", "function isPrimitive(value) {\r\n return (value === null ||\r\n typeof value === 'boolean' ||\r\n typeof value === 'number' ||\r\n typeof value === 'string');\r\n }", "function tt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? X(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Gn(\"Invalid value type: \" + JSON.stringify(t));\n}", "function M(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? O(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : _e(\"Invalid value type: \" + JSON.stringify(t));\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n }", "function _scalar( mixed ) {\n\t\treturn\ttypeof mixed == 'number' && 'number' ||\n\t\t\t\t\t\ttypeof mixed == 'string' && 'string' ||\n\t\t\t\t\t\ttypeof mixed == 'boolean' && 'boolean' ||\n\t\t\t\t\t\ttypeof mixed == 'undefined' && 'undefined' ||\n\t\t\t\t\t\tfalse;\n\t}", "function isPrimitive(v) {\n return (v === null ||\n v === undefined ||\n typeof v === \"boolean\" ||\n typeof v === \"number\" ||\n typeof v === \"string\" ||\n typeof v === \"symbol\");\n }", "function isGood(val){ \n return val !== false && val !== null && val !== 0 && val !== \"\" && val !== undefined && !Number.isNaN(val); \n }", "function isPrimitive(value) {\n return (value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string');\n }", "isPrimitive(value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n }", "function isPrimitiveType (obj) {\r\n return ( typeof obj === 'boolean' ||\r\n typeof obj === 'number' ||\r\n typeof obj === 'string' ||\r\n obj === null ||\r\n util.isDate(obj) ||\r\n util.isArray(obj));\r\n}", "function isPrimitiveType(obj) {\n return (\n typeof obj === 'boolean' ||\n typeof obj === 'number' ||\n typeof obj === 'string' ||\n obj === null ||\n util.isDate(obj) ||\n util.isArray(obj)\n );\n}", "function parsePrimitive(info, name, value) {\n var result = value;\n if (info.number || info.positiveNumber) {\n if (!isNaN(result) && result !== '') {\n result = Number(result);\n }\n } else if (info.boolean || info.overloadedBoolean) {\n // Accept `boolean` and `string`.\n if (typeof result === 'string' && (result === '' || normalize(value) === normalize(name))) {\n result = true;\n }\n }\n return result;\n}", "getTrueValue () {\n var val = this.getValue ();\n if (!val) return;\n if (val === NULL_CHARACTER) return null;\n return val;\n }", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n}", "function parsePrimitive(info, name, value) {\n var result = value\n\n if (info.number || info.positiveNumber) {\n if (!isNaN(result) && result !== '') {\n result = Number(result)\n }\n } else if (info.boolean || info.overloadedBoolean) {\n // Accept `boolean` and `string`.\n if (\n typeof result === 'string' &&\n (result === '' || normalize(value) === normalize(name))\n ) {\n result = true\n }\n }\n\n return result\n}", "function parsePrimitive(info, name, value) {\n var result = value\n\n if (info.number || info.positiveNumber) {\n if (!isNaN(result) && result !== '') {\n result = Number(result)\n }\n } else if (info.boolean || info.overloadedBoolean) {\n // Accept `boolean` and `string`.\n if (\n typeof result === 'string' &&\n (result === '' || normalize(value) === normalize(name))\n ) {\n result = true\n }\n }\n\n return result\n}", "function intOrString(param) {\n if (isNaN(param)) {\n return \"str\";\n }else {\n return \"int\"\n }\n \n}", "function whatDataTypeIsIt(data){\n if(data===null){return 'Null'}\n else if(Number.isNaN(data)){return 'NaN'}\n else{return typeof data}\n}", "function isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}", "function isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}", "function isRealValue(obj) {\r\n return obj && obj !== 'null' && obj !== 'undefined';\r\n}", "function isPrimitive(value) {\n\t\t return typeof value === 'string' || typeof value === 'number';\n\t\t}", "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number';\n\t}", "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number';\n\t}", "function isPrimitive(value) {\n\t // Using switch fallthrough because it's simple to read and is\n\t // generally fast: http://jsperf.com/testing-value-is-primitive/5\n\t switch (typeof value) {\n\t case \"string\":\n\t case \"number\":\n\t case \"boolean\":\n\t return true;\n\t }\n\n\t return value == null;\n\t }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n}", "function isValueObject(obj) {\n\treturn (obj instanceof Number) || (obj instanceof String) || (obj instanceof Boolean) || (obj === null);\n}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function isPrimitive (value) {\n\t return typeof value === 'string' || typeof value === 'number'\n\t}", "function stringToIntegerOrBoolean(parameter){\n var param = parameter.toLowerCase().trim();\n if(!isNaN(param)){\n console.log(\"retrn a number\");\n return +param;\n }\n switch(param){\n case \"true\": return true;\n case \"false\": case null: return false;\n default: return param;\n }\n}", "function primitive (value) {\n\t var type = typeof value;\n\t return type === 'number' ||\n\t type === 'boolean' ||\n\t type === 'string' ||\n\t type === 'symbol'\n\t}", "function isPrimitive(value) {\n var type = typeof value;\n return (\n type === 'boolean' ||\n type === 'number' ||\n type === 'string' ||\n type === 'undefined' ||\n value === null\n );\n}", "function isPlain(val) {\n return typeof val === 'undefined' || val === null || typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number' || Array.isArray(val) || isPlainObject(val);\n}", "function isPlain(val) {\n return typeof val === 'undefined' || val === null || typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number' || Array.isArray(val) || isPlainObject(val);\n}", "function isPlain(val) {\n return typeof val === 'undefined' || val === null || typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number' || Array.isArray(val) || isPlainObject(val);\n}", "function isPrimitive(value) {\n return typeof value !== 'object' || value === null;\n}", "function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }", "function isNullOrUndefined(value){return value===null||value===undefined;}", "function isBasicValue(val) {\n var t = typeof val;\n return val === null || (t !== 'object' && t !== 'function');\n }", "function getTypeForFilter(val) { // 18572\n return (val === null) ? 'null' : typeof val; // 18573\n} // 18574", "_toBool (valIn) { return (valIn === 'false' || valIn === '0') ? false : Boolean(valIn) }", "function normalizeData(value) {\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n if (value === Number(value).toString()) {\n return Number(value);\n }\n if (value === '' || value === 'null') {\n return null;\n }\n if (typeof value !== 'string') {\n return value;\n }\n try {\n return JSON.parse(decodeURIComponent(value));\n } catch (_unused) {\n return value;\n }\n }", "function toNative (value) {\n if (typeof value === 'string') {\n if (value === ''\n || value.trim() !== value\n || (value.length > 1 && value[0] === '0')) {\n return value\n } else if (value === 'true' || value === 'false') {\n return value === 'true'\n } else if (!isNaN(+value)) {\n return +value\n }\n }\n return value\n}", "function dataTypes() {\n console.log(typeof true);\n console.log(typeof null);\n console.log(typeof undefined);\n console.log(typeof 5);\n console.log(typeof NaN);\n console.log(typeof 'Hello');\n\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}", "function isPrimitive (value) {\n return typeof value === 'string' || typeof value === 'number'\n}" ]
[ "0.7381792", "0.7381792", "0.6962432", "0.68389475", "0.68389475", "0.6703971", "0.6703971", "0.6703971", "0.6703971", "0.66652465", "0.66652465", "0.6602444", "0.6602444", "0.658943", "0.65838563", "0.65795565", "0.65550643", "0.65550643", "0.65550643", "0.65550643", "0.65550643", "0.65545297", "0.65545297", "0.6541909", "0.6527519", "0.64715856", "0.6428196", "0.64266133", "0.64230216", "0.64166456", "0.638103", "0.63777477", "0.6365566", "0.63619274", "0.6339932", "0.63240814", "0.63240814", "0.63240814", "0.6320471", "0.6320471", "0.63130206", "0.6301622", "0.6286796", "0.6286796", "0.6279864", "0.6270536", "0.62685287", "0.62685287", "0.626846", "0.62646425", "0.6261282", "0.6238248", "0.6238248", "0.6238248", "0.6238248", "0.6238248", "0.6238248", "0.6238248", "0.6238248", "0.62305593", "0.6227372", "0.62161803", "0.6212356", "0.6212356", "0.6212356", "0.6209274", "0.6195238", "0.61828345", "0.6169009", "0.6167057", "0.6163676", "0.61616874", "0.61578023", "0.61009824", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.60935897", "0.6076526", "0.6076526", "0.6076526", "0.6076526", "0.6076526", "0.6076526", "0.6076526", "0.6076526", "0.6076526", "0.6076526" ]
0.0
-1
Function to populate month name, year, and populate dates (adding or removing table rows as needed)
function printCalendar(year = defaultYearValue, month = defaultMonthValue) { //set defaults for parameters to today's year and date if not provided var thisDate = new Date (year, month); var thisYear = thisDate.getFullYear(); var thisMonth = thisDate.getMonth(); var dateValue = thisDate.getDate(); //returns 1-31 var dayValue = thisDate.getDay(); //returns 0-6 var firstDate = new Date(year, month, 1); var firstDayValue = firstDate.getDay(); //to know which day on first row to start on var numberOfDaysInMonth = new Date(year, month + 1, 0).getDate(); /*console.log("month in print cal: " + month); console.log("year in print cal: " + year);*/ /*Print moth name & year*/ document.getElementById("monthLabel").innerHTML = monthNameArray[month]; document.getElementById("yearLabel").innerHTML = thisYear; /*Add an extra row to table if needed*/ if(numberOfDaysInMonth + firstDayValue > 35){ var row = table.insertRow(6); var cellIdBase = parseInt(35, 10); var numberCellsToAdd = (numberOfDaysInMonth + firstDayValue) - 35; for (var i=0; i< numberCellsToAdd; i++){ var newCellId = cellIdBase + i; row.insertCell(i).setAttribute("id", "c" + newCellId); } } /*Populate calendar dates*/ var i=0; do { document.getElementById("c" + firstDayValue).innerHTML = i+1; dateHolder.push(i+1); i++; firstDayValue++; } while (i<numberOfDaysInMonth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateMonth(month, year) {\n\n //Initialisieren des 1. gewuenschten Monats month im Jahr year\n var dt = new Date(year, month, 1);\n var ct = 0;\n\n //Ist der 1. eines Monats ein Montag, ansonsten gehe zum letzten Montag vor dem 1.\n while (dt.getDay() !== 1) {\n dt = new Date(year, month, ct);\n ct--;\n }\n\n if ((dt.getDay() === 0) || (dt.getDay() === 5) || (dt.getDay() === 6)) {\n rows = 6;\n }\n\n //laufe ueber den Monat und speichere die einzelnen Daten in ein Array\n for (var i = 0; i < 42; i++) {\n cal_sheet[i] = dt;\n\n if (dt.getDate() === 15) {\n date = dt;\n }\n\n dt = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate() + 1);\n }\n\n}", "function createMonth(inputMonth, inputYear, inputDay)\n{\n var leapYear = false;\n\t\tmonthName = months[inputMonth];\n yearName = inputYear.toString();\n\t\tcellsHTML = \"\";\n numBlankDays = inputDay;\n\t\t//figure out if the year is a leap year\n\t\tif(inputYear%4 == 0)\n\t\t{\n\t\t \tif(inputYear%100 != 0)\n \t\t\t{\n\t\t\t\tleapYear = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(inputYear%400 == 0)\n\t\t\t\t\tleapYear = true;\n\t\t\t\telse\n\t\t\t\t\tleapYear = false;\n\t\t\t}\n\t\t}\n\n\n\t\t//figure out the number of days in the month\n\t\t//if month is NOT february, april, june, september, nor november then it has 31 days\n\t\tif(inputMonth != 2 && inputMonth != 4 && inputMonth != 6 && inputMonth != 9 && inputMonth != 11)\n\t\t{\n\t\t\tnumberOfDays = 31;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//if month is NOT february, then it has 30 days\n\t\t\tif(inputMonth != 2)\n\t\t\t{\n\t\t\t\tnumberOfDays = 30;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if month is a leap year, then it has 29 days. if not, it has 28\n\t\t\t\tif(leapYear)\n\t\t\t\t{\n\t\t\t\t\tnumberOfDays = 29;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnumberOfDays = 28;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpostDay = (numberOfDays + numBlankDays) % 7; // day after end of month\n}", "function generateMonth(month, year) {\r\n var div = document.createElement(\"div\");\r\n div.className = \"month\";\r\n\r\n // month name\r\n div.innerText = monthNames[month];\r\n\r\n var table = document.createElement(\"table\");\r\n\r\n // days header\r\n var row = document.createElement(\"tr\");\r\n for (var j = 0; j < 7; j++) {\r\n var td = document.createElement(\"td\");\r\n td.innerText = dayNames[j];\r\n td.className = \"header\";\r\n row.appendChild(td);\r\n }\r\n table.appendChild(row);\r\n\r\n // days\r\n row = document.createElement(\"tr\");\r\n\r\n // amount of months in day\r\n var days = monthDays[month] + (month === 1 ? leapYear(year) : 0);\r\n\r\n // day of the week to start at\r\n var startDate = new Date(`${monthNames[month]} 1, ${year} 00:00:01`);\r\n var startDateIndex = startDate.getDay();\r\n\r\n // generate cells with date numbers\r\n for (var j = 0; j < days; j++) {\r\n // day of the week\r\n var dayIndex = (startDateIndex + j) % 7;\r\n\r\n // blank cells at start\r\n if (j === 0) {\r\n addCells(dayIndex, row);\r\n }\r\n\r\n // make a new row when needed\r\n if (j > 0 && dayIndex === 0) {\r\n table.appendChild(row);\r\n row = document.createElement(\"tr\");\r\n }\r\n\r\n // make cell\r\n var td = document.createElement(\"td\");\r\n td.innerText = j + 1;\r\n td.id = `${year}.${month}.${j + 1}`;\r\n td.className = \"day\";\r\n td.onclick = function () {\r\n if (selectedColor === \"#ffffff\") {\r\n if (this.childElementCount === 0) {\r\n addMessage(this, \"\");\r\n }\r\n } else {\r\n if (selectedIndex === 0) {\r\n this.style.backgroundColor = selectedColor;\r\n delete calendarData[currentYear].colors[this.id];\r\n if (this.childElementCount === 2) {\r\n this.removeChild(this.lastElementChild);\r\n this.removeChild(this.lastElementChild);\r\n delete calendarData[currentYear].text[this.id];\r\n }\r\n } else if (selectedIndex > 0) {\r\n this.style.backgroundColor = selectedColor;\r\n calendarData[currentYear].colors[this.id] = selectedIndex;\r\n }\r\n }\r\n };\r\n row.appendChild(td);\r\n\r\n // blank cells at end and append last row\r\n if (j + 1 === days) {\r\n addCells(6 - dayIndex, row);\r\n table.appendChild(row);\r\n }\r\n }\r\n\r\n div.appendChild(table);\r\n\r\n return div;\r\n}", "function init(month, year) {\n monthDisplay.innerHTML = `${monthList[month]}, ${year}`; \n populateCalender();\n}", "function FormMonthlyData(data) {\n var janArray = [];\n var febArray = [];\n var marArray = [];\n var aprArray = [];\n var mayArray = [];\n var junArray = [];\n var julArray = [];\n var augArray = [];\n var sepArray = [];\n var octArray = [];\n var novArray = [];\n var decArray = [];\n\n for (var i = 0; i < data.length; i++) {\n if(i < 743) {\n janArray.push(data[i]);\n }\n if(i > 744 && i < 1441) {\n febArray.push(data[i]);\n }\n if(i > 1442 && i < 2162) {\n marArray.push(data[i]);\n }\n if(i > 2163 && i < 2907) {\n aprArray.push(data[i]);\n }\n if(i > 2908 && i < 3628) {\n mayArray.push(data[i]);\n }\n if(i > 3629 && i < 4373) {\n junArray.push(data[i]);\n }\n if(i > 4374 && i < 5094) {\n julArray.push(data[i]);\n }\n if(i > 5095 && i < 5839) {\n augArray.push(data[i]);\n }\n if(i > 5840 && i < 6560) {\n sepArray.push(data[i]);\n }\n if(i > 6561 && i < 7305) {\n octArray.push(data[i]);\n }\n if(i > 7306 && i < 8026) {\n novArray.push(data[i]);\n }\n if(i > 8027 && i < 8771) {\n decArray.push(data[i]);\n }\n }\n return [janArray,febArray,marArray,aprArray,mayArray,junArray,julArray,augArray,sepArray,octArray,novArray,decArray];\n}", "function addMonths( month, year, howMany ) {\n\t\t\t\t\n\t\t\t\tvar html = \"\",\n\t\t\t\t\ty = year;\n\t\t\t\t\n\t\t\t\tfor( mo = month; mo < month+howMany; mo++ ) {\n\t\t\t\t\t\n\t\t\t\t\t// for each month we loops through, we need\n\t\t\t\t\t// to make sure it isn't past December. if it is,\n\t\t\t\t\t// we take away 12 , and add a year so that it equates to the right\n\t\t\t\t\t// month at the beginning of the next year\n\t\t\t\t\tvar m = mo;\n\t\t\t\t\tif (mo > 11) { var m = mo-12; y = year+1; }\n\t\t\t\t\t\n\t\t\t\t\t// get the current month's name to show in the side.\n\t\t\t\t\tvar monthname = mommy.options.months[ new Date(y,m,1).getMonth() ];\n\t\t\t\t\t\n\t\t\t\t\t// get the year number to show in the side. but we dont want\n\t\t\t\t\t// to show this year's number as that's implied.\n\t\t\t\t\tvar yearname = ( Date.today().getFullYear() != y ) ? y : \"\";\n\t\t\t\t\t\n\t\t\t\t\t// get the number of days in the currently looped month\n\t\t\t\t\tvar daysInMonth = Date.getDaysInMonth(y,m);\n\t\t\t\t\t\n\t\t\t\t\t// find out the first day of month(m) and call it offset\n\t\t\t\t\tvar offset = new Date(y,m,1).getDay();\n\t\t\t\t\tif (offset == 0) { offset=7; }\n\t\t\t\t\t\n\t\t\t\t\tfor( d = 1; d <= daysInMonth; d++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set some variables for styling the calendar\n\t\t\t\t\t\tvar filler = ( d == 1 && offset > 1 ) ? \"ui-gdatepicker-divider-left\" : \"\";\n\t\t\t\t\t\tvar divider = ( d <= 7 ) ? \"ui-gdatepicker-divider-top\" : \"\";\n\t\t\t\t\t\tvar previous = ( mo == month ) ? \"ui-gdatepicker-previous-month\" : \"\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-day \" +filler+\" \"+divider+\" \"+previous+\" gdpd-\"+d+\" gdpm-\"+m+\" gdpy-\"+y+\"\\\" data-day=\\\"\"+d+\"\\\" data-year=\\\"\"+y+\"\\\" data-month=\\\"\"+m+\"\\\">\";\n\t\t\t\t\t\thtml += d;\n\t\t\t\t\t\thtml += \"</span>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// at the end of each week, either show the month and year, or just start a new row.\n\t\t\t\t\t\tif( (offset+(d-1))%7 == 0 ) {\n\t\t\t\t\t\t\tif( (offset+(d-1)) < 8 ) {\n\t\t\t\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-monthname ui-gdatepicker-divider-top ui-gdatepicker-newline\\\" data-year=\\\"\"+y+\"\\\" data-month=\\\"\"+m+\"\\\">\"+monthname+\" \"+yearname+\"</span><br>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-newline\\\"></span><br>\";\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}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn html;\t\n\t\t\t\t\n\t\t\t}", "generateSelectMonths() {\n let allRecords = this.props.allRecords\n let months = []\n let key = \"\"\n\n if (allRecords.length !== 0) {\n let startDate = allRecords.sort((a, b) => (new Date(a.date) - new Date(b.date)))[0].date\n let { startMonth, startYear, currentMonth, currentYear } = this.getDatesSelect(startDate)\n\n for (let year = startYear; year <= currentYear; year++) {\n for (let month = startMonth; month <= currentMonth; month++) {\n month = (month < 10) ? ('0' + month) : month\n key = `${month}/${year}`\n months.push(key)\n }\n }\n }\n return months;\n }", "function fillMonthYear() {\n\tvar i, j;\n\tvar month_arr = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\t\n\tfor (i = 0; i < month_arr.length; i++) {\n\t\tselect_month.innerHTML += \"<option value='\" + i + \"'>\" + month_arr[i] + \"</option\";\n\t}\n\tfor (j = 1920; j < 2101; j++){\n\t\tselect_year.innerHTML += \"<option value='\" + j + \"'>\" + j + \"</option\";\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function months() {\n let monthArray = [\n \"month\",\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ];\n\n document.getElementById(\"month\").innerHTML = \"\";\n\n // month options dynamically\n\n if (document.getElementById(\"year\").value == new Date().getFullYear()) {\n max_month = new Date().getMonth() + 1;\n\n document.getElementById(\"month\").innerHTML = \"\";\n\n for (m = 0; m <= max_month; m++) {\n let month_option = document.createElement(\"option\");\n month_option.value = m;\n month_option.innerHTML = monthArray[m];\n document.getElementById(\"month\").appendChild(month_option);\n }\n } else {\n for (m = 0; m < monthArray.length; m++) {\n let month_option = document.createElement(\"option\");\n month_option.value = m;\n month_option.innerHTML = monthArray[m];\n document.getElementById(\"month\").appendChild(month_option);\n }\n }\n}", "function initialise(){\n\r\n\t/* Calculate the start month (current - 1)*/\r\n\tintMonthOffset = (12 - intMonth);\r\n\tvar intPreviousMonth = 99;\n\t\r\n\t/*Build the current date object*/\r\n\tdatCurrentDate.setDate(1);\r\n\tdatCurrentDate.setMonth(intMonth);\r\n\tdatCurrentDate.setFullYear(intYear);\r\n\t/* Build the end date one year on */\r\n\tendDate.setDate(1);\r\n\tendDate.setMonth(intMonth);\r\n\tendDate.setFullYear(datCurrentDate.getFullYear()+1);\r\n\tendDate.setDate(1);\r\n\tdocument.getElementById(\"yearDisplay\").innerHTML = \"\";\r\n\t/* Loop through the display 12 months and draw the plan */\r\n\twhile (datCurrentDate< endDate)\r\n\t\t{\n\t\t\r\n\t\t/*Test for new month */\r\n\t\tif (datCurrentDate.getMonth() != intPreviousMonth)\r\n\t\t\t{\r\n\t\t\t/* Clear all previous cell data */\r\n\t\t\tfor (var x = 1; x<=42; x++)\r\n\t\t\t\t{\r\n\t\t\t\tclrElid = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + x;\r\n\t\t\t\tdocument.getElementById(clrElid).innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById(clrElid).className = \"dateExtra\";\r\n\t\t\t\t}\r\n\t\t\t/* Create the month jump controls and its title */\r\n\t\t\telid = \"monthHeader\" + (( datCurrentDate.getMonth() + intMonthOffset) % 12);\r\n\t\t\tdocument.getElementById(elid).onclick = function(){\tjumpMonthHead(this);\t};\r\n\t\t\tdocument.getElementById(elid).innerHTML = myMonths[datCurrentDate.getMonth()] + \" \" +datCurrentDate.getFullYear();\r\n\t\t\tintPreviousMonth = datCurrentDate.getMonth();\r\n\t\t\tintDayOffset = datCurrentDate.getDay() + 6;\r\n\t\t\t//alert(intDayOffset);\r\n\t\t\t}\r\n\t\t/* Draw the weekdays for the first seven days */\r\n\t\tif (datCurrentDate.getDate() < 8)\r\n\t\t\t{\r\n\t\t\tstrDateId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"day\" + (( datCurrentDate.getDate() + intDayOffset) % 7);\r\n\t\t\tdocument.getElementById(strDateId).innerHTML = myShortDays[datCurrentDate.getDay()];\r\n\t\t\t//document.getElementById(strDateId).innerHTML = datCurrentDate.getDay();\r\n\t\t\t}\r\n\t\tstrDayId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + ( datCurrentDate.getDate() + (intDayOffset %7));\r\n\t\tdocument.getElementById(strDayId).innerHTML = datCurrentDate.getDate();\r\n\t\tdocument.getElementById(strDayId).title = \"\";\r\n\t\tdocument.getElementById(strDayId).className = \"dateShow\";\r\n\t\tdocument.getElementById(strDayId).onclick = function(){\tjumpMonth(this);\t};\r\n\t\tdatCurrentDate.setDate(datCurrentDate.getDate()+1);\r\n\t\t}\r\n\tif (intYear == endDate.getFullYear())\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear;\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + intYear -1;\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + intYear+1;\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear + \"/\" + endDate.getFullYear();\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + (intYear * 1 -1) + \"/\" + (endDate.getFullYear() *1 -1);\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + (intYear * 1 + 1) + \"/\" + (endDate.getFullYear() * 1 +1);\r\n\t\t}\r\n\t//listReminders();\r\n\t\r\n\t\r\n\t}", "function buildDataByMonth(dataMap){\n var ret = {}; //the result data map\n var i = 1; //next month index\n var sum = 0; //the sum for current month\n var count = 0; //the day count for current month\n var m; //the month index for the current day\n for(var day in dataMap){\n m = new Date(day).getMonth() + 1;\n if(m > i) { // now we got to the first day of the next month, we need to caculate the current month firstly\n ret[\"2016年\"+(i++)+\"月\"] = sum / count;\n sum = count = 0;\n }\n sum += dataMap[day];\n ++count;\n }\n ret[\"2016年\"+(i)+\"月\"] = sum / count; //for the final month;\n return ret;\n}", "function fillCalendar(month,year){\n var start = new Date(year,month,1);\n //update global values\n gMonth = start.getMonth();\n gYear = start.getFullYear();\n var firstday = start.getDay();\n //Update the month text\n $('#month h1').html(months[ start.getMonth() ]);\n $('#month h1').append(' '+ start.getFullYear() );\n //clear calendar's values\n //$('.calendar td div, .calendar td span').empty();\n //$('.calendar').remove('.event');\n //fill cells with dates and events\n var date = 1;\n for (var i = 0; i< 42 ; i++){\n $('.calendar td:eq('+i+') span').text(\"\");\n var day = new Date(year,month,date);\n var d = day.getDate();\n var m = day.getMonth();\n var y = day.getFullYear();\n var dayIndex = firstday+date-1;\n if ( i < firstday || m >month) {\n $('.calendar td:eq('+i+') div').text(\"\");\n }\n else {\n $('.calendar td:eq('+dayIndex+') div').text(date);\n //check for events\n events.forEach(function(ele) {\n if ( d == ele.day && m == ele.month && y == ele.year){\n //print text\n $('.calendar td:eq('+dayIndex+')').append('<span class=\"event\">'+ele.text+'</span>');\n //create handler for text\n $('.calendar td:eq('+dayIndex+') span:last()').click(function(){\n $(this).hide();\n var tmpText = $(this).text();\n $(this).after('<input type=\"text\" value=\"'+tmpText+'\" day=\"'+ele.day+'\" month=\"'+ele.month+'\" year=\"'+ele.year+'\" prevtext=\"'+ele.text+'\">');\n $(\"input\").focus();\n });\n }\n });\n date++;\n }\n }\n}", "function fillCalendar() {\n // adds the dates of the current month to dateArray\n function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }\n // creates an array of dates in the previous month, slices off a number of\n // indices equal to previousEndDate minus startDay in order to find the number\n // to add to the calendar cells, then adds them to the beginning of dateArray\n function fillPrevious() {\n const previousMonth = moment(currentDate).subtract(1, 'month');\n const previousEndDate = moment(previousMonth).endOf('month').date();\n const previousArray = [];\n for (let i = 0; i < previousEndDate; i++) {\n previousArray.push(i + 1);\n }\n const toAdd = previousArray.slice(previousEndDate - startDay)\n dateArray = toAdd.concat(dateArray)\n }\n // adds the next month's dates to the end of dateArray\n // up to a maximum equalling the total remaining cells;\n // extra numbers will not render on the page\n function fillNext() {\n const nextMonth = moment(currentDate).add(1, 'month');\n const nextStartDay = nextMonth.startOf('month').day();\n for (let i = nextStartDay; i < 14; i++) {\n dateArray.push(i - nextStartDay + 1)\n }\n \n }\n // iterates across the grid, replacing the text in each cell\n // with the numbers generated by the previous functions\n function populate() {\n for (let i = 0; i < 42; i++) {\n calendarCells[i].textContent = dateArray[i];\n }\n }\n // updates the month header thing\n function monthUpdate() {\n const monthField = document.querySelector('#month');\n monthField.textContent = moment(currentDate).format('MMMM')\n }\n\n fillCurrent()\n fillPrevious()\n fillNext()\n populate()\n monthUpdate()\n}", "function selectMonth() {\n currentMonth = Number(months.val());\n initBodyTable();\n}", "function scrapeMonth(date) {\n var originalDate = new Date(date.getTime());\n var year = date.getFullYear();\n var month = date.getMonth();\n var data = {\n date: originalDate,\n month: undefined\n };\n exports.monthTracker.current = new Date(date.getTime());\n exports.monthTracker.current.setDate(1);\n exports.monthTracker.years[year] = exports.monthTracker.years[year] || {};\n if (exports.monthTracker.years[year][month] !== undefined) {\n data.month = exports.monthTracker.years[year][month];\n return data;\n }\n date = new Date(date.getTime());\n date.setDate(1);\n exports.monthTracker.years[year][month] = [];\n var tracker = exports.monthTracker.years[year][month];\n var rowTracker = 0;\n while (date.getMonth() === month) {\n var _date = date.getDate();\n var day = date.getDay();\n if (_date === 1) {\n tracker[rowTracker] = fill([], day);\n }\n tracker[rowTracker] = tracker[rowTracker] || [];\n tracker[rowTracker][day] = _date;\n if (day === 6) {\n rowTracker++;\n }\n date.setDate(date.getDate() + 1);\n }\n var lastRow = 5;\n if (tracker[5] === undefined) {\n lastRow = 4;\n tracker[5] = fill([], 7);\n }\n var lastRowLength = tracker[lastRow].length;\n if (lastRowLength < 7) {\n var filled = tracker[lastRow].concat(fill([], 7 - lastRowLength));\n tracker[lastRow] = filled;\n }\n data.month = tracker;\n return data;\n}", "function getMonth()\n{\n // determine which font size to use for dates.\n var fontsize=1;\n\t\tif (document.CalendarSettings.fontsize[0].checked) fontsize=1;\n\t\tif (document.CalendarSettings.fontsize[1].checked) fontsize=3;\n\t\tif (document.CalendarSettings.fontsize[2].checked) fontsize=5;\n\t\tif (document.CalendarSettings.fontsize[3].checked) fontsize=7;\n\n\t\t//integer to keep track of how many days were added to the month in the html string\n\t\tcellCount = 0;\n\n\t\t//prints out blank cells needed to start off month calendar\n\t\tfor(var blanks = 0; blanks < numBlankDays; blanks++)\n\t\t{\n\t\t\t\tcellsHTML = cellsHTML + \"<TD vAlign=top align=left width=\\\"14%\\\" >&nbsp;<br><br><br><br></TD>\";\n cellsHTML += \"\\n\";\n\t\t\t\tcellCount++;\n\t\t}\n\n\t\t//prints out cells for each day of the month\n\t\tfor(var days = 1; days <= numberOfDays; days++)\n\t\t{\n\t\t\tcellsHTML = cellsHTML + \"<TD vAlign=top align=left width=\\\"14%\\\" ><font size=\\\"\"+fontsize+\"\\\" face=\\\"Verdana\\\">\" +days +\"</font><br><br><br><br></TD>\";\n cellsHTML += \"\\n\";\n \t\tcellCount++;\n\t\t\tif(cellCount % 7 == 0)\n\t\t\t{\n\t\t\t\tcellsHTML = cellsHTML + \"</tr><tr>\";\n cellsHTML += \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\t//prints out blank cells needed to end off month calendar\n\t\twhile (cellCount % 7 != 0)\n\t\t{\n\t\t\tcellsHTML = cellsHTML + \"<TD vAlign=top align=left width=\\\"14%\\\" >&nbsp;<br><br></TD>\";\n cellsHTML += \"\\n\";\n \t\tcellCount++;\n\t\t}\n\n\t\t//returns full html code for the month\n\t\treturn begTags + monthName + \" \" + yearName + \"\\n\" + columnHeaders() + \"\\n\" + cellsHTML + endTags;\n}", "function Calendar_calcMonthYear( p_Month, p_Year, incr )\n{\n/*\nWill return an 1-D array with 1st element being the calculated month \nand second being the calculated year \nafter applying the month increment/decrement as specified by 'incr' parameter.\n'incr' will normally have 1/-1 to navigate thru the months.\n*/\nvar ret_arr = new Array();\nif( incr == -1 ) {\n// B A C K W A R D\nif( p_Month == 0 ) {\nret_arr[0] = 11;\nret_arr[1] = parseInt( p_Year ) - 1;\n}\nelse {\nret_arr[0] = parseInt( p_Month ) - 1;\nret_arr[1] = parseInt( p_Year );\n}\n} else if( incr == 1 ) {\n// F O R W A R D\nif( p_Month == 11 ) {\nret_arr[0] = 0;\nret_arr[1] = parseInt( p_Year ) + 1;\n}\nelse {\nret_arr[0] = parseInt( p_Month ) + 1;\nret_arr[1] = parseInt( p_Year );\n}\n}\nreturn ret_arr;\n}", "function pickYearAndMonth(year, month) {\n self.date.year = year || new Date().getFullYear();\n self.date.month = month || self.months[new Date().getMonth()];\n self.date.day = new Date().getDay();\n self.activeDay = self.date.day;\n\n getMonthNotes(year, month);\n }", "function fill_table(month,month_length)\n{ \n day=1\n // begin the new month table\n document.write(\"<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=%3><TR>\")\n document.write(\"<TD COLSPAN=7 ALIGN=center><B>\"+month+\" \"+year+\"</B><TR>\")\n // column headings\n day_title(\"Sun\")\n day_title(\"Mon\")\n day_title(\"Tue\")\n day_title(\"Wed\")\n day_title(\"Thu\")\n day_title(\"Fri\")\n day_title(\"Sat\")\n\n // pad cells before first day of month\n document.write(\"</TR><TR>\")\n for (var i=1;i<start_day;i++){\n document.write(\"<TD>\")\n }\n // fill the first week of days\n for (var i=start_day;i<8;i++){\n if (day == z) {\n document.write(\"<TD ALIGN=center>\"+day+\"</TD>\")\n }\n else {\n document.write(\"<TD ALIGN=center>\"+day+\"</TD>\")\n }\n day++\n }\n document.write(\"<TR>\")\n // fill the remaining weeks\n while (day <= month_length) {\n for (var i=1;i<=7 && day<=month_length;i++){\n if (day == z) {\n document.write(\"<TD ALIGN=center>\"+day+\"</TD>\")\n }\n else {\n document.write(\"<TD ALIGN=center>\"+day+\"</TD>\")\n }\n day++\n }\n document.write(\"</TR><TR>\")\n // the first day of the next month\n start_day=i\n }\n document.write(\"</TR></TABLE><BR>\")\n}", "function prepareDataToCreateChart(inputMonthValue){\t\n\t\n\t// extract year and monthName from inputMonthValue\n\tvar startIndex = 0;\n\tfor(var i=0; i<inputMonthValue.length ; i++ ){\n\t\tif($.isNumeric(inputMonthValue.charAt(i))){\n\t\t\tstartIndex = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tvar selectedMonthName = inputMonthValue.substring(0,startIndex-1);\n\tvar selectedYear = inputMonthValue.substring(startIndex,inputMonthValue.length);\n\t\n\t// get month index based on month name\n\tvar selectedMonthIndex=-1;\n\t\n\tfor(var i=0 ; i < 12 ; i++) {\n\t\tif(monthNamesPL[i] == selectedMonthName || monthNamesEN[i] == selectedMonthName){\n\t\t\tselectedMonthIndex=i;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// create startDate, endDate and monthLength based on extracted values\n\tvar tempDate = new Date();\n\ttempDate.setFullYear(selectedYear);\n\ttempDate.setMonth(selectedMonthIndex);\n\t\n\tvar tempStartDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), 1);\n\tvar tempEndDate = new Date(tempDate.getFullYear(), tempDate.getMonth() + 1, 0);\n\t\n\tvar startDate = tempStartDate.getFullYear()+'-'+(tempStartDate.getMonth() + 1)+'-'+tempStartDate.getDate();\n\tvar endDate = tempEndDate.getFullYear()+'-'+(tempEndDate.getMonth() + 1)+'-'+tempEndDate.getDate();\n\t\n\tvar monthLength = tempEndDate.getDate();\n\t\n\tvar resultSet = [startDate, endDate, selectedMonthName, monthLength]\n\t\n\treturn resultSet;\n}", "function displayMonthYear(year, month) {\n let showHeader = document.querySelector(\".display-header\")\n let selectYear = document.querySelector(\"#select-year\")\n let selectMonth = document.querySelector(\"#select-month\")\n selectYear.value = year;\n selectMonth.value = months[month - 1]\n showHeader.innerText = `${months[month-1]} ${year}` //arr starts with index 0\n return showHeader\n}", "function billDate() {\n var a4 = sheet(1).getRange(\"A4\");\n\n // Read the initial month and year (the date for which we display the table)\n var date = sheet(0).getRange(\"A1\").getValue().split(' ');\n var initialMonth = date[0],\n year = parseInt(date[1]);\n\n // Build an array of month names\n // [todo] replace with Object.keys(months(year))\n var monthsObj = months(year);\n var monthsArray = [];\n for (month in monthsObj) {\n monthsArray.push(month); // [IANUARIE, FEBRUARIE, MARTIE, APRILIE, MAI, IUNIE, IULIE, AUGUST, SEPTEMBRIE, OCTOMBRIE, NOIEMBRIE, DECEMBRIE]\n }\n\n // Calculate the billing month. Billing is done 2 months after the actual month.\n var position = monthsArray.indexOf(initialMonth);\n var billMonth = monthsArray[(position + 2) % 12];\n\n var localYear = year;\n if (billMonth == 'IANUARIE' || billMonth == 'FEBRUARIE') {\n localYear += 1;\n }\n var localMonths = months(localYear);\n\n // Calculate month index, prefixed with 0 if needed.\n var billMonthNumber = localMonths[billMonth][0];\n if (billMonthNumber < 10) {\n billMonthNumber = \"0\" + localMonths[billMonth][0];\n }\n\n // Update all sheets headers with the date value.\n if (initialMonth == \"\" || year == \"\"){\n a4.setValue(\"\");\n } else {\n var diff = localMonths[billMonth][1]-12+1,\n term = diff < 20 ? diff + ' ZILE' : diff + ' DE ZILE';\n a4.setValue(initialMonth +\", DATA DE AFIŞARE: 12.\"+billMonthNumber+\".\"+localYear+\", DATA SCADENTĂ: \"+localMonths[billMonth][1]+'.'+billMonthNumber+\".\"+localYear+\", TERMEN DE PLATĂ: \"+term);\n }\n\n // Delete 'termoficare' or 'fondRulment' if needed\n deleteColumns();\n // Calculate and display the penalties for last month\n restantUpkeep();\n Browser.msgBox('Datele au fost adăugate','',Browser.Buttons.OK);\n}", "function monthChange(btn){\n let newMonth = Toolbar.curTime.getMonth() + Number(btn.getAttribute(\"data-dir\"));\n let newYear = Toolbar.curTime.getFullYear();\n if(newMonth<0){\n newMonth = 11;\n newYear--;\n }\n else if(newMonth > 11){\n newMonth = 0;\n newYear++;\n }\n Toolbar.curTime.setMonth(newMonth);\n Toolbar.curTime.setFullYear(newYear);\n genDateTable();\n}", "function createMonth(team, year, month, pattern, pattern_dates) {\n\n\tvar table = document.createElement(\"TABLE\");\n\ttable.className = \"table\";\n\n\ttable.insertRow(0).innerHTML = \"<th colspan='7' style='background-color:gray; font-size:x-large;'>\" + monthNames[month] + \",&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\" + year + \"</th>\";\n\tvar weekRow = table.insertRow(1);\n\tweekRow.innerHTML = \"<td>Su</td><td>Mo</td><td>Tu</td><td>We</td><td>Th</td><td>Fr</td><td>Sa</td>\";\n\tweekRow.className = \"weekdays\";\n\n\tvar date = Date.today().set({millisecond: 0, second: 0, minute: 0, hour: 0, day: 1, month: month, year: year});\n\n\tvar rowIndex = 2;\n\tvar row = \"\";\n\tvar RowE;\n\tvar stop = 42;\n\n\t//offset the first week\n\tvar offset = date.getDay();\n\tif (offset==0) {\n\t\tfor (i=0; i<7; i++) {\n\t\t\trow += \"<td class='off'></td>\";\n\t\t}\n\t\ttable.insertRow(rowIndex).innerHTML = row;\n\t\trowIndex++;\n\t\tstop -= 7;\n\t\trow = \"\";\n\t\t\n\t} else {\n\n\t\tfor (i=0; i<offset; i++) {\n\t\t\trow += \"<td class='off'></td>\";\n\t\t}\n\t}\n\n\tvar mc = date.getDaysInMonth();\n\tfor (i=offset+1; i<=stop; i++) { \n\n\t\tvar shiftIndex = getShiftIndex(pattern, pattern_dates[team-1], date);\n\n\t\tvar shift = shifts[shiftIndex]; \n\t\tif (mc > 0) row += \"<td class='\" + shift + \"'>\" + date.toString(\"d\") + \"</td>\";\n\t\telse { row += \"<td class='off'> </td>\"; }\n\t\t\n\t\t//update looping parameters\n\t\tdate = date.addDays(1);\n\t\tmc--;\n\n\t\tif (i%7==0) {\n\t\t\trowE = table.insertRow(rowIndex);\n\t\t\trowE.innerHTML = row;\n\t\t\trow = \"\";\n\t\t\trowIndex++;\n\t\t}\n\n\t}\n\treturn table;\n}", "function setValueMonth(){\n \t$scope.tableMonth[0] = {'Cle': '1', 'Name': 'Janvier'};\n \t$scope.tableMonth[1] = {'Cle': '2', 'Name': 'Février'};\n \t$scope.tableMonth[2] = {'Cle': '3', 'Name': 'Mars'};\n \t$scope.tableMonth[3] = {'Cle': '4', 'Name': 'Avril'};\n \t$scope.tableMonth[4] = {'Cle': '5', 'Name': 'Mai'};\n \t$scope.tableMonth[5] = {'Cle': '6', 'Name': 'Juin'};\n \t$scope.tableMonth[6] = {'Cle': '7', 'Name': 'Juillet'};\n \t$scope.tableMonth[7] = {'Cle': '8', 'Name': 'Aout'};\n \t$scope.tableMonth[8] = {'Cle': '9', 'Name': 'Septembre'};\n \t$scope.tableMonth[9] = {'Cle': '10', 'Name': 'Octobre'};\n \t$scope.tableMonth[10] = {'Cle': '11', 'Name': 'Novembre'};\n \t$scope.tableMonth[11] = {'Cle': '12', 'Name': 'Décembre'};\n }", "function showCalendar(month, year) {\r\n\r\n\tlet firstDay = (new Date(year, month)).getDay();\r\n\tlet daysInMonth = 32 - new Date(year, month, 32).getDate();\r\n\r\n\tlet tbl = document.getElementById(\"calendar-body\"); // body of the calendar\r\n\r\n\t// clearing all previous cells\r\n\ttbl.innerHTML = \"\";\r\n\r\n\t// filing data about month and in the page via DOM.\r\n\tmonthAndYear.innerHTML = months[month] + \" \" + year;\r\n\tcurrentYear.value = year;\r\n\tcurrentMonth.value = month;\r\n\r\n\t// creating all cells\r\n\tlet date = 1;\r\n\tfor (let i = 0; i < 6; i++) {\r\n\t\t// creates a table row\r\n\t\tlet row = document.createElement(\"tr\");\r\n\r\n\t\t//creating individual cells, filing them up with data.\r\n\t\tfor (let j = 0; j < 7; j++) {\r\n\t\t\tif (i === 0 && j < firstDay) {\r\n\t\t\t\tlet cell = document.createElement(\"td\");\r\n\t\t\t\tlet cellText = document.createTextNode(\"\");\r\n\t\t\t\tcell.appendChild(cellText);\r\n\t\t\t\trow.appendChild(cell);\r\n\t\t\t}\r\n\t\t\telse if (date > daysInMonth) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tlet trueMonth = month + 1;//Because months start at 0, i need to +1 to compare.\r\n\t\t\t\tlet dateString = year + \"-\" + trueMonth.toString().padStart(2, 0) + \"-\" + date.toString().padStart(2, 0);\r\n\t\t\t\tlet cell = document.createElement(\"td\");\r\n\t\t\t\tlet cellText = document.createTextNode(date);\r\n\r\n\t\t\t\tif (date === today.getDate() && year === today.getFullYear() && month === today.getMonth()) {\r\n\t\t\t\t\tcell.classList.add('addBold');//Add bold to the current date\r\n\t\t\t\t\tselectedTd = cell;\r\n\t\t\t\t\tshowDisplay(dateString, date);\r\n\t\t\t\t} // color today's date\r\n\r\n\t\t\t\t//Check for dueDates matching with calendar dates and color them.\r\n\t\t\t\tfor (let i = 0; i < projects.length; i++) {\r\n\t\t\t\t\tif (dateString == projects[i].dueDate)\r\n\t\t\t\t\t\tcell.classList.add(\"bg-danger\");\r\n\t\t\t\t}\r\n\t\t\t\tfor (let j = 0; j < tasks.length; j++) {\r\n\t\t\t\t\tif (dateString == tasks[j].dueDate && !cell.classList.contains('bg-danger'))\r\n\t\t\t\t\t\tcell.classList.add(\"bg-warning\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.appendChild(cellText);\r\n\t\t\t\trow.appendChild(cell);\r\n\t\t\t\tdate++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttbl.appendChild(row); // appending each row into calendar body.\r\n\t}\r\n\tcreateMouseEvent();//Allows me to be able to click on a cell\r\n}", "function set(){\n calendarBody = document.getElementsByTagName(\"tbody\")[0];\n today = new Date();\n year = today.getFullYear();\n month = today.getMonth();\n buildCalendar();\n}", "function populateInitialValues(){\r\n\t\t\tvar existingDate = mainEvt.target.value;\r\n\t\t\texistingDate = existingDate.split(\".\");\r\n\t\t\tif(existingDate.length > 1){\r\n\t\t\t\tvar date = existingDate[2] + \"-\" + addLeadingZero(existingDate[1]) + \"-01\";\r\n\t\t\t\t// Update display date\r\n\t\t\t\tjcalendar_y_m.children[0].textContent = JC_Months[existingDate[1] - 1];\r\n\t\t\t\tjcalendar_y_m.children[1].textContent = existingDate[2];\r\n\t\t\t\t// Update select boxes\r\n\t\t\t\tjcalendar_year.value = existingDate[2];\r\n\t\t\t\tjcalendar_month.value = (+existingDate[1]);\r\n\t\t\t\tpopulateData(get1stDayOfMonth(date), getTotalDays(existingDate[2], existingDate[1]));\r\n\t\t\t}else{\r\n\t\t\t\tvar date = JC_cur_year + \"-\" + JC_cur_month + \"-01\";\r\n\t\t\t\t// Update display date\r\n\t\t\t\tjcalendar_y_m.children[0].textContent = JC_Months[JC_cur_month - 1];\r\n\t\t\t\tjcalendar_y_m.children[1].textContent = JC_cur_year;\r\n\t\t\t\t// Update select boxes\r\n\t\t\t\tjcalendar_year.value = JC_cur_year;\r\n\t\t\t\tjcalendar_month.value = (+JC_cur_month);\r\n\t\t\t\tpopulateData(get1stDayOfMonth(date), getTotalDays(JC_cur_year, JC_cur_month));\r\n\t\t\t}\r\n\t\t}", "function data_for_datatables(){\n var obj_date_datables=[], range_title='';\n if(typeof Const.year !='undefined' && Const.year!=null && Const.year != get_current_date().year){\n range_title = config_moments('undefined', ''+Const.year+'-12-02', ''+Const.year+'-12-31').diff_days;\n\n obj_date_datables={\n config_data:{day:undefined,\n data_i:''+Const.year+'-12-02',\n data_f:''+Const.year+'-12-31',\n },\n title:range_title,\n };\n\n } else {\n range_title = moment(new Date()).format('YYYY');\n obj_date_datables={\n config_data:{day:undefined,\n data_i:String(get_current_date().year+'-01-01'),//01/01/2015\n data_f:undefined\n },\n title:range_title,\n };\n }\n\n return obj_date_datables;\n}", "function genDateTable(){\n let day = Toolbar.curTime.getDate();\n let month = Toolbar.curTime.getMonth();\n let year = Toolbar.curTime.getFullYear();\n let monthData = {\n 0 : [\"January\", 31],\n 1 : [\"February\", 28],\n 2 : [\"March\", 31],\n 3 : [\"April\", 30],\n 4 : [\"May\", 31],\n 5 : [\"June\", 30],\n 6 : [\"July\", 31],\n 7 : [\"August\", 31],\n 8 : [\"September\", 30],\n 9 : [\"October\", 31],\n 10 : [\"November\", 30],\n 11 : [\"December\", 31],\n };\n //0=mon, 6=sun\n let dayofWeekNum = dayofweek(day,month+1,year).toFixed(0)-2;\n let count = 1;\n Quas.getEl(\"#date-picker-title\").text(monthData[month][0] + \" \" + year);\n for(let a=1; a<=6; a++){\n let week = document.querySelectorAll(\"#week-\"+a+\" td\");\n for(let i=0; i<week.length; i++){\n if(((a==1 && dayofWeekNum <= i) || a>1) && count <= monthData[month][1]){\n week[i].textContent = count;\n week[i].className = \"allowed\";\n count++;\n }\n else{\n week[i].className = \"\";\n week[i].textContent = \"\";\n }\n }\n }\n}", "function fill_Month_List(data) {\n\tfor (var key in data) {\n\t\tmonthList.push(key)\n }\n}", "function CalendarPopup_setMonthNames() \r\n{\r\n\tfor (var i=0; i<arguments.length; i++) \r\n\t this.monthNames[i] = arguments[i];\r\n}", "function defineMonth(data){\n let monthData;\n\n switch(data) {\n case \"january\":\n monthData = \"Jan\";\n break;\n\n case \"february\":\n monthData = \"FEB\";\n break;\n\n case \"march\":\n monthData = \"MAR\";\n break;\n\n case \"april\":\n monthData = \"APR\";\n break;\n\n case \"may\":\n monthData = \"MAY\";\n break;\n\n case \"june\":\n monthData = \"JUN\";\n break;\n\n case \"july\":\n monthData = \"JUL\";\n break;\n\n case \"august\":\n monthData = \"AUG\";\n break;\n\n case \"september\":\n monthData = \"SEP\";\n break;\n\n case \"october\":\n monthData = \"OCT\";\n break;\n\n case \"november\":\n monthData = \"NOV\";\n break;\n\n case \"december\":\n monthData = \"DEC\";\n break;\n\n default:\n monthData = \"JAN\";\n } \n return monthData; \n}//defineMonth", "function datem(a)\n {\n month=a+month;\n \n if(month == \"0\")\n {\n \n month=12;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"December\";\n year=year-1;\n document.getElementById(\"year12\").innerHTML=year;\n }\n else if(month==\"13\")\n {\n \n month=1;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"January\";\n year=year+1;\n document.getElementById(\"year12\").innerHTML=year;\n \n }\n \n \n if(month==\"1\")\n {\n document.getElementById(\"month12\").innerHTML=\"January\";\n daychange();\n }\n \n else if(month==\"2\")\n {\n document.getElementById(\"month12\").innerHTML=\"February\";\n daychange();\n }\n else if(month==\"3\")\n {\n document.getElementById(\"month12\").innerHTML=\"March\";\n daychange();\n }\n \n else if(month==\"4\")\n {\n document.getElementById(\"month12\").innerHTML=\"April\";\n daychange();\n }\n else if(month==\"5\")\n {\n document.getElementById(\"month12\").innerHTML=\"May\";\n daychange();\n }\n else if(month==\"6\")\n {\n document.getElementById(\"month12\").innerHTML=\"June\";\n daychange();\n }\n else if(month==\"7\")\n {\n document.getElementById(\"month12\").innerHTML=\"July\";\n daychange();\n }\n else if(month==\"8\")\n {\n document.getElementById(\"month12\").innerHTML=\"August\";\n daychange();\n }\n else if(month==\"9\")\n {\n document.getElementById(\"month12\").innerHTML=\"September\";\n daychange();\n }\n else if(month==\"10\")\n {\n document.getElementById(\"month12\").innerHTML=\"October\";\n daychange();\n }\n else if(month==\"11\")\n {\n document.getElementById(\"month12\").innerHTML=\"November\";\n daychange();\n }\n else if(month==\"12\")\n {\n document.getElementById(\"month12\").innerHTML=\"December\";\n daychange();\n }\n \n \n }", "function printtables(tempmonth,tempyear) {\r\n\t\tvar Monthtemp = getdate.getMonth(); //temparary variable taken for highlighting today\r\n\t\tvar Yeartemp = getdate.getFullYear();\r\n\t\tvar start_day_of_month = 1; // defining variable =1 as months start with 1\r\n\t\tvar getweekday = new Date(tempyear,tempmonth,1);//gets months start day\r\n\t\tvar weekday = getweekday.getDay();//gets where 1 day of month in a week starts with\r\n\t\tvar total_Days_in_month = new Date(tempyear,tempmonth+1, 0).getDate();//gets total days in month\r\n\t\tvar count = 0;\r\n\t\tprinttable += \"<table id = 'mytable'>\";\r\n\t\t\tprinttable += \"<tr colspan = '8' align = 'center'>\";\r\n\t\t\t\tprinttable += \"<th onclick = 'monthdec()' class = 'click'><</th>\";\r\n\t\t\t\tprinttable += \"<th colspan = '2' id = 'monthtd'>\" + armonths[tempmonth] + \"</th>\";\r\n\t\t\t\tprinttable += \"<th onclick = 'monthinc()' class = 'click'>></th>\";\r\n\t\t\t\tprinttable += \"<th onclick = 'yeardec()' class = 'click'><</th>\";\r\n\t\t\t\tprinttable += \"<th colspan = '2' id = 'yeartd'>\" + tempyear + \"</th>\";\r\n\t\t\t\tprinttable += \"<th onclick = 'yearinc()' class = 'click'>></th>\";\r\n\t\t\tprinttable += \"</tr>\";\r\n\t\t\tprinttable += \"<tr colspan = '8' align = 'center' colspan = '1'>\"\r\n\t\t\t\tfor (var i = 0; i < arweeks.length; i++){\r\n\t\t\t\t\tprinttable += \"<td id = 'weektd' colspan = '1'>\" + arweeks[i] + \"</td>\";\r\n\t\t\t\t}\r\n\t\t\tprinttable += \"</tr>\";\r\n\t\t\t//printing week days at their positions\r\n\t\t\tprinttable += \"<tr align = 'center' colspan = '1'>\";\r\n\t\t\t\tfor (var k = 0; k < arweeks.length; k++){\r\n\t\t\t\t\tif (weekday === k) {\r\n\t\t\t\t\t\tfor(var month_days = 1; month_days <= total_Days_in_month; month_days++) {\r\n\t\t\t\t\t\t\tif(Yeartemp == tempyear && Monthtemp == tempmonth && date === month_days){\r\n\t\t\t\t\t\t\t\t/*above if condition checks the to days month , date with printing\r\n\t\t\t\t\t\t\t\tmonth , date and print the value separately*/\r\n\t\t\t\t\t\t\t\tprinttable += \"<td id = 'today' class = 'tabledata1' onclick = 'check(\" + month_days + \")'>\" + (month_days) + \"</td>\";\r\n\t\t\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\tprinttable += \"<td class = 'tabledata1' onclick = 'check(\" + month_days + \")'>\" + ( month_days) + \"</td>\";\r\n\t\t\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t\t\t\tif(count % 7 === 0) {\r\n\t\t\t\t\t\t\t\t\tprinttable += \"</tr><tr align = 'center' colspan = '1'>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tprinttable += \"<td></td>\";\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tprinttable += \"</tr>\";\r\n\t\tprinttable += \"</table>\";\r\n\t\tdocument.getElementById('mydiv').innerHTML=printtable;\r\n\t resultyear = tempyear;\r\n\t resultmonth = tempmonth;\r\n\t}", "function initDayOfMonth() {\n let dayOfCurrentMonth; //define array day in current month\n let dayOfPrevMonth; //definde array day in prevent month\n let dayOfNextMounth; //definde array day in next month\n let countDay = 0; //initialize value index of day in array current month\n let countNextDay = 0; //initialize value index of day in array current next month\n\n dayOfCurrentMonth = getDaysOfMonth(currentYear, currentMonth);\n if (currentMonth === 0) {\n dayOfPrevMonth = getDaysOfMonth(currentYear - 1, 11);\n } else {\n dayOfPrevMonth = getDaysOfMonth(currentYear, currentMonth - 1);\n }\n dayOfPrevMonth.splice(0, dayOfPrevMonth.length - 6);\n\n if (currentMonth === 11) {\n dayOfNextMounth = getDaysOfMonth(currentYear + 1, 0);\n } else {\n dayOfNextMounth = getDaysOfMonth(currentYear, currentMonth + 1);\n }\n\n let listClassCss;\n for (let tr = 0; tr < 6; tr++) {\n let dataColum = \"\";\n for (let th = 0; th < ARR_DAY_OF_WEEKS.length; th++) {\n if (dayOfCurrentMonth[countDay] != undefined ||\n dayOfCurrentMonth[countDay] != null) {\n if (dayOfCurrentMonth[countDay].getDay() === th) {\n let date = dayOfCurrentMonth[countDay];\n listClassCss = \"date-num\";\n if (date.getDate() === now.getDate() &&\n date.getMonth() === now.getMonth() &&\n date.getFullYear() === now.getFullYear()) {\n listClassCss += \" current-date\";\n }\n dataColum += `<td class='${listClassCss}' onclick='selectDay(event,${date.getDate()},${date.getMonth()},${date.getFullYear()})'>${dayOfCurrentMonth[countDay].getDate()}</td>`;\n countDay++;\n } else {\n dayOfPrevMonth.forEach(date => {\n if (date.getDay() === th) {\n dataColum += `<td class='date-num date-prev' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${date.getDate()}</td>`;\n return;\n }\n });\n }\n } else {\n let date = dayOfNextMounth[countNextDay];\n dataColum += `<td class='date-num date-next' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${dayOfNextMounth[countNextDay].getDate()}</td>`;\n countNextDay++;\n }\n }\n bodyDate.append(`<tr>${dataColum}</tr>`);\n }\n trDates = $('.date-num');\n}", "function createCal(year, month) {\n var day = 1, i, j, haveDays = true,\n startDay = new Date(year, month, day).getDay(),\n daysInMonths = [31, (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n calendar = [];\n\n startDay -= firstDay;\n if (startDay < 0) {\n startDay = 7 + startDay;\n }\n\n if (createCal.cache[year] && !isIE11) {\n if (createCal.cache[year][month]) {\n return createCal.cache[year][month];\n }\n } else {\n createCal.cache[year] = {};\n }\n\n i = 0;\n while (haveDays) {\n calendar[i] = [];\n for (j = 0; j < 7; j++) {\n if (i === 0) {\n if (j === startDay) {\n calendar[i][j] = day++;\n startDay++;\n }\n } else if (day <= daysInMonths[month]) {\n calendar[i][j] = day++;\n } else {\n calendar[i][j] = '';\n haveDays = false;\n }\n if (day > daysInMonths[month]) {\n haveDays = false;\n }\n }\n i++;\n }\n\n ////6th week of month fix IF NEEDED\n //if (calendar[5]) {\n // for (i = 0; i < calendar[5].length; i++) {\n // if (calendar[5][i] !== '') {\n // calendar[4][i] = '<span>' + calendar[4][i] + '</span><span>' + calendar[5][i] + '</span>';\n // }\n // }\n // calendar = calendar.slice(0, 5);\n //}\n\n for (i = 0; i < calendar.length; i++) {\n calendar[i] = '<tr><td class=\"eformDay month_holder\" data-month=\"'+(parseInt(month)+1)+'\" onclick=\"pureJSCalendar.dayClick(this)\">' + calendar[i].join('</td><td class=\"eformDay\" onclick=\"pureJSCalendar.dayClick(this)\">') + '</td></tr>';\n }\n\n const calendarInnerHtml = calendar.join('');\n calendar = document.createElement('table', { class: 'curr' });\n calendar.innerHTML = calendarInnerHtml;\n const tdEmty = calendar.querySelectorAll('td:empty');\n for (var i = 0; i < tdEmty.length; ++i) {\n tdEmty[i].classList.add('nil');\n }\n if (month === new Date().getMonth()) {\n const calTd = calendar.querySelectorAll('td');\n const calTdArray = Array.prototype.slice.call(calTd);\n calTdArray.forEach(function (current, index, array) {\n if (current.innerHTML === new Date().getDate().toString()) {\n current.classList.add('today');\n }\n });\n }\n\n createCal.cache[year][month] = { calendar: function () { return calendar }, label: months[month] + ' ' + year };//calendar.clone()\n\n //DisableCalendarDays();\n return createCal.cache[year][month];\n }", "function createNav(table) {\n var rowNav = document.createElement(\"tr\");\n rowNav.setAttribute(\"class\", \"nav-js\");\n\n var preYear = document.createElement(\"th\");\n preYear.setAttribute(\"id\", \"preYear-js\");\n var preMonth = document.createElement(\"th\");\n preMonth.setAttribute(\"id\", \"preMonth-js\");\n var cboMonth = document.createElement(\"th\");\n cboMonth.setAttribute(\"colspan\", 2);\n var cboYear = document.createElement(\"th\");\n var nextMonth = document.createElement(\"th\");\n nextMonth.setAttribute(\"id\", \"nextMonth-js\");\n var nextYear = document.createElement(\"th\");\n nextYear.setAttribute(\"id\", \"nextYear-js\");\n preYear.innerHTML = \"<<\";\n preMonth.innerHTML = \"<\";\n nextMonth.innerHTML = \">\";\n nextYear.innerHTML = \">>\";\n\n var i;\n var cboM = document.createElement(\"select\");\n cboM.setAttribute(\"id\", \"month-js\");\n for (i = 0; i < 12; i++) {\n var t = document.createElement(\"option\");\n t.setAttribute(\"value\", i);\n t.innerHTML = month[i];\n cboM.appendChild(t);\n }\n var cboY = document.createElement(\"select\");\n cboY.setAttribute(\"id\", \"year-js\");\n for (i = 1900; i < 2100; i++) {\n var t = document.createElement(\"option\");\n t.setAttribute(\"value\", i);\n t.innerHTML = i;\n cboY.appendChild(t);\n }\n\n cboMonth.appendChild(cboM);\n cboYear.appendChild(cboY);\n rowNav.appendChild(preYear);\n rowNav.appendChild(preMonth);\n rowNav.appendChild(cboMonth);\n rowNav.appendChild(cboYear);\n rowNav.appendChild(nextMonth);\n rowNav.appendChild(nextYear);\n table.appendChild(rowNav);\n}", "months() {\n return _monthLabels.map((ml, i) => ({\n label: ml,\n label_1: ml.substring(0, 1),\n label_2: ml.substring(0, 2),\n label_3: ml.substring(0, 3),\n number: i + 1,\n }));\n }", "function upLayout(){\n const monthHTML = document.querySelector('.month');\n const yearHTML = document.querySelector('.year');\n let monthString = '';\n if(month === 0){\n monthString = 'January';\n }else if(month === 1){\n monthString = 'February';\n }else if(month === 2){\n monthString = 'March';\n }else if(month === 3){\n monthString = 'April';\n }else if(month === 4){\n monthString = 'May';\n }else if(month === 5){\n monthString = 'June';\n }else if(month === 6){\n monthString = 'July';\n }else if(month === 7){\n monthString = 'August';\n }else if(month === 8){\n monthString = 'September';\n }else if(month === 9){\n monthString = 'October';\n }else if(month === 10){\n monthString = 'November';\n }else if(month === 11){\n monthString = 'December';\n }else{\n console.log('NOTWORKING');\n monthString = 'default';\n }\n monthHTML.innerHTML = monthString;\n yearHTML.innerHTML = year;\n }", "function changeMonthByYear(year_selector, month_selector) {\n var today = new Date();\n var months = \"<option selected disabled>Tháng</option>\";\n if (today.getFullYear() == year_selector.val()) {\n var today = new Date();\n for (var month = 1; month <= today.getMonth(); month++) {\n months += \"<option value='\" + month + \"'>\" + month + \"</option>/n\"\n }\n } else {\n for (var month = 1; month <= 12; month++) {\n months += \"<option value='\" + month + \"'>\" + month + \"</option>/n\"\n }\n }\n month_selector.html(months);\n}", "function fillCalendar() {\n console.log(\"inside the fill calendar\");\n // for (let i = 0; i < events.length; i++) {\n // console.log(events[i].title);\n // }\n let currentMonth = date.getMonth()+1;\n let dateComp = new Date(date.getFullYear()+yearCounter, currentMonth-1+monthCounter, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n let year = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getFullYear();\n let month = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getMonth();\n let numDaysInMonth = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getDate();\n let monthStartingDay = new Date(date.getFullYear()+yearCounter, currentMonth+-1+monthCounter, 1).getDay();\n let numDaysLastMonth = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter-1, 0).getDate();\n let monthStartingDayCopy = monthStartingDay;\n let counter = 1;\n let counter2 = 0;\n let counter3 = 0;\n let counter4 = 1;\n //\n //prints month and year above calendar\n //\n $(\"#month\").html(`${months[month]}`);\n $(\"#year\").html(`${year}`);\n //\n //clears all day boxes on calendar\n //\n $(\".day-box\").html(\" \"); \n // while loop fills in boxes for last month\n // first for-loop fills in first row for curreny month\n // second for-loop fills in the rest of the rows for current month\n // third for-loop fills in the rest of the rows for next month\n while (counter2 < monthStartingDay) {\n $(`#c${counter2}`).append(`<span class=\"faded\">${numDaysLastMonth-monthStartingDayCopy+1}</span>`);\n counter2++;\n monthStartingDayCopy--;\n }\n for (let j = monthStartingDay; j < 7; j++) {\n $(`#c${j}`).append(`<span class=\"bold\">${counter}</span>`);\n for (let i = 0 ; i < events.length; i++) {\n //\n // If the current date is equal to the date generated by fillCalender()\n // then highlight current day's box to lightgreen using currentDay class\n //\n if (currentMonth + monthCounter == parseInt(events[i].startMonth) && counter == parseInt(events[i].startDay)) {\n $(`#c${j}`).append(`<p class=\"event ${events[i].tag}\">${events[i].startHour}:${events[i].startMinutes} ${events[i].title}</p>`);\n }\n }\n counter++;\n }\n for (let j = 7; counter <= numDaysInMonth; j++) {\n $(`#c${j}`).append(`<span class=\"bold\">${counter}</span>`);\n if (date.getMonth() == dateComp.getMonth() && date.getDate() == dateComp.getDate() && date.getFullYear() == dateComp.getFullYear()) {\n currentDayIDNum = date.getDate()-monthStartingDay+1;\n $(`#c${currentDayIDNum}`).find(\"span\").addClass(\"currentDay\");\n } else {\n $(`#c${currentDayIDNum}`).find(\"span\").removeClass(\"currentDay\");\n }\n for (let i = 0 ; i < events.length; i++) {\n // console.log(\"Event index: \" + i)\n if (currentMonth + monthCounter == parseInt(events[i].startMonth) && counter == parseInt(events[i].startDay)) {\n $(`#c${j}`).append(`<p class=\"event ${events[i].tag}\">${events[i].startHour}:${events[i].startMinutes} ${events[i].title}</p>`);\n }\n }\n counter++;\n counter3 = j+1;\n }\n for (j = counter3; j < 42; j++) {\n $(`#c${j}`).append(`<span class=\"faded\">${counter4}</span>`);\n counter3++;\n counter4++;\n }\n console.log(\"Outside fill calendar\");\n}", "function add_month_and_year_text(){\n\t\tvar month_and_year_array = return_current_month_and_year();\n\t\t$('#sub_top_month').text(`Available Budget in ${month_and_year_array[0]} ${month_and_year_array[1]}:`);\n\t}", "function r()\n\t\t{\n\t\t\tgenRow(self.year, self.month);\n\t\t\t$('caption', table).html(Cal.months[self.month] + \" \" + self.year);\n\t\t\taction(self);\n\t\t}", "_setInfo() {\n let { year: currentYear, month: currentMonth } = this.currentMonthInfo; \n \n this.prevMonthInfo = { \n year: currentMonth == 0 ? currentYear - 1 : currentYear,\n month: currentMonth == 0 ? 11 : currentMonth - 1,\n day: null\n };\n \n this.nextMonthInfo = {\n year: currentMonth == 11 ? currentYear + 1 : currentYear,\n month: currentMonth == 11 ? 0 : currentMonth + 1,\n day: null\n }\n }", "function initialize()\n{\n curr_month; \n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n // display_cal(); \n}", "function addMonthesToYear() {\n\tvar listItem = this.parentNode;\n\tyear = listItem.id;\n\tvar yearNav = document.getElementById('year-nav').querySelectorAll(\"ul\")[0];\n\tyearNav.childNodes.forEach(function(item) {\n\t\titem.classList.remove('active');\n\t});\n\tlistItem.classList.add('active');\n\tif (listItem.className.indexOf('month-populated') > -1) {\n\t\treturn;\n\t}\n\tvar monthes = diaryByYear[listItem.id];\n\tparseObjectToNavItems(monthes, listItem, addDaysToMonth);\n\tlistItem.classList.add('month-populated');\n\tloadLastMonth();\n}", "_init() {\n this._setSelectedMonth(this.selected);\n this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());\n this._yearLabel = this._dateAdapter.getYearName(this.activeDate);\n let monthNames = this._dateAdapter.getMonthNames('short');\n // First row of months only contains 5 elements so we can fit the year label on the same row.\n this._months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));\n this._changeDetectorRef.markForCheck();\n }", "_init() {\n this._setSelectedMonth(this.selected);\n this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());\n this._yearLabel = this._dateAdapter.getYearName(this.activeDate);\n let monthNames = this._dateAdapter.getMonthNames('short');\n // First row of months only contains 5 elements so we can fit the year label on the same row.\n this._months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));\n this._changeDetectorRef.markForCheck();\n }", "function render_table_month_year() {\n let columnDefs = [\n {\n headerName: \"Month\",\n field: \"month\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Year\",\n field: \"year\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Total Cases\",\n field: \"total_cases\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Total Deaths\",\n field: \"total_deaths\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n {\n headerName: \"Total Tests\",\n field: \"total_tests\",\n sortable: true,\n filter: \"agTextColumnFilter\",\n sortingOrder: ['desc', 'asc']\n },\n ];\n\n // let the grid know which columns and what data to use\n let gridOptionsContinents = {\n columnDefs: columnDefs,\n onFirstDataRendered: onFirstDataRendered_f,\n animateRows: true,\n pagination: false,\n };\n\n\n let gridDiv = document.querySelector('#table_month_year');\n new agGrid.Grid(gridDiv, gridOptionsContinents);\n\n // get data from server\n let full_url = \"/mysql/month\"\n agGrid.simpleHttpRequest({url: full_url})\n .then(function (data) {\n gridOptionsContinents.api.setRowData(data);\n });\n\n}", "function calanderBuild(calanderElement,startElement,endElement,object){\ncalanderElement.empty();\nvar end = assumptions.completeReturns[0].length - 1;\ncalander.months=['Jan','Feb','Mar', 'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n\n\nstartYear=moment(assumptions.completeReturns[0][end]).format(\"YYYY\")/1;\nendYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\")/1;\n\n\ndropdown=\"<select class='calanderDropDown'>\"\n\nfor(i=startYear;i<=endYear;i++){\ndropdown +=\"<option>\"+i+\"</option>\"\n\n}\ndropdown +=\"</select>\"\nvar calanderTable = \"<table class='calander'><th colspan='4'>\"+dropdown+\"</th><tr><td id='Jan'>Jan</td><td id='Feb'>Feb</td><td id='Mar'>Mar</td><td id='Apr'>Apr</td></tr><tr><td id='May'>May</td><td id='Jun'>Jun</td><td id='Jul'>Jul</td><td id='Aug'>Aug</td></tr><tr><td id='Sep'>Sep</td><td id='Oct'>Oct</td><td id='Nov'>Nov</td><td id='Dec'>Dec</td></tr></table>\"\n\n\ncalanderElement.append(calanderTable);\ncalanderElement.css('display','none');\n$('.calander').draggable();\n\n//build calander applicable to start date\nstartElement.bind( \"click\", function() {\n\ncalander.start=true;\ncalanderElement.css('display','block');\nyear=moment(this.text).format(\"YYYY\");\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\n\n$('.calanderDropDown').val(year);\nlastYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\");\nfirstYear=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"YYYY\");\nlastMonth=moment(assumptions.completeReturns[0][0]).format(\"M\");\nfirstMonth=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"M\");\n\nstartMonthsGrey=[];\nendMonthsGrey=[];\nfor(i=0;i<12;i++){\nif(firstMonth/1>i+1){\nstartMonthsGrey[i]=calander.months[i];\n}\n}\nfor(i=12;i>0;i--){\nif(i>lastMonth/1){\nendMonthsGrey[12-i]=calander.months[i-1];\n}\n}\n\nif(year==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nif(year==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\n\n\n\n//set up months per year choice chosen, once month is chosen magic will actually happen\n$('.calanderDropDown').bind(\"change\",function(){\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\nif($('.calanderDropDown').val()==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse if($('.calanderDropDown').val()==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse{}\n})\n\n});\n\n\n//build calander applicable to end date\nendElement.bind( \"click\", function() {\ncalander.start=false;\ncalanderElement.css('display','block');\nyear=moment(this.text).format(\"YYYY\");\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\n\n$('.calanderDropDown').val(year);\nlastYear=moment(assumptions.completeReturns[0][0]).format(\"YYYY\");\nfirstYear=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"YYYY\");\nlastMonth=moment(assumptions.completeReturns[0][0]).format(\"M\");\nfirstMonth=moment(assumptions.completeReturns[0][assumptions.completeReturns[0].length-1]).format(\"M\");\n\nstartMonthsGrey=[];\nendMonthsGrey=[];\nfor(i=0;i<12;i++){\nif(firstMonth/1>i+1){\nstartMonthsGrey[i]=calander.months[i];\n}\n}\nfor(i=12;i>0;i--){\nif(i>lastMonth/1){\nendMonthsGrey[12-i]=calander.months[i-1];\n}\n}\n\nif(year==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nif(year==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\n\n\n$('.calanderDropDown').bind(\"change\",function(){\nfor(i=0;i<calander.months.length;i++){\n$('#' + calander.months[i]).removeClass('inactiveMonth');\n$('#' + calander.months[i]).addClass('activeMonth');\n}\n\nif($('.calanderDropDown').val()==firstYear){\nfor(i=0;i<startMonthsGrey.length;i++){\n$('#' + startMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + startMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse if($('.calanderDropDown').val()==lastYear){\nfor(i=0;i<endMonthsGrey.length;i++){\n\n$('#' + endMonthsGrey[i]).addClass('inactiveMonth');\n$('#' + endMonthsGrey[i]).removeClass('activeMonth');\n}\n}\nelse{}\n})\n\n\n});\n//when month is chosen sets date and recalculates using assumptions.js function customReturn()\n$('.calander td').click(function(){\nmonth = this.innerText;\nyear = $('.calanderDropDown').val();\ncompleteReturnsPosition=\"\";\ndate=\"\";\nnewReturnArray=[];\n\n\nstart=\"\";\nend=\"\";\n\nif(this.className==\"activeMonth\"){\nfor(i=0;i<assumptions.completeReturns[0].length;i++){\nif(month == moment(assumptions.completeReturns[0][i]).format('MMM') && year == moment(assumptions.completeReturns[0][i]).format('YYYY')){\ncompleteReturnsPosition = i;\ndate = assumptions.completeReturns[0][i];\n};\n/* console.log(moment(assumptions.completeReturns[0][i]).format('MMM')) */\n}\n\n/* if(calander.start){\nif(completeReturnsPosition == assumptions.completeReturns[0].length-1){}\nelse{\ncalander.startDate=assumptions.completeReturns[0][completeReturnsPosition];\n\n}\n}\nelse{\nif(completeReturnsPosition == 0){}\nelse{\ncalander.endDate=assumptions.completeReturns[0][completeReturnsPosition];\n\n}\n\n} */\nif(calander.start){\ncalander.startDate = date;\n}\nelse{calander.endDate = date}\nfor(i=0;i<assumptions.completeReturns[0].length;i++){\nif(assumptions.completeReturns[0][i]==calander.startDate){\nstart = i;\n}\nif(assumptions.completeReturns[0][i]==calander.endDate){\nend = i;\n}\n\n}\n//if start date is greater than end date it does nothing\nif(start <= end){}\nelse{\nfor(i=0;i<assumptions.completeReturns.length;i++){\nnewReturnArray.push(assumptions.completeReturns[i].slice(end,start+1))\n}\n\n//found in assumptions.js\npresentAssumptions(newReturnArray);\n\n}\n\n\n}\n\n})\n\n}", "function scrapeMonth(date) {\n const originalDate = new Date(date.getTime());\n const year = date.getFullYear();\n const month = date.getMonth();\n\n const data = {\n date: originalDate\n };\n\n monthTracker.current = new Date(date.getTime());\n monthTracker.current.setDate(1);\n monthTracker.years[year] = monthTracker.years[year] || {};\n if (monthTracker.years[year][month] !== undefined) {\n data.month = monthTracker.years[year][month];\n return data;\n }\n\n date = new Date(date.getTime());\n date.setDate(1);\n monthTracker.years[year][month] = [];\n\n let tracker = monthTracker.years[year][month];\n let rowTracker = 0;\n while (date.getMonth() === month) {\n const _date = date.getDate();\n const day = date.getDay();\n if (_date === 1) {\n tracker[rowTracker] = fill([], day);\n }\n\n tracker[rowTracker] = tracker[rowTracker] || [];\n tracker[rowTracker][day] = _date;\n\n if (day === 6) {\n rowTracker++;\n }\n\n date.setDate(date.getDate() + 1);\n }\n \n let lastRow = 5;\n if (tracker[5] === undefined) {\n lastRow = 4;\n tracker[5] = fill([], 7);\n }\n\n let lastRowLength = tracker[lastRow].length;\n if (lastRowLength < 7) {\n let filled = tracker[lastRow].concat(fill([], 7 - lastRowLength));\n tracker[lastRow] = filled;\n }\n\n data.month = tracker;\n return data;\n}", "function writeMonth(name, common) {\n //console.log(currentYear);\n yearEl.innerHTML = currentYear.year;\n yearNameEl.innerHTML = currentYear.name;\n monthEl.innerHTML = name;\n if (name == \"The Feast of the Moon\") {\n monthEl.style = \"font-size: 4.3em;\";\n }\n else {\n monthEl.style = \"font-size: 6em;\";\n }\n commonEl.innerHTML = (common === undefined) ? \"\" : common;\n }", "renderMonthYear() {\n this.elements.month.textContent = `${this.data.monthList[this.data.dates.current.getMonth()]} ${this.data.dates.current.getFullYear()}`;\n }", "setMonthTable(state, {ledger}) {\n ledger.bill.forEach(e => {\n let item = {year: e.year, month: e.month, monthKey: e.monthKey};\n if(e.month && e.year && ledger.monthTable.findIndex(i => (i.year === e.year && i.month === e.month)) < 0) {\n ledger.monthTable.push(item);\n }\n });\n }", "function createCalendar(){\n // display the current month and year at the top of the calendar\n calendarHeader.innerHTML = `<h1>${monthInfo[dateInfo.currentMonth][0]} ${dateInfo.currentYear}</h1>`;\n checkLeapYear();\n addDaysFromPastMonth();\n addDaysFromCurrentMonth();\n addDaysFromNextMonth();\n}", "function printMonth(template, date) {\n // numero giorni nel mese\n var daysInMonth = date.daysInMonth();\n\n // setta header\n $('h1').html(date.format('MMMM YYYY'));\n\n // Imposta data attribute data visualizzata\n $('.month').attr('data-this-date', date.format('YYYY-MM-DD'));\n\n // genera giorni mese\n for (var i = 0; i < daysInMonth; i++) {\n // genera data con moment js\n var thisDate = moment({\n year: date.year(),\n month: date.month(),\n day: i + 1\n });\n\n // imposta dati template\n var context = {\n class: 'day',\n day: thisDate.format('DD MMMM'),\n completeDate: thisDate.format('YYYY-MM-DD')\n };\n\n //compilare e aggiungere template\n var html = template(context);\n $('.month-list').append(html);\n }\n}", "function printDateNumber(monthNumber, mon, tue, wed, thur, fri, sat, sund) {\n\n $($('tbody.event-calendar tr')).each(function(index) {\n $(this).empty();\n });\n\n $($('thead.event-days tr')).each(function(index) {\n $(this).empty();\n });\n\n function getDaysInMonth(month, year) {\n // Since no month has fewer than 28 days\n var date = new Date(year, month, 1);\n var days = [];\n while (date.getMonth() === month) {\n days.push(new Date(date));\n date.setDate(date.getDate() + 1);\n }\n return days;\n }\n\n i = 0;\n\n setDaysInOrder(mon, tue, wed, thur, fri, sat, sund);\n\n function setDaysInOrder(mon, tue, wed, thur, fri, sat, sund) {\n var monthDay = getDaysInMonth(monthNumber - 1, yearNumber)[0].toString().substring(0, 3);\n if (monthDay === 'Mon') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Tue') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Wed') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Thu') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Fri') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Sat') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Sun') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n }\n };\n $(getDaysInMonth(monthNumber - 1, yearNumber)).each(function(index) {\n var index = index + 1;\n if (index < 8) {\n $('tbody.event-calendar tr.1').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 15) {\n $('tbody.event-calendar tr.2').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 22) {\n $('tbody.event-calendar tr.3').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 29) {\n $('tbody.event-calendar tr.4').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 32) {\n $('tbody.event-calendar tr.5').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n }\n i++;\n });\n\n\n function getWeekDay(date) { \n var daySunday = [sund, mon, tue, wed, thur, fri, sat];\n return daySunday[date.getDay()];\n }\n var date = new Date(); \n var CYear = date.getFullYear();\n var Cmonth = date.getUTCMonth();\n var firstDate = new Date(CYear, Cmonth, 1 )\n var fDate = getWeekDay(firstDate);\n var minusDay = 0;\n if(fDate == sund){minusDay = 6;}\n else if(fDate == mon){ minusDay = 0;}\n else if(fDate == tue){ minusDay = 1;}\n else if(fDate == wed){ minusDay = 2;}\n else if(fDate == thur){minusDay = 3;}\n else if(fDate == fri){ minusDay = 4;}\n else if(fDate == sat){ minusDay = 5;}\n $('.calentdar-days td').each(function(){\n var calDayTd = $(this);\n var lCalDay = calDayTd.html() - minusDay;\n calDayTd.html(lCalDay);\n calDayTd.attr('date-day', lCalDay);\n });\n var b = 0;\n var lastMonthDay = $('.calentdar-days td:last').html();\n for(var i = 1; i<= minusDay; i++){\n b++;\n var lMDay = +lastMonthDay+b;\n $('.calentdar-days tr:last').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + lastMonthDay + '\" date-year=\"' + CYear + '\">' + lMDay + '</td>');\n }\n var colDay = $('.calentdar-days tr:last td').length;\n var remainsDay = 7 - colDay;\n var d = 0;\n for(var i = 1; i<= remainsDay; i++){\n d++;\n if(monthNumber != 12){\n var nextMonthNumber = monthNumber +1;\n nextCYear = CYear;\n }\n else{\n var nextMonthNumber = 1;\n var nextCYear = CYear + 1;\n var prevCYear = CYear - 1;\n }\n $('.calentdar-days tr:last').append('<td class=\"next-month\" date-month=\"' + nextMonthNumber + '\" date-day=\"' + d + '\" date-year=\"' + nextCYear + '\">' + d + '</td>');\n }\n var lestMonth = new Date(CYear,Cmonth,0).getDate();\n $('.calentdar-days td').each(function(){\n if($(this).html() <= 0 ){\n for(var i =1; i <= minusDay; i++){\n\n var daysM = $(this).attr('date-day');\n var dayD = lestMonth - (-daysM);\n $(this).html(dayD)\n .attr('date-day',daysM)\n .addClass('next-month')\n .attr('date-month',nextMonthNumber-1)\n .css('color','#cecece')\n .attr('date-year',prevCYear);\n\n }\n }\n $('.calentdar-days tr td.next-month').css('color','#cecece'); \n })\n\n\n\n\n var date = new Date();\n var month = date.getMonth() + 1;\n var thisyear = new Date().getFullYear();\n setCurrentDay(month, thisyear);\n setEvent();\n displayEvent();\n }", "dateHelper(mo, yr) {\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return months[mo - 1] + '-' + yr;\n }", "function generateYear(year) {\r\n var h2 = document.createElement(\"h2\");\r\n h2.innerText = year;\r\n calendar.appendChild(h2);\r\n for (var i = 0; i < monthDays.length; i++) {\r\n calendar.appendChild(generateMonth(i, year));\r\n }\r\n if (calendarData[year] === undefined) {\r\n calendarData[year] = { colors: {}, text: {} };\r\n }\r\n}", "function generateMonth(){\n //let monthsArr = ['January','Febuary','March','April','May','June','July','August','September','October','November','December'];\n let monthsArr = ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'];\n var weeks = currentMonth.getWeeks();\n document.getElementById('monthAndYear').innerHTML = monthsArr[currentMonth.month]+' '+currentMonth.year;\n document.getElementById('calendarTable').innerHTML=\"<thead><tr><th>Domingo</th><th>Lunes</th><th>Martes</th><th>Miércoles</th><th>Jueves</th><th>Viernes</th><th>Sabado</th></tr></thead>\";\n \n $.get(\"datos/datos.php\", { yyyy:currentMonth.year,mm:currentMonth.month })\n .done(function (datos) {\n data=datos.feriados \n let i = 1;\n for(var w in weeks){\n var days = weeks[w].getDates();\n let tableRow = document.createElement(\"tr\");\n tableRow.setAttribute('id','row'+i);\n i+=1;\n let week = document.getElementById('calendarTable').appendChild(tableRow);\n let nextMonthDays = document.createElement(\"th\");\n for(var d in days){\n if(currentMonth.month == days[d].getMonth()){\n dayId = days[d].getDate()+'';\n vActual=today.getFullYear()*10000+(today.getMonth()+1)*100+today.getDate()\n vDiaMes=currentMonth.year*10000+(currentMonth.month+1)*100+parseInt(dayId)\n debugger\n\n vFeriado=feriado(dayId,data)\n vTurnos=conTurno(dayId,datos.turnos)\n if (vDiaMes>vActual){\n if (days[d].getDay()==0 || days[d].getDay()==6){\n if (vFeriado.length>0){ \n day = week.innerHTML+='<th class=\"day2\" style=\"background-color: green;color:white;\" id=\"'+dayId+'\">'+ days[d].getDate()+'<hr />'+vFeriado+'</th>'; \n } else { \n day = week.innerHTML+='<th class=\"day2\" id=\"'+dayId+'\">'+ days[d].getDate() +'</th>'; \n }\n\n } else {\n if (vFeriado.length>0){ \n day = week.innerHTML+='<th class=\"day\" style=\"background-color: green;color:white;\" id=\"'+dayId+'\">'+ days[d].getDate()+'<hr />'+vFeriado+'</th>'; \n } else {\n if (vTurnos>0){\n day = week.innerHTML+='<th class=\"day\" id=\"'+dayId+'\">'+ days[d].getDate() + '<br /> ('+vTurnos+' turnos.)</th>'; \n } else {\n day = week.innerHTML+='<th class=\"day\" id=\"'+dayId+'\">'+ days[d].getDate() + '</th>'; \n }\n \n } \n } \n \n } else {\n if (vFeriado.length>0){ \n day = week.innerHTML+='<th class=\"day1\" style=\"background-color: green;color:white;\" id=\"'+dayId+'\">'+ days[d].getDate()+'<hr />'+vFeriado+'</th>'; \n } else { \n day = week.innerHTML+='<th class=\"day1\" id=\"'+dayId+'\">'+ days[d].getDate()+'</th>'; \n }\n }\n \n } \n else{\n day = week.innerHTML+='<th class=\"otherDay\">'+ monthsArr[days[d].getMonth()]+' '+days[d].getDate()+'</th>';\n }\n }\n }\n var r1=document.getElementsByClassName(\"day\")\n for (var j = 0; j < r1.length; j++) {\n \n r1[j].addEventListener(\"click\", function(){\n\n /*if (this.getAttribute('style')!==\"background-color:red\"){\n this.setAttribute('style','background-color:red') \n } else {\n this.setAttribute('style','background-color: green')\n }*/\n var vFecha = (currentMonth.month+1).toString()+'-'+this.id.toString()+'-'+currentMonth.year.toString()\n diaElegido=vFecha\n \n document.getElementById('eventPopUp').hidden = false;\n document.getElementById('editEvent').hidden = false;\n \n });\n }\n\n }); \n \n}", "function buildYear(){\r\n\tyear = Object.create(d); //so year is an object like Date, that we passed to this with 'd'\r\n\tyear.currentYear = d.getFullYear(); //just trying to make things quicker to get at\r\n\tyear.thisMonthNumber = d.getMonth();\r\n\r\n //month and day names.\r\n\tyear.monthNames = [\r\n\t\t\t\t\"January\",\r\n\t\t\t\t\"February\",\r\n\t\t\t\t\"March\",\r\n\t\t\t\t\"April\",\r\n\t\t\t\t\"May\",\r\n\t\t\t\t\"June\",\r\n\t\t\t\t\"July\",\r\n\t\t\t\t\"August\",\r\n\t\t\t\t\"September\" ,\r\n\t\t\t\t\"October\",\r\n\t\t\t\t\"November\",\r\n\t\t\t\t\"December\"\r\n\t\t\t],\r\n\tyear.dayNames = [\r\n\t\t\t\t\"Monday\",\r\n\t\t\t\t\"Tuesday\",\r\n\t\t\t\t\"Wednesday\",\r\n\t\t\t\t\"Thursday\",\r\n\t\t\t\t\"Friday\",\r\n\t\t\t\t\"Saturday\",\r\n\t\t\t\t\"Sunday\"\r\n\t\t\t],\r\n\r\n\tyear.currentDay = d.getDay(); //a number 0 -6\r\n\tyear.workingMonth = workingMonth;\r\n\tyear.workingDayName = workingDayName;\r\n\tyear.workingDayNum = workingDayNum;\r\n\tyear.workingDate = workingDate;\r\n\tyear.workingHour = workingHour;\r\n\tyear.daysInMonths = getDaysInMonths();//an array with each month's number of days.\r\n\r\n\tyear.weekdays = new Array(7);\r\n\t\tyear.weekdays[0] = \"Monday\";\r\n\t\tyear.weekdays[1] = \"Tuesday\";\r\n\t\tyear.weekdays[2] = \"Wednesday\";\r\n\t\tyear.weekdays[3] = \"Thursday\";\r\n\t\tyear.weekdays[4] = \"Friday\";\r\n\t\tyear.weekdays[5] = \"Saturday\";\r\n\t\tyear.weekdays[6]= \"Sunday\";\r\n\r\n\tyear.printYear = function(){\r\n\r\n\t\t$.each( year.monthNames, function( key, value ) {\r\n\t\t $(\"#rightBar\").append( \"<div id='\"+key + \"' class='mNamesRight'>\" + value.toUpperCase() + \"</div>\");\r\n\t\t $('#'+key).on(\"click\",dayBoxes);\r\n\t\t});\r\n\t};\r\n\r\n\r\n\treturn year\r\n}", "function firstload(){\n var curDate = new Date();\n var curMonth = curDate.getMonth();\n var curYear = curDate.getFullYear();\n var thisMonth= new Month(curYear,curMonth);\n toMonth = thisMonth;\n $( document ).ready(load);\n}", "function printMonth(template, date) {\n // numero giorni nel mese\n var daysInMonth = date.daysInMonth();\n\n // setta header\n $('h1').html( date.format('MMMM YYYY') );\n\n // Imposta data attribute data visualizzata\n $('.month').attr('data-this-date', date.format('YYYY-MM-DD'));\n \n // pulizia giorni mese precedenti\n $('.month-list').children('li').remove();\n\n // genera giorni mese\n for (var i = 0; i < daysInMonth; i++) {\n // genera data con moment js\n var thisDate = moment({\n year: date.year(),\n month: date.month(),\n day: i + 1\n });\n\n // imposta dati template\n var context = {\n class: 'day',\n day: thisDate.format('DD - ddd'),\n completeDate: thisDate.format('YYYY-MM-DD')\n };\n\n //compilare e aggiungere template\n var html = template(context);\n $('.month-list').append(html);\n }\n}", "_renderCalendarMonth() {\n let i = 0;\n let calendarWrapper = document.getElementById('calendarWrapper');\n let calendarMonth = document.getElementById('calendarMonth');\n let iteratingDate =1;\n this.numberOfDaysInMonth = this.daysInMonth(this.monthIndex,this.year);\n // Set date to the 1st of current month\n this.startOfMonthDate = new Date(this.year,this.monthIndex,1);\n this.dayAtStartOfMonth = this.startOfMonthDate.getDay();\n calendarWrapper.innerHTML = '';\n // Changes month and year displayed\n calendarMonth.innerHTML = '';\n calendarMonth.innerHTML += `${this.month} ${this.year}`; \n var myRequest = new Request('../months.json');\n fetch(myRequest)\n .then(function(response) {return response.json();})\n .then(function(months) {\n let colour = 'light-grey';\n let colourTwo = \"\";\n let text = \"\";\n for (var i=1; i<=42;i++ ){\n if (i>=dayArray[calendar.dayAtStartOfMonth] && iteratingDate<=calendar.numberOfDaysInMonth){\n if (`${iteratingDate}` in months[`${calendar.year}`][calendar.monthIndex]){\n colour = months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`].colour;\n if (`text` in months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`]){\n text = months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`].text;\n }\n if (`colourTwo` in months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`]){\n colourTwo = months[`${calendar.year}`][calendar.monthIndex][`${iteratingDate}`].colourTwo;\n } \n }\n if (colourTwo !== \"\"){\n calendarWrapper.innerHTML +=`<div><div class=\"grid-two-col\"><div class=\"${colour}\"></div><div class= \"${colourTwo}\"><p class=\"calendar-number\">${iteratingDate}</p></div></div><p class=\"calendar-text\">${text}</p></div>`;\n colourTwo = \"\"; \n } else {\n calendarWrapper.innerHTML +=`<div><div class=\"grid-two-col\"><div class=\"${colour}\"></div><div class= \"${colour}\"><p class=\"calendar-number\">${iteratingDate}</p></div></div><p class=\"calendar-text\">${text}</p></div>`;\n }\n iteratingDate++;\n text=\"\";\n } else {\n calendarWrapper.innerHTML += `<div><p class=\"calendar-text\"></p></div>`;\n }\n } \n });\n }", "function createCalendar(year, month) {\n //where the first of month start in the week\n let firstDayofMonth = new Date(year, month - 1, 1).getDay() //weeks starts index=0 and sunday=0 \n let monthTest = new Date(year, month, 1).getMonth() // here month index start 1;\n console.log(monthTest)\n // console.log(firstDayofMonth)\n let totalDaysinMonth = new Date(year, month, 0).getDate()\n console.log(totalDaysinMonth)\n changeBody(month)\n getHoliday()\n displayMonthYear(year, month)\n\n clearCalendar()\n\n let day = 1; //everymonth start day=1\n //loop to create row/data \n let calendarBody = document.querySelector('#calendar-body')\n for (let i = 0; i < 7; i++) {\n let tr = document.createElement(\"tr\") //create row\n tr.setAttribute(\"class\", \"calendar-row\")\n for (let z = 0; z < 7; z++) { //seven days a week\n //on the first row, indicate first day of month start in week\n //empty html element\n if (i === 0 && z < firstDayofMonth) {\n let td = document.createElement(\"td\")\n td.innerText = \"\"\n tr.append(td) ////each row should have data with empty date\n } else {\n if (day > totalDaysinMonth) { //loop stop when reach to total days\n break;\n }\n let td = document.createElement(\"td\")\n //highlight today;\n if (day === currentDate && month === currentMonth && year === currentYear) {\n td.setAttribute(\"class\", \"itstoday\")\n }\n td.innerText = day;\n tr.append(td)\n\n day++; //increment day\n }\n }\n calendarBody.append(tr) //insert row into calendar body\n }\n return calendarBody;\n}", "function loadMonth(e, el, datepicker, chosendate) {\n\n // reference our years for the nextMonth and prevMonth buttons\n var mo = jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex;\n var yr = jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex;\n var yrs = jQuery(\"select[name=year] option\", datepicker).get().length;\n\n // first try to process buttons that may change the month we're on\n if (e && jQuery(e.target).hasClass('prevMonth')) {\n if (0 == mo && yr) {\n yr -= 1;\n mo = 11;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 11;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo -= 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n } else if (e && jQuery(e.target).hasClass('nextMonth')) {\n if (11 == mo && yr + 1 < yrs) {\n yr += 1;\n mo = 0;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 0;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo += 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n }\n\n // maybe hide buttons\n if (0 == mo && !yr) jQuery(\"span.prevMonth\", datepicker).hide();\n else jQuery(\"span.prevMonth\", datepicker).show();\n if (yr + 1 == yrs && 11 == mo) jQuery(\"span.nextMonth\", datepicker).hide();\n else jQuery(\"span.nextMonth\", datepicker).show();\n\n // clear the old cells\n var cells = jQuery(\"tbody td\", datepicker).unbind().empty().removeClass('date');\n\n // figure out what month and year to load\n var m = jQuery(\"select[name=month]\", datepicker).val();\n var y = jQuery(\"select[name=year]\", datepicker).val();\n var d = new Date(y, m, 1);\n var startindex = d.getDay();\n var numdays = monthlengths[m];\n\n // http://en.wikipedia.org/wiki/Leap_year\n if (1 == m && ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)) numdays = 29;\n\n // test for end dates (instead of just a year range)\n if (opts.startdate.constructor == Date) {\n var startMonth = opts.startdate.getMonth();\n var startDate = opts.startdate.getDate();\n }\n if (opts.enddate.constructor == Date) {\n var endMonth = opts.enddate.getMonth();\n var endDate = opts.enddate.getDate();\n }\n\n // walk through the index and populate each cell, binding events too\n for (var i = 0; i < numdays; i++) {\n\n var cell = jQuery(cells.get(i + startindex)).removeClass('chosen');\n\n // test that the date falls within a range, if we have a range\n if (\n (yr || ((!startDate && !startMonth) || ((i + 1 >= startDate && mo == startMonth) || mo > startMonth))) &&\n (yr + 1 < yrs || ((!endDate && !endMonth) || ((i + 1 <= endDate && mo == endMonth) || mo < endMonth)))) {\n\n cell\n .text(i + 1)\n .addClass('date')\n .hover(\n function () {\n jQuery(this).addClass('over');\n },\n function () {\n jQuery(this).removeClass('over');\n })\n .click(function () {\n var chosenDateObj = new Date(jQuery(\"select[name=year]\", datepicker).val(), jQuery(\"select[name=month]\", datepicker).val(), jQuery(this).text());\n closeIt(el, datepicker, chosenDateObj);\n });\n\n // highlight the previous chosen date\n if (i + 1 == chosendate.getDate() && m == chosendate.getMonth() && y == chosendate.getFullYear()) cell.addClass('chosen');\n }\n }\n }", "generateMonth(){\n const d = new Date();\n let listOfMonth = new Array(12);\n listOfMonth[0] = \"January\"\n listOfMonth[1] = \"February\"\n listOfMonth[2] = \"March\"\n listOfMonth[3] = \"April\"\n listOfMonth[4] = \"May\"\n listOfMonth[5] = \"June\"\n listOfMonth[6] = \"July\"\n listOfMonth[7] = \"August\"\n listOfMonth[8] = \"September\"\n listOfMonth[9] = \"October\"\n listOfMonth[10] = \"November\"\n listOfMonth[11] = \"December\"\n const currentMonth = listOfMonth[d.getMonth()]\n return currentMonth;\n }", "_setMonth(date, monthSelector, updateDatesOnly) {\n const that = this,\n selectedDates = that._getDays(date, that.selectedDates),\n importantDates = that._getDays(date, that.importantDates),\n restrictedDates = that._getDays(date, that.restrictedDates);\n\n date.setDate(1);\n\n if (!monthSelector) {\n monthSelector = that.$.month;\n }\n\n monthSelector._date = new Date(date);\n\n if (!updateDatesOnly) {\n if (!that._viewDates || that._viewDates.length >= that.months) {\n that._viewDates = [];\n }\n\n that._viewDates.push(new Date(date));\n }\n\n date = new Date(date);\n\n //Correct the start day according to firstDayOfWeek property\n let firstDayOfWeek = (date.getDay() - that.firstDayOfWeek + 7) % 7;\n\n date.setDate(0);\n\n let previusMonthDays = date.getDate();\n\n date.setDate(32); // current month.\n date.setDate(1); // set to first day of month.\n date.setDate(32); // next month.\n\n if (that._selectedCells) {\n for (let i = 0; i < that._selectedCells.length; i++) {\n if (that._selectedCells[i].closest('.jqx-calendar-month') === monthSelector) {\n that._setCellState(that._selectedCells[i], 'selected', false);\n }\n }\n }\n\n that._setMonthContent(date, monthSelector, {\n previusMonthDays: previusMonthDays,\n firstDayOfWeek: firstDayOfWeek,\n selectedDates: selectedDates,\n importantDates: importantDates,\n restrictedDates: restrictedDates\n });\n }", "function onClickPreMonth(preMonth, month, year) {\n preMonth.onclick = function() {\n selectCbo(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) - 1, \n daysInMonth(parseInt(month.options[month.selectedIndex].value) - 1, \n year.options[year.selectedIndex].value));\n var newDate = new Date();\n newDate.setFullYear(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) - 1,\n 1);\n updateMonth(month, newDate);\n updateYear(year, newDate);\n }\n}", "function fillMonthsWithWeeks(year) {\n var count = 0;\n for (var i = 0; i < 12; i++) {\n creatMonthsArray(i + 1, daysCountForaMonthinaYear(i + 1, year));\n console.log(jan);\n }\n}", "function calendar(month, yr){\n\n\tvar daysInWeek = 7; //Used to create a loop for the days in the week.\n\tvar calendarDrawing; //Variable used later to create the calendar.\n\n\t// Setting the value of the date if user has choosen a different month or year.\n\tif (month || yr){\n\t\tnewDate = new Date(month + day + yr);\n\t}\n\telse{\n\t\tnewDate = new Date();\n\t}\n\n\tvar tempYear = newDate.getFullYear(); //Getting the year of newDate \n\n\tvar tempDate = new Date((newDate.getMonth()+1) +' 1 ,'+tempYear); //Creating a temp date to find first day of month\n\tvar startDay = tempDate.getDay();\n\tvar w = startDay; //copying startDay value for use in while loop to draw calendar\n\t\n\tvar newMonth = newDate.getMonth();\n\tvar newYear = newDate.getFullYear();\n\n\t//Leap year check (extra day in February?)\n\tvar daysInFeb = leapYear(tempYear);\n\n\tvar totalDays = [\"31\", \"\"+daysInFeb+\"\",\"31\",\"30\",\"31\",\"30\",\"31\",\"31\",\"30\",\"31\",\"30\",\"31\"] //Array of the days in each month.\n\n\tcalendarDrawing = \"<table class='calendar'>\";\n\n\t//Header for calendar\n\tcalendarDrawing += \"<tr class='daysOfCurrentMonth'>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.getMonth(), date.setFullYear(date.getFullYear()-1))'>&lt;&lt;&nbsp;</span></th>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.setMonth(date.getMonth()-1),date.getFullYear())'>&lt;&nbsp;</span></th>\";\n\tcalendarDrawing += \"<th colspan='3'>\" + monthNames[newMonth] + \" \" + newYear + \"</th>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.setMonth(date.getMonth()+1), date.getFullYear())'>&nbsp;&gt;</span></th>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.getMonth(), date.setFullYear(date.getFullYear()+1))'>&nbsp;&gt;&gt;</span></th></tr>\";\n\n\t//Header for weekdays\n\tcalendarDrawing += \"<tr class='weekdays'> <th>Sun</th> <th>Mon</th> <th>Tues</th> <th>Wed</th> <th>Thu</th> <th>Fri</th> <th>Sat</th> </tr>\";\n\n\t//START OF PRINTING OF DAYS IN MONTH\n\n\tcalendarDrawing += \"<tr>\";\n\n\t//Getting the total amount of days in the previous month\n\t//\t for Figuring out number of cells to fill with &nbsp in order for appropriate weekday position for first day of month\t\n\n\tvar prevMonth = (newMonth-1);\n\tvar prevMonthdays = totalDays[prevMonth];\n\n\tif (prevMonth < 0){\n\t\tvar previousMonthDaysFromLastWeek = 31 - startDay +1;\n\t}\n\telse{\n\t\tvar previousMonthDaysFromLastWeek = prevMonthdays - startDay + 1;\n\t}\n\n\tif (startDay != 0){\n\t\twhile (startDay > 0){\n\t\t\tcalendarDrawing += \"<td>&nbsp;</td>\";\n\t\t\tpreviousMonthDaysFromLastWeek++;\n\t\t\tstartDay --;\n\t\t}\n\t}\n\n\t//PRINTING DAYS OF MONTH\n\n\tvar i = 1 //Setting the counter to 1 to loop through the days of the month.\n\n\twhile (i<=totalDays[newMonth]){\n\n\n\t\t//Checking if the 7 days in a week have been filled for one row/week\n\t\tif (w > 6){\n\t\t\tw = 0;\n\t\t\tcalendarDrawing += \"</tr><tr>\";\n\t\t}\n\n\t\t// If calendar is displaying current month and year, current date will be highlighted\n\t\tif (i == defaultDay && newMonth == defaultMonth && newYear == defaultYear){\n\t\t\tcalendarDrawing += \"<td class='currentDate' onMouseover='this.style.background=\\\"#7EC0EE\\\"; this.style.color=\\\"#FFFFFF\\\"' \"\n\t\t\t\t\t\t\t+ \"onMouseOut='this.style.background=\\\"#7EC000\\\"; this.style.color=\\\"#000000\\\"' \"\n\t\t\t\t\t\t\t+ \"onclick =\\\"events(\"+i+\",\"+newMonth+\",\"+newYear+\")\\\"> \" +i+ \"<ul id=\\\"desc_\"+i+\"\\\">\"\n\t\t\t\t\t\t\t+ \"</ul></td>\";\t\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\tcalendarDrawing += \"<td class='daysOfCurrentMonth' onMouseOver='this.style.background=\\\"#7EC0EE\\\"; this.style.color=\\\"#FFFFFF\\\"' \"\n\t\t\t\t\t\t\t+ \"onMouseOut='this.style.background=\\\"#FFFFFF\\\"; this.style.color=\\\"#000000\\\"' \"\n\t\t\t\t\t\t\t+ \"onclick =\\\"events(\"+i+\",\"+newMonth+\",\"+newYear+\")\\\"> \" +i+ \"<ul id=\\\"desc_\"+i+\"\\\">\"\n\t\t\t\t\t\t\t+ \"</ul></td>\";\n\t\t}\n\n\n\t\ti++;\t//go to next ith day\n\t\tw++;\t//increase number of days to check for filled week (7 days)\n\t}\n\n\t//Finish padding the month with the start of the following month\n\twhile (w <= 6){\n\t\tcalendarDrawing += \"<td>&nbsp;</td>\";\n\t\tw++;\n\t}\n\n\t\t$.getJSON(\"/appointments\",function(data){\n\t\t\tfor (var j=0; j<data.length; j++) {\n\t\t\t\tif(data[j].year == newYear && data[j].month-1 == newMonth){\n\t\t\t\t\t$(\"#desc_\"+data[j].day).append(data[j].time + \" \" + data[j].description + \"<br><br>\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\n\n\t//Closing the table cleanly.\n\tcalendarDrawing += \"</tr></table>\";\n\n\tdocument.getElementById('calendar').innerHTML = calendarDrawing;\n}", "function CalendarPopup_setMonthAbbreviations() \r\n{\r\n\tfor (var i=0; i<arguments.length; i++) \r\n\t this.monthAbbreviations[i] = arguments[i];\r\n}", "formatDateForArray(date, month, year) {\n //console.log('month-->'+month+'date-->'+date);\n if (month <= 9 ) \n month = '0' + (month+1);\n if (date <= 9) \n date = '0' + (date);\n\n return [year, month, date].join('-');\n }", "function thisMonthData(data, userChoice) {\n var startOfMonth = moment().startOf('month').toDate();\n var startDate = moment(startOfMonth).format(\"D\");\n displayDateData(data, userChoice, startDate); \n}", "function fillDays() {\n var i;\n var calendarDays = document\n .getElementById(\"calendarTable\")\n .getElementsByTagName(\"tbody\")[0]\n .getElementsByClassName(\"day\");\n\n //get month -current month is April -so this got 3\n month = date.getMonth();\n console.log(month);\n //get year -current year is 2019\n year = date.getFullYear();\n console.log(year);\n var daysOffset = new Date(year, month, 1).getDay();\n console.log(daysOffset);\n var numberOfDays = new Date(year, month + 1, 0).getDate(); //0 for day gives last day of the PREVIOUS month\n console.log(numberOfDays);\n\n //clear cells\n for (i = 0; i < calendarDays.length; i++) {\n calendarDays[i].innerHTML = \"&nbsp\";\n }\n\n //populate cells with dates, 1-31\n for (i = 1; i <= numberOfDays; i++) {\n calendarDays[daysOffset].innerHTML = i;\n daysOffset++;\n }\n}", "function getDate(months,years){ \n var birth_year = parseInt($('#birth_year').val());\n var birth_month = parseInt($('#birth_month').val());\n var year = birth_year + years; //this year is correct when month > birthmonth\n var month = (birth_month + months) \n if (month > 12){\n month %= 12;\n year += 1;\n }\n $('#date_month').val(month);\n $('#date_year').val(year); \n}", "function initCalendar() {\n var firstDayOfMonth = new Date(currentDateTime.getFullYear(), currentDateTime.getMonth(), 1);\n var lastDayOfMonth = new Date(currentDateTime.getFullYear(), currentDateTime.getMonth() + 1, 0);\n\n // Set headline content\n headline.innerHTML = formatDate(currentDateTime, 'headline');\n\n // Create elements for calendar\n var table = document.createElement('table')\n var thead = document.createElement('thead');\n var headRow = document.createElement('tr');\n\n // Fill header row with weekdays\n weekdays.forEach(function (weekDay) {\n var cell = document.createElement('th');\n cell.innerHTML = weekDay;\n headRow.appendChild(cell);\n });\n\n var tbody = document.createElement('tbody');\n\n // Calculate the first rendered day of the current view.\n // We always begin with a sunday, which can be before first day of month\n var firstDayOfCalendar = new Date(firstDayOfMonth);\n while (firstDayOfCalendar.getDay() != 0) {\n firstDayOfCalendar.setDate(firstDayOfCalendar.getDate() - 1);\n }\n\n // Fill the calendar month with elements\n var currentRenderDate = new Date(firstDayOfCalendar);\n var i = 0;\n var row = document.createElement('tr');\n var current = formatDate(currentDateTime, 'date');\n var cell;\n\n while (currentRenderDate <= lastDayOfMonth) {\n if (i == 7) {\n i = 0;\n tbody.appendChild(row);\n row = document.createElement('tr');\n }\n var currentString = formatDate(currentRenderDate, 'date');\n\n cell = document.createElement('td');\n cell.innerHTML = currentRenderDate.getDate().toString();\n // This is the selected date. Mark it\n if (currentString == current) {\n addClass(cell, 'selected');\n }\n // The day is not in the current month. Mark it\n if (currentRenderDate.getMonth() != lastDayOfMonth.getMonth()) {\n addClass(cell, 'outerMonth');\n }\n cell.setAttribute('data-date' , currentString);\n cell.addEventListener('click', onDateSelect);\n\n row.appendChild(cell);\n\n // Prepare next step\n currentRenderDate.setDate(currentRenderDate.getDate() + 1);\n i++;\n }\n\n // Each row should have the same amount of cells.\n // Create empty cells if needed.\n for (i; i < 7; i++) {\n cell = document.createElement('td');\n cell.innerHTML = '&nbsp;';\n row.appendChild(cell);\n }\n tbody.appendChild(row);\n\n thead.appendChild(headRow);\n table.appendChild(thead);\n table.appendChild(tbody);\n\n // Clear calendar and add new table\n calendar.innerHTML = '';\n calendar.appendChild(table);\n }", "function populate() {\n for (let i = 0; i < 42; i++) {\n calendarCells[i].textContent = dateArray[i];\n }\n }", "function setSelectedMonth()\n{\nptr= arguments[0];\nnew_date= arguments[1];\nptr=new_date.getMonth()+ptr;\nindex=ptr\nif(index == 12)\n index = 0;\nelse if(index == -1)\n index = 11;\nisLeap=leapYear(new_date.getFullYear)\nif(isLeap)\n new_date.setDate(calLeapPeriods[index]);\nelse\n new_date.setDate(calPeriods[index]);\nnew_date.setMonth(ptr);\n}", "function Month(parent){var _this=_super.call(this,parent)||this;_this.dayNameFormat='wide';_this.viewClass='e-month-view';_this.isInverseTableSelect=false;_this.monthDates={};return _this;}", "function printMonth(template, date) {\n // numero giorni nel mese\n var daysInMonth = date.daysInMonth();\n\n // setta header\n $('.cn .box-icon .month').html( date.format('MMMM YYYY') );\n\n // Imposta data attribute data visualizzata\n $('.month').attr('data-this-date', date.format('YYYY-MM-DD'));\n\n // genera giorni mese\n for (var i = 0; i < daysInMonth; i++) {\n // genera data con moment js\n var thisDate = moment({\n year: date.year(),\n month: date.month(),\n day: i + 1\n });\n\n // imposta dati template\n var context = {\n class: 'day',\n day: thisDate.format('DD'),\n dayWord: thisDate.format('dddd'),\n completeDate: thisDate.format('YYYY-MM-DD')\n };\n\n //compilare e aggiungere template\n var html = template(context);\n $('.month-list').append(html);\n }\n}", "function onChangeMonthYear(year, month, inst) {\n datepicker('setDate', `${year}-${month}-01`);\n const yyyymm = year + ((month < 10) ? '0' : '') + month;\n return fetchDates(topic, yyyymm);\n }", "function createMonth() {\n var currentCalendar = document.getElementById(\"calendar\");\n\n var dateObject = new Date();\n dateObject.setDate(date.getDate());\n dateObject.setMonth(date.getMonth());\n dateObject.setYear(date.getFullYear());\n\n createCalendarDay(dateObject.getDate(), dayOfWeekAsString(dateObject.getDay()), monthsAsString(dateObject.getMonth()), dateObject.getFullYear());\n\n dateObject.setDate(dateObject.getDate() + 1);\n\n while (dateObject.getDate() != 1) {\n createCalendarDay(dateObject.getDate(), dayOfWeekAsString(dateObject.getDay()), monthsAsString(dateObject.getMonth()), dateObject.getFullYear());\n dateObject.setDate(dateObject.getDate() + 1);\n }\n\n // Set the text to the correct month\n var currentMonthText = document.getElementById(\"current-month\");\n currentMonthText.innerHTML = monthsAsString(date.getMonth()) + \" \" + date.getFullYear();\n getCurrentDay();\n\n}", "function addMonthPickerFunctionality() {\r\n const d = new Date();\r\n $(\".month-text\").text(MONTH_NAMES[d.getMonth()]);\r\n\r\n document.getElementById(\"list\").addEventListener(\"click\", function (e) {\r\n $(\".month-text\").text(e.target.innerHTML);\r\n applyDateFilter(e.target.innerHTML);\r\n });\r\n}", "updateHeader(date, header) {\n var monthText = this.settings.months[date.getMonth()];\n monthText += this.settings.displayYear ? ' <div class=\"year\">' + date.getFullYear() : '</div>';\n header.querySelector('.month');\n header.querySelector('.month').innerHTML = monthText;\n }", "function DateHelper(year,month){\n\t\tthis.setDate(year,month);\n\t}", "function makeDateObjects(data){\r\n\t\tconsole.log(\"makeDateObjects\");\r\n\t\tfor (i = 0; i < data.length; i++){\r\n\t\t\tvar datestring = data[i][selectedOptions.dateField];\r\n\t\t\tvar thisYear = parseInt(datestring.substring(0,4));\r\n\t\t\tvar thisMonth = parseInt(datestring.substring(5,7));\r\n\t\t\tvar thisDay = parseInt(datestring.substring(8,10));\r\n\t\t\tvar thisDateComplete = new Date(thisYear, thisMonth-1, thisDay); // JS-Date Month begins at 0\r\n\t\t\tzaehlstellen_data[i][selectedOptions.dateField] = thisDateComplete;\r\n\t\t}\r\n\t}", "function newDatepickerHTML() {\n\n var years = [];\n\n // process year range into an array\n for (var i = 0; i <= opts.endyear - opts.startyear; i++) years[i] = opts.startyear + i;\n\n // build the table structure\n var table = jQuery('<table class=\"datepicker\" cellpadding=\"0\" cellspacing=\"0\"></table>');\n table.append('<thead></thead>');\n table.append('<tfoot></tfoot>');\n table.append('<tbody></tbody>');\n\n // month select field\n var monthselect = '<select name=\"month\">';\n for (var i in months) monthselect += '<option value=\"' + i + '\">' + months[i] + '</option>';\n monthselect += '</select>';\n\n // year select field\n var yearselect = '<select name=\"year\">';\n for (var i in years) yearselect += '<option>' + years[i] + '</option>';\n yearselect += '</select>';\n\n jQuery(\"thead\", table).append('<tr class=\"controls\"><th colspan=\"7\"><span class=\"prevMonth\">&laquo;</span>&nbsp;' + monthselect + yearselect + '&nbsp;<span class=\"nextMonth\">&raquo;</span></th></tr>');\n jQuery(\"thead\", table).append('<tr class=\"days\"><th>S</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th></tr>');\n jQuery(\"tfoot\", table).append('<tr><td colspan=\"2\"><span class=\"today\">today</span></td><td colspan=\"3\">&nbsp;</td><td colspan=\"2\"><span class=\"close\">close</span></td></tr>');\n for (var i = 0; i < 6; i++) jQuery(\"tbody\", table).append('<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>');\n return table;\n }", "function update_month() { //this is helper function for when component param changes, update months and year\n\n\tvar solution2 = $('#solution_param').val();//Grab Parameters\n\tvar component2 = $('#component_param').val();\n\tvar start_year2 = $('#yearparam_start').val();\n\n\tvar temp_url = replace_url;//Formulate URL\n\ttemp_url += \"GenerateMonthList\";\n\ttemp_url += \"/\" + solution2;\n\ttemp_url += \"/\" + component2;\n\ttemp_url += \"/\" + start_year2;\n\t\n\n\tvar $month = $('#monthparam_start');\n\t$month.empty(); //clear out the year options\n\n\t$.ajax({\n\t\turl: temp_url,\n\t\tbeforeSend: function() {\n\t\t\t$('#loading-year-click').show();\n\t\t},\n\t\ttype: 'GET',\n\t\tdataType: 'json',\n\n\t\tsuccess: function(order) {\n\t\t\t$month.append($('<option>', {value:\"\"}).text(\"Please select an option\"));\t\n\t\t\t$.each(order, function(key, value) {\n\t\t\t\t$month.append($('<option>', {\n\t\t\t\t\tvalue: value\n\t\t\t\t}).text(value));\n\t\t\t});\n\t\t},\n\t\tcomplete: function() {\n\t\t\t$('#loading-year-click').hide();\n\t\t}\n\t});//end of AJAX call\n\treturn false;\n}//end of update_month()", "function forwardMonth(){\n toMonth=globalMonth.nextMonth();\n $( document ).ready(load);\n}", "function setDate(date) {\n \n var monthNames = [\n \"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ];\n \n var suffixNames = [\n \"th\", \"st\", \"nd\", \"rd\", \"th\", \"th\", \"th\", \"th\", \"th\", \"th\"\n ];\n \n var d = new Date(date);\n var suffix = suffixNames[(d.getDate() % 10)];\n var dateString = monthNames[d.getMonth()] + \" \" + d.getDate() + suffix;\n \n document.getElementById('date').innerHTML = dateString;\n}", "function initialDate(mapData1, i) {\n let m = mapData1.month;\n\n if (m == \"January\") {\n this.parentElement.appendChild(this);\n return \"#eb2828\";\n } else {\n return \"#636769\";\n }\n }", "calculateDates(date) {\n const dateFormat = moment(date, 'MMMM YYYY');\n\n const dateObj = {\n startOfMonth : dateFormat.startOf('month').format('d'), \n daysInMonth : dateFormat.daysInMonth(),\n month: dateFormat.format('MMMM'),\n year: dateFormat.format('YYYY')\n };\n\n this.renderDateGrid(dateObj);\n }", "function calendar(year) {\n console.log(\"creating calendar\")\n for (var monthCount = 0; monthCount < 13; monthCount++) {\n var newList = $(\"<ul>\");\n newList.addClass(\"main\");\n for (var dayCount = 0; dayCount < 32; dayCount++) {\n\n if (dayCount===0 && monthCount===0) {\n var newListItem = $(\"<li>\")\n newListItem.addClass(\"cEmpty\")\n // newListItem.addClass(\"cLabel\");\n newList.append(newListItem)\n }\n else if (monthCount ===0)\n {\n var newListItem = $(\"<li>\");\n newListItem.addClass(\"cEmpty\");\n var labelDiv = $(\"<div>\")\n labelDiv.addClass(\"cLabel\");\n labelDiv.text(dayCount);\n newListItem.append(labelDiv);\n newList.append(newListItem);\n\n } else if (dayCount ===0) {\n var monthName = moment(monthCount, \"M\").format(\"MMM\")\n var newListItem = $(\"<li>\");\n newListItem.addClass(\"cEmpty\");\n var labelDiv = $(\"<div>\");\n labelDiv.addClass(\"cLabel\");\n labelDiv.text(monthName.substring(0,1));\n newListItem.append(labelDiv);\n newList.append(newListItem)\n } else {\n\n var newListItem = $(\"<li>\")\n\n var dateDiv = $(\"<div>\")\n var date = String(monthCount) + \"/\" + String(dayCount) + \"/\" + year\n var dateFormat = \"M/D/YYYY\"\n var convertedDate = moment(date, dateFormat)\n var dayOfTheWeek = convertedDate.format(\"d\") // sunday =0\n\n\n\n if (!convertedDate.isValid()) {\n newListItem.addClass(\"cEmpty\")\n } else {\n dateDiv.addClass(\"cDate\")\n dateDiv.addClass(date)\n dateDiv.text(convertedDate.format(\"MM/DD/YY\"));\n newListItem.append(dateDiv)\n\n var location = $(\"<div>\")\n location.addClass(\"cLocation\")\n location.text(\"Gary, IN\")\n newListItem.append(location)\n\n var mood = Math.floor(Math.random() * (9 - 1)) + 1\n newListItem.addClass(\"type-\" + mood)\n newListItem.addClass(\"cat-\" + dayOfTheWeek)\n }\n\n\n\n newList.append(newListItem)\n }\n }\n $(\".wrapper\").append(newList)\n }\n }", "function setDate(the_month){\r\n if (the_month === 'undefined'){\r\n the_month = document.getElementById('month').value\r\n }\r\n let the_date = document.getElementById('date')\r\n removeAllChildNodes(the_date)\r\n\r\n for (let i = 0; i< total_day[the_month]; i++){\r\n const d = document.createElement('option')\r\n d.innerText = i+1+\"\"\r\n d.value = i+1+\"\"\r\n the_date.appendChild(d)\r\n }\r\n}", "getMonthDetail() {\n var y = this.currentDate.getFullYear(),\n m = this.currentDate.getMonth();\n var firstDay = new Date(y, m, 1);\n var lastDay = new Date(y, m + 1, 0);\n return {\n date: this.currentDate,\n month: this.currentDate.getMonth(),\n firstDay: firstDay,\n lastDay: lastDay,\n year: y\n };\n }", "createMonth() {\n // Set boundaries of month and render <Day /> components\n let startOfMonth = Moment( this.state.currentMonth + ' ' + this.state.currentYear, 'MMMM YYYY' );\n let endOfMonth = this.getEndOfMonth( this.state.currentMonth, this.state.currentYear );\n let daysInMonth = startOfMonth.daysInMonth();\n let currentDayOffset = this.state.dayOffset[startOfMonth.format( 'dddd' )];\n let previousMonth = Moment( this.state.currentMonth + ' ' + this.state.currentYear, 'MMMM YYYY' ).subtract( 1, 'months' );\n let nextMonth = Moment( this.state.currentMonth + ' ' + this.state.currentYear, 'MMMM YYYY' ).add( 1, 'months' );\n\n this.setState({\n startOfMonth: startOfMonth,\n endOfMonth: endOfMonth,\n daysInMonth: daysInMonth,\n currentDayOffset: currentDayOffset,\n previousMonth: previousMonth,\n nextMonth: nextMonth,\n }, function() {\n this.createDays();\n });\n }", "function displayDates(month, year) {\n datesRegion.innerHTML = `\n <div class=\"row\" id=\"days\">\n <span class=\"day\">SUN</span>\n <span class=\"day\">MON</span>\n <span class=\"day\">TUES</span>\n <span class=\"day\">WED</span>\n <span class=\"day\">THURS</span>\n <span class=\"day\">FRI</span>\n <span class=\"day\">SAT</span>\n </div>\n `\n let n = numberOfDays[month];\n if(year%4==0 && year%100!=0 && month==1)\n n=29;\n let firstDay = `${monthList[month]} 1 ${year}`;\n let dateStart = new Date(firstDay);\n let counter = 1;\n let monthStart = dateStart.getDay();\n let output = '<div class=\"row date-row\">';\n for(let i=0; i<monthStart; i++)\n {\n output+=`\n <span class=\"date\"></span>\n `\n }\n for(let i=0; i<7-monthStart; i++)\n {\n output+=`\n <span class=\"date date-val\">${counter}</span>\n `\n counter++;\n }\n for(let i=0;;i++)\n {\n if(counter==n+1)\n break;\n else {\n if(i%7==0) {\n output+=\n `\n </div><div class=\"row date-row\">\n `\n }\n }\n output+= `<span class=\"date date-val\">${counter}</span>`;\n counter++;\n }\n let extra = 7-((n-(7-monthStart))%7);\n if(extra!=7) {\n while(extra--) {\n output+=`\n <span class=\"date\"></span>\n `\n }\n }\n datesRegion.innerHTML+= output;\n addSelectableProperty();\n}", "function onLoad(){\r\n\r\n\t var d = new Date();\r\n\t var month_name = ['January','February','March','April','May','June','July','August','September','October','November','December'];\r\n\t var month = d.getMonth(); //0-11\r\n\t var year = d.getFullYear(); //2017\r\n\t var first_date = month_name[month] + \" \" + 1 + \" \" + year;\r\n\t //Nov 1 2017\r\n\t var tmp = new Date(first_date).toDateString();\r\n\t //Wed Nov 01 2017 ...\r\n\t var first_day = tmp.substring(0, 3); //Wed\r\n\t var day_name = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];\r\n\t var day_no = day_name.indexOf(first_day); //1\r\n\t var days = new Date(year, month+1, 0).getDate(); //30\r\n\t //Wed Nov 01 2017 ...\r\n\t var calendar = get_calendar(day_no, days);\r\n\t document.getElementById(\"calendar-month-year\").innerHTML = month_name[month]+\" \"+year;\r\n\t document.getElementById(\"calendar-dates\").appendChild(calendar);\r\n\t}" ]
[ "0.6735977", "0.6646715", "0.6570881", "0.65015596", "0.6467753", "0.638965", "0.63804156", "0.63526314", "0.6329986", "0.6300602", "0.62774956", "0.6260706", "0.625348", "0.62503475", "0.62444645", "0.62438047", "0.62138647", "0.61977965", "0.6164012", "0.6162928", "0.616261", "0.61473733", "0.61100835", "0.61046416", "0.6098566", "0.606908", "0.6058632", "0.60553986", "0.60504115", "0.60340834", "0.60176116", "0.600068", "0.59832674", "0.5980687", "0.5976488", "0.5975787", "0.59693265", "0.59462166", "0.5940549", "0.5927403", "0.59236777", "0.59141046", "0.5906053", "0.59043044", "0.5903438", "0.589849", "0.5893892", "0.58908457", "0.58908457", "0.5884504", "0.58666956", "0.58617467", "0.5851581", "0.583965", "0.5816954", "0.5816314", "0.58107823", "0.5807619", "0.58061326", "0.58043027", "0.5803381", "0.5799629", "0.5794821", "0.5792004", "0.5786964", "0.5786962", "0.57851493", "0.57779276", "0.5776819", "0.5773659", "0.57726073", "0.57722944", "0.5767639", "0.5765851", "0.5758335", "0.5755984", "0.57537514", "0.5750429", "0.5737905", "0.57352364", "0.57283914", "0.5720955", "0.57128996", "0.57113695", "0.5710734", "0.57084507", "0.56963557", "0.5692155", "0.5685711", "0.5681543", "0.56754446", "0.5671479", "0.56627524", "0.5659301", "0.5657321", "0.56527346", "0.5648143", "0.5631667", "0.5628951", "0.5621721" ]
0.6637944
2
Function to remove data from calendar so that navigation between months doesn't cause overlap
function clearCalendar() { for (var i = 0; i<35; i++) { document.getElementById("c"+i).innerHTML =""; } if(table.rows.length >6){ table.deleteRow(6); } dateHolder.length =0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eraseForMonths() {\n eraseDays();\n setUpCalendar(currentDate);\n}", "removeMonthOverview () {\n this.items\n .selectAll ('.item-block-month')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function removingMonth () {\n $(\".mthsName\").empty();\n $(\".dayBox\").empty().removeClass(\"today\");\n }", "removeYearOverview () {\n this.items\n .selectAll ('.item-circle')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-month').remove ();\n this.hideBackButton ();\n }", "function eraseForYears() {\n currentDate.setFullYear(yearHolder.textContent);\n currentDate.setMonth(0);\n monthHolder.textContent = monthNames[0];\n eraseDays();\n setUpCalendar(currentDate);\n}", "function participateMonthDelete(){\n\tvar element = document.getElementById(\"participate_month\");\n\tvar length = element.length;\n\tparticipate.month = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tparticipateDayDelete();\n}", "function clearCalendar() {\n var $datePickerGrid = $calendar.find('tbody');\n $datePickerGrid.empty();\n }", "removeDayOverview () {\n this.items\n .selectAll ('.item-block')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-time').remove ();\n this.labels.selectAll ('.label-project').remove ();\n this.hideBackButton ();\n }", "removeWeekOverview () {\n this.items\n .selectAll ('.item-block-week')\n .selectAll ('.item-block-rect')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .attr ('x', (d, i) => {\n return i % 2 === 0 ? -this.settings.width / 3 : this.settings.width / 3;\n })\n .remove ();\n this.labels.selectAll ('.label-day').remove ();\n this.labels.selectAll ('.label-week').remove ();\n this.hideBackButton ();\n }", "function deleteEventDisplay(){\n closeEvent();\n generateMonth();\n \n}", "removeGlobalOverview () {\n this.items\n .selectAll ('.item-block-year')\n .transition ()\n .duration (this.settings.transition_duration)\n .ease (d3.easeLinear)\n .style ('opacity', 0)\n .remove ();\n this.labels.selectAll ('.label-year').remove ();\n }", "function clearCalendar()\n{\n$(\"TBODY#calendarStart\").html(\"\");\n}", "removeAllMonthStyles() {\n var i, len, month, ref, results;\n ref = Data.season;\n results = [];\n for (i = 0, len = ref.length; i < len; i++) {\n month = ref[i];\n results.push(this.$month(month).removeAttr('style'));\n }\n return results;\n }", "function nexttimeMonthDelete(){\n\tvar element = document.getElementById(\"nexttime_month\");\n\tvar length = element.length;\n\tnexttime.month = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tnexttimeDayDelete();\n}", "function acceptMonthDelete(){\n\tvar element = document.getElementById(\"accept_month\");\n\tvar length = element.length;\n\taccept.month = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tacceptDayDelete();\n}", "clearMovieDates() {\n var id = document.getElementById(\"movieId\").value;\n document.getElementById(\"movieShowDates\").innerHTML = \"\";\n var arrayLength = this.showDates.length;\n this.showDates.forEach((item, index) => {\n if (item.id === id) {\n var indx = this.showDates.indexOf(item)\n this.showDates.splice(indx, 1);\n }\n });\n\n }", "function removeWeeks () {\n\tvar parent = document.getElementById(\"month\"); // find a parent element\n\tvar children = document.getElementById(\"month\").children; // find children of the partent\n\tvar numberOfChildren = children.length; // save a children number\n\tfor (var i = 0; i < numberOfChildren; i++) { // repeate as many times as there were children\n\t\tparent.removeChild(children[0]); // remove first child\n\t}\n}", "function deleteAppointments(){\n container = document.getElementById(\"examinationsContainer\");\n prevAppointments = container.getElementsByClassName(\"appointmentAdminPage\");\n while(prevAppointments[0]){\n container.removeChild(prevAppointments[0]);\n }\n //elimino anche i bottoni\n document.getElementById(\"examinationsTitle\").getElementsByTagName(\"h2\")[0].innerText = \"Non hai ancora selezionato un giorno\";\n deleteButtons = container.getElementsByClassName(\"deleteButtonCalendarPage\");\n while(deleteButtons[0]){\n container.removeChild(deleteButtons[0]);\n }\n range = container.getElementsByClassName(\"selectCalendarPage\");\n while(range[0]){\n container.removeChild(range[0]);\n }\n orarioDiv = container.getElementsByClassName(\"infoCalendar\");\n while(orarioDiv[0]){\n container.removeChild(orarioDiv[0]);\n }\n}", "function previous(){\n if(dateInfo.currentMonth!=0){\n dateInfo.currentMonth--;\n }\n else{\n dateInfo.currentYear--;\n dateInfo.currentMonth=11;\n }\n while (calendar.firstChild) {calendar.removeChild(calendar.firstChild);}\n createCalendar();\n document.documentElement.scrollTop = 0;\n}", "function clearCalendar() {\n\t$(\"#calendar\").html(\"\").css(\"background-color\",\"white\").stop().css(\"opacity\",1);\n\t$(\"#term\").html(\"\");\n}", "doDestroy() {\n this.attachToCalendar(null);\n super.doDestroy();\n }", "function wipe() {\n removeAllEventsFromDisplay();\n cosmo.view.cal.itemRegistry = new cosmo.util.hash.Hash();\n }", "undoAddDate(type, e){\n e.preventDefault();\n if(type === 'exclude'){\n let newExcludes = this.props.calendarForm.excludeDates;\n if(newExcludes.length !== 0){\n newExcludes.pop();\n this.props.setCalExcludeDates(newExcludes);\n }\n }\n else if(type === 'include'){\n let newIncludes = this.props.calendarForm.includeDates;\n if(newIncludes.length !== 0){\n newIncludes.pop();\n this.props.setCalIncludeDates(newIncludes);\n }\n }\n }", "function removeDaysDetailsCollection(calendardate) {\n\n if (calendardate < todaysdate) return [false, 'past-date'];\n\n var today_cls = '';\n if ((calendardate.toDateString() == today_str)) {\n today_cls = 'calendar-today-date';\n }\n\n var caldate = calendardate.getDate();\n var calmon = calendardate.getMonth();\n var calyear = calendardate.getFullYear();\n var result = true;\n var changed = false;\n\n /* Calendar date format m/d/y */\n\n var calm = parseInt(calendardate.getMonth()) + 1, \n cald = calendardate.getDate(), \n caly = calendardate.getFullYear();\n\n if (cald < 10) cald = '0' + cald.toString();\n if (calm < 10) calm = '0' + calm.toString();\n\n var calMDY = calm + '/' + cald +'/' + calyear;\n\n console.log('Cal date', calMDY);\n if (closedDatesCollection.indexOf(calMDY) != -1) {\n return [true, 'calendar-closed-date '+today_cls, 'Not available'];\n }\n if (openDatesCollection.indexOf(calMDY) != -1) {\n return [true, 'calendar-open-date '+today_cls, 'Available'];\n }\n\n if (available_collect_days != '') {\n var daysopen = available_collect_days.split(\",\");\n daynum = calendardate.getDay();\n for (var i = 0; i < daysopen.length; i++) {\n if (daysopen[i] == daynum) {\n return [true, 'calendar-selectable-date '+today_cls, 'Available'];\n }\n }\n }\n return [true, 'calendar-closed-date '+today_cls, 'Not available'];\n}", "complementData(chartData, hasCountMonth) {\n var zeroCountMonth = [];\n var minDate = cloudberry.parameters.timeInterval.start;\n var maxDate = cloudberry.parameters.timeInterval.end;\n\n // add empty data point\n for (var m = new Date(minDate.getFullYear(), minDate.getMonth()); m <= new Date(maxDate.getFullYear(), maxDate.getMonth()); m.setMonth(m.getMonth() + 1)) {\n zeroCountMonth.push(new Date(m.getTime()));\n }\n zeroCountMonth = this.arrayDiff(hasCountMonth, zeroCountMonth);\n for (var j = 0; j < zeroCountMonth.length; j++) {\n chartData.push({x: new Date(zeroCountMonth[j]), y: 0});\n }\n\n // sort the date\n chartData.sort(function (previousVal, currentVal) {\n return previousVal.x - currentVal.x;\n });\n return chartData;\n }", "function removeDates() {\n firebase.database().ref(`dateData`).remove()\n}", "function deselectDate(day, month, year) {\r\n date = { day: day, month: month, year: year };\r\n data.selectedDates.removeJsonObject(date);\r\n stopShowingAsSelected(day, month, year);\r\n }", "function delete_meal_from_calendar()\n{\n if (current_meal.is_calendar_meal) {\n var meal_id = current_meal.id\n var meal_image_element_to_be_removed = document.getElementById(\"drag_\" + meal_id + \"_calendar\");\n var meal_name_element_to_be_removed = document.getElementById(\"calendar_day_data_container_name_element_\" + meal_id);\n var meal_container_element = meal_image_element_to_be_removed.parentElement;\n\n // Remove that one item from the calendar in HTML\n meal_container_element.removeChild(meal_image_element_to_be_removed);\n meal_container_element.removeChild(meal_name_element_to_be_removed);\n meal_container_element.style.backgroundColor = \"\";\n\n // Delete the PlannedMonths_MealPlans record for that day\n if (isValueSet(current_plannedMonth.id) && current_plannedMonth.formatted_date == formatted_date(calendar_date)) {\n var mealPlan_record_to_remove = firebase_database.ref(\"PlannedMonths_MealPlans/\" + current_plannedMonth.id + \"/\" + meal_id);\n mealPlan_record_to_remove.remove();\n } else {\n firebase_database.ref('Users_PlannedMonths' + user.uid).orderByChild(\"formatted_date\").equalTo(formatted_date(calendar_date)).once(\"value\", function(db_snapshot) {\n for (var plannedMonth_id in db_snapshot.val()) {\n if (db_snapshot.val().hasOwnProperty(plannedMonth_id) && (db_snapshot.val()[plannedMonth_id]).formatted_date == formatted_date(calendar_date)) {\n current_plannedMonth = { id: plannedMonth_id, formatted_date: formatted_date(calendar_date) };\n var mealPlan_record_to_remove = firebase_database.ref(\"PlannedMonths_MealPlans/\" + current_plannedMonth.id + \"/\" + meal_id);\n mealPlan_record_to_remove.remove();\n }\n }\n })\n }\n }\n}", "function previousMonth(){\n // if(data.calendar.month != 11 || data.calendar.year == 2019){\n if(data.calendar.month == 0 && data.calendar.year == 2018) {\n return;\n }\n data.calendar.month--;\n // }\n if(data.calendar.month <= -1){\n data.calendar.month = 11;\n data.calendar.year--;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}", "function participateYearDelete(){\n\tvar element = document.getElementById(\"participate_year\");\n\tvar length = element.length;\n\tparticipate.year = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tparticipateMonthDelete();\n}", "[REMOVE_EVENT_FROM_CALENDAR_MUTATION](state, idToRemove) {\n state.eventsInCalendar = state.eventsInCalendar.filter( (event)=> {\n return event.id !== idToRemove;\n });\n }", "function clearCalendar() {\n localStorage.clear();\n window.location.reload();\n}", "function removerCursoCalendar(vistaprevia, persistido, indiceEnResultados, numocur) {\n\t\t\n\t\tif(persistido){\n\t\t\tfor(var k = 0; k < horarioActual.cursos[sel.substring(1,sel.length)].ocurrencias.length; k++) {\n\t\t\t\tcalendar.weekCalendar(\"removeEvent\", \"\" + sel + \"-\" + k);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor(var k = 0; k < numocur; k++) {\n\t\t\t\tcalendar.weekCalendar(\"removeEvent\", \"\" + sel + \"-\" + k);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\tif(!vistaprevia) {\n\t\t\tif($('#' + sel)){\n\t\t\t\t$('#' + sel).show(500);\n\t\t\t\t$('#' + sel).removeAttr('out');\n\t\t\t}\n\t\t}\n\t}", "function removerMarcas(){\n markerInicioFin.clearMarkers();\n}", "function deleteSelection() {\n tempSelectedDates.forEach(function (e) {\n dateRangeChart.dispatchAction({\n type: 'downplay',\n dataIndex: e[1],\n seriesIndex: e[2]\n });\n });\n tempSelectedDates = new Set([]);\n //update the selection date list\n var $ul = createSelectionUl(tempSelectedDates);\n $(\"#daysSelectedList\").empty().append($ul);\n }", "function sched_clear() {\n\tfor (let name in schedule.list) {\n\t\t// Remove summary sidebar elements.\n\t\tdiv.summary_tbody.removeChild(schedule.list[name].tr);\n\n\t\t// Remove cards.\n\t\tfor (let i in schedule.list[name].cards)\n\t\t\tdiv.deck.removeChild(schedule.list[name].cards[i]);\n\n\t\tdelete schedule.list[name];\n\t}\n}", "function clearSchedule() {\n $('#clear-button').on('click', function() {\n scheduleObj = {};\n scheduleArr.length = 0;\n scheduleObj['date'] = date;\n scheduleArr.push(scheduleObj);\n\n localStorage.removeItem(date);\n $('.input-area').val('');\n\n localStorage.setItem(date, JSON.stringify(scheduleArr));\n });\n }", "function nexttimeYearDelete(){\n\tvar element = document.getElementById(\"nexttime_year\");\n\tvar length = element.length;\n\tnexttime.year = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tnexttimeMonthDelete();\n}", "function removePastTimes()\n{\n // If the node exists.\n if ($('.tn-flex-performance-selector__toggle-container .tn-flex-performance-selector__form-group').length > 0) {\n // Loop all the nodes that contains a select field with dates as their option.\n $('.tn-flex-performance-selector__toggle-container .tn-flex-performance-selector__form-group').each(function() {\n // Loop all the options for each select field.\n $($(this).find('select option')).each(function() {\n let timeRegex = /(\\d{1,2}\\:\\d{2})/;\n let eventDateFormat = 'MMM D, YYYY HH:mm';\n let eventDateLocale = 'en';\n\n if (translator.to() === 'fr') {\n timeRegex = /(\\d{1,2}\\ h \\d{2})/;\n eventDateFormat = 'D MMM YYYY HH [h] mm';\n eventDateLocale = 'fr';\n }\n\n // If the content of the option field contains time and not only a date.\n if (timeRegex.test($(this).text())) {\n let momentObj = moment($(this).text(), eventDateFormat, eventDateLocale);\n\n // Check if the date is valid to avoid errors with the 'Select a date' default option.\n if (momentObj.isValid()) {\n // If the time has past remove the node.\n if (moment().tz('America/Toronto').format('YYYY-MM-DD HH:mm') > momentObj.format('YYYY-MM-DD HH:mm')) {\n $(this).remove();\n }\n }\n }\n });\n });\n }\n}", "function removeOrders() {\n Object.keys(orders).map(function(k) {\n orders[k]['start'].setMap(null);\n orders[k]['end'].setMap(null);\n });\n has_orders = false;\n orders = {};\n }", "function previousMonth() {\n // clearCalendar();\n date.setMonth(date.getMonth() - 1);\n var val = date.getMonth();\n createMonth(date.getMonth());\n heatmap(date.getMonth()-1);\n}", "_clearSelection(eventPrevented) {\n const that = this;\n\n if (that._selectedCells) {\n that._selectedCells.map(cell => {\n that._setCellState(cell, 'selected', false);\n });\n }\n\n that.selectedDates = [];\n that._selectedCells = [];\n\n if (that.selectionMode === 'many') {\n const months = that.$.monthsContainer.children;\n\n for (let m = 0; m < months.length; m++) {\n that._getMonthCells(months[m]).map(cell => {\n that._setCellState(cell, 'hover', false);\n });\n }\n }\n\n that._refreshFooter();\n\n //Update the hidden input\n that.$.hiddenInput.value = that.selectedDates.toString();\n\n if (!eventPrevented) {\n that.$.fireEvent('change', {\n 'value': []\n });\n }\n\n that._refreshTitle();\n }", "function reset() {\n clock.style.display = 'none';\n container.style.display = 'block';\n removeClass(calendar, 'datipi-circle-hidden');\n calendar.style.display = 'block';\n btnPreviousMonth.style.display = 'inline-block';\n btnNextMonth.style.display = 'inline-block';\n if (hours != null) {\n hours.setAttribute('style', '');\n hours.className = 'datipi-circle-selector datipi-hours';\n }\n if (minutes != null) {\n minutes.setAttribute('style', '');\n minutes.className = 'datipi-minutes datipi-circle-hidden';\n }\n initCalendar();\n }", "function removeData(chart, timeline) {\n chart.data.datasets[0].data = data_traffic_chart[timeline];\n chart.update();\n}", "function removeAllEventsFromDisplay() {\n cosmo.view.cal.itemRegistry.each(removeEventFromDisplay);\n return true;\n }", "function removeYearFromHistorical(y) {\n for (var b in HistoricalMap) {\n for (var i = 0; i < HistoricalMap[b].length; ++i) {\n if (HistoricalMap[b][i].year > y)\n HistoricalMap[b].splice(i, 1);\n }\n }\n}", "function updateCalendar(data){\n emptyCalendar(apmnt)\n populateCalendar(data)\n}", "function removeData() {\n let parent = document.querySelector('#carbon-data')\n while (parent.firstElementChild) {\n parent.removeChild(parent.firstElementChild)\n\n }\n return\n}", "function datepickerClear() {\n vm.thing.findings[0].date = null;\n }", "deleteAnyPastReservations(bank, branch) {\r\n //Get current day time\r\n var currentDate = new Date();\r\n var month = currentDate.getMonth() + 1;\r\n var day = currentDate.getDate();\r\n var year = currentDate.getFullYear();\r\n\r\n //Get timeframes referrence\r\n var timeFramesRef = database.getDocumentFromCollection(bank, branch).collection('TimeFrames');\r\n\r\n var yearLookup = 'year';\r\n var monthLookup = 'month';\r\n var dayLookup = 'day';\r\n\r\n //Find old timeframes and write a batch do delete them\r\n timeFramesRef.get().then(function (querySnapshot, docId) {\r\n var batch = database.getBatch();\r\n querySnapshot.forEach(doc => {\r\n\r\n if (!(doc.data()[yearLookup] > year) &&\r\n !(doc.data()[yearLookup] == year &&\r\n doc.data()[monthLookup] > month) &&\r\n !(doc.data()[yearLookup] == year &&\r\n doc.data()[monthLookup] == month &&\r\n doc.data()[dayLookup] >= day)) {\r\n batch.delete(doc.ref);\r\n }\r\n });\r\n return batch.commit();\r\n }).catch(err => {\r\n console.log(err.message);\r\n });\r\n }", "removePeriodAndTaskMarker(task){\n let taskElem = task;\n if (taskElem) {\n let taskDays = $('.day[data-task=true]');\n let taskDebut = taskElem.datedebut;\n let taskFin = taskElem.datefin;\n let periodDays = [];\n //On genere un tableau representant la periode de la tache et les cellules concerné\n $.each(taskDays, (i, e) => {\n if ($(e).attr('data-date') >= taskDebut && $(e).attr('data-date') <= taskFin) {\n periodDays.push(e);\n }\n });\n //on verifie si les cellules de la periode on d'autre taches que celle supprimé.\n let emptyDay = periodDays.filter((e) => {\n let date = $(e).attr('data-date');\n let taskPerDay =0;\n $.each(this.tasks, (i, e) => {\n let dateDebut = e.datedebut;\n let dateFin = e.datefin;\n if (date >= dateDebut && date <= dateFin) {\n taskPerDay++\n }\n\n });\n //si aucune date de tache ne correspond a la date de la cellules on la met dans un tableau\n //representant une cellule vide\n if(!taskPerDay)return true;\n });\n //on retire l'attribut;\n $.each(emptyDay,(i,e)=>{\n if($(e).attr('data-task')){\n $(e).removeAttr('data-task');\n }\n });\n $('.period').toggleClass('period');\n }\n }", "removeHeadlines(propsDate) {\n if (this.headline !== null) {\n // something to remove\n\n let headline = this.headline;\n let startDate = this.dateMap.get(headline);\n\n let endDate = new Date(\n `${headline.endYear}/${headline.endMonth}/${headline.endDay}`\n );\n\n if (propsDate <= startDate || propsDate >= endDate) {\n this.headline = null;\n this.props.updateProps({\n paused: false\n });\n }\n }\n }", "function removeBadData(e) {\n\t\te.duration = Math.max(0, e.duration);\n\n\t\t//only show events that occur during the calendar hours\n\t\treturn e.starts_at + e.duration > 0 && e.starts_at <= (HOURS_PER_DAY * 60);\n\t}", "function clearFlights() {\n document.getElementsByClassName('tabs')[0].style.display = 'none';\n for(var day = 1; day <=5; day++) {\n var tableArea = document.getElementById('tab-content' + day);\n var oldTable = tableArea.getElementsByTagName('table')[0];\n if(oldTable) {\n tableArea.removeChild(oldTable);\n }\n }\n }", "function onPreviousMonth(event) {\n currentDateTime.setMonth(currentDateTime.getMonth() - 1);\n initCalendar();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "function clearPastFutureColornig(){\n $('#life-calendar .time-box').each(function(){\n $(this).removeClass('past-colored');\n $(this).removeClass('future-colored');\n });\n}", "delete_old() {\n var start_of_day = moment().startOf('day').format('X');\n\n _.forEach(this.score, (events, email) => {\n this.score[email] = _.filter(events, (event) => {\n return event.time > start_of_day;\n })\n });\n }", "prevMonth() {\n if (this.monthIndex==0){\n this.monthIndex = 11;\n this.month = monthsArray[this.monthIndex];\n this.year -= 1;\n } else {\n this.monthIndex -= 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "resetDays() {\n this.resetFilled();\n let days = this.days;\n let filled = this.filled;\n let current = filled.start;\n let daysBetween = filled.days(Op.UP);\n let total = Math.max(this.minimumSize, daysBetween);\n for (let i = 0; i < total; i++) {\n let day = days[i];\n if (!day || !day.sameDay(current)) {\n day = new CalendarDay(current.date);\n if (i < days.length) {\n days.splice(i, 1, day);\n }\n else {\n days.push(day);\n }\n }\n day.inCalendar = this.span.contains(day);\n current = current.next();\n }\n if (days.length > total) {\n days.splice(total, days.length - total);\n }\n return this;\n }", "function acceptYearDelete(){\n\tvar element = document.getElementById(\"accept_year\");\n\tvar length = element.length;\n\taccept.year = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tacceptMonthDelete();\n}", "function previousMonth () {\n\tmonth = month - 1; // substract one from current month\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n\tchangeWeeksDisplay(\"flex\"); // show all weeks except model one (= view: month) \n\tdocument.getElementById(\"currentMonth\").innerHTML = months[month].name; // change displayed month name\n\taddDayClickEvent(); // add \"click\" event to new calendar days elements\n\taddWeekClickEvent(); // add \"click\" event to new calendar weeks elements\n}", "function clearSchedule() {\n\t\tvar timeblocks = babysitterScheduleTable.getTimeblocks();\n\t\tfor (var i = 0; i < timeblocks.length; i++) {\n\t\t\tvar block = timeblocks[i];\n\t\t\tfor(var day = block.start.day; day <= block.end.day; day++) {\n\t\t\t\tfor(var time = earliestTimeOnSchedule; time <= latestTimeOnSchedule; time++) {\n\t\t\t\t\tbabysitterScheduleTable.paint(day, time, \"blank\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function participateDayDelete(){\n\tvar element = document.getElementById(\"participate_day\");\n\tvar length = element.length;\n\tparticipate.day = 0;\n\t\n\tfor(var i = 0; i < length - 1; i++){\n\t\telement.removeChild(element.lastChild);\n\t}\n\t\n\tif(document.getElementById(\"accept_year\") == null){\n\t\tnexttimeYearDelete();\n\t}else{\n\t\tacceptYearDelete();\n\t}\n}", "function removeOlderRows(from, to) {\n for (var i = from; i <= to; i++) {\n if (_shownData[i] === undefined) continue;\n _shownData[i].parentNode.removeChild(_shownData[i]);\n _shownData[i] = undefined;\n }\n }", "removeOccurrencesFrom(date) {\n this.occurrenceMap.forEach((occurrence, dateKey) => {\n if (DateHelper.parseKey(dateKey) >= date) {\n this.removeOccurrence(occurrence);\n }\n });\n }", "function clearDateContainer() {\n\t$(\".pushNotification\").children(\"#title\").children(\"h2\").html(\"\");\n}", "function removeEdit(day, month){\n let data = fs.readFileSync('Edits.txt', 'utf-8');\n\n let lines = data.split('\\r\\n');\n let date = '';\n if(day < 10){\n date += '0';\n }\n date += day + '-' ;\n if(month < 10){\n date += '0';\n }\n date += month;\n console.log(date, lines);\n\n let newdata = '';\n let removed = 'Removed:\\n';\n for (let i=0; i<lines.length; i++){\n console.log(lines[i].substring(0,5));\n // TODO check for indiv msg\n if(lines[i].substring(0,5) === date ){\n removed += lines[i] + '\\n';\n console.log(\"removed\", lines[i]);\n }\n else{\n newdata += lines[i] + '\\r\\n'\n }\n }\n\n console.log(newdata);\n fs.writeFileSync('Edits.txt', newdata);\n\n return removed;\n\n}", "function clearMonth(){\n\n let errorExists = false;\n\n pool.getConnection(function(err, connection){\n\n if(_assertConnectionError(err)){\n return;\n }\n \n const streamersReg = [];\n const streamersWhitelist = [];\n connection.query(\"SELECT * FROM list_of_streamers;\",\n function(error, results, fields){\n\n if(errorExists || _assertError(error, connection)){\n errorExists = true;\n return;\n }\n\n for(let row of results){\n streamersReg.push(sql.raw(row[\"channel_id\"] \n + _REGULAR_SUFFIX));\n streamersWhitelist.push(sql.raw(row[\"channel_id\"] \n + _WHITELIST_SUFFIX));\n }\n\n });\n\n connection.query(\"UPDATE ?, ? SET ?.month=0, ?.month=0;\", \n [streamersReg, streamersWhitelist, streamersReg, \n streamersWhitelist], function(error){\n \n if(errorExists || _assertError(error)){\n errorExists = true;\n return;\n }\n\n });\n\n if(!errorExists){\n connection.release();\n }\n\n });\n}", "function unschedule() {\n withScheduler(\n 'unschedule',\n (scheduler) => {\n withUniqueTag(\n scheduler,\n 'button',\n matchingAttr('data-track', 'scheduler|date_shortcut_nodate'),\n click,\n );\n });\n }", "function remove_future_bookings(bookings){\n var today = new Date(new Date().setHours(1,0,0,0));\n\n for(var i=0; i<bookings.length; i++){\n if(new Date(bookings[i].start_on) > today){\n bookings.splice(i, 1);\n i--;\n }\n }\n\n return bookings;\n }", "function removeDaysDetailsDelivery(calendardate) {\n\n if (calendardate < todaysdate) return [false, 'past-date'];\n\n var today_cls = '';\n if ((calendardate.toDateString() == today_str)) {\n today_cls = 'calendar-today-date';\n }\n\n var caldate = calendardate.getDate();\n var calmon = calendardate.getMonth();\n var calyear = calendardate.getFullYear();\n var result = true;\n var changed = false;\n\n /* Calendar date format m/d/y */\n\n var calm = parseInt(calendardate.getMonth()) + 1, \n cald = calendardate.getDate(), \n caly = calendardate.getFullYear();\n\n if (cald < 10) cald = '0' + cald.toString();\n if (calm < 10) calm = '0' + calm.toString();\n\n var calMDY = calm + '/' + cald +'/' + calyear;\n\n console.log('Cal date', calMDY);\n\n if (closedDatesDelivery.indexOf(calMDY) != -1) {\n console.log('Closed delivery date', calMDY);\n return [true, 'calendar-closed-date '+today_cls, 'Not available'];\n }\n if (openDatesDelivery.indexOf(calMDY) != -1) {\n return [true, 'calendar-open-date '+today_cls, 'Available'];\n }\n\n if (available_delivery_days != '') {\n var daysopen = available_delivery_days.split(\",\");\n daynum = calendardate.getDay();\n for (var i = 0; i < daysopen.length; i++) {\n if (daysopen[i] == daynum) {\n return [true, 'calendar-selectable-date '+today_cls, 'Available'];\n }\n }\n }\n return [true, 'calendar-closed-date '+today_cls, 'Not available'];\n}", "resetDateRange() {\n var beg, end;\n beg = Data.toDateStr(Data.begDay, Data.monthIdx);\n end = Data.advanceDate(beg, Data.numDays - 1);\n return this.res.dateRange(beg, end, this.resetRooms);\n }", "function cancelarNuevaCita(){\n\t\n\t$(\"#hidden_agendarCita\").hide('slower');\n\n\t$(\"#calendar\").addClass(\"m12\");\n\t$(\"#calendar\").addClass(\"l12\");\n\t\n\t$(\"#calendar\").removeClass(\"m6\");\n\t$(\"#calendar\").removeClass(\"l6\");\n\t\n\t$('#calendar').fullCalendar('option', 'height', 900);\n\t\n\t\n\t//se limpian los campos\n\t$(\"#cita_idPropietario\").val(\"0\");\n\t$(\"#cita_propietario\").val(\"\");\n\t$(\"#fecha_cita\").val(\"\");\n\t$(\"#hora_cita\").val(\"\");\n\t$(\"#duracion_citaHoras\").val(\"\");\n\t$(\"#duracion_citaMinutos\").val(\"\");\n\t$(\"#cita_observaciones\").val(\"\");\n\t\n\t$(\"#label_cita_propietario\").removeClass( \"active\" );\n\t\n\t$(\".prefix\").removeClass( \"active\" );\n\t\n\t$(\"#cita_propietario\").removeClass( \"invalid\" );\n\t$(\"#cita_propietario\").removeClass( \"valid\" );\n\t\n\t$(\"#fecha_cita\").removeClass( \"invalid\" );\n\t$(\"#fecha_cita\").removeClass( \"valid\" );\t\n\n\t$(\"#label_hora_cita\").removeClass( \"invalid\" );\n\t$(\"#label_hora_cita\").removeClass( \"valid\" );\t\n\n\t$(\"#duracion_citaHoras\").removeClass( \"invalid\" );\n\t$(\"#duracion_citaHoras\").removeClass( \"valid\" );\n\t\n\t$(\"#duracion_citaMinutos\").removeClass( \"invalid\" );\n\t$(\"#duracion_citaMinutos\").removeClass( \"valid\" );\n\t\n\t$(\"#cita_observaciones\").removeClass( \"invalid\" );\n\t$(\"#cita_observaciones\").removeClass( \"valid\" );\n\t\n\t var selectList = $(\"#selectPacienterDelPropietario\");\n\t selectList.find(\"option:gt(0)\").remove();\n $('#cita_pacientes').material_select('destroy');\n $('#cita_pacientes').material_select();\n \n $(\"#cita_tipoCita\").val(\"\");\n $('#cita_tipoCita').material_select('destroy');\n $('#cita_tipoCita').material_select();\n\t\t\t\n\t\n}", "removeOccurrencesFrom(date) {\n this.occurrenceMap.forEach((occurrence, dateKey) => {\n if (DateHelper.parseKey(dateKey) >= date) {\n this.removeOccurrence(occurrence);\n }\n });\n }", "function removeEntries() {\n // Find all entries\n var $entries = $schedule.find('.entry');\n\n // Delete them\n $entries.fadeOut(function () {\n $entries.remove();\n });\n\n return false;\n }", "function reset() {\n\tvar eventDom = document.getElementById('event');\n\tvar timeDom = document.getElementById('time');\n\twhile (eventDom.firstChild) {\n\t\teventDom.removeChild(eventDom.firstChild);\n\t}\n\twhile (timeDom.firstChild) {\n\t\ttimeDom.removeChild(timeDom.firstChild);\n\t}\n}", "function removeOverlapsTrackingElement(event) {\n if(event.direct==-1)return false;\n var arr = overlappedEvents[event.direct]\n if(arr==null||arr==undefined)return false;\n for (var value = 0; value < arr.length; value++) {\n if (arr[value] == event._id) {\n //var parentObject = $('#calendar').fullCalendar('clientEvents', key);\n //parentObject.backgroundColor = '';\n arr.splice(value, 1);\n if (arr.length == 0) {\n var e = $('#calendar').fullCalendar('clientEvents', event.direct);\n e.overlaped = false;\n delete(overlappedEvents[event.direct]);\n }\n break;\n }\n }\n\n}", "function removeFromHistorical(n) {\n delete HistoricalMap[n];\n}", "function hideYearTitles() {\n svg.selectAll('.year').remove();\n }", "function fillCalendar() {\n console.log(\"inside the fill calendar\");\n // for (let i = 0; i < events.length; i++) {\n // console.log(events[i].title);\n // }\n let currentMonth = date.getMonth()+1;\n let dateComp = new Date(date.getFullYear()+yearCounter, currentMonth-1+monthCounter, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n let year = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getFullYear();\n let month = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getMonth();\n let numDaysInMonth = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter, 0).getDate();\n let monthStartingDay = new Date(date.getFullYear()+yearCounter, currentMonth+-1+monthCounter, 1).getDay();\n let numDaysLastMonth = new Date(date.getFullYear()+yearCounter, currentMonth+monthCounter-1, 0).getDate();\n let monthStartingDayCopy = monthStartingDay;\n let counter = 1;\n let counter2 = 0;\n let counter3 = 0;\n let counter4 = 1;\n //\n //prints month and year above calendar\n //\n $(\"#month\").html(`${months[month]}`);\n $(\"#year\").html(`${year}`);\n //\n //clears all day boxes on calendar\n //\n $(\".day-box\").html(\" \"); \n // while loop fills in boxes for last month\n // first for-loop fills in first row for curreny month\n // second for-loop fills in the rest of the rows for current month\n // third for-loop fills in the rest of the rows for next month\n while (counter2 < monthStartingDay) {\n $(`#c${counter2}`).append(`<span class=\"faded\">${numDaysLastMonth-monthStartingDayCopy+1}</span>`);\n counter2++;\n monthStartingDayCopy--;\n }\n for (let j = monthStartingDay; j < 7; j++) {\n $(`#c${j}`).append(`<span class=\"bold\">${counter}</span>`);\n for (let i = 0 ; i < events.length; i++) {\n //\n // If the current date is equal to the date generated by fillCalender()\n // then highlight current day's box to lightgreen using currentDay class\n //\n if (currentMonth + monthCounter == parseInt(events[i].startMonth) && counter == parseInt(events[i].startDay)) {\n $(`#c${j}`).append(`<p class=\"event ${events[i].tag}\">${events[i].startHour}:${events[i].startMinutes} ${events[i].title}</p>`);\n }\n }\n counter++;\n }\n for (let j = 7; counter <= numDaysInMonth; j++) {\n $(`#c${j}`).append(`<span class=\"bold\">${counter}</span>`);\n if (date.getMonth() == dateComp.getMonth() && date.getDate() == dateComp.getDate() && date.getFullYear() == dateComp.getFullYear()) {\n currentDayIDNum = date.getDate()-monthStartingDay+1;\n $(`#c${currentDayIDNum}`).find(\"span\").addClass(\"currentDay\");\n } else {\n $(`#c${currentDayIDNum}`).find(\"span\").removeClass(\"currentDay\");\n }\n for (let i = 0 ; i < events.length; i++) {\n // console.log(\"Event index: \" + i)\n if (currentMonth + monthCounter == parseInt(events[i].startMonth) && counter == parseInt(events[i].startDay)) {\n $(`#c${j}`).append(`<p class=\"event ${events[i].tag}\">${events[i].startHour}:${events[i].startMinutes} ${events[i].title}</p>`);\n }\n }\n counter++;\n counter3 = j+1;\n }\n for (j = counter3; j < 42; j++) {\n $(`#c${j}`).append(`<span class=\"faded\">${counter4}</span>`);\n counter3++;\n counter4++;\n }\n console.log(\"Outside fill calendar\");\n}", "function modify_time_period(data, past_n_days) {\n //splice time period\n var data_spliced = clone(data);\n if(past_n_days != '') {\n for(var i=0; i<data_spliced.length; i++) {\n var from = data_spliced[i].length - past_n_days;\n data_spliced[i].splice(0,from);\n }\n }\n\n return data_spliced;\n}", "function borrarFragmentosPendientes() {\n try {\n\n var fragmentosNoGuardados = $('.fragmentoCalendarioCreado');\n for (var i = 0; i < fragmentosNoGuardados.length; i++) {\n if ($(fragmentosNoGuardados[i]).attr('id') == null || $(fragmentosNoGuardados[i]).attr('id') == '') {\n $(fragmentosNoGuardados[i]).remove();\n }\n }\n var fragmentoPerdido = $('#fragmentoTemporal');\n if (fragmentoPerdido != null) {\n $(fragmentoPerdido).remove();\n }\n\n } catch (e) { }\n}", "function stopShowingAsSelected(day, month, year) {\r\n var calendarDay = $(\".calendar-day[day=\" + day + \"][month=\" + month + \"][year=\" + year + \"]\");\r\n calendarDay.removeClass(\"selected\");\r\n }", "function removeSelected(){\n\t$('.popover-content > ul > li').each (function(){\n\t\t$(this).removeClass('selected-day');\n\t})\n}", "function removeComingSoon() {\n sortedGames = []; \n let todayDate = new Date();\n let parseTodaysDate = Date.parse(todayDate);\n for (let i of gameList) {\n let itemDate = (i.releaseDate);\n let parseItemDate = Date.parse(i.releaseDate);\n if (!itemDate.includes(\"t.b.d\") && parseTodaysDate > parseItemDate) {\n sortedGames.push(i);\n }\n }\n sortedGamesImmutable = sortedGames;\n sortMapByScore();\n}", "timelineUnmarkEvents() {\n this.line.setSelection();\n }", "function removeData(graph) {\n //Clears all datasets\n graph.data.datasets = [];\n\n //Updates the chart to display to changes\n graph.update();\n}", "removeEvents() {\n }", "function hideYearTitles() {\n svg.selectAll('.year').remove();\n svg.selectAll('.safetynum').remove();\n }", "clearDate() {\n this.set('date', null);\n }", "function updateCalendar(){\n //events = [];\n document.getElementById(\"display_events\").innerHTML = \"\";\n //document.getElementById(\"days\").innerHTML = \"\";\n $(\"#days\").empty();\n\tlet weeks = currentMonth.getWeeks();\n \n const data = {'month': currentMonth.month+1, 'year': currentMonth.year};\n eventsDay(data);\n //console.log(currentMonth);\n let index = 0;\n\tfor(let w in weeks){\n\t\tlet days = weeks[w].getDates();\n index++;\n\t\t// days contains normal JavaScript Date objects.\n\t\t//alert(\"Week starting on \"+days[0]); \n\t\t//$(\"#days\").append(\"<div class='calendar__week'>\");\n\t\tfor(let d in days){ \n\t\t\t// You can see console.log() output in your JavaScript debugging tool, like Firebug,\n\t\t\t// WebWit Inspector, or Dragonfly.\n const dayRegex = /(\\d{2})/g;\n const dayMatch = dayRegex.exec(days[d])[1];\n //const data = {'day': dayMatch, 'month': currentMonth.month+1, 'year': currentMonth.year};\n let name =\"\";\n let namearray = [];\n let count = 0;\n for (let i = 0; i < eventclass.length; ++i) {\n //console.log(eventclass[i].name);\n //console.log(eventclass[i].day + \" \" + dayMatch);\n const c = eventclass[i].tag;\n let color;\n if (c == 'holiday') {\n color = 'green';\n }\n else if (c == 'birthday') {\n color = 'pink';\n }\n else if (c == 'exam') {\n color = 'blue';\n }\n else if (c == 'important') {\n color = 'red';\n }\n else {\n color = '#aab2b8';\n }\n //console.log(eventclass[i].name + \" \" + eventclass[i].month);\n \n if (eventclass[i].day == dayMatch && currentMonth.month+1 == eventclass[i].month && currentMonth.year == eventclass[i].year) {\n //console.log(\"entered\");\n if (eventclass[i].day < 7) {\n if(index > 1) {\n //console.log(\"less than 1\");\n //\n }\n else {\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n //console.log(eventclass[i].month);\n //console.log(\"greater\");\n }\n \n }\n else if (eventclass[i].day > 23) {\n if(index < 3) {\n //\n }\n else {\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n \n }\n }\n else {\n //sname = name.concat(eventclass[i].name);\n // name= name.concat(\"<button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">\" + eventclass[i].name + \"</button><p>\");\n name= name.concat(\"<div id='eventbox'><span style='color:\"+color+\";'>\" + eventclass[i].name + \"</span> <button class='mod' id='modify_btn' value=\" + eventclass[i].id +\">Edit</button> <button class='del' id='delete_btn' value=\" + eventclass[i].id +\">Delete</button> <button class='time' id='time_btn' value=\" + eventclass[i].id +\">View Details</button></div>\");\n name = name.concat(\"<br>\");\n //console.log(\"work\");\n //name = name + \"\\n\" + \"\\n\";\n //namearray[count] = name;\n //count ++;\n }\n\n }\n }\n if(name == \"\"){\n $(\"#days\").append(\"<li><div class='box'>\" + dayMatch + \"</div></li>\");\n } else {\n \n $(\"#days\").append(\"<li><div class='box'>\" + dayMatch + \"<br>\" +name + \"</div></li>\");\n }\n }\n\t}\n const mod_buttons = document.getElementsByClassName('mod');\n const del_buttons = document.getElementsByClassName('del');\n const time_buttons = document.getElementsByClassName('time');\n for ( let j in Object.keys( mod_buttons ) ) {\n mod_buttons[j].addEventListener(\"click\", modifyEvents, false);\n }\n for ( let k in Object.keys( del_buttons ) ) {\n del_buttons[k].addEventListener(\"click\", deleteEvents, false);\n }\n for ( let m in Object.keys( time_buttons ) ) {\n time_buttons[m].addEventListener(\"click\", viewtime, false);\n }\n \n}", "function clearAppointments(){\n for(var prop in appointmentProperties){\n if(appointmentProperties[prop]['id']){\n if(document.getElementById(appointmentProperties[prop]['id'])){\n var obj = document.getElementById(appointmentProperties[prop]['id']);\n obj.parentNode.removeChild(obj);\n }\n appointmentProperties[prop]['id'] = false;\n }\n }\n}", "function displayOclinics () {\n\n var d = new Date();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n var may = Object.keys(Oclinicsmay);\n var june = Object.keys(Oclinicsjune);\n for (var i = 0; i < (may.length + june.length); i++) {\n $(\"#oevents\" + i).html('');\n }\n // see if there are any Officials Clinics in May and display them ---------\n if (may.length > 0) {\n\n for (var i = 0; i < may.length; i++) {\n $(\"#oevents\" + i).html(\"<div class='month1'>May \" + may[i] + \":</div><div class='officialsclinics'>\" + Oclinicsmay[may[i]]+ \"</div>\");\n }\n counter = (may.length - 1); // adjust ids used for May clinics\n }\n // Display Officials Clinics in June ----------------------------\n for (var i = 0; i < june.length; i++) {\n counter ++;\n $(\"#oevents\" + counter).html(\"<div class='month1'>June \" + june[i] + \":</div><div class='officialsclinics'>\" + Oclinicsjune[june[i]]+ \"</div>\");\n }\n //delete unused cells ---------------------------------------------\n\n if (counter+1 <= 5) {\n\n for (var i = counter+1; i < 9; i++) {\n $(\"#oclinics\" + i).css('display', 'none');\n }\n }\n // add strike through when date passes\n var z = findEvent(date, june);\n if ((month === 4 && date > parseInt(may[may.length-1])) || month > 4) {\n for (var i = 0; i < may.length; i++) {\n $(\"#oevents\" + i).html(\"<s><div class='month1'>May \" + may[i] + \":</div><div class='officialsclinics'>\" + Oclinicsmay[may[i]]+ \"</div></s>\");\n }\n }\n if (month === 5 ) {\n counter = (may.length - 1);\n for (var i = 0; i < z; i++) {\n counter ++;\n $(\"#oevents\" + counter).html(\"<s><div class='month1'>June \" + june[i] + \":</div><div class='officialsclinics'>\" + Oclinicsjune[june[i]]+ \"</div></s>\");\n }\n }\n if (month === 5 && date > parseInt(june[june.length-1]) || month > 5) {\n counter = (may.length - 1);\n for (var i = 0; i <= june.length; i++) {\n counter ++;\n $(\"#oevents\" + counter).html(\"<s><div class='month1'>June \" + june[i] + \":</div><div class='officialsclinics'>\" + Oclinicsjune[june[i]]+ \"</div></s>\");\n }\n }\n}", "function resetAll() {\n //reset date\n entries = [];\n localStorage.clear();\n\n //clear most of the chart\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawAxis();\n\n //remove all items from list\n while (dataList.firstChild) dataList.removeChild(dataList.firstChild);\n}", "function removeTimeSpacesAndAlign(chart_data){\n\n //alinha os eventos de acordo com data atual\n let alignStartTime = new Date();\n\n chart_data.forEach((student) =>{\n let currentTime = alignStartTime;\n student.data.forEach((item, index) =>{\n if (item !== undefined){\n if (item.type == TimelineChart.TYPE.POINT){ //apenas desloca o 'at' do evento\n item.at = currentTime;\n } else { //altera o 'to' e 'from'\n let eventIntervalSizeInMs = item.to.getTime() - item.from.getTime();\n \n item.from = currentTime;\n item.to = new Date(currentTime.getTime() + eventIntervalSizeInMs);\n } \n \n //atualiza currentTime, adicionando 0,5s de espaço entre os eventos\n currentTime = (item.type == TimelineChart.TYPE.POINT) ? new Date(item.at.getTime() + 500) : new Date(item.to.getTime() + 500); \n }\n }); \n }); \n}", "function borrarMarcadores() {\r\n\tfor (let i = 0; i < markers.length; i++) {\r\n\t\tmarkers[i].setMap(null);\r\n\t}\r\n\tmarkers = [];\r\n}", "function constrainResize(days,start){\n let allEvents = calendar.getEvents();\n let eventsToRemove = [];\n\n allEvents.sort((a,b) => moment(a.start).dayOfYear() - moment(b.start).dayOfYear())\n\n if(days > 0){\n index = allEvents.findIndex(event => moment(event.start).isSame(moment(start),'day')) \n for(i = 1; i <= days;i++){\n if(allEvents[index+i].classNames[0] === 'present')\n eventsToRemove.push(allEvents[index+i]);\n else{\n eventsToRemove.push(true);\n break;\n } \n }\n return eventsToRemove;\n }\n\n else{\n return [];\n }\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function borrarMarcadores() {\n if (arregloMarcadores) {\n for (i in arregloMarcadores) {\n arregloMarcadores[i].setMap(null);\n }\n //arregloMarcadores.length = 0;\n }\n }", "function borrarMarcadores() {\n if (arregloMarcadores) {\n for (i in arregloMarcadores) {\n arregloMarcadores[i].setMap(null);\n }\n //arregloMarcadores.length = 0;\n }\n }" ]
[ "0.77282315", "0.7604135", "0.69815797", "0.6969459", "0.68167526", "0.6565822", "0.65581083", "0.6507041", "0.65002173", "0.6403687", "0.6351278", "0.6313507", "0.62849325", "0.62436", "0.6242865", "0.61985207", "0.61952615", "0.61874694", "0.6182711", "0.61441046", "0.61035764", "0.6085857", "0.6079036", "0.6073707", "0.60716414", "0.6068121", "0.6059692", "0.6048696", "0.6042298", "0.60338634", "0.6014162", "0.5944995", "0.5923041", "0.59189045", "0.5907537", "0.5820427", "0.58125955", "0.5805702", "0.58051413", "0.5789191", "0.5788601", "0.57676244", "0.57651037", "0.5758532", "0.57507527", "0.57422453", "0.5727679", "0.5726127", "0.57244545", "0.57213145", "0.57077056", "0.57042384", "0.5652323", "0.56382865", "0.5632682", "0.5632384", "0.5626949", "0.5621214", "0.5612059", "0.5587525", "0.5584707", "0.5583029", "0.55823034", "0.55750597", "0.55654395", "0.5563583", "0.5557782", "0.55431294", "0.5542887", "0.5527797", "0.55277896", "0.55252165", "0.5522305", "0.55191547", "0.5513954", "0.55044836", "0.5501282", "0.5498074", "0.54840225", "0.5482037", "0.5471894", "0.5468194", "0.5467816", "0.54626155", "0.54614615", "0.5456523", "0.5453617", "0.5450241", "0.5446097", "0.5445677", "0.54455686", "0.5433338", "0.5429392", "0.54265505", "0.5424598", "0.54118043", "0.54006344", "0.53981596", "0.53957176", "0.53957176" ]
0.6522502
7
Function to move to next month
function nextMonth(){ clearCalendar(); var newMonth =""; var newYear=0; if (displayedMonth == 11) { newMonth = 0; newYear = displayedYear + 1; displayedMonth = 0; displayedYear = displayedYear + 1; } else { newMonth = displayedMonth+ 1; displayedMonth = displayedMonth + 1; newYear = displayedYear; } //console.log("newMonth: " + newMonth); //console.log("newYear: " + newYear); //console.log("displayedMonth: " + displayedMonth); //console.log("displayedYear: " + displayedYear); printCalendar(newYear, newMonth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextMonth(){\n setDate(1);\n getStartDay();\n renderDays();\n calendarMonthAndYear.innerText = months[setCal.month] + \" \" + setCal.year;\n }", "function nextMonth() {\n // -- add one month to the viewDate --/\n $directive.viewDate.setDate(1);\n $directive.viewDate.setMonth($directive.viewDate.getMonth() + 1);\n // -- reload the viewdate :P --/\n setViewDate($directive.viewDate);\n }", "function next(){\n month++;\n if(month==12){\n month=0;\n year++;\n }\n buildCalendar();\n}", "function nextMonth() {\n month++;\n if (month > 11) {\n alert('Sei arrivato alla fine del calendario.');\n month = 11;\n } else {\n printMonth(month);\n addHolidays(month);\n }\n }", "nextMonth() {\n if (this.monthIndex==11){\n this.monthIndex = 0;\n this.year += 1;\n this.month = monthsArray[this.monthIndex];\n } else {\n this.monthIndex += 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function nextMonth(event) {\n event.preventDefault();\n\n if (newselectedMonth == 11) {\n newselectedMonth = 0;\n newselectedYear = newselectedYear + 1;\n }\n else {\n newselectedMonth = newselectedMonth + 1;\n }\n createMonth(newselectedMonth, newselectedYear);\n console.log(\"one swipeleft\");\n }", "function nextMonth(){\n if(data.calendar.month != 11 || data.calendar.year == 2018 || data.calendar.year == 2019){\n data.calendar.month++;\n }\n if(data.calendar.month >= 12){\n data.calendar.month = 0;\n data.calendar.year++;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}", "nextMonth(){\n return this.addMonths(1);\n }", "function nextMonth () {\n\tmonth = month + 1; // add one to current month\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n\tchangeWeeksDisplay(\"flex\"); // show all weeks except model one (= view: month) \n\tdocument.getElementById(\"currentMonth\").innerHTML = months[month].name; // change displayed month name\n\taddDayClickEvent(); // add \"click\" event to new calendar days elements\n\taddWeekClickEvent(); // add \"click\" event to new calendar weeks elements\n}", "function nextDate() {\n var year = x.getFullYear();\n var month = x.getMonth();\n if (month == 12) {\n month = 0;\n year += 1;\n }\n x = new Date(year, (month + 1), 1);\n displayDates();\n}", "function pre_nextMonth(month) {\n\tcurrent_month = parseInt(current_month) + parseInt(month);\n\t\n\t\n\tif(current_month > 11){\n\t\tcurrent_month = 0;\n\t\tcurrent_year+= parseInt(1);\n\t}\n\telse{\n\t\tif(current_month < 0){\n\t\t\tcurrent_month = 11;\n\t\t\tcurrent_year -= parseInt(1);\n\t\t}\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function scheduleNextMonth() {\n withScheduler(\n 'scheduleNextMonth',\n () => {\n error('schedule next month no longer supported.');\n });\n }", "function onNextMonth(event) {\n currentDateTime.setMonth(currentDateTime.getMonth() + 1);\n initCalendar();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "function getNextMonth() {\n\ttempDate = getTempDate();\n\n var year = tempDate.getFullYear();\n var month = tempDate.getMonth();\n var date = tempDate.getDate();\n\n if (month == 11) {\n \tyear += 1;\n tempDate.setFullYear(year, 0, 1);\n }\n else {\n \tmonth += 1;\n tempDate.setMonth(month, 1);\n }\n\n var nextDays = getDays(tempDate);\n\n if(date >= nextDays){\n \tdate = nextDays;\n }\n tempDate.setDate(date);\n\n return tempDate;\n}", "function setToNextMonth(dc) {\n\n var y = new Date();\n var my = (y.getMonth() + 1) / 12; // number of years to add for next month\n var m = (y.getMonth() + 1) % 12; // next month\n var d2 = new Date(y.getFullYear() + my, m, 1, 0,0,0,0);\n return setDateControl(dc, d2);\n}", "function nextButton() {\n\tvar nextMonth = getNextMonth();\n\tdrawCalendar(nextMonth);\n }", "function forwardMonth(){\n toMonth=globalMonth.nextMonth();\n $( document ).ready(load);\n}", "function next(){\n if(dateInfo.currentMonth!=11){\n dateInfo.currentMonth++;\n }\n else{\n dateInfo.currentYear++;\n dateInfo.currentMonth=0;\n }\n while (calendar.firstChild) {calendar.removeChild(calendar.firstChild);}\n createCalendar();\n document.documentElement.scrollTop = 0; \n}", "function addDaysFromNextMonth(){\n if(new Date(dateInfo.currentYear, dateInfo.currentMonth, monthInfo[dateInfo.currentMonth][1],0,0,0,0).getDay()!=6){\n var day = new Date(dateInfo.currentYear, dateInfo.currentMonth+1, 1,0,0,0,0).getDay();\n var j=1;\n for(i=day;i<=6;i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth+1, j++);\n }\n }\n}", "handleNextMonth() {\n this.currentYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n this.currentMonth = (this.currentMonth + 1) % 12;\n console.log(\n \"Handle Next --> \" +\n this.currentMonth +\n \"this.currentYear\" +\n this.currentYear\n );\n const currMonth = this.monthsText[this.months[this.currentMonth]];\n this.currentMonthText = currMonth.charAt(0).toUpperCase() + currMonth.slice(1).toLowerCase();\n this.value = this.currentYear;\n this.options = [{ label: this.currentYear, value: this.currentYear }];\n this.showCalendar(1, this.currentMonth, this.currentYear);\n this.currentSelectedDate.length > 0 ? this.handleSelectedDate(this.currentSelectedDate) : '';\n }", "function cal_next()\n{\n if(curr_month < 11 )\n {\n curr_month = curr_month + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n else if(curr_month === 11)\n {\n curr_month = 0;\n curr_year = curr_year + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n // display_cal();\n}", "nextClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, 1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);\n }", "nextClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, 1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);\n }", "next() {\n let {month} = this.state;\n this.setState({\n month: month.add(1, 'month'),\n });\n }", "function handleNextClick() {\n if(view === 'month') {\n setYear(year + 1);\n return; \n }\n\n if(view === 'year') {\n setYear(year + YEARS_SHOW);\n return;\n }\n\n const previousMont = getNextMonth(month, year);\n setMonth(previousMont.month);\n\n if(previousMont.year === year) return;\n setYear(previousMont.year);\n }", "function getNextDate(date) {\n var day = date.day + 1; //date in increased\n var month = date.month;\n var year = date.year;\n var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if(month===2)//if month is feb check leapyear or not\n {\n if(leapyear(year))\n {\n if(day>29)\n {\n day=1;\n month++;\n }\n }\n else{\n if(day>28)\n {\n day=1;\n month++;\n }\n }\n }\nelse { //for other month increament if the day >month array\n if (day > daysInMonth[month - 1]) {\n day = 1;\n month++;\n\n }\n}\nif(month>12) //if dec then it may go to 13 14 for that we increment the year and set month to 1\n{\n month=1;\n year++;\n}\nreturn { // return the increment date\n day:day,\n month:month,\n year:year,\n}\n}", "function fillNext() {\n const nextMonth = moment(currentDate).add(1, 'month');\n const nextStartDay = nextMonth.startOf('month').day();\n for (let i = nextStartDay; i < 14; i++) {\n dateArray.push(i - nextStartDay + 1)\n }\n \n }", "function setNextMonthData() {\n if (self.currentMonthIndex < 12) {\n self.currentMonthIndex++;\n } else {\n self.currentMonthIndex = 1;\n }\n\n for (var i = 0; i < self.budgetMonths.length; i++) {\n if (self.currentMonthIndex == self.budgetMonths[i].month_id) {\n self.currentMonthData = self.budgetMonths[i];\n self.currentMonth = self.budgetMonths[i].month;\n }\n }\n } // end setNextMonthData", "function setNextMonthYear() {\n if (thisWeekMonth === \"Dec\") {\n thisWeekMonth = \"Jan\";\n thisWeekYear = (Number(thisWeekYear) + 1).toString();\n } else {\n thisWeekMonth = months.all[months.all.indexOf(thisWeekMonth) + 1];\n }\n }", "function next()\n{\nnextdate= getSelectedDate();\nlocation.reload();\nsetSelectedMonth(1,nextdate);\n}", "function onClickNextMonth(nextMonth, month, year) {\n nextMonth.onclick = function() {\n selectCbo(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) + 1, \n daysInMonth(parseInt(month.options[month.selectedIndex].value) + 1, \n year.options[year.selectedIndex].value));\n var newDate = new Date();\n newDate.setFullYear(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) + 1,\n 1);\n updateMonth(month, newDate);\n updateYear(year, newDate);\n }\n}", "function generateNextMonth(currentYear){\n\n\tcalendar.empty();\n\tcurrentMonthIndex++;\n\tif(currentMonthIndex >= 9 && currentMonthIndex <=12)\n\t\tyearIndex = currentYear-1;\n\n\telse if(currentMonthIndex > 12) {\n\t\tcurrentMonthIndex = 1;\n\t\tyearIndex = currentYear;\n\t}\n\t\telse\n\t\t\tyearIndex = currentYear;\n\n\tvar calObjt = createCalendar(currentMonthIndex, yearIndex);\n\tvar rowDays = generateDayRow();\n\tdocument.getElementById(\"calendar-month-year\").innerHTML = month_name[currentMonthIndex-1]+\" \"+yearIndex;\n\tdocument.getElementById(\"calendar-dates\").appendChild(rowDays); \n\tdocument.getElementById(\"calendar-dates\").appendChild(calObjt);\n\thighlightDateWithEvent(currentMonthIndex);\n}", "function jumpToMonth(_show, _year, _month) {\n\t\tvar curr_m = flags.wrap.attr('data-current-month');\n\t\tvar curr_y = flags.wrap.attr('data-current-year');\n\t\tvar show = _show;\n\t\tif(!show){\n\t\t\ttry{\n\t\t\t\tif(Number(_year) == Number(curr_y) && Number(_month) == Number(curr_m)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(Number(_year) < Number(curr_y)){\n\t\t\t\t\tshow = 'prev';\n\t\t\t\t}else{\n\t\t\t\t\tif(Number(_month) < Number(curr_m)){\n\t\t\t\t\t\tshow = 'prev';\n\t\t\t\t\t}else{\n\t\t\t\t\t\tshow = 'next';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(err){}\n\t\t}\n\t\t\n\t\tif (show == ('next')) {\n\t\t\tdateSlider(\"next\", _year, _month);\n\t\t\tvar lastMonthMove = '-=' + flags.directionLeftMove;\n\n\t\t} else {\n\t\t\tdateSlider(\"prev\", _year, _month);\n\t\t\tvar lastMonthMove = '+=' + flags.directionLeftMove;\n\t\t}\n\n\t\tflags.wrap.find('.eventsCalendar-monthWrap.oldMonth').animate({\n\t\t\topacity: eventsOpts.moveOpacity,\n\t\t\tleft: lastMonthMove\n\t\t}, eventsOpts.moveSpeed, function() {\n\t\t\tflags.wrap.find('.eventsCalendar-monthWrap.oldMonth').remove();\n\t\t});\n\t\t//showMessageBox();\n\t\tshowEvents();\n\t}", "function interfaceNext ( ) {\n\t\t\tif ( !CAN_NEXT ) return;\n\t\t\tCURRENT.addMonths(1);\n\t\t\tgenerateCalendarForCurrent();\n\t\t\temitEvent('Clear');\n\t\t}", "function calNext()\n{\nnextdate= getCalValue();\nlocation.reload();\nsetSelectedMonth(1,nextdate);\n}", "function _isNextMonth(d1, d2) {\n if (_isSameYear(d1, d2)) {\n return d2.getMonth() - d1.getMonth() === 1;\n } else if (_isNextYear(d1, d2)) {\n return d1.getMonth() === 11 && d2.getMonth() === 0;\n }\n return false;\n }", "function advance_month(a_value) {\n // Increment/Decrement the month\n calendar_date.setMonth(calendar_date.getMonth() + a_value)\n\n // Format the new date to only have the month name and year (e.g. January 2017)\n var current_calendar_date = formatted_date(calendar_date);\n\n // Display the formatted date on the calendar title\n document.getElementById(\"month_title\").innerHTML = formatted_date(calendar_date);\n\n // Set the current_plannedMonth from the database?\n firebase_database.ref('Users_PlannedMonths/' + user.uid).orderByChild(\"formatted_date\").equalTo(formatted_date(calendar_date)).once(\"value\", function(snapshot) {\n var plannedMonths = snapshot.val();\n if (isValueSet(plannedMonths)) {\n for (var plannedMonth_record_id in plannedMonths) {\n if (plannedMonths.hasOwnProperty(plannedMonth_record_id)) {\n if (plannedMonths[plannedMonth_record_id].formatted_date == formatted_date(calendar_date)) {\n current_plannedMonth = { id: plannedMonth_record_id, formatted_date: plannedMonths[plannedMonth_record_id].formatted_date };\n }\n }\n }\n } else {\n current_plannedMonth = { id: null, formatted_date: null };\n }\n })\n\n // Repopulate the calander\n populate_calendar_days();\n}", "_moveToToStep() {\n let [,month] = get(this, '_dates') || Ember.A();\n if (month) {\n var startOfMonth = new Date(month.getFullYear(), month.getMonth(), 1);\n set(this, 'currentMonth', startOfMonth);\n }\n set(this, 'isToStep', true);\n }", "function NextDay()\n{\n\tif (boolSaveChanges || bSelectChanged)\n\t{\n\t\tSaveChanges(\"MoveToNextDay()\", \"Daily\");\n\t}\n\telse\n\t{\n\t\tMoveToNextDay();\n\t}\n}", "function gotoMonth(index, recursive) {\n if (index == -1 && (+date.getMonth()+1 == minLimits[2] && date.getFullYear() == minLimits[1])) {\n return;\n } else\n if (index == 1 && (+date.getMonth()+1 == maxLimits[2] && date.getFullYear() == maxLimits[1])) {\n return;\n }\n\n date.setDate(1);\n date.setMonth(date.getMonth()+index);\n date.setFullYear(date.getFullYear());\n\n build();\n\n options.onChange && options.onChange.call(Datepicker, date);\n\n if(recursive && isMouseDown) {\n setTimeout(function() {\n gotoMonth(index, recursive);\n }, 50);\n }\n }", "function nextMonthDay(dayName, val) {\n\n if ((timeAdjEle[0] == dayName) || (timeAdjEle[1] == dayName)) {\n for (k = 0; k < timeElements.length; k++) {\n if (timeElements[k] != \"MONTH\") {\n day = dayFinder(timeElements[k]);\n for (n = 1; n <= 31; n++) {\n if (val == \"0\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 2, -n + 1);\n\n }\n if (val == \"1\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n);\n }\n if (val == \"2\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 8);\n }\n if (val == \"3\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 15);\n }\n if (val == \"4\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 21);\n }\n if (val == \"5\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 28);\n }\n var timeFind2 = timeFind1.getDay();\n\n if (day == timeFind2) {\n finalTime = timeFind1;\n displayDate(finalTime);\n return;\n }\n }\n }\n }\n }\n}", "nextMonthComps() {\n if (this.month === 12) return {\n days: _daysInMonths[0],\n month: 1,\n year: this.year + 1,\n };\n return {\n days: (this.month === 2 && this.isLeapYear) ? 29 : _daysInMonths[this.month],\n month: this.month + 1,\n year: this.year,\n };\n }", "_moveToFromStep() {\n let [month] = get(this, '_dates') || Ember.A();\n if (month) {\n var startOfMonth = new Date(month.getFullYear(), month.getMonth(), 1);\n set(this, 'currentMonth', startOfMonth);\n }\n set(this, 'isToStep', false);\n }", "function nextDay(date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1)\n }", "function insertNextMonth(thisMonthStarts){\r\n\tvar nextMonthStarts = (new Date(year, month, amountOfDays(year, month+1))).getDay()\r\n\tfor (let j = 0; j < amountOfCells - ( thisMonthStarts + amountOfDays ( year, month+1 )); j++){\r\n\t\tvar dayElement = document.createElement('div');\r\n\t\tdayElement.innerHTML = j+1;\r\n\t\tdayElement.style.color = \"var(--lighter-color)\"\r\n\t\tdocument.getElementById('month').appendChild(dayElement);\r\n\t}\r\n}", "function Calendar_switchMonth(month) {\n\tthis.dtCurrentDate.setMonth(month, 1);\t\t\t\t// reset day to 1\n\tthis.dtStartDay = new Date(this.dtCurrentDate);\n}", "function bsDpickerSetPrevNextMonth(step) {\n let currentMonth = currentSelectedDate.getMonth();\n currentMonth += step;\n currentSelectedDate.setMonth(currentMonth);\n bsDatepick.datepicker(\"update\", currentSelectedDate);\n selectMonths.selectpicker(\"val\", currentSelectedDate.getMonth());\n selectYears.selectpicker(\"val\", currentSelectedDate.getFullYear());\n}", "function getHeadOfNextMonth(date) {\n\tvar days = getDays(date);\n var firstDayOfMonth = getFirstDayOfMonth(date);\n var verbose = firstDayOfMonth;\n\tvar elements=[];\n var line = 0;\n\n for (var i = 1; i <= days; i++) {\n \tif ((i + verbose) % 7 == 0) {\n \tline++;\n }\n }\n\n var year = date.getFullYear();\n var month = date.getMonth();\n if (month == 11) {\n \tyear += 1;\n month = 0;\n }\n else {\n \tmonth += 1;\n }\n\n var nextMonth = new Date(year, month);\n var firstDayOfNextMonth = getFirstDayOfMonth(nextMonth);\n verbose = firstDayOfNextMonth;\n\n if (line == 5 || line == 4) {\n \tfor (var i = 1; i <= 7 - verbose; i++) {\n\t\t\telements.push(Util.td(i, \"next\", \"\"));\n }\n }\n\treturn elements;\n}", "function dateMonthFwd(y) {\n\n var m = (y.getMonth() + 1) % 12; // set m to the correct next month value\n var my = (y.getMonth() + 1) / 12; // number of years to add for next month\n var d = y.getDate(); // this is the target date\n // console.log('dateMonthFwd: T1 - d = ' + d);\n\n // If there is a chance that there is no such date next month, then let's make sure we\n // do this right. If the date is > than the number of days in month m then snap as follows:\n // if d is valid in month m then use d, otherwise snap to the end of the month.\n if (d > 28) {\n var d0 = new Date(y.getFullYear() + my, m, 0, 0, 0, 0);\n var daysInCurrentMonth = d0.getDate();\n var m2 = (y.getMonth() + 2) % 12; // used to find # days in month m\n var m2y = (y.getMonth() + 2) / 12; // number of years to add for month m\n var d3 = new Date(y.getFullYear() + m2y, m2, 0, 0, 0, 0);\n var daysInNextMonth = d3.getDate();\n if (d >= daysInNextMonth || d == daysInCurrentMonth) { d = daysInNextMonth; }\n }\n // console.log('dateMonthFwd: m = ' + m + ' d = ' + d);\n var d2 = new Date(y.getFullYear() + my, m, d, 0, 0, 0);\n return d2;\n}", "function incrementCurrentDate(increment) {\n\n\tlet currentDate = new Date();\n\tlet daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).getDate();\n\tlet incrementDate = currentDate.getDate() + increment;\n\n\tif(incrementDate > daysInMonth) {\n\t\tincrementDate = incrementDate % daysInMonth;\t\t\n\t\tcurrentDate.setMonth(currentDate.getMonth() + 1);\n\t\t\n\t}\n\n\tcurrentDate.setDate(incrementDate);\n\n\treturn currentDate;\n}", "getNextMonthComps(month, year) {\n if (month === 12) return this.getMonthComps(1, year + 1);\n return this.getMonthComps(month + 1, year);\n }", "getNextMonthComps(month, year) {\n if (month === 12) return this.getMonthComps(1, year + 1);\n return this.getMonthComps(month + 1, year);\n }", "async getNextMonthCalendar(page) {\n loadPage(page);\n }", "function next_date(tanggal, bulan, tahun){\n var months = [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ];\n var selectedMonthName = months[bulan-1];\n var combine = selectedMonthName + '/' + tanggal.toString() + '/' + tahun.toString();\n var d = new Date(combine);\n d.setDate(d.getDate() + 1);\n return `${d.getDate()} ${months[d.getMonth()]} ${d.getFullYear()}`;\n}", "function addMonth() {\r\n if (this.date.getMonth() >= 11) {\r\n this.date = new Date((this.date.getFullYear() + 1), 00, 01);\r\n } else {\r\n this.date = new Date(this.date.getFullYear(), (this.date.getMonth() + 1), 01);\r\n }\r\n document.getElementById(\"body\").className+=\" animated--hide\";\r\n setTimeout(function(){ initCalendar(this.date); }, 200);\r\n}", "function setSelectedMonth()\n{\nptr= arguments[0];\nnew_date= arguments[1];\nptr=new_date.getMonth()+ptr;\nindex=ptr\nif(index == 12)\n index = 0;\nelse if(index == -1)\n index = 11;\nisLeap=leapYear(new_date.getFullYear)\nif(isLeap)\n new_date.setDate(calLeapPeriods[index]);\nelse\n new_date.setDate(calPeriods[index]);\nnew_date.setMonth(ptr);\n}", "function moveDate(para) {\n if (para == \"prev\") {\n dt.setMonth(dt.getMonth() - 1);\n renderDate();\n } else {\n (para == \"next\")\n dt.setMonth(dt.getMonth() + 1);\n }\n renderDate();\n // We use the renderDate function in here, because the moveDate function needs to have this reference because the other attributed from the calendar is declared inside this function. And eventhough the tuborg klamme had continued, we have not declared an onclick function in the prevDate and nextDate object constructor.\n}", "function changeNextDate() {\n var setDateVal = $('#microbundle_fireinspection_inspectionDate').val();\n var setDate = new Date(setDateVal);\n var nextDate = $('#microbundle_fireinspection_nextInspectionDate');\n switch ($(\"input[type='radio']:checked\").val()) {\n case '' :\n nextDate.prop(\"readonly\", false);\n break;\n case '3' :\n setDate.setMonth(setDate.getMonth() + 3);\n nextDate.val(setDate.toISOString().split('T')[0]);\n nextDate.prop(\"readonly\", true);\n break;\n case '6' :\n setDate.setMonth(setDate.getMonth() + 6);\n nextDate.val(setDate.toISOString().split('T')[0]);\n nextDate.prop(\"readonly\", true);\n break;\n case '12' :\n setDate.setMonth(setDate.getMonth() + 12);\n nextDate.val(setDate.toISOString().split('T')[0]);\n nextDate.prop(\"readonly\", true);\n break;\n }\n\n}", "function monthCycler (month) {\n //cycle through days of the month\n for (let i = 0 ; i < months[currentMonth] ; i++) {\n //Check if it's one of our sundays and increment the count if true\n if ((i === 0) && (currentDay === 6)) {\n specialSundays++;\n }\n currentDay = weekCycler(currentDay);\n }\n //increment currentMonth\n month++;\n if (month > 11) {\n month = 0;\n }\n return month;\n}", "function checkMonthTraversal(date, targetMonth) {\n if(targetMonth < 0) {\n targetMonth = targetMonth % 12 + 12;\n }\n if(targetMonth % 12 != callDateGet(date, 'Month')) {\n callDateSet(date, 'Date', 0);\n }\n }", "function checkMonthTraversal(date, targetMonth) {\n if(targetMonth < 0) {\n targetMonth = targetMonth % 12 + 12;\n }\n if(targetMonth % 12 != callDateGet(date, 'Month')) {\n callDateSet(date, 'Date', 0);\n }\n }", "function getDataNextPeriod(){\n $rootScope.selectedPeriod.setMonth($rootScope.selectedPeriod.getMonth( ) + 1 );\n $rootScope.getData();\n }", "function incrementDate() {\n setDate(addDays(date, 1));\n setPage(1);\n }", "clickNextMonthButton() {\n $(this.rootElement)\n .$$('button[data-id=button-icon-element]')[1]\n .click();\n }", "clickNextMonthButton() {\n $(this.rootElement)\n .$$('button[data-id=button-icon-element]')[1]\n .click();\n }", "function monthChange(btn){\n let newMonth = Toolbar.curTime.getMonth() + Number(btn.getAttribute(\"data-dir\"));\n let newYear = Toolbar.curTime.getFullYear();\n if(newMonth<0){\n newMonth = 11;\n newYear--;\n }\n else if(newMonth > 11){\n newMonth = 0;\n newYear++;\n }\n Toolbar.curTime.setMonth(newMonth);\n Toolbar.curTime.setFullYear(newYear);\n genDateTable();\n}", "function nextDay() {\n rightNow = SunCalcHelper.addDays(rightNow, 1);\n\n if (rightNow.getDate() !== new Date().getDate()) {\n Elements.decreaseDay.addEventListener('click', previousDay);\n Elements.decreaseDay.classList.remove('is-disabled');\n }\n\n getTimes(userPosition);\n updateCurrentMoment(rightNow);\n}", "prevMonth() {\n if (this.monthIndex==0){\n this.monthIndex = 11;\n this.month = monthsArray[this.monthIndex];\n this.year -= 1;\n } else {\n this.monthIndex -= 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function jumpToDate(ele){\r\n\tfor(var i=0; i<reminders.length; i++)\r\n\t\t{\r\n\t\tif(\treminders[i].rmId == ele)\r\n\t\t\t{\r\n\t\t\tvar reminderDate=reminders[i].rmDate.split(\"-\");\r\n\t\t\tintYear = reminderDate[0];\r\n\t\t\tintMonth = reminderDate[1];\r\n\t\t\tdocument.location = \"/personalReminders/monthview.php?date=01&month=\" + intMonth + \"&year=\" + intYear;\r\n\t\t\t}\r\n\t\t}\r\n}", "function addDaysFromCurrentMonth(){\n for(var i=1;i<=monthInfo[dateInfo.currentMonth][1];i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth, i);\n }\n}", "function nextView(e) {\n var target = e.target;\n var day = target.innerText;\n if (parseInt(day) < 10) {\n day = \"0\" + day;\n }\n var year = x.getFullYear().toString();\n var month = x.getMonth() + 1;\n if (month < 10) {\n month = \"0\" + (month.toString());\n }\n var date = year + month + day;\n localStorage.setItem(date, date);\n savedDate = date;\n addedDate = true;\n mainFunction();\n}", "function jumpMonthHead(obj){\r\nvar mId = obj.id;\r\nvar dateVal = 1;\r\nvar yearVal = document.getElementById(mId).innerHTML.substr(-4);\r\nvar monthStr = document.getElementById(mId).innerHTML.split(\" \");\r\nfor (var x=0; x<myMonths.length;x++)\r\n\t{\r\n\tif (myMonths[x] == monthStr[0])\r\n\t\t{\r\n\t\tmonthVal = x;\r\n\t\t}\r\n\t}\r\ndocument.location = \"/personalReminders/monthview.php?date=\" + dateVal + \"&month=\" + monthVal + \"&year=\" + yearVal;\r\n}", "function adjustMonth(value) {\n var date = new Date();\n var month = date.getMonth();\n date.setMonth(month + value);\n return date;\n}", "function onClickNextYear(nextYear, month, year) {\n nextYear.onclick = function() {\n selectCbo(parseInt(year.options[year.selectedIndex].value) + 1, \n month.options[month.selectedIndex].value, \n daysInMonth(month.options[month.selectedIndex].value, \n parseInt(year.options[year.selectedIndex].value) + 1));\n var newDate = new Date();\n newDate.setFullYear(parseInt(year.options[year.selectedIndex].value) + 1, \n month.options[month.selectedIndex].value,\n 1);\n updateYear(year, newDate);\n }\n}", "function getMonth(e) {\n import('./calendar.service.js').then((calendar) => {\n // Get new month from service.\n // renderMonth is called once when the script loads outside of an event handler,\n // so the first time it loads, e will be undefined. After that it'll come from\n // an event handler.\n if (e === undefined) {\n calendar.month.then(month => { renderMonth(month); });\n }\n else {\n // Shieldmeet only happens on a leap year, so we utilize the modulo to check this.\n if (e.target.id == \"next-month\") {\n calendar.nextMonth().then(month => {\n if (month.name == \"Shieldmeet\") {\n console.log('currentYear:', currentYear);\n if (currentYear.year % 4 != 0) {\n calendar.nextMonth().then(month => { renderMonth(month); });\n }\n else { renderMonth(month); }\n }\n else { renderMonth(month); }\n });\n }\n else {\n calendar.prevMonth().then(month => {\n if (month.name == \"Shieldmeet\") {\n if (currentYear.year % 4 != 0) {\n calendar.prevMonth().then(month => { renderMonth(month); });\n }\n else { renderMonth(month); }\n }\n else { renderMonth(month); }\n });\n \n }\n }\n \n });\n }", "function nextWeek () {\n\tif(day > daysInMonth-6) { // if there is less than 6 days to the end of the month\n\t\tday = 1; // change the day to first day of month\n\t\tnextMonth(); // calling a \"next month\" funtion to change the month\n\t} else { // if there is more than 6 days to the end of the month\n\t\tweekToDisplay[4]++; // show next week\n\t\tday+=7; // add 7 to current day\n\t}\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n}", "M (date) {\n return date.getMonth() + 1\n }", "setPrevMonth (prev, e) {\n let curDate = new Date(this.state.currentDate);\n let curMonth = curDate.getMonth();\n let newMonth = prev ? curMonth - 1 : curMonth + 1;\n curDate = new Date(curDate.setMonth(newMonth));\n this.setState({'currentDate': curDate});\n this.props.getDatesWithTasksByMonth(strftime('%Y-%m-%d', curDate), false);\n }", "function setToCurrentMonth(dc) {\n\n var y = new Date();\n var d2 = new Date(y.getFullYear(), y.getMonth(), 1, 0, 0, 0, 0);\n return setDateControl(dc, d2);\n}", "function setCurrentDay(month, year) {\n var viewMonth = $('.month').attr('data-month');\n var eventYear = $('.event-days').attr('date-year');\n if (parseInt(year) === yearNumber) {\n if (parseInt(month) === parseInt(viewMonth)) {\n $('tbody.event-calendar td[date-day=\"' + d.getDate() + '\"]').addClass('current-day');\n }\n }\n }", "function NextPeriod()\n{\n\tif(boolSaveChanges || bSelectChanged)\n\t\tSaveChanges(\"MoveToNextPeriod()\", \"Period\")\n\telse\n\t\tMoveToNextPeriod()\n}", "function UpdateDate(frequency, day, month, year){\n var yearWords = ['annual','annually', 'yearly', 'year']\n var quarterlyWords = ['quarterly', 'quarter', 'four months', '4 months']\n var monthlyWords = ['monthly', 'month']\n var int_year = Number(year)\n var int_month = Number(month)\n var updatedMonth\n var updatedYear\n var nextUpdated = day + ' ' + updatedMonth + ' ' + updatedYear\n\n function monthUpdates(int_month, frequency) {\n if (int_month + frequency > 12) {\n updatedYear = int_year + 1\n updatedMonth = `0${(int_month + frequency)% 12}`\n nextUpdated = day + ' ' + monthNames[updatedMonth] + ' ' + updatedYear\n } else if (int_month + frequency == 12) {\n nextUpdated = day + ' ' + monthNames['12'] + ' ' + year\n } else {\n updatedMonth = `0${(int_month + frequency)}`\n nextUpdated = day + ' ' + monthNames[updatedMonth] + ' ' + year\n }\n return nextUpdated\n }\n\n if (yearWords.includes(frequency.toLowerCase())) {\n updatedYear = int_year + 1\n nextUpdated = day + ' ' + monthNames[month] + ' ' + updatedYear\n } else if (quarterlyWords.includes(frequency.toLowerCase())) {\n monthUpdates(int_month, 4)\n } else if (monthlyWords.includes(frequency.toLowerCase())) {\n monthUpdates(int_month, 1)\n } else {\n nextUpdated = ''\n }\n return nextUpdated\n}", "function moveOneDay(date) {date.setTime((date.getTime() + 24 * 60 * 60 * 1000)); }", "function pre_nextYear(year) {\n\tcurrent_year = parseInt(current_year) + parseInt(year);\n\t\n\t\n\tif(current_year < 1920){\n\t\tcurrent_year = 2100;\n\t}\n\telse{\n\t\tif(current_year > 2100){\n\t\t\tcurrent_year = 1920;\n\t\t}\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function adjustDayOfMonth(self) {\n var fields = self.fields;\n var year = fields[YEAR];\n var month = fields[MONTH];\n var monthLen = getMonthLength(year, month);\n var dayOfMonth = fields[DAY_OF_MONTH];\n if (dayOfMonth > monthLen) {\n self.set(DAY_OF_MONTH, monthLen);\n }\n }", "function adjustDayOfMonth(self) {\n var fields = self.fields;\n var year = fields[YEAR];\n var month = fields[MONTH];\n var monthLen = getMonthLength(year, month);\n var dayOfMonth = fields[DAY_OF_MONTH];\n if (dayOfMonth > monthLen) {\n self.set(DAY_OF_MONTH, monthLen);\n }\n }", "function changeByMonth(month, year, back) {\n back = back || false;\n var numDaysInMo,\n addend = 1;\n if (back) {\n addend = -1;\n }\n month = month + addend;\n if ((month < 0) || (month === 12)) {\n month = (month < 0) ? (month = 11) : month = 0;\n year = year + addend;\n }\n numDaysInMo = daysInMonth(month, year);\n return {month: month, year: year, numDaysInMo: numDaysInMo};\n }", "function updateCurrentMonth() {\n updateDays();\n currentM.textContent = months[month];\n}", "function setMonth(date, month) {\n return addMonths(date, month - date.getMonth());\n}", "function next() {\r\n saveYearText();\r\n calendar.innerHTML = \"\";\r\n generateYear(++currentYear);\r\n loadFromCalendarData();\r\n}", "function backMonth(){\n toMonth=globalMonth.prevMonth();\n $( document ).ready(load);\n}", "function changeMonth(){\n\tvar elements = document.getElementsByTagName(\"a\");\n\tfor(var i=0; i<elements.length; i++){\n\t\telements[i].onclick = function(){\n\t\t\ttempDate=getTempDate();\n\t\t\ttempDate.setMonth(this.id);\n\t\t\tdrawCalendar(tempDate);\n\t \t}\n\t}\n}", "function getCurrentMonth() {\r\n\t\tvar d = new Date();\r\n\t\treturn d.getMonth() + 1;\r\n\t}", "function loadMonth(e, el, datepicker, chosendate) {\n\n // reference our years for the nextMonth and prevMonth buttons\n var mo = jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex;\n var yr = jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex;\n var yrs = jQuery(\"select[name=year] option\", datepicker).get().length;\n\n // first try to process buttons that may change the month we're on\n if (e && jQuery(e.target).hasClass('prevMonth')) {\n if (0 == mo && yr) {\n yr -= 1;\n mo = 11;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 11;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo -= 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n } else if (e && jQuery(e.target).hasClass('nextMonth')) {\n if (11 == mo && yr + 1 < yrs) {\n yr += 1;\n mo = 0;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 0;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo += 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n }\n\n // maybe hide buttons\n if (0 == mo && !yr) jQuery(\"span.prevMonth\", datepicker).hide();\n else jQuery(\"span.prevMonth\", datepicker).show();\n if (yr + 1 == yrs && 11 == mo) jQuery(\"span.nextMonth\", datepicker).hide();\n else jQuery(\"span.nextMonth\", datepicker).show();\n\n // clear the old cells\n var cells = jQuery(\"tbody td\", datepicker).unbind().empty().removeClass('date');\n\n // figure out what month and year to load\n var m = jQuery(\"select[name=month]\", datepicker).val();\n var y = jQuery(\"select[name=year]\", datepicker).val();\n var d = new Date(y, m, 1);\n var startindex = d.getDay();\n var numdays = monthlengths[m];\n\n // http://en.wikipedia.org/wiki/Leap_year\n if (1 == m && ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)) numdays = 29;\n\n // test for end dates (instead of just a year range)\n if (opts.startdate.constructor == Date) {\n var startMonth = opts.startdate.getMonth();\n var startDate = opts.startdate.getDate();\n }\n if (opts.enddate.constructor == Date) {\n var endMonth = opts.enddate.getMonth();\n var endDate = opts.enddate.getDate();\n }\n\n // walk through the index and populate each cell, binding events too\n for (var i = 0; i < numdays; i++) {\n\n var cell = jQuery(cells.get(i + startindex)).removeClass('chosen');\n\n // test that the date falls within a range, if we have a range\n if (\n (yr || ((!startDate && !startMonth) || ((i + 1 >= startDate && mo == startMonth) || mo > startMonth))) &&\n (yr + 1 < yrs || ((!endDate && !endMonth) || ((i + 1 <= endDate && mo == endMonth) || mo < endMonth)))) {\n\n cell\n .text(i + 1)\n .addClass('date')\n .hover(\n function () {\n jQuery(this).addClass('over');\n },\n function () {\n jQuery(this).removeClass('over');\n })\n .click(function () {\n var chosenDateObj = new Date(jQuery(\"select[name=year]\", datepicker).val(), jQuery(\"select[name=month]\", datepicker).val(), jQuery(this).text());\n closeIt(el, datepicker, chosenDateObj);\n });\n\n // highlight the previous chosen date\n if (i + 1 == chosendate.getDate() && m == chosendate.getMonth() && y == chosendate.getFullYear()) cell.addClass('chosen');\n }\n }\n }", "MM (date) {\n return pad(date.getMonth() + 1)\n }", "function getplus() {\n month++;\n if (month == 12) {\n year++;\n month = 0;\n }\n htmlCalender.html(\"\");\n createcalender(year, month);\n}", "function goToNextPage() {\n updateCurrentPage((page) => page + 1);\n }", "function _isNextDay(d1, d2) {\n if (!_isSameMonth(d1, d2) && !_isNextMonth(d1, d2)) {\n return false;\n }\n return _getDaysDif(d1, d2) === 1;\n }", "function month(){\n step=1.2;\n timeSelector=\"month\";\n resetGraph();\n}", "function datem(a)\n {\n month=a+month;\n \n if(month == \"0\")\n {\n \n month=12;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"December\";\n year=year-1;\n document.getElementById(\"year12\").innerHTML=year;\n }\n else if(month==\"13\")\n {\n \n month=1;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"January\";\n year=year+1;\n document.getElementById(\"year12\").innerHTML=year;\n \n }\n \n \n if(month==\"1\")\n {\n document.getElementById(\"month12\").innerHTML=\"January\";\n daychange();\n }\n \n else if(month==\"2\")\n {\n document.getElementById(\"month12\").innerHTML=\"February\";\n daychange();\n }\n else if(month==\"3\")\n {\n document.getElementById(\"month12\").innerHTML=\"March\";\n daychange();\n }\n \n else if(month==\"4\")\n {\n document.getElementById(\"month12\").innerHTML=\"April\";\n daychange();\n }\n else if(month==\"5\")\n {\n document.getElementById(\"month12\").innerHTML=\"May\";\n daychange();\n }\n else if(month==\"6\")\n {\n document.getElementById(\"month12\").innerHTML=\"June\";\n daychange();\n }\n else if(month==\"7\")\n {\n document.getElementById(\"month12\").innerHTML=\"July\";\n daychange();\n }\n else if(month==\"8\")\n {\n document.getElementById(\"month12\").innerHTML=\"August\";\n daychange();\n }\n else if(month==\"9\")\n {\n document.getElementById(\"month12\").innerHTML=\"September\";\n daychange();\n }\n else if(month==\"10\")\n {\n document.getElementById(\"month12\").innerHTML=\"October\";\n daychange();\n }\n else if(month==\"11\")\n {\n document.getElementById(\"month12\").innerHTML=\"November\";\n daychange();\n }\n else if(month==\"12\")\n {\n document.getElementById(\"month12\").innerHTML=\"December\";\n daychange();\n }\n \n \n }" ]
[ "0.8419958", "0.82215583", "0.80941474", "0.80797505", "0.8067942", "0.7876407", "0.7872111", "0.77928907", "0.77617645", "0.76835895", "0.76754457", "0.7644924", "0.7587343", "0.7528253", "0.7501121", "0.7477259", "0.7239996", "0.72141606", "0.7198018", "0.7176866", "0.7127136", "0.7124747", "0.7124747", "0.71144456", "0.6993869", "0.6962887", "0.6960696", "0.69369644", "0.6915401", "0.6872881", "0.68627566", "0.6847379", "0.68471736", "0.68101424", "0.6765128", "0.67495924", "0.6707227", "0.6627948", "0.6616196", "0.66113234", "0.65636706", "0.65349156", "0.651219", "0.6499293", "0.6479946", "0.64495987", "0.63930047", "0.63578475", "0.6353156", "0.6346262", "0.63371414", "0.63371414", "0.6326672", "0.6318009", "0.62988347", "0.6283289", "0.6233105", "0.62165654", "0.6212283", "0.62096393", "0.62096393", "0.6207225", "0.6193124", "0.617643", "0.617643", "0.6175181", "0.61027104", "0.60954976", "0.6094034", "0.60316616", "0.6026294", "0.6007985", "0.6003688", "0.5977903", "0.5972553", "0.5960104", "0.5938913", "0.59179115", "0.59102803", "0.5905301", "0.5879379", "0.586966", "0.58679944", "0.5867494", "0.5867119", "0.5867119", "0.5865744", "0.58593106", "0.58543503", "0.58473647", "0.58472836", "0.5847057", "0.5845863", "0.58442247", "0.5837871", "0.5817405", "0.58018655", "0.57917947", "0.5785221", "0.57706" ]
0.7657514
11
Function to move to next month
function previousMonth(){ clearCalendar(); var newMonth =""; var newYear=0; if (displayedMonth == 0) { //console.log("IF! 0"); newMonth = 11; newYear = displayedYear - 1; displayedMonth = 11; displayedYear = displayedYear - 1; } else { //console.log("ELSE!"); newMonth = displayedMonth - 1; displayedMonth = displayedMonth - 1; newYear = displayedYear; } // console.log("newMonth: " + newMonth); // console.log("newYear: " + newYear); //console.log("displayedMonth: " + displayedMonth); //console.log("displayedYear: " + displayedYear); printCalendar(newYear, newMonth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextMonth(){\n setDate(1);\n getStartDay();\n renderDays();\n calendarMonthAndYear.innerText = months[setCal.month] + \" \" + setCal.year;\n }", "function nextMonth() {\n // -- add one month to the viewDate --/\n $directive.viewDate.setDate(1);\n $directive.viewDate.setMonth($directive.viewDate.getMonth() + 1);\n // -- reload the viewdate :P --/\n setViewDate($directive.viewDate);\n }", "function next(){\n month++;\n if(month==12){\n month=0;\n year++;\n }\n buildCalendar();\n}", "function nextMonth() {\n month++;\n if (month > 11) {\n alert('Sei arrivato alla fine del calendario.');\n month = 11;\n } else {\n printMonth(month);\n addHolidays(month);\n }\n }", "nextMonth() {\n if (this.monthIndex==11){\n this.monthIndex = 0;\n this.year += 1;\n this.month = monthsArray[this.monthIndex];\n } else {\n this.monthIndex += 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function nextMonth(event) {\n event.preventDefault();\n\n if (newselectedMonth == 11) {\n newselectedMonth = 0;\n newselectedYear = newselectedYear + 1;\n }\n else {\n newselectedMonth = newselectedMonth + 1;\n }\n createMonth(newselectedMonth, newselectedYear);\n console.log(\"one swipeleft\");\n }", "function nextMonth(){\n if(data.calendar.month != 11 || data.calendar.year == 2018 || data.calendar.year == 2019){\n data.calendar.month++;\n }\n if(data.calendar.month >= 12){\n data.calendar.month = 0;\n data.calendar.year++;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}", "nextMonth(){\n return this.addMonths(1);\n }", "function nextMonth () {\n\tmonth = month + 1; // add one to current month\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n\tchangeWeeksDisplay(\"flex\"); // show all weeks except model one (= view: month) \n\tdocument.getElementById(\"currentMonth\").innerHTML = months[month].name; // change displayed month name\n\taddDayClickEvent(); // add \"click\" event to new calendar days elements\n\taddWeekClickEvent(); // add \"click\" event to new calendar weeks elements\n}", "function nextDate() {\n var year = x.getFullYear();\n var month = x.getMonth();\n if (month == 12) {\n month = 0;\n year += 1;\n }\n x = new Date(year, (month + 1), 1);\n displayDates();\n}", "function pre_nextMonth(month) {\n\tcurrent_month = parseInt(current_month) + parseInt(month);\n\t\n\t\n\tif(current_month > 11){\n\t\tcurrent_month = 0;\n\t\tcurrent_year+= parseInt(1);\n\t}\n\telse{\n\t\tif(current_month < 0){\n\t\t\tcurrent_month = 11;\n\t\t\tcurrent_year -= parseInt(1);\n\t\t}\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function nextMonth(){\n\tclearCalendar();\n\tvar newMonth =\"\";\n\tvar newYear=0;\n\tif (displayedMonth == 11) {\n\t newMonth = 0;\n\t newYear = displayedYear + 1;\n \t displayedMonth = 0;\n \t displayedYear = displayedYear + 1;\n\t} else {\n\t newMonth = displayedMonth+ 1;\n \t displayedMonth = displayedMonth + 1;\n newYear = displayedYear;\n\t}\n\t//console.log(\"newMonth: \" + newMonth);\n\t//console.log(\"newYear: \" + newYear);\n\t//console.log(\"displayedMonth: \" + displayedMonth);\n\t//console.log(\"displayedYear: \" + displayedYear);\n\tprintCalendar(newYear, newMonth);\n}", "function scheduleNextMonth() {\n withScheduler(\n 'scheduleNextMonth',\n () => {\n error('schedule next month no longer supported.');\n });\n }", "function onNextMonth(event) {\n currentDateTime.setMonth(currentDateTime.getMonth() + 1);\n initCalendar();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "function getNextMonth() {\n\ttempDate = getTempDate();\n\n var year = tempDate.getFullYear();\n var month = tempDate.getMonth();\n var date = tempDate.getDate();\n\n if (month == 11) {\n \tyear += 1;\n tempDate.setFullYear(year, 0, 1);\n }\n else {\n \tmonth += 1;\n tempDate.setMonth(month, 1);\n }\n\n var nextDays = getDays(tempDate);\n\n if(date >= nextDays){\n \tdate = nextDays;\n }\n tempDate.setDate(date);\n\n return tempDate;\n}", "function setToNextMonth(dc) {\n\n var y = new Date();\n var my = (y.getMonth() + 1) / 12; // number of years to add for next month\n var m = (y.getMonth() + 1) % 12; // next month\n var d2 = new Date(y.getFullYear() + my, m, 1, 0,0,0,0);\n return setDateControl(dc, d2);\n}", "function nextButton() {\n\tvar nextMonth = getNextMonth();\n\tdrawCalendar(nextMonth);\n }", "function forwardMonth(){\n toMonth=globalMonth.nextMonth();\n $( document ).ready(load);\n}", "function next(){\n if(dateInfo.currentMonth!=11){\n dateInfo.currentMonth++;\n }\n else{\n dateInfo.currentYear++;\n dateInfo.currentMonth=0;\n }\n while (calendar.firstChild) {calendar.removeChild(calendar.firstChild);}\n createCalendar();\n document.documentElement.scrollTop = 0; \n}", "function addDaysFromNextMonth(){\n if(new Date(dateInfo.currentYear, dateInfo.currentMonth, monthInfo[dateInfo.currentMonth][1],0,0,0,0).getDay()!=6){\n var day = new Date(dateInfo.currentYear, dateInfo.currentMonth+1, 1,0,0,0,0).getDay();\n var j=1;\n for(i=day;i<=6;i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth+1, j++);\n }\n }\n}", "handleNextMonth() {\n this.currentYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n this.currentMonth = (this.currentMonth + 1) % 12;\n console.log(\n \"Handle Next --> \" +\n this.currentMonth +\n \"this.currentYear\" +\n this.currentYear\n );\n const currMonth = this.monthsText[this.months[this.currentMonth]];\n this.currentMonthText = currMonth.charAt(0).toUpperCase() + currMonth.slice(1).toLowerCase();\n this.value = this.currentYear;\n this.options = [{ label: this.currentYear, value: this.currentYear }];\n this.showCalendar(1, this.currentMonth, this.currentYear);\n this.currentSelectedDate.length > 0 ? this.handleSelectedDate(this.currentSelectedDate) : '';\n }", "function cal_next()\n{\n if(curr_month < 11 )\n {\n curr_month = curr_month + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n else if(curr_month === 11)\n {\n curr_month = 0;\n curr_year = curr_year + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n // display_cal();\n}", "nextClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, 1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);\n }", "nextClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, 1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? 1 : yearsPerPage);\n }", "next() {\n let {month} = this.state;\n this.setState({\n month: month.add(1, 'month'),\n });\n }", "function handleNextClick() {\n if(view === 'month') {\n setYear(year + 1);\n return; \n }\n\n if(view === 'year') {\n setYear(year + YEARS_SHOW);\n return;\n }\n\n const previousMont = getNextMonth(month, year);\n setMonth(previousMont.month);\n\n if(previousMont.year === year) return;\n setYear(previousMont.year);\n }", "function getNextDate(date) {\n var day = date.day + 1; //date in increased\n var month = date.month;\n var year = date.year;\n var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if(month===2)//if month is feb check leapyear or not\n {\n if(leapyear(year))\n {\n if(day>29)\n {\n day=1;\n month++;\n }\n }\n else{\n if(day>28)\n {\n day=1;\n month++;\n }\n }\n }\nelse { //for other month increament if the day >month array\n if (day > daysInMonth[month - 1]) {\n day = 1;\n month++;\n\n }\n}\nif(month>12) //if dec then it may go to 13 14 for that we increment the year and set month to 1\n{\n month=1;\n year++;\n}\nreturn { // return the increment date\n day:day,\n month:month,\n year:year,\n}\n}", "function fillNext() {\n const nextMonth = moment(currentDate).add(1, 'month');\n const nextStartDay = nextMonth.startOf('month').day();\n for (let i = nextStartDay; i < 14; i++) {\n dateArray.push(i - nextStartDay + 1)\n }\n \n }", "function setNextMonthData() {\n if (self.currentMonthIndex < 12) {\n self.currentMonthIndex++;\n } else {\n self.currentMonthIndex = 1;\n }\n\n for (var i = 0; i < self.budgetMonths.length; i++) {\n if (self.currentMonthIndex == self.budgetMonths[i].month_id) {\n self.currentMonthData = self.budgetMonths[i];\n self.currentMonth = self.budgetMonths[i].month;\n }\n }\n } // end setNextMonthData", "function setNextMonthYear() {\n if (thisWeekMonth === \"Dec\") {\n thisWeekMonth = \"Jan\";\n thisWeekYear = (Number(thisWeekYear) + 1).toString();\n } else {\n thisWeekMonth = months.all[months.all.indexOf(thisWeekMonth) + 1];\n }\n }", "function next()\n{\nnextdate= getSelectedDate();\nlocation.reload();\nsetSelectedMonth(1,nextdate);\n}", "function onClickNextMonth(nextMonth, month, year) {\n nextMonth.onclick = function() {\n selectCbo(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) + 1, \n daysInMonth(parseInt(month.options[month.selectedIndex].value) + 1, \n year.options[year.selectedIndex].value));\n var newDate = new Date();\n newDate.setFullYear(year.options[year.selectedIndex].value, \n parseInt(month.options[month.selectedIndex].value) + 1,\n 1);\n updateMonth(month, newDate);\n updateYear(year, newDate);\n }\n}", "function generateNextMonth(currentYear){\n\n\tcalendar.empty();\n\tcurrentMonthIndex++;\n\tif(currentMonthIndex >= 9 && currentMonthIndex <=12)\n\t\tyearIndex = currentYear-1;\n\n\telse if(currentMonthIndex > 12) {\n\t\tcurrentMonthIndex = 1;\n\t\tyearIndex = currentYear;\n\t}\n\t\telse\n\t\t\tyearIndex = currentYear;\n\n\tvar calObjt = createCalendar(currentMonthIndex, yearIndex);\n\tvar rowDays = generateDayRow();\n\tdocument.getElementById(\"calendar-month-year\").innerHTML = month_name[currentMonthIndex-1]+\" \"+yearIndex;\n\tdocument.getElementById(\"calendar-dates\").appendChild(rowDays); \n\tdocument.getElementById(\"calendar-dates\").appendChild(calObjt);\n\thighlightDateWithEvent(currentMonthIndex);\n}", "function jumpToMonth(_show, _year, _month) {\n\t\tvar curr_m = flags.wrap.attr('data-current-month');\n\t\tvar curr_y = flags.wrap.attr('data-current-year');\n\t\tvar show = _show;\n\t\tif(!show){\n\t\t\ttry{\n\t\t\t\tif(Number(_year) == Number(curr_y) && Number(_month) == Number(curr_m)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(Number(_year) < Number(curr_y)){\n\t\t\t\t\tshow = 'prev';\n\t\t\t\t}else{\n\t\t\t\t\tif(Number(_month) < Number(curr_m)){\n\t\t\t\t\t\tshow = 'prev';\n\t\t\t\t\t}else{\n\t\t\t\t\t\tshow = 'next';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(err){}\n\t\t}\n\t\t\n\t\tif (show == ('next')) {\n\t\t\tdateSlider(\"next\", _year, _month);\n\t\t\tvar lastMonthMove = '-=' + flags.directionLeftMove;\n\n\t\t} else {\n\t\t\tdateSlider(\"prev\", _year, _month);\n\t\t\tvar lastMonthMove = '+=' + flags.directionLeftMove;\n\t\t}\n\n\t\tflags.wrap.find('.eventsCalendar-monthWrap.oldMonth').animate({\n\t\t\topacity: eventsOpts.moveOpacity,\n\t\t\tleft: lastMonthMove\n\t\t}, eventsOpts.moveSpeed, function() {\n\t\t\tflags.wrap.find('.eventsCalendar-monthWrap.oldMonth').remove();\n\t\t});\n\t\t//showMessageBox();\n\t\tshowEvents();\n\t}", "function interfaceNext ( ) {\n\t\t\tif ( !CAN_NEXT ) return;\n\t\t\tCURRENT.addMonths(1);\n\t\t\tgenerateCalendarForCurrent();\n\t\t\temitEvent('Clear');\n\t\t}", "function calNext()\n{\nnextdate= getCalValue();\nlocation.reload();\nsetSelectedMonth(1,nextdate);\n}", "function _isNextMonth(d1, d2) {\n if (_isSameYear(d1, d2)) {\n return d2.getMonth() - d1.getMonth() === 1;\n } else if (_isNextYear(d1, d2)) {\n return d1.getMonth() === 11 && d2.getMonth() === 0;\n }\n return false;\n }", "function advance_month(a_value) {\n // Increment/Decrement the month\n calendar_date.setMonth(calendar_date.getMonth() + a_value)\n\n // Format the new date to only have the month name and year (e.g. January 2017)\n var current_calendar_date = formatted_date(calendar_date);\n\n // Display the formatted date on the calendar title\n document.getElementById(\"month_title\").innerHTML = formatted_date(calendar_date);\n\n // Set the current_plannedMonth from the database?\n firebase_database.ref('Users_PlannedMonths/' + user.uid).orderByChild(\"formatted_date\").equalTo(formatted_date(calendar_date)).once(\"value\", function(snapshot) {\n var plannedMonths = snapshot.val();\n if (isValueSet(plannedMonths)) {\n for (var plannedMonth_record_id in plannedMonths) {\n if (plannedMonths.hasOwnProperty(plannedMonth_record_id)) {\n if (plannedMonths[plannedMonth_record_id].formatted_date == formatted_date(calendar_date)) {\n current_plannedMonth = { id: plannedMonth_record_id, formatted_date: plannedMonths[plannedMonth_record_id].formatted_date };\n }\n }\n }\n } else {\n current_plannedMonth = { id: null, formatted_date: null };\n }\n })\n\n // Repopulate the calander\n populate_calendar_days();\n}", "_moveToToStep() {\n let [,month] = get(this, '_dates') || Ember.A();\n if (month) {\n var startOfMonth = new Date(month.getFullYear(), month.getMonth(), 1);\n set(this, 'currentMonth', startOfMonth);\n }\n set(this, 'isToStep', true);\n }", "function NextDay()\n{\n\tif (boolSaveChanges || bSelectChanged)\n\t{\n\t\tSaveChanges(\"MoveToNextDay()\", \"Daily\");\n\t}\n\telse\n\t{\n\t\tMoveToNextDay();\n\t}\n}", "function gotoMonth(index, recursive) {\n if (index == -1 && (+date.getMonth()+1 == minLimits[2] && date.getFullYear() == minLimits[1])) {\n return;\n } else\n if (index == 1 && (+date.getMonth()+1 == maxLimits[2] && date.getFullYear() == maxLimits[1])) {\n return;\n }\n\n date.setDate(1);\n date.setMonth(date.getMonth()+index);\n date.setFullYear(date.getFullYear());\n\n build();\n\n options.onChange && options.onChange.call(Datepicker, date);\n\n if(recursive && isMouseDown) {\n setTimeout(function() {\n gotoMonth(index, recursive);\n }, 50);\n }\n }", "function nextMonthDay(dayName, val) {\n\n if ((timeAdjEle[0] == dayName) || (timeAdjEle[1] == dayName)) {\n for (k = 0; k < timeElements.length; k++) {\n if (timeElements[k] != \"MONTH\") {\n day = dayFinder(timeElements[k]);\n for (n = 1; n <= 31; n++) {\n if (val == \"0\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 2, -n + 1);\n\n }\n if (val == \"1\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n);\n }\n if (val == \"2\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 8);\n }\n if (val == \"3\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 15);\n }\n if (val == \"4\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 21);\n }\n if (val == \"5\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 28);\n }\n var timeFind2 = timeFind1.getDay();\n\n if (day == timeFind2) {\n finalTime = timeFind1;\n displayDate(finalTime);\n return;\n }\n }\n }\n }\n }\n}", "nextMonthComps() {\n if (this.month === 12) return {\n days: _daysInMonths[0],\n month: 1,\n year: this.year + 1,\n };\n return {\n days: (this.month === 2 && this.isLeapYear) ? 29 : _daysInMonths[this.month],\n month: this.month + 1,\n year: this.year,\n };\n }", "_moveToFromStep() {\n let [month] = get(this, '_dates') || Ember.A();\n if (month) {\n var startOfMonth = new Date(month.getFullYear(), month.getMonth(), 1);\n set(this, 'currentMonth', startOfMonth);\n }\n set(this, 'isToStep', false);\n }", "function nextDay(date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + 1)\n }", "function insertNextMonth(thisMonthStarts){\r\n\tvar nextMonthStarts = (new Date(year, month, amountOfDays(year, month+1))).getDay()\r\n\tfor (let j = 0; j < amountOfCells - ( thisMonthStarts + amountOfDays ( year, month+1 )); j++){\r\n\t\tvar dayElement = document.createElement('div');\r\n\t\tdayElement.innerHTML = j+1;\r\n\t\tdayElement.style.color = \"var(--lighter-color)\"\r\n\t\tdocument.getElementById('month').appendChild(dayElement);\r\n\t}\r\n}", "function Calendar_switchMonth(month) {\n\tthis.dtCurrentDate.setMonth(month, 1);\t\t\t\t// reset day to 1\n\tthis.dtStartDay = new Date(this.dtCurrentDate);\n}", "function bsDpickerSetPrevNextMonth(step) {\n let currentMonth = currentSelectedDate.getMonth();\n currentMonth += step;\n currentSelectedDate.setMonth(currentMonth);\n bsDatepick.datepicker(\"update\", currentSelectedDate);\n selectMonths.selectpicker(\"val\", currentSelectedDate.getMonth());\n selectYears.selectpicker(\"val\", currentSelectedDate.getFullYear());\n}", "function getHeadOfNextMonth(date) {\n\tvar days = getDays(date);\n var firstDayOfMonth = getFirstDayOfMonth(date);\n var verbose = firstDayOfMonth;\n\tvar elements=[];\n var line = 0;\n\n for (var i = 1; i <= days; i++) {\n \tif ((i + verbose) % 7 == 0) {\n \tline++;\n }\n }\n\n var year = date.getFullYear();\n var month = date.getMonth();\n if (month == 11) {\n \tyear += 1;\n month = 0;\n }\n else {\n \tmonth += 1;\n }\n\n var nextMonth = new Date(year, month);\n var firstDayOfNextMonth = getFirstDayOfMonth(nextMonth);\n verbose = firstDayOfNextMonth;\n\n if (line == 5 || line == 4) {\n \tfor (var i = 1; i <= 7 - verbose; i++) {\n\t\t\telements.push(Util.td(i, \"next\", \"\"));\n }\n }\n\treturn elements;\n}", "function dateMonthFwd(y) {\n\n var m = (y.getMonth() + 1) % 12; // set m to the correct next month value\n var my = (y.getMonth() + 1) / 12; // number of years to add for next month\n var d = y.getDate(); // this is the target date\n // console.log('dateMonthFwd: T1 - d = ' + d);\n\n // If there is a chance that there is no such date next month, then let's make sure we\n // do this right. If the date is > than the number of days in month m then snap as follows:\n // if d is valid in month m then use d, otherwise snap to the end of the month.\n if (d > 28) {\n var d0 = new Date(y.getFullYear() + my, m, 0, 0, 0, 0);\n var daysInCurrentMonth = d0.getDate();\n var m2 = (y.getMonth() + 2) % 12; // used to find # days in month m\n var m2y = (y.getMonth() + 2) / 12; // number of years to add for month m\n var d3 = new Date(y.getFullYear() + m2y, m2, 0, 0, 0, 0);\n var daysInNextMonth = d3.getDate();\n if (d >= daysInNextMonth || d == daysInCurrentMonth) { d = daysInNextMonth; }\n }\n // console.log('dateMonthFwd: m = ' + m + ' d = ' + d);\n var d2 = new Date(y.getFullYear() + my, m, d, 0, 0, 0);\n return d2;\n}", "function incrementCurrentDate(increment) {\n\n\tlet currentDate = new Date();\n\tlet daysInMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).getDate();\n\tlet incrementDate = currentDate.getDate() + increment;\n\n\tif(incrementDate > daysInMonth) {\n\t\tincrementDate = incrementDate % daysInMonth;\t\t\n\t\tcurrentDate.setMonth(currentDate.getMonth() + 1);\n\t\t\n\t}\n\n\tcurrentDate.setDate(incrementDate);\n\n\treturn currentDate;\n}", "getNextMonthComps(month, year) {\n if (month === 12) return this.getMonthComps(1, year + 1);\n return this.getMonthComps(month + 1, year);\n }", "getNextMonthComps(month, year) {\n if (month === 12) return this.getMonthComps(1, year + 1);\n return this.getMonthComps(month + 1, year);\n }", "async getNextMonthCalendar(page) {\n loadPage(page);\n }", "function next_date(tanggal, bulan, tahun){\n var months = [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ];\n var selectedMonthName = months[bulan-1];\n var combine = selectedMonthName + '/' + tanggal.toString() + '/' + tahun.toString();\n var d = new Date(combine);\n d.setDate(d.getDate() + 1);\n return `${d.getDate()} ${months[d.getMonth()]} ${d.getFullYear()}`;\n}", "function addMonth() {\r\n if (this.date.getMonth() >= 11) {\r\n this.date = new Date((this.date.getFullYear() + 1), 00, 01);\r\n } else {\r\n this.date = new Date(this.date.getFullYear(), (this.date.getMonth() + 1), 01);\r\n }\r\n document.getElementById(\"body\").className+=\" animated--hide\";\r\n setTimeout(function(){ initCalendar(this.date); }, 200);\r\n}", "function setSelectedMonth()\n{\nptr= arguments[0];\nnew_date= arguments[1];\nptr=new_date.getMonth()+ptr;\nindex=ptr\nif(index == 12)\n index = 0;\nelse if(index == -1)\n index = 11;\nisLeap=leapYear(new_date.getFullYear)\nif(isLeap)\n new_date.setDate(calLeapPeriods[index]);\nelse\n new_date.setDate(calPeriods[index]);\nnew_date.setMonth(ptr);\n}", "function moveDate(para) {\n if (para == \"prev\") {\n dt.setMonth(dt.getMonth() - 1);\n renderDate();\n } else {\n (para == \"next\")\n dt.setMonth(dt.getMonth() + 1);\n }\n renderDate();\n // We use the renderDate function in here, because the moveDate function needs to have this reference because the other attributed from the calendar is declared inside this function. And eventhough the tuborg klamme had continued, we have not declared an onclick function in the prevDate and nextDate object constructor.\n}", "function changeNextDate() {\n var setDateVal = $('#microbundle_fireinspection_inspectionDate').val();\n var setDate = new Date(setDateVal);\n var nextDate = $('#microbundle_fireinspection_nextInspectionDate');\n switch ($(\"input[type='radio']:checked\").val()) {\n case '' :\n nextDate.prop(\"readonly\", false);\n break;\n case '3' :\n setDate.setMonth(setDate.getMonth() + 3);\n nextDate.val(setDate.toISOString().split('T')[0]);\n nextDate.prop(\"readonly\", true);\n break;\n case '6' :\n setDate.setMonth(setDate.getMonth() + 6);\n nextDate.val(setDate.toISOString().split('T')[0]);\n nextDate.prop(\"readonly\", true);\n break;\n case '12' :\n setDate.setMonth(setDate.getMonth() + 12);\n nextDate.val(setDate.toISOString().split('T')[0]);\n nextDate.prop(\"readonly\", true);\n break;\n }\n\n}", "function monthCycler (month) {\n //cycle through days of the month\n for (let i = 0 ; i < months[currentMonth] ; i++) {\n //Check if it's one of our sundays and increment the count if true\n if ((i === 0) && (currentDay === 6)) {\n specialSundays++;\n }\n currentDay = weekCycler(currentDay);\n }\n //increment currentMonth\n month++;\n if (month > 11) {\n month = 0;\n }\n return month;\n}", "function checkMonthTraversal(date, targetMonth) {\n if(targetMonth < 0) {\n targetMonth = targetMonth % 12 + 12;\n }\n if(targetMonth % 12 != callDateGet(date, 'Month')) {\n callDateSet(date, 'Date', 0);\n }\n }", "function checkMonthTraversal(date, targetMonth) {\n if(targetMonth < 0) {\n targetMonth = targetMonth % 12 + 12;\n }\n if(targetMonth % 12 != callDateGet(date, 'Month')) {\n callDateSet(date, 'Date', 0);\n }\n }", "function getDataNextPeriod(){\n $rootScope.selectedPeriod.setMonth($rootScope.selectedPeriod.getMonth( ) + 1 );\n $rootScope.getData();\n }", "function incrementDate() {\n setDate(addDays(date, 1));\n setPage(1);\n }", "clickNextMonthButton() {\n $(this.rootElement)\n .$$('button[data-id=button-icon-element]')[1]\n .click();\n }", "clickNextMonthButton() {\n $(this.rootElement)\n .$$('button[data-id=button-icon-element]')[1]\n .click();\n }", "function monthChange(btn){\n let newMonth = Toolbar.curTime.getMonth() + Number(btn.getAttribute(\"data-dir\"));\n let newYear = Toolbar.curTime.getFullYear();\n if(newMonth<0){\n newMonth = 11;\n newYear--;\n }\n else if(newMonth > 11){\n newMonth = 0;\n newYear++;\n }\n Toolbar.curTime.setMonth(newMonth);\n Toolbar.curTime.setFullYear(newYear);\n genDateTable();\n}", "function nextDay() {\n rightNow = SunCalcHelper.addDays(rightNow, 1);\n\n if (rightNow.getDate() !== new Date().getDate()) {\n Elements.decreaseDay.addEventListener('click', previousDay);\n Elements.decreaseDay.classList.remove('is-disabled');\n }\n\n getTimes(userPosition);\n updateCurrentMoment(rightNow);\n}", "prevMonth() {\n if (this.monthIndex==0){\n this.monthIndex = 11;\n this.month = monthsArray[this.monthIndex];\n this.year -= 1;\n } else {\n this.monthIndex -= 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function jumpToDate(ele){\r\n\tfor(var i=0; i<reminders.length; i++)\r\n\t\t{\r\n\t\tif(\treminders[i].rmId == ele)\r\n\t\t\t{\r\n\t\t\tvar reminderDate=reminders[i].rmDate.split(\"-\");\r\n\t\t\tintYear = reminderDate[0];\r\n\t\t\tintMonth = reminderDate[1];\r\n\t\t\tdocument.location = \"/personalReminders/monthview.php?date=01&month=\" + intMonth + \"&year=\" + intYear;\r\n\t\t\t}\r\n\t\t}\r\n}", "function addDaysFromCurrentMonth(){\n for(var i=1;i<=monthInfo[dateInfo.currentMonth][1];i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth, i);\n }\n}", "function nextView(e) {\n var target = e.target;\n var day = target.innerText;\n if (parseInt(day) < 10) {\n day = \"0\" + day;\n }\n var year = x.getFullYear().toString();\n var month = x.getMonth() + 1;\n if (month < 10) {\n month = \"0\" + (month.toString());\n }\n var date = year + month + day;\n localStorage.setItem(date, date);\n savedDate = date;\n addedDate = true;\n mainFunction();\n}", "function jumpMonthHead(obj){\r\nvar mId = obj.id;\r\nvar dateVal = 1;\r\nvar yearVal = document.getElementById(mId).innerHTML.substr(-4);\r\nvar monthStr = document.getElementById(mId).innerHTML.split(\" \");\r\nfor (var x=0; x<myMonths.length;x++)\r\n\t{\r\n\tif (myMonths[x] == monthStr[0])\r\n\t\t{\r\n\t\tmonthVal = x;\r\n\t\t}\r\n\t}\r\ndocument.location = \"/personalReminders/monthview.php?date=\" + dateVal + \"&month=\" + monthVal + \"&year=\" + yearVal;\r\n}", "function adjustMonth(value) {\n var date = new Date();\n var month = date.getMonth();\n date.setMonth(month + value);\n return date;\n}", "function onClickNextYear(nextYear, month, year) {\n nextYear.onclick = function() {\n selectCbo(parseInt(year.options[year.selectedIndex].value) + 1, \n month.options[month.selectedIndex].value, \n daysInMonth(month.options[month.selectedIndex].value, \n parseInt(year.options[year.selectedIndex].value) + 1));\n var newDate = new Date();\n newDate.setFullYear(parseInt(year.options[year.selectedIndex].value) + 1, \n month.options[month.selectedIndex].value,\n 1);\n updateYear(year, newDate);\n }\n}", "function getMonth(e) {\n import('./calendar.service.js').then((calendar) => {\n // Get new month from service.\n // renderMonth is called once when the script loads outside of an event handler,\n // so the first time it loads, e will be undefined. After that it'll come from\n // an event handler.\n if (e === undefined) {\n calendar.month.then(month => { renderMonth(month); });\n }\n else {\n // Shieldmeet only happens on a leap year, so we utilize the modulo to check this.\n if (e.target.id == \"next-month\") {\n calendar.nextMonth().then(month => {\n if (month.name == \"Shieldmeet\") {\n console.log('currentYear:', currentYear);\n if (currentYear.year % 4 != 0) {\n calendar.nextMonth().then(month => { renderMonth(month); });\n }\n else { renderMonth(month); }\n }\n else { renderMonth(month); }\n });\n }\n else {\n calendar.prevMonth().then(month => {\n if (month.name == \"Shieldmeet\") {\n if (currentYear.year % 4 != 0) {\n calendar.prevMonth().then(month => { renderMonth(month); });\n }\n else { renderMonth(month); }\n }\n else { renderMonth(month); }\n });\n \n }\n }\n \n });\n }", "function nextWeek () {\n\tif(day > daysInMonth-6) { // if there is less than 6 days to the end of the month\n\t\tday = 1; // change the day to first day of month\n\t\tnextMonth(); // calling a \"next month\" funtion to change the month\n\t} else { // if there is more than 6 days to the end of the month\n\t\tweekToDisplay[4]++; // show next week\n\t\tday+=7; // add 7 to current day\n\t}\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n}", "M (date) {\n return date.getMonth() + 1\n }", "setPrevMonth (prev, e) {\n let curDate = new Date(this.state.currentDate);\n let curMonth = curDate.getMonth();\n let newMonth = prev ? curMonth - 1 : curMonth + 1;\n curDate = new Date(curDate.setMonth(newMonth));\n this.setState({'currentDate': curDate});\n this.props.getDatesWithTasksByMonth(strftime('%Y-%m-%d', curDate), false);\n }", "function setToCurrentMonth(dc) {\n\n var y = new Date();\n var d2 = new Date(y.getFullYear(), y.getMonth(), 1, 0, 0, 0, 0);\n return setDateControl(dc, d2);\n}", "function setCurrentDay(month, year) {\n var viewMonth = $('.month').attr('data-month');\n var eventYear = $('.event-days').attr('date-year');\n if (parseInt(year) === yearNumber) {\n if (parseInt(month) === parseInt(viewMonth)) {\n $('tbody.event-calendar td[date-day=\"' + d.getDate() + '\"]').addClass('current-day');\n }\n }\n }", "function NextPeriod()\n{\n\tif(boolSaveChanges || bSelectChanged)\n\t\tSaveChanges(\"MoveToNextPeriod()\", \"Period\")\n\telse\n\t\tMoveToNextPeriod()\n}", "function UpdateDate(frequency, day, month, year){\n var yearWords = ['annual','annually', 'yearly', 'year']\n var quarterlyWords = ['quarterly', 'quarter', 'four months', '4 months']\n var monthlyWords = ['monthly', 'month']\n var int_year = Number(year)\n var int_month = Number(month)\n var updatedMonth\n var updatedYear\n var nextUpdated = day + ' ' + updatedMonth + ' ' + updatedYear\n\n function monthUpdates(int_month, frequency) {\n if (int_month + frequency > 12) {\n updatedYear = int_year + 1\n updatedMonth = `0${(int_month + frequency)% 12}`\n nextUpdated = day + ' ' + monthNames[updatedMonth] + ' ' + updatedYear\n } else if (int_month + frequency == 12) {\n nextUpdated = day + ' ' + monthNames['12'] + ' ' + year\n } else {\n updatedMonth = `0${(int_month + frequency)}`\n nextUpdated = day + ' ' + monthNames[updatedMonth] + ' ' + year\n }\n return nextUpdated\n }\n\n if (yearWords.includes(frequency.toLowerCase())) {\n updatedYear = int_year + 1\n nextUpdated = day + ' ' + monthNames[month] + ' ' + updatedYear\n } else if (quarterlyWords.includes(frequency.toLowerCase())) {\n monthUpdates(int_month, 4)\n } else if (monthlyWords.includes(frequency.toLowerCase())) {\n monthUpdates(int_month, 1)\n } else {\n nextUpdated = ''\n }\n return nextUpdated\n}", "function pre_nextYear(year) {\n\tcurrent_year = parseInt(current_year) + parseInt(year);\n\t\n\t\n\tif(current_year < 1920){\n\t\tcurrent_year = 2100;\n\t}\n\telse{\n\t\tif(current_year > 2100){\n\t\t\tcurrent_year = 1920;\n\t\t}\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function adjustDayOfMonth(self) {\n var fields = self.fields;\n var year = fields[YEAR];\n var month = fields[MONTH];\n var monthLen = getMonthLength(year, month);\n var dayOfMonth = fields[DAY_OF_MONTH];\n if (dayOfMonth > monthLen) {\n self.set(DAY_OF_MONTH, monthLen);\n }\n }", "function adjustDayOfMonth(self) {\n var fields = self.fields;\n var year = fields[YEAR];\n var month = fields[MONTH];\n var monthLen = getMonthLength(year, month);\n var dayOfMonth = fields[DAY_OF_MONTH];\n if (dayOfMonth > monthLen) {\n self.set(DAY_OF_MONTH, monthLen);\n }\n }", "function changeByMonth(month, year, back) {\n back = back || false;\n var numDaysInMo,\n addend = 1;\n if (back) {\n addend = -1;\n }\n month = month + addend;\n if ((month < 0) || (month === 12)) {\n month = (month < 0) ? (month = 11) : month = 0;\n year = year + addend;\n }\n numDaysInMo = daysInMonth(month, year);\n return {month: month, year: year, numDaysInMo: numDaysInMo};\n }", "function moveOneDay(date) {date.setTime((date.getTime() + 24 * 60 * 60 * 1000)); }", "function updateCurrentMonth() {\n updateDays();\n currentM.textContent = months[month];\n}", "function setMonth(date, month) {\n return addMonths(date, month - date.getMonth());\n}", "function next() {\r\n saveYearText();\r\n calendar.innerHTML = \"\";\r\n generateYear(++currentYear);\r\n loadFromCalendarData();\r\n}", "function backMonth(){\n toMonth=globalMonth.prevMonth();\n $( document ).ready(load);\n}", "function changeMonth(){\n\tvar elements = document.getElementsByTagName(\"a\");\n\tfor(var i=0; i<elements.length; i++){\n\t\telements[i].onclick = function(){\n\t\t\ttempDate=getTempDate();\n\t\t\ttempDate.setMonth(this.id);\n\t\t\tdrawCalendar(tempDate);\n\t \t}\n\t}\n}", "function getCurrentMonth() {\r\n\t\tvar d = new Date();\r\n\t\treturn d.getMonth() + 1;\r\n\t}", "function loadMonth(e, el, datepicker, chosendate) {\n\n // reference our years for the nextMonth and prevMonth buttons\n var mo = jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex;\n var yr = jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex;\n var yrs = jQuery(\"select[name=year] option\", datepicker).get().length;\n\n // first try to process buttons that may change the month we're on\n if (e && jQuery(e.target).hasClass('prevMonth')) {\n if (0 == mo && yr) {\n yr -= 1;\n mo = 11;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 11;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo -= 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n } else if (e && jQuery(e.target).hasClass('nextMonth')) {\n if (11 == mo && yr + 1 < yrs) {\n yr += 1;\n mo = 0;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 0;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo += 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n }\n\n // maybe hide buttons\n if (0 == mo && !yr) jQuery(\"span.prevMonth\", datepicker).hide();\n else jQuery(\"span.prevMonth\", datepicker).show();\n if (yr + 1 == yrs && 11 == mo) jQuery(\"span.nextMonth\", datepicker).hide();\n else jQuery(\"span.nextMonth\", datepicker).show();\n\n // clear the old cells\n var cells = jQuery(\"tbody td\", datepicker).unbind().empty().removeClass('date');\n\n // figure out what month and year to load\n var m = jQuery(\"select[name=month]\", datepicker).val();\n var y = jQuery(\"select[name=year]\", datepicker).val();\n var d = new Date(y, m, 1);\n var startindex = d.getDay();\n var numdays = monthlengths[m];\n\n // http://en.wikipedia.org/wiki/Leap_year\n if (1 == m && ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)) numdays = 29;\n\n // test for end dates (instead of just a year range)\n if (opts.startdate.constructor == Date) {\n var startMonth = opts.startdate.getMonth();\n var startDate = opts.startdate.getDate();\n }\n if (opts.enddate.constructor == Date) {\n var endMonth = opts.enddate.getMonth();\n var endDate = opts.enddate.getDate();\n }\n\n // walk through the index and populate each cell, binding events too\n for (var i = 0; i < numdays; i++) {\n\n var cell = jQuery(cells.get(i + startindex)).removeClass('chosen');\n\n // test that the date falls within a range, if we have a range\n if (\n (yr || ((!startDate && !startMonth) || ((i + 1 >= startDate && mo == startMonth) || mo > startMonth))) &&\n (yr + 1 < yrs || ((!endDate && !endMonth) || ((i + 1 <= endDate && mo == endMonth) || mo < endMonth)))) {\n\n cell\n .text(i + 1)\n .addClass('date')\n .hover(\n function () {\n jQuery(this).addClass('over');\n },\n function () {\n jQuery(this).removeClass('over');\n })\n .click(function () {\n var chosenDateObj = new Date(jQuery(\"select[name=year]\", datepicker).val(), jQuery(\"select[name=month]\", datepicker).val(), jQuery(this).text());\n closeIt(el, datepicker, chosenDateObj);\n });\n\n // highlight the previous chosen date\n if (i + 1 == chosendate.getDate() && m == chosendate.getMonth() && y == chosendate.getFullYear()) cell.addClass('chosen');\n }\n }\n }", "MM (date) {\n return pad(date.getMonth() + 1)\n }", "function getplus() {\n month++;\n if (month == 12) {\n year++;\n month = 0;\n }\n htmlCalender.html(\"\");\n createcalender(year, month);\n}", "function goToNextPage() {\n updateCurrentPage((page) => page + 1);\n }", "function _isNextDay(d1, d2) {\n if (!_isSameMonth(d1, d2) && !_isNextMonth(d1, d2)) {\n return false;\n }\n return _getDaysDif(d1, d2) === 1;\n }", "function month(){\n step=1.2;\n timeSelector=\"month\";\n resetGraph();\n}", "function datem(a)\n {\n month=a+month;\n \n if(month == \"0\")\n {\n \n month=12;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"December\";\n year=year-1;\n document.getElementById(\"year12\").innerHTML=year;\n }\n else if(month==\"13\")\n {\n \n month=1;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"January\";\n year=year+1;\n document.getElementById(\"year12\").innerHTML=year;\n \n }\n \n \n if(month==\"1\")\n {\n document.getElementById(\"month12\").innerHTML=\"January\";\n daychange();\n }\n \n else if(month==\"2\")\n {\n document.getElementById(\"month12\").innerHTML=\"February\";\n daychange();\n }\n else if(month==\"3\")\n {\n document.getElementById(\"month12\").innerHTML=\"March\";\n daychange();\n }\n \n else if(month==\"4\")\n {\n document.getElementById(\"month12\").innerHTML=\"April\";\n daychange();\n }\n else if(month==\"5\")\n {\n document.getElementById(\"month12\").innerHTML=\"May\";\n daychange();\n }\n else if(month==\"6\")\n {\n document.getElementById(\"month12\").innerHTML=\"June\";\n daychange();\n }\n else if(month==\"7\")\n {\n document.getElementById(\"month12\").innerHTML=\"July\";\n daychange();\n }\n else if(month==\"8\")\n {\n document.getElementById(\"month12\").innerHTML=\"August\";\n daychange();\n }\n else if(month==\"9\")\n {\n document.getElementById(\"month12\").innerHTML=\"September\";\n daychange();\n }\n else if(month==\"10\")\n {\n document.getElementById(\"month12\").innerHTML=\"October\";\n daychange();\n }\n else if(month==\"11\")\n {\n document.getElementById(\"month12\").innerHTML=\"November\";\n daychange();\n }\n else if(month==\"12\")\n {\n document.getElementById(\"month12\").innerHTML=\"December\";\n daychange();\n }\n \n \n }" ]
[ "0.8421461", "0.8221818", "0.80959976", "0.80807745", "0.80692595", "0.7876335", "0.78731066", "0.77936506", "0.7762997", "0.76837665", "0.76770383", "0.76589346", "0.76460993", "0.7588513", "0.7529623", "0.7501605", "0.7479279", "0.7239434", "0.7214741", "0.7199656", "0.71786565", "0.712803", "0.7125126", "0.7125126", "0.7115418", "0.69951576", "0.6964999", "0.69614166", "0.69390464", "0.6917041", "0.6872775", "0.6863367", "0.6848809", "0.6847043", "0.68110734", "0.67652756", "0.6752427", "0.6706641", "0.6625728", "0.6617015", "0.66110176", "0.65650815", "0.6537578", "0.65098804", "0.65003556", "0.64815986", "0.64501554", "0.63936144", "0.6360578", "0.6352829", "0.6345984", "0.6341345", "0.6341345", "0.63293177", "0.6318047", "0.6297984", "0.6281721", "0.62303126", "0.6216452", "0.6215979", "0.621087", "0.621087", "0.62081754", "0.6192306", "0.6178232", "0.6178232", "0.61740506", "0.6103781", "0.6094801", "0.6093065", "0.6032422", "0.6025049", "0.6007545", "0.6001728", "0.5977866", "0.5973193", "0.5960302", "0.59379786", "0.59167874", "0.5908832", "0.59063536", "0.5879873", "0.5870537", "0.5867979", "0.5866278", "0.5866278", "0.586621", "0.58654356", "0.5859312", "0.5854517", "0.5848218", "0.58463514", "0.584616", "0.58457416", "0.58447266", "0.5837103", "0.58175445", "0.58018845", "0.57950294", "0.5784832", "0.5769953" ]
0.0
-1
Do nothing here, as this is not really a 'filter', and we do not want this to filter the httpRequest in any way.
static filterHttpRequest (request) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_request_filter_on_request_page() {}", "filter() {\n\t}", "filter() {\n\t}", "function block() { return new Filter(function () { return false; }); }", "async processRequest(_operationResponse) {\n /* no_op */\n }", "_dummyRequest(request) {\n console.log(\"\\n--------------------------- request ---------------------------\\n\");\n console.log(JSON.stringify(request, null, 2));\n console.log(\"\\n--------------------------- response ---------------------------\\n\");\n return \"dummy\";\n }", "static get eachReq () {\n return false\n }", "function filterNonFetchRequests(requests) {\n return requests.filter(request => {\n return (request.resourceType() === 'fetch');\n });\n }", "function runFilter(servletRequest, servletResponse) {\n\tRingoJsgiFilter.runFilterChain(servletRequest, servletResponse);\n}", "function defaultFilter(proxyReqOptBuilder, userReq) { // eslint-disable-line\n return true;\n}", "function filter() {\n \n}", "function NullFilter() {\n\t\t}", "function performRequest() {\n $.ajax({\n type: 'GET',\n url: generateUrl(ajaxUrl),\n dataType: 'html',\n delay: 400,\n beforeSend: function() {\n if (processing) {\n return false;\n } else {\n processing = true;\n }\n },\n success: function (html) {\n $('#filtered-list').replaceWith(html);\n processing = false;\n }\n });\n }", "function xmlHttp_handle_object_search_disallowed(){\n\tif(xmlHttp.readyState == 4 && xmlHttp.status == 200){\n\t\tpopulate_list_from_xml(xmlHttp.responseText, 'obj_list_disallowed');\n\t}\n}", "function shouldFilterRequest(replay, url) {\n // If we enabled the `traceInternals` experiment, we want to trace everything\n if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals) {\n return false;\n }\n\n return _isSentryRequest(url);\n }", "beforeHandling() {}", "function logRequest(){\n res.removeListener('finish', logRequest);\n res.removeListener('close', logRequest);\n httpLogger.info({\n startTime: req._startTime,\n duration: (new Date() - req._startTime),\n statusCode: req.statusCode,\n method: req.method,\n ip: req.ip,\n uri: req.originalUrl,\n userId: (req.user && req.user._id.toString())\n });\n }", "continueRequestOverrides() {\n throw new Error('Not implemented');\n }", "function processOptions(request, response) {\n if (VerifyCORSAndSetHeaders(request, response)) {\n response.writeHead(\"204\", \"No Content\", {\"content-length\": 0});\n } else {\n response.writeHead(\"403\", \"Origin \" + request.headers.origin + \" not allowed\", {});\n }\n response.end();\n }", "function processOptions(request, response) {\n if (VerifyCORSAndSetHeaders(request, response)) {\n response.writeHead(\"204\", \"No Content\", {\"content-length\": 0});\n } else {\n response.writeHead(\"403\", \"Origin \" + request.headers.origin + \" not allowed\", {});\n }\n response.end();\n }", "function sendFilter() {\n\t\tdispatch(addFilterAction(filterReport));\n\t}", "initFilterEndpoint() {\n this.router.get('/search', (req, res) => {\n if (!req.query || !req.query.filter) return res.status(200).send([]);\n // TODO parse filter\n return this.getDAO().getByCriteria(req.query.filter, { user: req.user })\n .then(result => res.status(200).send(result)).catch(err => {\n debug('[search]', err.message);\n return this.sendErr(res, 400, err.message);\n });\n });\n }", "function ignore() { }", "function setFilters() {} // 2166", "removeAllFilters() {}", "_request() {\n var options = url.parse(this._url);\n options.headers = {\n 'User-Agent': 'Benjamin Tambourine',\n 'If-None-Match': this._etag\n };\n https.get(options, this._onResponse.bind(this));\n }", "function denyRequest(data) {\n var response = JSON.parse(data);\n if (response.hasOwnProperty('error')) {\n alert(response.error);\n return;\n } else if (window.location.pathname === \"/profile\") {\n ajaxFunctions.ajaxRequest('GET', appUrl + \"/profile/api/\" + profId, getBooks);\n } else {\n ajaxFunctions.ajaxRequest('GET', appUrl + \"/books/api/\", getAllBooks);\n\n }\n }", "if (inFlightRequests[url]) {\n // We know that that this is abortable so we can leave it like this\n // $FlowFixMe\n return inFlightRequests[url];\n }", "constructor() {\n this._requests = {};\n }", "function uninstrumentXHR() {\n\t\tif (BOOMR.orig_XMLHttpRequest && BOOMR.orig_XMLHttpRequest !== w.XMLHttpRequest) {\n\t\t\tw.XMLHttpRequest = BOOMR.orig_XMLHttpRequest;\n\t\t}\n\t}", "_trackAllHttpTraffic() {\n let origOpen = XMLHttpRequest.prototype.open;\n let overlay = document.getElementById('GlobalLoadingOverlay');\n let self = this;\n XMLHttpRequest.prototype.open = function(method, url) {\n console.log(`${method} ${url} started`);\n let timestamp = new Date().getTime();\n self.activeHttpRequestCount++;\n if (self.activeHttpRequestCount === 1) {\n overlay.className = 'unremoved waiting';\n }\n this.addEventListener('loadend', function() {\n self.activeHttpRequestCount--;\n console.log(`${method} ${url} completed in ${(new Date().getTime())-timestamp}ms`);\n if (self.activeHttpRequestCount === 0) {\n overlay.className = 'removed';\n }\n });\n origOpen.apply(this, arguments);\n };\n }", "getTagsRequest() { return null; }", "function getHttpRequestCallback(request) {\n return function() {\n if (request.readyState === 4 && request.status === 200) {\n if (DEBUG) {\n console.log(request.responseText);\n }\n var gistArray = JSON.parse(request.responseText);\n displayResults(gistArray);\n filterResults();\n }\n }\n}", "function reqNone () {\n return [];\n}", "function overrideHttpRequestPrototype () {\n // Save the original function in a 'proxy' variable\n let original = window.XMLHttpRequest.prototype.send;\n\n // Override it\n window.XMLHttpRequest.prototype.send = function() {\n console.info(\"[COVID-COUNTER] Intercepting request...\");\n\n // Appends an event to the stack\n this.addEventListener(\"readystatechange\", function(e) {\n // Check if the response was successful\n if (this.readyState === 4 && this.status === 200) {\n // Check for the wanted API endpoint\n if (this.__zone_symbol__xhrURL.toLowerCase().endsWith(API_ENDPOINT)) {\n // Parse the responseText and send it to the event handler!\n let response = JSON.parse(this.responseText);\n onResponse(response);\n }\n }\n });\n\n // Route back to the original function\n return original.apply(this, [...arguments]);\n };\n}", "function filterSalesRecords(event) {\n\t\n\t//construct empty retrieve JSON object\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"retrieve\"\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//console.log(json);\n\t\n\treturn sendAPIRequest(json, event, displaySalesRecords);\n}", "function httpRequestWatchDog(task) {\n var httpRequest = task.httpRequest;\n var currentRequest = task.currentRequest;\n var job = getJob(task.jobId);\n setStatus('Aborting HTTP Request', job);\n if (httpRequest) {\n httpRequest.abort();\n // Log your miserable failure.\n currentRequest.returnedURL = null;\n task.httpRequest = null;\n }\n window.setTimeout(function () {\n spiderPage(getJob(task.jobId));\n }, 1);\n\n if (job.spidering[task.url]) {\n\n if (job.pagesError[task.url] && job.pagesError[task.url] > RETRY_MAX) {\n console.error(\"retry failed!\");\n delete job.spidering[task.url];\n } else if (job.pagesError[task.url]) {\n job.pagesError[task.url]++\n } else {\n job.pagesError[task.url] = 1;\n }\n }\n}", "function stripRequest(request) {\n const url = new URL(request.url);\n if (url.hash || url.search) {\n url.hash = '';\n url.search = '';\n return new Request(url.toString())\n } else {\n return request\n }\n}", "handleEventFiltering() {\n this.events = this.filterByType(this.replicaSetEvents.events, this.eventType);\n this.events = this.filterBySource(this.events, this.eventSource);\n }", "__normalizeStatus() {\n var isDone = this.readyState === qx.bom.request.Xhr.DONE;\n\n // BUGFIX: Most browsers\n // Most browsers tell status 0 when it should be 200 for local files\n if (this._getProtocol() === \"file:\" && this.status === 0 && isDone) {\n if (!this.__isNetworkError()) {\n this.status = 200;\n }\n }\n\n // BUGFIX: IE\n // IE sometimes tells 1223 when it should be 204\n if (this.status === 1223) {\n this.status = 204;\n }\n\n // BUGFIX: Opera\n // Opera tells 0 for conditional requests when it should be 304\n //\n // Detect response to conditional request that signals fresh cache.\n if (qx.core.Environment.get(\"engine.name\") === \"opera\") {\n if (\n isDone && // Done\n this.__conditional && // Conditional request\n !this.__abort && // Not aborted\n this.status === 0 // But status 0!\n ) {\n this.status = 304;\n }\n }\n }", "uploadFilter (req, file, cb) { return cb(null, true) }", "function urlFilter(field) {\n\tfilterUsingFn( field, isURLUnsafe );\n}", "filterEvent(event) {\n return false;\n }", "function onRequest() {\n\n // sets the actually resolved action, as it is also set by notfound\n req.data.action = req.action;\n \n if (req.action != 'notfound') {\n // let soft-coded actions override\n var idempotentAction = req.action +'_'+ req.method.toLowerCase();\n var action = (this.actions[idempotentAction] || this.actions[req.action]);\n \n if (action) {\n action.call(this);\n res.stop();\n }\n }\n}", "function reqNone() {\n return [];\n}", "function captureFilter() {\n updateProductList();\n event.preventDefault();\n}", "function xmlRequestNoProcessing(serviceString,paraString) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.responseType = 'json';\n\n xmlhttp.onreadystatechange=function() {\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\t{\n console.log(xmlhttp.response);\n }\n };\n\n console.log(serviceString + paraString);\n xmlhttp.open(\"POST\",serviceString + paraString,true);\n xmlhttp.send();\n}", "function stripRequest(request) {\n const strippedRequest = request.clone();\n if (strippedRequest.headers) {\n strippedRequest.headers.remove(\"authorization\");\n }\n return strippedRequest;\n}", "function stripRequest(request) {\n const strippedRequest = request.clone();\n if (strippedRequest.headers) {\n strippedRequest.headers.remove(\"authorization\");\n }\n return strippedRequest;\n}", "applyFindFilters(filters) { throw 'Not Implemented' }", "function testFilter(self) {\n if (self.filters.tagOptions == \"all\") {\n return function(item) {\n console.log(\"filter run because all\");\n return true;\n }\n } else {\n return function(item) {\n console.log(\"filter run because any\");\n return true;\n }\n }\n}", "function onResourceRequested(requestData, request){\n resources[requestData.id] = requestData.stage;\n var domain = get_domain(requestData['url']);\n if ((/http:\\/\\/.+?\\.(css|ssi)$/gi).test(requestData['url'])) {\n // abort all css request\n request.abort();\n return;\n }else if((/^http.*\\.js.*/).test(requestData['url'])){\n //This a js request would not be aborted\n return;\n } else if (root_domain != null && domain.indexOf(root_domain) == -1 && !_valid_request(domain, root_domain)){\n // abort request for other sites\n request.abort();\n return;\n }\n}", "function applyFilter(req, res, r) {\n var route = req.route;\n var excludedPaths = [];\n \n if (!r || !r.apis) {\n return stopWithError(res, {'description': 'internal error', 'code': 500}); }\n\n for (var key in r.apis) {\n var api = r.apis[key];\n for (var opKey in api.operations) {\n var op = api.operations[opKey];\n var path = api.path.replace(/{.*\\}/, \"*\");\n if (!canAccessResource(req, route + path, op.httpMethod)) {\n excludedPaths.push(op.httpMethod + \":\" + api.path); }\n }\n }\n \n // clone attributes if any\n var output = shallowClone(r);\n \n // clone models\n var requiredModels = [];\n \n // clone methods that have access\n output.apis = new Array();\n var apis = JSON.parse(JSON.stringify(r.apis));\n for (var i in apis) {\n var api = apis[i];\n var clonedApi = shallowClone(api);\n \n clonedApi.operations = new Array();\n var shouldAdd = true;\n for (var o in api.operations){\n var operation = api.operations[o];\n if (excludedPaths.indexOf(operation.httpMethod + \":\" + api.path)>=0) {\n break; }\n else {\n clonedApi.operations.push(JSON.parse(JSON.stringify(operation)));\n addModelsFromResponse(operation, requiredModels);\n }\n }\n if (clonedApi.operations.length > 0) {\n // only add cloned api if there are operations\n output.apis.push(clonedApi);\n }\n }\n \n // add models to output\n output.models = {};\n for (var i in requiredModels){\n var modelName = requiredModels[i];\n var model = allModels.models[modelName];\n if(model){\n output.models[requiredModels[i]] = model;\n }\n }\n // look in object graph\n for (key in output.models) {\n var model = output.models[key];\n if (model && model.properties) {\n for (var key in model.properties) {\n var t = model.properties[key].type;\n \n switch (t){\n case \"Array\":\n if (model.properties[key].items) {\n var ref = model.properties[key].items.$ref;\n if (ref && requiredModels.indexOf(ref) < 0) {\n requiredModels.push(ref);\n }\n }\n break;\n case \"string\":\n case \"long\":\n break;\n default:\n if (requiredModels.indexOf(t) < 0) {\n requiredModels.push(t);\n }\n break;\n }\n }\n }\n }\n for (var i in requiredModels){\n var modelName = requiredModels[i];\n if(!output[modelName]) {\n var model = allModels.models[modelName];\n if(model){\n output.models[requiredModels[i]] = model;\n }\n }\n }\n return output;\n}", "__statementFilter(...args) {}", "handleFilter(e) {\r\n e.preventDefault();\r\n let url = \"/endpoints/teams.json?teamname=\" + this.state.teamname + \"&type=\" + this.state.type + \"&org=\" + this.state.org;\r\n fetch(url)\r\n .then(response => {\r\n const contentType = response.headers.get(\"content-type\");\r\n if (contentType && contentType.indexOf(\"application/json\") !== -1) {\r\n return response.json()\r\n .then(response => this.setState({items: response.data}));\r\n }\r\n })\r\n }", "disableAsyncRequest() {\n this._asyncRequest = false;\n }", "function oraSetInternalFilters(){s.linkInternalFilters=\"javascript:,datascience,.oracle.\";if(s.linkObject&&-1==s.linkObject.href.indexOf(\"datascience.com\")&&-1==s.linkObject.href.indexOf(\"oracle.com\")){s.linkType=\"e\";s.linkTrackVars=\"pageName,prop8\";s.prop8=s.pageName}-1===location.href.indexOf(\":8888\")&&-1===location.href.indexOf(\"webstandards-us\")||(s.linkInternalFilters=\"javascript:,localhost,webstandards-us.oracle.com\")}", "function allButHttpAgent(filteredOpts, val, keyName) {\n if (keyName !== 'httpAgent') {\n filteredOpts[keyName] = val;\n }\n\n return filteredOpts;\n }", "function inception() {\n \tinception();\n }", "function decline_friend_request() {\n handle_friend_request_accept_or_decline(false);\n}", "onStoreFilter() {}", "function cleanseResponseBody(response) {\n var entity = response[\"entity\"];\n\n //console.log('***',entity);\n\n //TODO: DOUBLE CHECK THIS ISN'T NEEDED\n\n /*** STRIP OUT allowIllegalResourceCall HEADER ***/\n // entity = entity.substring(entity.indexOf(\"{\"));\n // return JSON.parse(entity);\n\n return entity;\n}", "unfilterNoChangeLayers(){\n //get the no change status object\n let no_change_status = this.props.statuses.filter(status => status.key === 'no_change');\n //clear the filter depending on whether it is a global or country view\n let filter = (this.props.view === 'global') ? null : ['in', 'iso3', this.props.country.iso3];\n //iterate through the layers and set the filter\n no_change_status[0].layers.forEach(layer => this.map.setFilter(layer, filter));\n //\n }", "@task\n *resetFilters() {\n yield super.setupForm(FILTER_FORM_UUID);\n this.updateQueryParams();\n this.registerObserver();\n }", "validateFilterRemoved() {\n return this\n .assert.not.urlContains('&filter=', 'Filter has been removed');\n }", "function onActionHttpRequest (callback, args) {\n util.debugLog('A90 WARNING: Depricated \"HTTP Geek Request\" action used. Will be deleted in next version.')\n var method = 'get'\n try {\n var options = JSON.parse(args.options)\n } catch (error) {\n return callback(error)\n }\n if (options.method) method = options.method.toLowerCase()\n http[method](options).then(function (result) {\n if (result.response.statusCode === 200) {\n callback(null, true)\n } else {\n callback(result.response.statusCode)\n }\n }).catch(function (reason) {\n callback(reason)\n })\n}", "constructor() { \n \n OrgApacheSlingEngineImplDebugRequestProgressTrackerLogFilterProperties.initialize(this);\n }", "requestContent(){\n throw \"Not implemented\";\n }", "function filterFunction() {\n \n}", "static get chainErrors () { return 'nonhttp' }", "function addFilter() {\n if (filterAllowedIdsArr.length > 0) {\n createFilter();\n }\n}", "_cleanUpRedirect() {\n super._cleanUpRedirect();\n this.state = RequestSocket.STATUS;\n this._rawHeaders = undefined;\n this.dataReceived = false;\n }", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}" ]
[ "0.65203387", "0.61868197", "0.61868197", "0.6081533", "0.57972354", "0.57011545", "0.5590274", "0.55641294", "0.55419326", "0.54653203", "0.54418397", "0.54269993", "0.53626436", "0.53607255", "0.53084534", "0.52883613", "0.52758664", "0.52757007", "0.52747136", "0.52747136", "0.52622044", "0.52264225", "0.52117544", "0.5203885", "0.5191474", "0.51664364", "0.51591086", "0.5150239", "0.51498866", "0.51474136", "0.5134133", "0.51309294", "0.5110882", "0.5100152", "0.5091485", "0.50887805", "0.5085012", "0.50817907", "0.5069459", "0.504881", "0.5048758", "0.5025888", "0.5022497", "0.5020579", "0.5019691", "0.50192076", "0.50086534", "0.50082535", "0.50082535", "0.5003498", "0.50000435", "0.49997306", "0.49969122", "0.49950805", "0.49933267", "0.49922946", "0.49882036", "0.49858454", "0.4972525", "0.49698678", "0.4964862", "0.49609625", "0.49605995", "0.495923", "0.4959027", "0.494579", "0.4945267", "0.49400046", "0.4930941", "0.49294555", "0.4925962", "0.4925737", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237", "0.49244237" ]
0.78771555
0
called when the application loads
function CrearBD(){ //alert("DEBUGGING: we are in the onBodyLoad() function"); if (!window.openDatabase) { alert('Error con la Base de Datos'); return; } db = openDatabase(shortName, version, displayName,maxSize); db.transaction(function(tx){ //tx.executeSql( 'DROP TABLE ViajesGPl',nullHandler,nullHandler); tx.executeSql( 'CREATE TABLE IF NOT EXISTS BDViajes (Ruta TEXT NOT NULL, Magna DECIMAL(18,2) NULL, Premium DECIMAL(18,2) NULL, Diesel DECIMAL(18,2) NULL, Auto TEXT NOT NULL, Litros DECIMAL(18,2) NOT NULL, Combustible TEXT NOT NULL, KilometrajeInicial DECIMAL(18,2) NOT NULL, KilometrajeFinal DECIMAL(18,2) NULL, Rendimiento DECIMAL(18,2) NULL, Fecha DATE NOT NULL)',[],nullHandler,errorHandler); },errorHandler,successCallBack); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n // Action to execute on load of the app\n }", "function onLoaded()\n\t{\n\t\twindow.initExhibitorsList();\n\t\twindow.initFloorPlans();\n\t\twindow.initConciege();\n\t\twindow.initAmenities();\n\t\twindow.initVisas();\n\t}", "function applicationLoaded() {\n initiateController();\n }", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "onInitialize() {}", "onInit() {}", "function onInit() {}", "onload() {\n this.init();\n }", "function loadApplication() {\n console.log(\"Application loaded\");\n // Load directly to the main menu\n configureUI(displayMainMenu());\n\n}", "function initApp() {\n\tinitSounds();\n\tinitSensors();\n\tshowWelcome();\n}", "_init() {\r\n app.whenReady().then(() => {\r\n this.setLoadingWindow();\r\n this.setWindowMain();\r\n });\r\n this.beforeCloseFunctions();\r\n }", "function alwaysRunOnload () {\n\t\n\t}", "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 onLoad() {\n\t\tdocument.addEventListener(\"deviceready\", onDeviceReady, false);\n\t\tinit();\n\t}", "function loaded() {\n\taddElements();\n\tosScroll();\n\t// initiate tabs\n\t$('#tabs').tab();\n\t// set event listeners\n\tsetOneTimeEventListeners();\n\t//updateChecked();\n}", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function initApp () {\n loadThemes();\n}", "function InitApplication() {\n ProcessCtrl.ePage.Masters.Application = {};\n ProcessCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }", "function initApp() {\n var urlParams, configManager, layoutManager;\n console.log('jimu.js init...');\n urlParams = getUrlParams();\n\n DataManager.getInstance();\n\n html.setStyle(jimuConfig.loadingId, 'display', 'none');\n html.setStyle(jimuConfig.mainPageId, 'display', 'block');\n\n layoutManager = LayoutManager.getInstance({\n mapId: jimuConfig.mapId\n }, jimuConfig.layoutId);\n configManager = ConfigManager.getInstance(urlParams);\n\n layoutManager.startup();\n configManager.loadConfig();\n }", "function eventWindowLoaded() {\n\tcanvasApp();\t\n}", "function init() {\n\t\t\t// Mount all riot tags\n\t\t\triot.mount('loadingscreen');\n\t\t\triot.mount('applauncher');\n\n\t\t\t//window.wm.mode = 'exposeHack';\n //window.wm.mode = 'default';\n\t\t}", "didInit() { }", "function initApplicationEventHandler() {\n initLocaleManager();\n }", "function onPageLoaded() {\n}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function init () {\r\n\t\tconsole.log('all is loaded.');\r\n\t}", "_ready() {\n this.tabs = new Tabs(this.app)\n }", "function initApp() {\r\n var startUpInfo;\r\n MemoryMatch.setPlatform();\r\n startUpInfo = \"Loading \" + MemoryMatch.getAppInfo();\r\n if (MemoryMatch.debugMode) {\r\n MemoryMatch.debugLog(startUpInfo);\r\n } else {\r\n console.log(startUpInfo);\r\n }\r\n\r\n // Listeners for all possible cache events\r\n\r\n var cache = window.applicationCache;\r\n if (cache != null) {\r\n cache.addEventListener('cached', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('checking', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('downloading', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('error', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('noupdate', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('obsolete', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('progress', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('updateready', MemoryMatch.logCacheEvent, false);\r\n }\r\n if (document.getElementById(MemoryMatch.loaderElement) != null) {\r\n // show canvas under loader so we can implement a loadbar until we get everything setup for EaselJS to take over\r\n document.getElementById(MemoryMatch.loaderElement).style.display = \"block\";\r\n document.getElementById(MemoryMatch.stageCanvasElement).style.display = \"block\";\r\n }\r\n\r\n // Determine canvas size, it will determine which assets need to be loaded\r\n MemoryMatch.isDesiredOrientationWhenLoadStarted = MemoryMatch.isDesiredOrientation();\r\n MemoryMatch.setCanvasSize(null);\r\n MemoryMatch.loadAllAssets(false);\r\n\r\n //runTests(); // run unit tests\r\n}", "function loadApp() {\n console.log(\"loadApp\");\n displayHomePage();\n}", "onReady() {}", "onInit()\n {\n // \n }", "start() {\n //DO BEFORE START APP CONFIGURATION/INITIALIZATION\n super.start();\n }", "function oninitialized() {\n\t // focus once ready\n\t this.once(this.options.mode + ' ready', bind(this.focusInput, this));\n\t\n\t // resolve view\n\t if ('signin' === this.options.mode) {\n\t // if user in AD ip range\n\t if (this.$ssoData && this.$ssoData.connection) {\n\t return this._kerberosPanel(this.options, callback);\n\t }\n\t\n\t // if user logged in show logged in experience\n\t if (this.options._shouldShowLastLogin()) {\n\t return this._loggedinPanel(this.options, callback);\n\t }\n\t\n\t // otherwise, just show signin\n\t this._signinPanel();\n\t }\n\t\n\t if ('signup' === this.options.mode) {\n\t this._signupPanel();\n\t }\n\t\n\t if ('reset' === this.options.mode) {\n\t this._resetPanel(this.options, callback);\n\t }\n\t\n\t }", "function appLoad(){\n console.log('*App Loaded*')\n watchForm();\n}", "onPageReady () {}", "function screenLoad(){\r\n\t\t\tcenterAlignPortraits();\r\n\t\t\tadjustBiographyPlacement();\r\n\t\t\tupdateLatonaTeamRowHeight();\r\n\t\t}", "onLoad() { }", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function eltdfOnWindowLoad() {\n\t eltdfWooCommerceStickySidebar().init();\n\t eltdfInitButtonLoading();\n eltdfInitProductListMasonryShortcode();\n }", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "init() {\n\t\tglobalApplication.events.document();\n\t\tglobalApplication.events.header();\n\t}", "function onLoad() {\n sozi.events.listen('framechange', onFrameChange);\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}", "function initializeApplication() {\n\n app.utils.getPageResources(chkErr(function(templates, content, config) {\n \n app.storage.getData(chkErr(function(contacts) {\n\n listTemplate = templates.partials_contact_list;\n pageContents = content;\n\n app.utils.renderPage(templates.page_contacts, content);\n refreshContactList(contacts);\n addContactPageListeners();\n\n }));\n\n }));\n\n }", "function startApp() {\n //first calls, default dataset? \n }", "onLoad () {\n\n }", "function startOnLoad() {\n}", "function startOnLoad() {\n}", "function windowOnLoad() {\n\n setupCodeMirrorBox()\n registerEventHandlers()\n setupTutorial()\n\n setSpeed(INIT_PLAY_SPEED)\n\n var campaign = PUZZLE_CAMPAIGN\n var state = PUZZLE_CAMPAIGN_STATE\n\n showOrHideLevelMenu(state) \n\n loadLevel(campaign, state)\n restartSimulation()\n\n}", "function qodeOnWindowLoad() {\n qodeInitElementorCustomFont();\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 }", "async function window_OnLoad() {\n await initialLoad();\n}", "static init() {\n console.log(\"App is Initialize...\");\n }", "function InitApplication() {\n DataExtIntegrationCtrl.ePage.Masters.Application = {};\n DataExtIntegrationCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }", "function startup() {\n // Set initial UI data for our app and Vue\n // App data will be populated after updateUI is called in onMessage EVENT_BRIDGE_OPEN_MESSAGE \n dynamicData = deepCopy(CONFIG.INITIAL_DYNAMIC_DATA);\n defaultMaterialProperties = {\n shadeless: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].shadeless),\n pbr: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].pbr)\n };\n \n // Create the tablet app\n ui = new AppUi({\n buttonName: CONFIG.BUTTON_NAME,\n home: URL,\n onMessage: onMessage, // UI event listener \n // Icons are located in graphicsDirectory\n // AppUI is looking for icons named with the BUTTON_NAME \"avatar-101\" \n // For example: avatar-101-a.svg for active button icon, avatar-101-i.svg for inactive button icon\n graphicsDirectory: Script.resolvePath(\"./resources/icons/\"), \n onOpened: onOpened,\n onClosed: onClosed\n });\n\n // Connect unload function to the script ending\n Script.scriptEnding.connect(unload);\n // Connect function callback to model url changed signal\n MyAvatar.skeletonModelURLChanged.connect(onAvatarModelURLChanged);\n }", "function onStart() {\n // loads manifests, scouts, schedule, etc.\n loadImportantFiles();\n // goes to the home page\n switchPages(\"home\", undefined, undefined, 0);\n // determines a list of teams\n determineTeams();\n // uses list of teams to create \"Teams\" page\n insertTeams();\n // sorts \"Teams\" table once files are loaded\n window.setTimeout(sortTable, 200);\n // loads scouting data\n loadData();\n // sets up \"Team\" page for data to be inputted\n setupData();\n // \"Picklist\" page starts with one picklist\n createPicklist();\n // decides whether or not to display sensitive info\n displaySensitiveInfo();\n // hides the \"Team\" page carousel\n $(\"#myCarousel\").hide();\n // puts scouts on Scouts page\n populateScouts();\n // sets up the rankings table\n addRankingsToPage();\n}", "function initialize_app() {\n // We are downloading solutions.min.js in parallel, so we show the\n // activity icon here, to inform the user that a \"background download\"\n // is happening (the users at least sees that 'somethnig is going on')\n // TODO is this really necessary? Downloading a 400k file should take\n // far less time than the time it takes the user to start the first\n // calcuation process. Besides, I should already do check for the\n // existence of solutions_db (i.e. \"solutions_db !== null\") before I\n // try to use it anyway...\n show_activity_icon();\n mainEl = document.querySelector('main');\n custom_stamps = new UserStamps();\n small_screen = document.documentElement.clientWidth < 450;\n\n if (small_screen) {\n document.getElementById('forward_btn').textContent = 'Neste';\n document.querySelector('.dropdown-activator').addEventListener('click',\n show_menu);\n }\n document.getElementById('back_btn').addEventListener('click', go_back);\n document.getElementById('forward_btn').addEventListener('click', go_forward);\n document.querySelector('nav > h1').addEventListener('click', reset_site);\n}", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "function initializeApplication() {\n invokePageFunction(APPLICATION_METHOD_INITIALIZE);\n }", "onLoad() {}", "function qodeOnWindowLoad() {\n qodeInitElementorCardsSlider();\n }", "function appLoaded() {\n var lang = fetchLanguage(),\n data = fetchData();\n\n $.when(lang, data).then(startApp, appStartError);\n}", "function initApp() {\n // Listening for auth state changes.\n // [START authstatelistener]\n firebase.auth().onAuthStateChanged(function(user) {\n showHomePage();\n if (user) {\n // User is signed in.\n /** This section of code builds up the pages only the provider is allowed to see **/\n provider = {};\n provider.displayName = user.displayName;\n provider.email = user.email;\n /** build more provider properties here **/\n\n listenOnDateBase();\n\n $(\"li[name=signedInMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedOutMenu]\").hide(); // hide what's not relevant\n\n } else {\n // User is signed out.\n provider = null;\n $(\"li[name=signedOutMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedInMenu]\").hide(); // hide the user's data to create a feeling that it's gone\n tearDownUserPages(); // remove database listenrs and destory all the pages to prevent private info from leeking\n }\n });\n}", "function windowLoaded () {\n remote.getGlobal(\"share\").openFileDialog = openFileDialog;\n remote.getGlobal(\"share\").setAudioLogLin = setAudioLogLin;\n\n console.log(\"window loaded\");\n slidersInitialise(); // in sliders.js\n initialiseDragDrop (); // in dragdrop.js\n initialise_vis(); // in visualiser.js\n}", "onReady() {\n\n }", "function onPageLoad()\n\t{\n\t\t//Set page size\n\t\tSetSize();\n\t\tloadPreferences();\n\t}", "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function init() {\r\n\taddListeners();\r\n\t// Polite loading\r\n\tif (Enabler.isPageLoaded()) {\r\n\t\tshow();\r\n\t}\r\n\telse {\r\n\t\tEnabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, show);\r\n\t\t//Enabler.addEventListener(studio.events.StudioEvent.VISIBLE, show);\r\n\t}\r\n}", "function onDeviceReady() {\n \n }", "function mainComplete() {\n console.log('it is all loaded up');\n MyGame.game.initialize();\n\n }", "function onReady() {\n\t// TODO\n}", "function _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "onLoad() { \n\n }", "function pageLoad() {\n setControlValues();\n processHashInstruction();\n\n if (Common.isIE) Common.fixToMaxItemWidth('settings-header', 16, false);\n\n document.getElementById('theme').addEventListener('change', themeSelectChange);\n document.getElementById('defaults').addEventListener('click', defaultsClick);\n document.getElementById('save').addEventListener('click', saveClick);\n document.getElementById('cancel').addEventListener('click', cancelClick);\n\n document.getElementById('offline').style\n .display = (navigator.onLine ? 'none' : 'block');\n window.addEventListener('offline', appOffline);\n window.addEventListener('online', appOnline);\n}", "onLoad () {}", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "function init() {\n if (window.APPLICATION.DATA) {\n if (!window.APPLICATION.INITIALIZED) {\n Router.run(Routes, Router.HistoryLocation, function(Handler, state) {\n if (window.APPLICATION.INITIALIZED) {\n resolveRoute(context, state).then(function(data) {\n render(Handler, data);\n });\n } else {\n render(Handler, window.APPLICATION.DATA);\n }\n });\n }\n window.APPLICATION.INITIALIZED = true;\n }\n}", "function eventWindowLoaded () {\n canvasApp();\n}", "function initApp() {\n\tauthCode = null;\n\tchildWindow = null;\n\t//registerBbm();\n\n\t// setup our Foursquare credentials, and callback URL to monitor\n\tfoursquareOptions = {\n\t\tclientId: '*',\n\t\tclientSecret: '*',\n\t\tredirectUri: '*'\n\t};\n\n\t// (bbUI) push the start.html page\n\tbb.pushScreen('start.html', 'start');\n}", "function eventWindowLoaded() {\n canvasApp();\n}", "onDeviceReady() {\n /**\n * initialize all different stuff here:\n * e.g.\n * - sentry\n * - firebase\n * - adjust\n * - push notifications\n * - fabric\n * - custom url schema\n * - facebook\n * - universal links\n * - google analytics\n * - ...\n *\n * context to \"app\" is avaialble, but beware only the app scope of a plugin (which means if any other plugin\n * extends the app scope, it could be that it is not available yet)\n */ \n try {\n this.initStatusBar()\n } catch (err) {\n // console.error('status bar failed', err)\n }\n \n try {\n this.initWKWebView()\n } catch (err) {\n // console.error('init WKWebView failed', err)\n }\n \n try {\n this.initCustomUrlScheme()\n } catch (err) {}\n }", "function onReady() {\n ns.brd = new Board();\n ns.client = new clientLib.Client(ns);\n ns.client.addAppBar();\n\n // App Bar can move elements on the screen\n ns.brd.resizeWindow();\n\n ns.client.poll();\n }", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n setStepsClasses();\n _window.on('resize', debounce(setStepsClasses, 200))\n\n initMasks();\n initValidations();\n initSelectric();\n initDatepicker();\n\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "function init(){\n\n }", "function onLoad()\n{}", "function init() {\n\n initFloorsMapping(Config.BUILDINGS);\n createElevators(Config.BUILDINGS);\n\n AppUI.init();\n attachEvents(Config.BUILDINGS);\n }", "function startup() {\n\tdocument.addEventListener('DOMContentLoaded', function() {\n loadmap();\n loadquestions();\n\t\t}, false);\n }", "function onLoad() {\n document.documentElement.removeAttribute('viewBox');\n readFrames();\n sozi.events.fire('documentready');\n }", "function onReady () {\n restoreTime()\n }", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "function onLoad() {\n document.documentElement.removeAttribute(\"viewBox\");\n readFrames();\n sozi.events.fire(\"documentready\");\n }", "function init() {\n\n\n\n\t}", "function initialize() {\n }", "function init() {\n\t\ttrace(\"UnstackedAppinit\");\n\n\t\twindow.addEventListener( 'resize', \tonWindowResize, \tfalse );\t\t\n\t\twindow.addEventListener( 'orientationchange', onOrientationChange, false);\t\t\n\t\twindow.addEventListener( 'scroll', \tonWindowScroll, \tfalse );\n\t\tdocument.addEventListener( 'keyup',\t\tonDocumentKeyUp, \tfalse );\n\t\t\n\t\tif( isMicroFicheMode() ) {\n\t\t\tdocument.addEventListener( 'mousemove', onDocumentMouseMove, false);\t\t\t\n\t\t\t// TODO: read start mouse valuse from url args, sent in via shell call?\n\t\t\t// updateMousePos(load_event.clientX, load_event.clientY);\t\t\n\t\t\tHIDE_SCROLL = true;\t\n\t\t}\n\t\t\n\t\n\t\tif( ABS_DATE_MODE ) { // offset the last_data_server_date_stamp by 10 mins for the first data get\n\t\t\tvar _d = getRunningDate(); // the abs date\n\t\t\t_d.setSeconds( _d.getSeconds() - (10 * 60) );\n\t\t\tlast_data_server_date_stamp = Utils.getSQLTimeStamp( _d );\n\t\t}\n\t\t\n\t\t//\n\t\ttimeline.start_date = timeline.end_date = timeline.playback_date = getRunningDate();\n\t\t\n\t\tupdatePageStyle();\n\t\t\t\n\t\t// Setup freewall\n\t\twall = new Freewall(\"#freewall\");\n\t\twall.reset({\n\t\t\tselector: '.card',\n\t\t\tanimate: (ANIMATE == 1),\n\t\t\tcellW: wall_seed_width,\n\t\t\tcellH: 'auto',/*wall_seed_width, */\n\t\t\tgutterX: WALL_MARGIN,\n\t\t\tgutterY: WALL_MARGIN,\n\t\t\tonResize: function() {\n\t\t\t\treflowGrid();\n\t\t\t},\n\t\t\tbottomToTop: false,\n\t\t\tdelay: 0 /*,\n\t\t\tfixSize: isMicroFicheMode() ? 1 : null */\n\t\t});\n\t\t\n\t\tif(SHOW_MENU) {\n\t\t\tsetupMenu(!MENU_ON_TOP); // appending to wall\n\t\t}\n\t\t\n\t\t// wall.fitZone(window.innerWidth, 30, window.innerHeight - 30); // testing smething out\n\t\t\n\t\t$(\".tzone\").text(getRunningDate().getZoneAbbreviation());\n\t\t \n\t\tsetStatusVisibility( SHOW_STATUS );\n\t\t\n\t\t$(\"#status\").prepend( stats.domElement );\n\t\t\n\t\tQuickSettings.useExtStyleSheet();\n\t\tcontrol_panel = QuickSettings.create( window.innerWidth-195, 45, \"[ Controls ]\" );\n\n\t\tif(!LIVE_MODE) {\n\t\t\t\tcontrol_panel.addRange(\"Playback Speed\", .0166, 10.0, PLAYBACK_SPEED, .0166, function(value) {\n\t\t\t\tPLAYBACK_SPEED = value;\n\t\t\t\ttimeline.playback_seconds_step = PLAYBACK_SPEED;\n\t\t\t});\n\t\t}\n\t\t\n\t\tcontrol_panel.addBoolean(\"Playing\", running, function(value) {\n\t\t\tif(value) {\n\t\t\t\tstart(true);\n\t\t\t}else{\n\t\t\t\tstop(true);\n\t\t\t}\n\t\t});\n\t\t\n\t\tcontrol_panel.addRange(\"Visible Limit\", 0, 255, VISIBILE_LIMIT, 1, function(value) {\n\t\t\tVISIBILE_LIMIT = value;\n\t\t});\n\t\t\n\t\tif(LIVE_MODE) {\n\t\t\t// add a date \n\t\t\tcontrol_panel.addDate(\"Current Data Date\", getRunningDate(), function(value) {\n\t\t\t\t trace(\"Date changed to \" + value);\n\t\t\t});\n\t\t\t// could add a time too\n\t\t\t// .addTime(\"time\", new Date())\n\t\t}\n\t\t\t\t\n\t\tcontrol_panel.addDropDown(\"Data Source:\", [DataSources.BOTH.label, DataSources.UNPUB.label, DataSources.PUB.label], function(value) { \n\t\t\ttrace(\"Show Source:\", value.value);\n\t\t\t\t\t\t\n\t\t\tswitch(value.value) {\n\t\t\t\tcase DataSources.BOTH.label:\tDATA_SOURCE = DataSources.BOTH.value;\tbreak;\n\t\t\t\tcase DataSources.UNPUB.label: DATA_SOURCE = DataSources.UNPUB.value; break;\n\t\t\t\tcase DataSources.PUB.label: \tDATA_SOURCE = DataSources.PUB.value; \tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfilterWall();\t\t\t\n\t\t});\n\t\t\t\n\t\tcontrol_panel.addDropDown(\"Image Filter:\", [ImageDisplaySource.ALL.label, ImageDisplaySource.WITH_IMAGE.label, ImageDisplaySource.WITHOUT_IMAGE.label], function(value) { \n\t\t\ttrace(\"Show Images:\", value.value);\n\t\t\t\t\t\t\n\t\t\tswitch(value.value) {\n\t\t\t\tcase ImageDisplaySource.ALL.label:\t\t\t\tIMAGE_DISPLAY_MODE = ImageDisplaySource.ALL.value;\t\t\t\t\tbreak;\n\t\t\t\tcase ImageDisplaySource.WITH_IMAGE.label: \tIMAGE_DISPLAY_MODE = ImageDisplaySource.WITH_IMAGE.value; \t\tbreak;\n\t\t\t\tcase ImageDisplaySource.WITHOUT_IMAGE.label: IMAGE_DISPLAY_MODE = ImageDisplaySource.WITHOUT_IMAGE.value;\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tfilterWall();\t\t\t\n\t\t});\n\t\t\t\n\t\t// setup tracking on anchors\t\t\n\t\t$(\"a\").click( function() {\n\t\t\t\ttrace(\"Click\", $(this).attr('href'));\n\t\t\t\ttrackEvent(\"external_link\", \"click\", $(this).attr('href') );\n\t\t\t}); \n\t\t\t\n\t\t\t\n\t\t\t\n\t\tif(LIVE_MODE) {\n\t\t\ttimeline.start_date = getRunningDate();\n\t\t\ttimeline.start_date.setSeconds(timeline.start_date.getSeconds() - LIVE_START_OFFSET_MINS * 60);\n\t\t}\n\t\t\n\t\tif(DEV_UI_VISIBLE == false || Utils.isMobile.any()) control_panel.toggleVisibility();\n\t\t\n\t\tif(SHOW_HOME) {\n\t\t\tshowHome();\n\t\t}else if (SHOW_INSTRUCTION) {\n\t\t\tshowInstruction();\n\t\t}\n\t\t\n\t\tfetchData();\n\t\t\n\t}", "function onEverythingLoad() {\n\tviewerId = wave.getViewer().getId();\n\tviewerPO = getThing(\"player_\" + viewerId);\n\tviewerPM = getThing(\"pm_\" + viewerId);\n\n\t// If this is the viewer's first visit, show them the help screen.\n\tif (viewerPO.firstVisit) {\n\t\tdialogBox.openHelp();\n\n\t\t// If the gadget state is empty (there are no cards), create a deck.\n\t\tif (waveStateKeys.length == 0) {\n\t\t\t// blue, 2 jokers, and shuffled\n\t\t\taddDeck(0, 2, true);\n\t\t}\n\t}\n}", "ready() {\r\n\t\t// Override this\r\n\t\tthis.updateTitle();\r\n\t}", "function initOnLoad ()\r\n{\r\n\t//die listenelemnte der Navigation sollen anklickbar sein\r\n\tnavigationEventhandler();\r\n\t//öffne die datenbank\r\n\tdatenbankOeffnen();\r\n\t//lade die felder und buttons der kontakt seite in die variablen\r\n\tgetForms();\r\n}", "function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(scheduled.currentView);\n }\n }", "function init() {\n\t \t\n\t }", "function initialize() {\r\n\r\n \t}" ]
[ "0.74027157", "0.7277106", "0.72681385", "0.71761066", "0.7131263", "0.71186876", "0.7100112", "0.6992198", "0.6959564", "0.69529486", "0.6949132", "0.6934162", "0.6895081", "0.6794033", "0.67488104", "0.6676154", "0.6670383", "0.6658405", "0.6654034", "0.6644819", "0.66424906", "0.6623669", "0.66125077", "0.66054815", "0.66054285", "0.6590737", "0.65702015", "0.6569239", "0.6565625", "0.65641236", "0.6541943", "0.6536867", "0.6533836", "0.65326446", "0.65183246", "0.6497351", "0.6496544", "0.6489837", "0.6467361", "0.6464523", "0.6461087", "0.64529884", "0.64515084", "0.6440163", "0.6428578", "0.64265126", "0.6411224", "0.6411224", "0.6411087", "0.6396142", "0.63926613", "0.63913727", "0.6380255", "0.637316", "0.6365771", "0.6365669", "0.6363674", "0.63632876", "0.63632447", "0.6361209", "0.6358849", "0.6354353", "0.6349252", "0.6349008", "0.6345995", "0.63457745", "0.63400704", "0.63367635", "0.63319194", "0.6328184", "0.6327712", "0.6326641", "0.6325867", "0.6323886", "0.63223255", "0.6316938", "0.6313524", "0.63076967", "0.63043344", "0.63033426", "0.6298748", "0.62964064", "0.62955344", "0.62915015", "0.6288294", "0.6287722", "0.6286403", "0.6284286", "0.6273781", "0.62723976", "0.62721026", "0.6271467", "0.62701494", "0.62694556", "0.62530243", "0.6253024", "0.6251588", "0.6248595", "0.62478644", "0.6245382", "0.6240349" ]
0.0
-1
Package for PCM (Pulsecode modulation) data processing Describes methods for audio processing.
function IAudioRecorder() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function synthesizeAudioData(aPreOutputBuffer, aStartIndex, aAudioFrames) {\n // int zSamplesToProcess=aSamplesPerChannel;\n var zSamples = aAudioFrames * myChannels;\n var zVolChannelZero = Math.floor(((myAUDV[0] << 2) * myVolumePercentage) / 100);\n var zVolChannelOne = Math.floor(((myAUDV[1] << 2) * myVolumePercentage) / 100);\n var zIndex = aStartIndex;\n // Loop until the sample buffer is full\n while (zSamples > 0) {\n // Process both TIA sound channels\n for (var c = 0; c < 2; ++c) {\n // Update P4 & P5 registers for channel if freq divider outputs a pulse\n if ((myFrequencyDivider[c].clock())) {\n switch (myAUDC[c]) {\n case 0x00: // Set to 1\n { // Shift a 1 into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x01: // 4 bit poly\n {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n break;\n }\n\n case 0x02: // div 31 . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x03: // 5 bit poly . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit poly\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x04: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x05: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x06: // div 31 . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x07: // 5 bit poly . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit register\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x08: // 9 bit poly\n {\n // Clock P5 & P4 as a standard 9-bit LSFR taps at 8 & 4\n myP5[c] = (bool(myP5[c] & 0x1f) || bool(myP4[c] & 0x0f)) ? ((myP5[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP5[c] & 0x10) ? 1 : 0))) : 1;\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x09: // 5 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Clock value out of P5 into P4 with no modification\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x0a: // div 31\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Feed bit 4 of P5 into P4 (this will toggle back and forth)\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x10) ? 1 : 0);\n }\n break;\n }\n\n case 0x0b: // Set last 4 bits to 1\n {\n // A 1 is shifted into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x0c: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0d: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0e: // div 31 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n\n case 0x0f: // poly 5 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Use poly 5 to clock 4-bit div register\n if (bool(myP5[c] & 0x10)) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n }\n }\n }\n\n myOutputCounter += JAVA_SOUND_SAMPLE_RATE;\n\n if (myChannels == 1) {\n // Handle mono sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0); //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0);\n var zBothChannels = zChannelZero + zChannelOne + myVolumeClip;\n aPreOutputBuffer[zIndex] = (zBothChannels - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n zIndex++;\n zSamples--;\n //assert(zIndex<=aStartIndex + zSamplesToProcess);\n\n }\n }\n else {\n // Handle stereo sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0) + myVolumeClip; //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0) + myVolumeClip;\n //int zBothChannels=zChannelZero + zChannelOne + myVolumeClip;\n\n aPreOutputBuffer[zIndex] = (zChannelZero - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n zIndex++;\n zSamples--;\n\n aPreOutputBuffer[zIndex] = (zChannelOne - 128) & 0xFF;\n zIndex++;\n zSamples--;\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n }\n }\n }\n }", "onProcess(audioProcessingEvent) {\n\n this.blocked = true;\n this.nCall++;\n\n let inputBuffer = audioProcessingEvent.inputBuffer;\n let outputBuffer = audioProcessingEvent.outputBuffer;\n\n for (let chIdx = 0; chIdx < outputBuffer.numberOfChannels; chIdx++) {\n let inputData = inputBuffer.getChannelData(chIdx);\n let outputData = outputBuffer.getChannelData(chIdx);\n\n if (!this.bypass) {\n this.PreStageFilter[chIdx].process(inputData, outputData);\n } else {\n // just copy\n for (let sample = 0; sample < inputBuffer.length; sample++) {\n outputData[sample] = inputData[sample];\n }\n }\n } // next channel\n\n let time = this.nCall * inputBuffer.length / this.sampleRate;\n let gl = this.calculateLoudness(outputBuffer);\n this.callback(time, gl);\n\n this.blocked = false;\n }", "function ProcessFrames(mem48, speed, frequency, pitches, amplitude, sampledConsonantFlag) {\n const CombineGlottalAndFormants = (phase1, phase2, phase3, Y) => {\n let tmp; // unsigned int\n tmp = multtable[sinus[phase1] | amplitude[0][Y]];\n tmp += multtable[sinus[phase2] | amplitude[1][Y]];\n tmp += tmp > 255 ? 1 : 0; // if addition above overflows, we for some reason add one;\n tmp += multtable[rectangle[phase3] | amplitude[2][Y]];\n tmp += 136;\n tmp >>= 4; // Scale down to 0..15 range of C64 audio.\n\n Output(0, tmp & 0xf);\n };\n\n const RenderSample = (mem66, consonantFlag, mem49) => {\n const RenderVoicedSample = (hi, off, phase1) => {\n hi = hi & 0xFFFF; // unsigned short\n off = off & 0xFF; // unsigned char\n phase1 = phase1 & 0xFF; // unsigned char\n do {\n let sample = sampleTable[hi+off];\n let bit = 8;\n do {\n if ((sample & 128) !== 0) {\n Output(3, 26);\n } else {\n Output(4, 6);\n }\n sample <<= 1;\n } while(--bit !== 0);\n off++;\n } while (((++phase1) & 0xFF) !== 0);\n\n return off;\n };\n\n const RenderUnvoicedSample = (hi, off, mem53) => {\n hi = hi & 0xFFFF; // unsigned short\n off = off & 0xFF; // unsigned char\n mem53 = mem53 & 0xFF; // unsigned char\n do {\n let bit = 8;\n let sample = sampleTable[hi+off];\n do {\n if ((sample & 128) !== 0) {\n Output(2, 5);\n }\n else {\n Output(1, mem53);\n }\n sample <<= 1;\n } while (--bit !== 0);\n } while (((++off) & 0xFF) !== 0);\n };\n\n // mem49 == current phoneme's index - unsigned char\n\n // mask low three bits and subtract 1 get value to\n // convert 0 bits on unvoiced samples.\n let hibyte = (consonantFlag & 7) - 1;\n\n // determine which offset to use from table { 0x18, 0x1A, 0x17, 0x17, 0x17 }\n // T, S, Z 0 0x18\n // CH, J, SH, ZH 1 0x1A\n // P, F*, V, TH, DH 2 0x17\n // /H 3 0x17\n // /X 4 0x17\n\n let hi = hibyte * 256; // unsigned short\n // voiced sample?\n let pitch = consonantFlag & 248; // unsigned char\n if(pitch === 0) {\n // voiced phoneme: Z*, ZH, V*, DH\n pitch = pitches[mem49 & 0xFF] >> 4;\n return RenderVoicedSample(hi, mem66, pitch ^ 255);\n }\n RenderUnvoicedSample(hi, pitch ^ 255, tab48426[hibyte]);\n return mem66;\n };\n\n let speedcounter = new Uint8(72);\n let phase1 = new Uint8();\n let phase2 = new Uint8();\n let phase3 = new Uint8();\n let mem66 = new Uint8();\n let Y = new Uint8();\n let glottal_pulse = new Uint8(pitches[0]);\n let mem38 = new Uint8(glottal_pulse.get() - (glottal_pulse.get() >> 2)); // mem44 * 0.75\n\n while(mem48) {\n let flags = sampledConsonantFlag[Y.get()];\n\n // unvoiced sampled phoneme?\n if ((flags & 248) !== 0) {\n mem66.set(RenderSample(mem66.get(), flags, Y.get()));\n // skip ahead two in the phoneme buffer\n Y.inc(2);\n mem48 -= 2;\n speedcounter.set(speed);\n } else {\n CombineGlottalAndFormants(phase1.get(), phase2.get(), phase3.get(), Y.get());\n\n speedcounter.dec();\n if (speedcounter.get() === 0) {\n Y.inc(); //go to next amplitude\n // decrement the frame count\n mem48--;\n if(mem48 === 0) {\n return;\n }\n speedcounter.set(speed);\n }\n\n glottal_pulse.dec();\n\n if(glottal_pulse.get() !== 0) {\n // not finished with a glottal pulse\n\n mem38.dec();\n // within the first 75% of the glottal pulse?\n // is the count non-zero and the sampled flag is zero?\n if((mem38.get() !== 0) || (flags === 0)) {\n // reset the phase of the formants to match the pulse\n phase1.inc(frequency[0][Y.get()]);\n phase2.inc(frequency[1][Y.get()]);\n phase3.inc(frequency[2][Y.get()]);\n continue;\n }\n\n // voiced sampled phonemes interleave the sample with the\n // glottal pulse. The sample flag is non-zero, so render\n // the sample for the phoneme.\n mem66.set(RenderSample(mem66.get(), flags, Y.get()));\n }\n }\n\n glottal_pulse.set(pitches[Y.get()]);\n mem38.set(glottal_pulse.get() - (glottal_pulse.get() >> 2)); // mem44 * 0.75\n\n // reset the formant wave generators to keep them in\n // sync with the glottal pulse\n phase1.set(0);\n phase2.set(0);\n phase3.set(0);\n }\n }", "process(input, output, parameters) {\n // const analyser = parameters.getByteFrequencyData[0];\n // const sourceLimit = Math.min(inputList.length, outputList.length);\n\n let input = input[0];\n let output = output[0];\n // let channelCount = Math.min(input.length, output.length);\n\n // for (let channel = 0; channel < channelCount; channel++) {\n // let sampleCount = input[channel].length;\n\n // for (let i = 0; i < sampleCount; i++) {\n // let sample = input[channel][i];\n\n // output[channel][i] = sample;\n // }\n // } \n\n output[0][0] = 222;\n\n return true;\n }", "function process(Data) {\n source = context.createBufferSource(); // Create Sound Source\n context.decodeAudioData(Data, function (buffer) {\n console.log(buffer)\n source.buffer = buffer;\n source.connect(context.destination);\n source.start(context.currentTime);\n })\n }", "function MMLLSpectrumExtractor(blocksize=512,sampleRate=44100,fftsize=1024,hopsize=512,windowtype=0) {\n \n var self = this;\n \n self.audioblocksize = blocksize;\n self.inputAudio = new MMLLInputAudio(self.audioblocksize);\n \n self.sampleRate = sampleRate;\n\n self.numInputChannels = 1;\n\n self.fftsize = fftsize;\n self.hopsize = hopsize;\n self.windowtype = windowtype;\n \n //context required for sampler's decodeAudioData calls\n \n //can request specific sample rate, but leaving as device's default for now\n //https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext\n try {\n self.audiocontext = new webkitAudioContext();\n \n } catch (e) {\n \n try {\n \n self.audiocontext = new AudioContext();\n \n } catch(e) {\n \n alert(\"Your browser does not support Web Audio API!\");\n return;\n }\n \n }\n \n //ignore sampleRate of audiocontext for now, just running through sound files at rate set by user\n //self.sampleRate = self.audiocontext.sampleRate; //usually 44100.0\n //console.log(\"AudioContext established with sample rate:\",self.sampleRate,\" and now setting up for input type:\",self.inputtype); //print\n \n \n //use async, wait?\n self.analyseAudioFile = function(filename,updatefunction) {\n \n \n var spectraldata;\n \n self.sampler = new MMLLSampler();\n \n \n return new Promise(function(resolve, reject) {\n //\"/sounds/05_radiohead_killer_cars.wav\"\n self.sampler.loadSamples([filename],\n function onload() {\n \n console.log('loaded: ',filename);\n \n self.sampleplayer = new MMLLSamplePlayer();\n self.sampleplayer.reset(self.sampler.buffers[0]);\n //self.sampleplayer.numChannels = self.sampler.buffers[0]\n \n if(self.sampleplayer.numChannels>1) {\n //interleaved input\n self.numInputChannels = 2;\n \n self.inputAudio.numChannels = self.numInputChannels;\n //self.samplearray = new Float32Array(2*audioblocksize);\n \n }\n //fresh STFT object\n var stft = new MMLLSTFT(self.fftsize,self.hopsize,self.windowtype);\n \n \n //samplearray depends on number of Channels whether interleaved\n \n //include last frame, will be zero padded as needed\n var numblocks = Math.floor(self.sampleplayer.lengthinsampleframes/self.audioblocksize);\n \n \n //starts with fftsize-hopsize in the bank\n var numspectralframes = Math.floor(((numblocks*self.audioblocksize) - self.hopsize)/self.hopsize) + 1;\n \n //self.processSoundFile(self.audioblocksize);\n \n \n spectraldata = new Array(numspectralframes);\n \n \n var j=0, i = 0;\n \n //complex data not in packed form, but dc and nyquist real values as complex numbers at 0 and fftsize indices\n for (j = 0; j < numspectralframes; ++j)\n spectraldata[j] = new Array(self.fftsize+2);\n \n console.log('Extracting spectrum for: ',filename); //debug console message\n \n var spectralframecount = 0;\n \n for (j = 0; j < numblocks; ++j) {\n \n updatefunction(j,numblocks);\n \n //needed since player accumulates to its output\n for (i = 0; i < self.audioblocksize; ++i) self.inputAudio.monoinput[i] = self.inputAudio.inputL[i] = self.inputAudio.inputR[i] = 0.0;\n \n self.sampleplayer.render(self.inputAudio,self.audioblocksize);\n \n var newframe = stft.next(self.inputAudio.monoinput);\n \n if(newframe) {\n \n if(spectralframecount>=numspectralframes) {\n \n console.log(\"what the spectrum?\",numblocks,numspectralframes,spectralframecount,self.hopsize,self.fftsize);\n }\n \n \n // var fftdata = stft.complex;\n \n for (i = 0; i < (self.fftsize+2); ++i)\n spectraldata[spectralframecount][i] = stft.complex[i];\n \n ++spectralframecount;\n }\n \n \n \n }\n \n \n resolve(spectraldata); //return via Promise\n \n \n },self.audiocontext);\n \n })\n \n \n };\n\n\n \n}", "function processAudio(audioProcessingEvent) {\n // get data\n var array = new Uint8Array(analyser.frequencyBinCount);\n analyser.getByteFrequencyData(array);\n\n // clear old spectrum, draw new one\n canvasContext.clearRect(0, 0, 1000, 325);\n canvasContext.fillStyle = gradient;\n drawSpectrum(array)\n\n // output the audio\n outputAudio(audioProcessingEvent);\n}", "function modulator() {\n // this odd construct is for safari compatibility\n this.audioCtx = new(window.AudioContext || window.webkitAudioContext)();\n\n this.samplerate = this.audioCtx.sampleRate;\n\n console.log(\"speakerSampleRate is \" + this.samplerate);\n\n this.encoder = new FskEncoder(this.samplerate);\n\n}", "function processAudioInput(event)\n{\n const r = window.radioclient\n\n if ( !r.transmitting || r.disable )\n return;\n\n const data = event.inputBuffer.getChannelData(0);\n r.soc.send(pointSample(\n data, Int16Array, data.length, null, r.inputInterpolationContext));\n}", "function outputAudio(audioProcessingEvent) {\n var inputBuffer = audioProcessingEvent.inputBuffer;\n var outputBuffer = audioProcessingEvent.outputBuffer;\n for(var channel = 0; channel < outputBuffer.numberOfChannels; channel++) {\n var inputData = inputBuffer.getChannelData(channel);\n var outputData = outputBuffer.getChannelData(channel);\n for(var sample = 0; sample < inputBuffer.length; sample++) {\n outputData[sample] = inputData[sample];\n }\n }\n}", "constructor(d, audioCtx, source, muted=true, dir=\"vertical\") {\n this.clipping = false;\n this.lastClip = 0;\n this.clipLag = 250;\n this.clipLevel = 250;\n this.mode = MeterMode.RMS;\n this.klipKludge = 0;\n\n this.analyser = audioCtx.createAnalyser();\n this.analyser.fftSize = 256;\n this.analyser.smoothingTimeConstant = 0.8;\n\n this.bufferLength = 128; // this.analyser.frequencyBinCount;\n this.dataArray = new Uint8Array(this.bufferLength);\n //this.dataArray = new Float32Array(this.bufferLength);\n\n\tsource.connect(this.analyser);\n // this.canvas = document.createElement(\"canvas\");\n this.canvas = document.createElement(\"div\");\n this.canvas.setAttribute(\"id\", \"audioCanvas\"+canvases++);\n this.canvas.classList.add(\"audioCanvas\");\n\n //this.canvas.width = d.offsetWidth - 4;\n //this.canvas.height = d.offsetHeight - 26;\n\n // this.canvas.style.position = \"absolute\"\n this.canvas.style.width = d.offsetWidth - 4 +\"px\";\n this.canvas.style.height = d.offsetHeight - 26 +\"px\";\n\n this.height = d.offsetHeight;\n\n //this.canvasCtx = this.canvas.getContext(\"2d\");\n this.dir = dir;\n if (this.dir === \"vertical\") {\n //this.canvas.style.opacity = 0.9;\n }\n if (d) {\n d.appendChild(this.canvas);\n }\n\n this.volume = 0;\n this.averaging = 0.95;\n //this.image = new Image(this.canvas.width, this.canvas.height);\n //this.image.src = \"./images/microphone.png\";\n // this.image.onload = () => this.draw;\n this.draw();\n this.muted = muted;\n }", "function updateAudio(){\n\n\tif (!isPlayingAudio)return;\n\tanalyser.getByteFrequencyData(freqByteData);\n\n\tvar length = freqByteData.length;\n\n\t//GET AVG LEVEL\n\tvar sum = 0;\n\tfor(var j = 0; j < length; ++j) {\n\t\tsum += freqByteData[j];\n\t}\n\n\t// Calculate the average frequency of the samples in the bin\n\tvar aveLevel = sum / length;\n\n\tnormLevel = (aveLevel / 256) * sketchParams.volSens; //256 is the highest a freq data can be\n\n\t//BEAT DETECTION\n\tif (normLevel > beatCutOff && normLevel > BEAT_MIN){\n\t\tbeatCutOff = normLevel *1.1;\n\t\tbeatTime = 0;\n\t}else{\n\t\tif (beatTime < BEAT_HOLD_TIME){\n\t\t\tbeatTime ++;\n\t\t}else{\n\t\t\tbeatCutOff *= BEAT_DECAY_RATE;\n\t\t}\n\t}\n}", "function JsAudio(myConsole) {\n var audio = this;\n\n var CPU_SPEED = 1193191.66666667; //6502 speed is 1.19 MHz (million cycles /sec)\n\n var JAVA_SOUND_SAMPLE_RATE = 44100; //44,100 samples/sec\n var TIA_SAMPLE_RATE = 31400;\n\n var CYCLES_PER_SAMPLE = CPU_SPEED / (JAVA_SOUND_SAMPLE_RATE * 1.0); //27.056\n\n // *** AUDIO FORMAT CONSTANTS ***\n var BYTES_PER_SAMPLE = 1;\n var BITS_PER_SAMPLE = BYTES_PER_SAMPLE * 8;\n var BIG_ENDIAN = true;\n var SIGNED_VALUE = true;\n var CHANNELS = 1;\n\n // *** AUDIO BUFFER MANAGEMENT ***\n var DEFAULT_BUFFER_CUSHION = 4000; //samples left in buffer to prevent underflow\n\n var myAudio = null;\n var myWave = new RIFFWAVE();\n\n //Misc\n var myPreOutputBuffer = new Array(JAVA_SOUND_SAMPLE_RATE * 4);\n var myInitSuccess = false;\n\n // Poke/Queue related variables\n // private java.util.Queue<AudioRegisterPoke> myPokeQueue=new java.util.ArrayDeque<AudioRegisterPoke>(); //J6SE only\n var myPokeQueue = new Queue(); //J5SE\n\n var myExcessCycles = 0;\n var myCyclePool = 0;\n var myPreviousCycle = 0;\n var myPreviousPoke = null;\n\n //Audio registers\n var myAUDC = new Array(2);\n var myAUDF = new Array(2);\n var myAUDV = [1, 1];\n\n var myFutureAUDC = new Array(2);\n var myFutureAUDF = new Array(2);\n var myFutureAUDV = new Array(2);\n\n //Synthesis related variables\n var myFrequencyDivider = [new FrequencyDivider(), new FrequencyDivider()]; //[2]; // Frequency dividers\n var myP4 = new Array(2); // 4-bit register LFSR (lower 4 bits used)\n var myP5 = new Array(2); // 5-bit register LFSR (lower 5 bits used)\n var myOutputCounter = 0;\n\n //CONFIG variables\n var myChannels = CHANNELS;\n var myVolumePercentage = 100;\n var myVolumeClip = 128;\n var myNominalDisplayFrameRate = 60;\n var myRealDisplayFrameRate = 60.0;\n var myCycleSampleFactor = 1.0;\n var myAdjustedCyclesPerAudioFrame = CYCLES_PER_SAMPLE;\n //private int myWholeCyclesPerAudioFrame=(int)(CYCLES_PER_SAMPLE / CHANNELS);\n\n var myBufferCushion = DEFAULT_BUFFER_CUSHION * myChannels;\n\n var mySoundEnabled = true;\n\n audio.isSoundEnabled = function () { return mySoundEnabled; }\n\n audio.setVolume = function (percent) { myVolumePercentage = percent; }\n\n audio.setSoundEnabled = function (aSoundEnabled) {\n /* if (aSoundEnabled!=mySoundEnabled)\n {\n reset();\n }//end : change in value\n */\n\n //TODO : better system of figuring out if sound is open/active, and informing user of this\n /*\n if ((mySDLine != null) && (mySDLine.isOpen())) {\n //if (aSoundEnabled==true) mySDLine.start();\n if (aSoundEnabled == false) {\n mySDLine.stop();\n mySDLine.flush();\n }\n } //end : not null\n */\n\n if (myAudio != null) {\n if (aSoundEnabled)\n myAudio.play();\n else\n myAudio.pause();\n }\n\n mySoundEnabled = aSoundEnabled;\n }\n\n audio.pauseAudio = function () {\n /*\n //TODO : a more elegant way of stopping audio temporarily, to keep clicks, etc from occuring during a pause\n if (mySDLine!=null) mySDLine.stop(); \n */\n\n myAudio.pause();\n }\n\n\n /**\n * Sets the nominal (theoretical) display frame rate. This is usually 60 or 50.\n * See documentation for setRealDisplayFrameRate(...).\n * @param aFrameRate \n */\n audio.setNominalDisplayFrameRate = function (aFrameRate) {\n myNominalDisplayFrameRate = aFrameRate;\n myPreviousCycle = 0; //? (JLA)\n updateCycleSampleFactor();\n }\n\n /**\n * The sound object bases its frequency on the display's frame rate. If the game\n * was designed for 60 frames per second display rate, then it expects to be\n * called that many times per second to accurately produce the correct pitch.\n * Because the timers that are used to run the emulator use \"millisecond deley\" rather\n * than \"frequency\", certain frame rates can only be approximated. \n * For example, a delay of 16 ms is 62.5 frames per second, and a delay of 17 ms\n * is 58.82 frames per second. \n * To remedy this approximation, the class responsible for timing will notify\n * this class (via JSConsole) to compensate for this inexact.\n * @param aRealFrameRate \n */\n audio.setRealDisplayFrameRate = function (aRealFrameRate) {\n myRealDisplayFrameRate = aRealFrameRate;\n updateCycleSampleFactor();\n }\n\n function updateCycleSampleFactor() {\n myCycleSampleFactor = myRealDisplayFrameRate / (myNominalDisplayFrameRate * 1.0);\n\n myAdjustedCyclesPerAudioFrame = CYCLES_PER_SAMPLE * myCycleSampleFactor;\n }\n\n audio.systemCyclesReset = function (aCurrentCycle) {\n myPreviousCycle -= aCurrentCycle;\n }\n\n /**\n * Used when user is saving game (aka a state save). The only data from this class\n * that needs to be saved are the contents of the registers. (Sometimes a game\n * will set the register early on and not touch it again.) This is called\n * during the serialization method of JSConsole.\n * @return The audio register data in array form.\n */\n audio.getAudioRegisterData = function () {\n var zReturn = new Array(6);\n zReturn[0] = myAUDC[0];\n zReturn[1] = myAUDC[1];\n zReturn[2] = myAUDF[0];\n zReturn[3] = myAUDF[1];\n zReturn[4] = myAUDV[0];\n zReturn[5] = myAUDV[1];\n return zReturn;\n }\n\n /**\n * This is the opposite of the getAudioRegisterData() method. It is called \n * by JSConsole after a saved game has been read.\n * @param aData an array of the register values\n */\n audio.setAudioRegisterData = function (aData) {\n setAudioRegister(AUDC0, aData[0]);\n setAudioRegister(AUDC1, aData[1]);\n setAudioRegister(AUDF0, aData[2]);\n setAudioRegister(AUDF1, aData[3]);\n setAudioRegister(AUDV0, aData[4]);\n setAudioRegister(AUDV1, aData[5]);\n }\n\n /**\n * Changes the audio mode to either mono (channels=1), or stereo (channels=2).\n * @param aChannels Number of channels (1 or 2)\n */\n audio.setChannelNumber = function (aChannels) {\n //assert((aChannels==1)||(aChannels==2));\n\n if (myChannels != aChannels) //is a change\n {\n myChannels = aChannels;\n audio.initialize();\n\n } //end : changing value\n }\n\n /**\n * Returns the number of channels the audio system is using.\n * @return returns a 1 for mono, 2 for stereo\n */\n audio.getChannelNumber = function () {\n return myChannels;\n }\n\n /**\n * Closes the sound, freeing up system sound resources.\n */\n audio.close = function () {\n try {\n if (myAudio != null)\n myAudio.pause();\n\n } //end : try\n catch (msg) {\n //TODO : better exception handling\n alert(msg);\n }\n }\n\n /**\n * Initializes the sound. After calling this, one should make sure that\n * close() is called when this class is finished.\n */\n audio.initialize = function () {\n try {\n var zPreviouslyEnabled = mySoundEnabled;\n mySoundEnabled = false; //just in case...\n\n\n //Step 0 - get rid of old sound system, if one exists\n if (myAudio != null) {\n myAudio.pause();\n myAudio = null;\n } //end : old one exists\n\n clearPokeQueue();\n\n //Step 1 - establish what format we're going to use\n //myAudioFormat = new AudioFormat((JAVA_SOUND_SAMPLE_RATE * 1.0), BITS_PER_SAMPLE, myChannels, SIGNED_VALUE, BIG_ENDIAN);\n myWave.header.sampleRate = JAVA_SOUND_SAMPLE_RATE;\n myWave.header.bitsPerSample = BITS_PER_SAMPLE;\n myWave.header.numChannels = myChannels;\n //System.out.println(\"AudioFormat - sampleRate=\" + myAudioFormat.getSampleRate() + \", framerate=\" + myAudioFormat.getFrameRate());\n\n //Step 2 - acquire a Source Data Line\n //var zDLI=new DataLine.Info(SourceDataLine.class, myAudioFormat);\n //System.out.println(\"Acquiring source data line info - \" + zDLI);\n //mySDLine=(SourceDataLine)AudioSystem.getLine(zDLI);\n\n //Step 3 - open and start that Source Data Line object\n //mySDLine.open(myAudioFormat);\n //mySDLine.start();\n myInitSuccess = true;\n\n mySoundEnabled = zPreviouslyEnabled;\n myBufferCushion = DEFAULT_BUFFER_CUSHION * myChannels;\n updateCycleSampleFactor();\n\n } //end : try\n catch (msg) {\n\n //TODO : some type of notification that audio wasn't available\n myInitSuccess = false;\n\n } //end : catch - Line Unavailable\n }\n\n /**\n * Checks to see if the required Java Sound objects were created successfully.\n * @return true if sound objects created successfully\n */\n audio.isSuccessfullyInitialized = function () {\n return myInitSuccess;\n }\n\n audio.reset = function () {\n myPreviousCycle = 0;\n\n clearPokeQueue();\n myAUDC[0] = myAUDC[1] = myAUDF[0] = myAUDF[1] = myAUDV[0] = myAUDV[1] = 0;\n myFutureAUDC[0] = myFutureAUDC[1] = myFutureAUDF[0] = myFutureAUDF[1] = myFutureAUDV[0] = myFutureAUDV[1] = 0;\n myP4[0] = myP5[0] = myP4[1] = myP5[1] = 1;\n myFrequencyDivider[0].set(0);\n myFrequencyDivider[1].set(0);\n myOutputCounter = 0;\n }\n\n\n // ==================== AUDIO REGISTER METHODS ======================\n /**\n * This is the method that actually changes the sound register\n * variables. It is called by processPokeQueue(...) shortly before\n * process(...) is called.\n * @param address Address of a sound register\n * @param value The value to assign to the given register\n */\n function setAudioRegister(address, value) {\n switch (address) {\n case 0x15: myAUDC[0] = value & 0x0f; break;\n case 0x16: myAUDC[1] = value & 0x0f; break;\n\n case 0x17:\n myAUDF[0] = value & 0x1f;\n myFrequencyDivider[0].set(myAUDF[0]);\n break;\n\n case 0x18:\n myAUDF[1] = value & 0x1f;\n myFrequencyDivider[1].set(myAUDF[1]);\n break;\n\n case 0x19: myAUDV[0] = value & 0x0f; break;\n case 0x1a: myAUDV[1] = value & 0x0f; break;\n default: break;\n }\n }\n\n function getAudioRegister(address) {\n switch (address) {\n case 0x15: return myAUDC[0];\n case 0x16: return myAUDC[1];\n case 0x17: return myAUDF[0];\n case 0x18: return myAUDF[1];\n case 0x19: return myAUDV[0];\n case 0x1a: return myAUDV[1];\n default: return 0;\n }\n }\n\n function setFutureAudioRegister(address, value) {\n switch (address) {\n case 0x15: myFutureAUDC[0] = value & 0x0f; break;\n case 0x16: myFutureAUDC[1] = value & 0x0f; break;\n case 0x17: myFutureAUDF[0] = value & 0x1f; break;\n case 0x18: myFutureAUDF[1] = value & 0x1f; break;\n case 0x19: myFutureAUDV[0] = value & 0x0f; break;\n case 0x1a: myFutureAUDV[1] = value & 0x0f; break;\n default: break;\n }\n }\n\n function getFutureAudioRegister(address) {\n switch (address) {\n case 0x15: return myFutureAUDC[0];\n case 0x16: return myFutureAUDC[1];\n case 0x17: return myFutureAUDF[0];\n case 0x18: return myFutureAUDF[1];\n case 0x19: return myFutureAUDV[0];\n case 0x1a: return myFutureAUDV[1];\n default: return 0;\n }\n }\n\n // ================= MAIN SYNTHESIS METHOD =====================\n function bool(aValue) {\n return (aValue != 0);\n }\n\n /**\n * This method creates sound samples based on the current settings of the\n * TIA sound registers.\n * @param buffer the array into which the newly calculated byte values are to be placed\n * @param aStartIndex the array index at which the method should start placing the samples\n * @param samples the number of samples to create\n */\n function synthesizeAudioData(aPreOutputBuffer, aStartIndex, aAudioFrames) {\n // int zSamplesToProcess=aSamplesPerChannel;\n var zSamples = aAudioFrames * myChannels;\n var zVolChannelZero = Math.floor(((myAUDV[0] << 2) * myVolumePercentage) / 100);\n var zVolChannelOne = Math.floor(((myAUDV[1] << 2) * myVolumePercentage) / 100);\n var zIndex = aStartIndex;\n // Loop until the sample buffer is full\n while (zSamples > 0) {\n // Process both TIA sound channels\n for (var c = 0; c < 2; ++c) {\n // Update P4 & P5 registers for channel if freq divider outputs a pulse\n if ((myFrequencyDivider[c].clock())) {\n switch (myAUDC[c]) {\n case 0x00: // Set to 1\n { // Shift a 1 into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x01: // 4 bit poly\n {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n break;\n }\n\n case 0x02: // div 31 . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x03: // 5 bit poly . 4 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit poly\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 as a standard 4-bit LSFR taps at bits 3 & 2\n myP4[c] = bool(myP4[c] & 0x0f) ? ((myP4[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP4[c] & 0x04) ? 1 : 0))) : 1;\n }\n break;\n }\n\n case 0x04: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x05: // div 2\n {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n break;\n }\n\n case 0x06: // div 31 . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x07: // 5 bit poly . div 2\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // P5 clocks the 4 bit register\n if (bool(myP5[c] & 0x10)) {\n // Clock P4 toggling the lower bit (divide by 2)\n myP4[c] = (myP4[c] << 1) | (bool(myP4[c] & 0x01) ? 0 : 1);\n }\n break;\n }\n\n case 0x08: // 9 bit poly\n {\n // Clock P5 & P4 as a standard 9-bit LSFR taps at 8 & 4\n myP5[c] = (bool(myP5[c] & 0x1f) || bool(myP4[c] & 0x0f)) ? ((myP5[c] << 1) | ((bool(myP4[c] & 0x08) ? 1 : 0) ^ (bool(myP5[c] & 0x10) ? 1 : 0))) : 1;\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x09: // 5 bit poly\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Clock value out of P5 into P4 with no modification\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x20) ? 1 : 0);\n break;\n }\n\n case 0x0a: // div 31\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Feed bit 4 of P5 into P4 (this will toggle back and forth)\n myP4[c] = (myP4[c] << 1) | (bool(myP5[c] & 0x10) ? 1 : 0);\n }\n break;\n }\n\n case 0x0b: // Set last 4 bits to 1\n {\n // A 1 is shifted into the 4-bit register each clock\n myP4[c] = (myP4[c] << 1) | 0x01;\n break;\n }\n\n case 0x0c: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0d: // div 6\n {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n break;\n }\n\n case 0x0e: // div 31 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // This does the divide-by 31 with length 13:18\n if ((myP5[c] & 0x0f) == 0x08) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n\n case 0x0f: // poly 5 . div 6\n {\n // Clock P5 as a standard 5-bit LSFR taps at bits 4 & 2\n myP5[c] = bool(myP5[c] & 0x1f) ? ((myP5[c] << 1) | ((bool(myP5[c] & 0x10) ? 1 : 0) ^ (bool(myP5[c] & 0x04) ? 1 : 0))) : 1;\n\n // Use poly 5 to clock 4-bit div register\n if (bool(myP5[c] & 0x10)) {\n // Use 4-bit register to generate sequence 000111000111\n myP4[c] = (~myP4[c] << 1) | ((!(!bool(myP4[c] & 4) && (bool(myP4[c] & 7)))) ? 0 : 1);\n }\n break;\n }\n }\n }\n }\n\n myOutputCounter += JAVA_SOUND_SAMPLE_RATE;\n\n if (myChannels == 1) {\n // Handle mono sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0); //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0);\n var zBothChannels = zChannelZero + zChannelOne + myVolumeClip;\n aPreOutputBuffer[zIndex] = (zBothChannels - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n zIndex++;\n zSamples--;\n //assert(zIndex<=aStartIndex + zSamplesToProcess);\n\n }\n }\n else {\n // Handle stereo sample generation\n while ((zSamples > 0) && (myOutputCounter >= TIA_SAMPLE_RATE)) {\n var zChannelZero = (bool(myP4[0] & 8) ? zVolChannelZero : 0) + myVolumeClip; //if bit3 is on, amplitude is the volume, otherwise amp is 0\n var zChannelOne = (bool(myP4[1] & 8) ? zVolChannelOne : 0) + myVolumeClip;\n //int zBothChannels=zChannelZero + zChannelOne + myVolumeClip;\n\n aPreOutputBuffer[zIndex] = (zChannelZero - 128) & 0xFF; // we are using a signed byte, which has a min. of -128\n zIndex++;\n zSamples--;\n\n aPreOutputBuffer[zIndex] = (zChannelOne - 128) & 0xFF;\n zIndex++;\n zSamples--;\n\n myOutputCounter -= TIA_SAMPLE_RATE;\n }\n }\n }\n }\n\n /**\n * This takes register values off the register queue and submits them to the process of\n * sample creation by calling the process(...) method.\n *\n * This is called by the doFrameAudio() method, which is called once per frame.\n * <b>\n * When the ROM tells the CPU to poke the sound registers in the TIA, the TIA forwards\n * the data to this class (to the set() method). Instead of setting the register\n * variables immediately, it saves the poke data as a AudioRegisterPoke object and puts it\n * in a queue object. The processPokeQueue method takes these one-by-one off the front\n * of the queue and, one-by-one, sets the register variables, and calls the process(...)\n * method, creating a sound with a sample length corresponding to the number of\n * processor cycles that elapsed between it and the sound register change after\n * it.\n * @return total number of samples created\n */\n function processPokeQueue() {\n assert(myPokeQueue.getSize() > 0);\n var zCurrentBufferIndex = 0;\n var zEndOfFrame = false;\n\n while (zEndOfFrame == false) {\n var zRW = myPokeQueue.dequeue();\n if ((zRW == null)) {\n zEndOfFrame = true;\n }\n\n if (zRW != null) {\n assert(zRW.myDeltaCycles >= 0);\n\n if (zRW.myAddr != 0)\n setAudioRegister(zRW.myAddr, zRW.myByteValue);\n\n myCyclePool += zRW.myDeltaCycles;\n // if (myCyclePool>=CYCLE_COUNT_CUTOFF) {\n var zAudioFramesInPool = myCyclePool / myAdjustedCyclesPerAudioFrame;\n var zWholeAudioFramesInPool = Math.floor(zAudioFramesInPool);\n myCyclePool = myCyclePool - (zWholeAudioFramesInPool * myAdjustedCyclesPerAudioFrame * 1.0);\n //myCyclePool= myCyclePool % myWholeCyclesPerAudioFrame; //the new cycle count is the remainder from the division\n\n // dbgout(\"Processing --frame=\" + zRW.myDebugFrameCounter +\", #=\" + zRW.myDebugCounter + \", \" + zSamplesInBunch + \" samples/pool, zDeltaCycles==\" + zRW.myDeltaCycles);\n synthesizeAudioData(myPreOutputBuffer, zCurrentBufferIndex, zWholeAudioFramesInPool);\n zCurrentBufferIndex += (zWholeAudioFramesInPool * myChannels); //each samples is represented by a single byte in myAudioBuffer\n // }//end : met the threshold\n }\n var zNextARP = myPokeQueue.getOldestElement();\n if ((zNextARP == null) || (zNextARP.myFrameEnd == true)) zEndOfFrame = true;\n }\n\n return zCurrentBufferIndex;\n }\n\n /**\n * A very imperfect method that plays the sound information that has accumulated over\n * the past video frame.\n * @param aCycles the current CPU system cycle count\n * @param aFPS the console's framerate, in frames per second\n */\n audio.doFrameAudio = function (aCycles, aFPS) {\n\n\n return;\n\n\n if (audio.isSoundEnabled() == true) {\n //STEP 1 : add an 'end of frame' signal to the poke queue\n addPokeToQueue(true, aCycles, 0, 0); //indicates the end of a frame\n\n //STEP 2 : turn a frame's worth of poke objects into audio data (in the myPreOutputBuffer)\n zSamples = processPokeQueue();\n\n /*\n zBufferSize = mySDLine.getBufferSize();\n zAvailable = mySDLine.available();\n zInBuffer = zBufferSize - zAvailable;\n\n\n //STEP 3 : send audio data to the audio system (i.e. play the sound)\n\n\n\n //CURRENT SYSTEM OF BUFFER MANAGEMENT :\n //This assumes the actual emulator is running fastor than the nominal CPU speed, thus gradually filling up\n //the SDL sound buffer (not to be confused with myPreOutputBuffer). It just limits the number of samples that\n //actually make it into the play buffer. It doesn't affect the number of samples processed, as this might\n //affect the frequency (pitch) of music.\n\n zPercentFull = 100.0 * (zInBuffer / zBufferSize); //used in debugging\n\n var zToPlay = Math.min(myBufferCushion - zInBuffer, zSamples);\n zToPlay = Math.max(0, zToPlay); //Make sure it's zero or greater\n if (myChannels == 2) zToPlay = roundToEven(zToPlay); //make sure it's even if it's stereo\n */\n\n /*\n if (mySDLine.isRunning() == false) mySDLine.start();\n\n mySDLine.write(myPreOutputBuffer, 0, zToPlay); //Math.min(zSamples,zAvail)); //This sends the samples to the play buffer - out of the programmer's hands after this point\n */\n\n myAudio = new Audio();\n var buffer = myPreOutputBuffer.slice(0, zSamples);\n myWave.Make(buffer);\n myAudio.src = myWave.dataURI;\n myAudio.play();\n\n }\n }\n\n function roundToEven(aNumber) {\n //return (aNumber / 2) * 2; \n return (aNumber % 2 != 0) ? (aNumber - 1) : aNumber;\n }\n\n function clearPokeQueue() {\n myPokeQueue = new Queue();\n addPokeToQueue(true, 0, 0, 0); //Add a 1-frame lag\n }\n\n function addPokeToQueue(aFrameEnd, aCycleNumber, aAddress, aByteValue) {\n //STEP 1 : Determine how many cycles have elapsed since last poke and assign that to previous poke (in queue)\n var zDeltaCycles = aCycleNumber - myPreviousCycle;\n if (myPreviousPoke != null) myPreviousPoke.myDeltaCycles = zDeltaCycles; //setting delta cycles on previous one\n\n //STEP 2 : Determine if this poke is actually changing any values\n var zValueToOverwrite = getFutureAudioRegister(aAddress);\n\n //STEP 3 : If poke is a new value or this is the end of a frame, add a poke object to queue\n //I'm not sure how necessary this whole only-add-if-different-value thing is...I just thought it might be good if ((zValueToOverwrite!=aByteValue)||(aFrameEnd==true)) \n //{ \n var zRW = new AudioRegisterPoke(aFrameEnd, aAddress, aByteValue);\n myPokeQueue.enqueue(zRW);\n setFutureAudioRegister(aAddress, aByteValue);\n myPreviousPoke = zRW;\n myPreviousCycle = aCycleNumber;\n\n //}//end : new value for future reg\n //\n }\n\n /**\n * This method is called by TIA when it receives a poke command destined for a\n * sound register. This is the method that converts the data received into a\n * AudioRegisterPoke object and stores that object on a queue for later processing.\n * Check out the processPokeQueue(...) description for details.\n * @param addr address to poke\n * @param aByteValue byte value of the poke\n * @param cycle the CPU system cycle number\n * @see processPokeQueue(int, int, int)\n */\n audio.pokeAudioRegister = function (addr, aByteValue, cycle) {\n if (audio.isSoundEnabled() == true) {\n addPokeToQueue(false, cycle, addr, aByteValue);\n }\n }\n\n //=============================================================================\n //========================== INNER CLASSES ====================================\n //=============================================================================\n function FrequencyDivider() {\n //private final static long serialVersionUID = 8982487492473260236L;\n var myDivideByValue = 0;\n var myCounter = 0;\n var fd = this;\n\n fd.set = function (divideBy) { myDivideByValue = divideBy; }\n fd.clock = function () {\n myCounter++;\n if (myCounter > myDivideByValue) {\n myCounter = 0;\n return true;\n }\n return false;\n }\n }\n\n function AudioRegisterPoke(aFrameEnd, aAddr, aByteValue) {\n // private final static long serialVersionUID = -4187197137229151004L;\n var arp = this;\n arp.myAddr = aAddr;\n arp.myByteValue = aByteValue;\n arp.myDeltaCycles = 0;\n arp.myFrameEnd = aFrameEnd;\n }\n\n //NOTE : when actual frame rate is below the theoretical audio frame rate, you get a buffer underrun -> popping noises\n // when actual frame rate is significantly above the theoretical fps, you get too much cut out by the compensation,\n //which causes a sort of singing-on-a-bumpy-road effect...\n\n\n audio.debugSetReg = function (address, value) {\n setAudioRegister(address, value);\n }\n\n function dbgout(aOut) {\n System.out.println(\"DEBUG: \" + aOut);\n }\n\n /**\n * Occasionally good for debugging, but ultimately, this method must go.\n * @param aTimerDelay\n * @deprecated\n */\n audio.debugPlayChunk = function (aTimerDelay) {\n var zSamples = Math.floor(((JAVA_SOUND_SAMPLE_RATE / 1000.0) * aTimerDelay));\n\n if (zSamples > myPreOutputBuffer.length) zSamples = myPreOutputBuffer.length;\n synthesizeAudioData(myPreOutputBuffer, 0, zSamples);\n var zAvail = mySDLine.available();\n\n mySDLine.write(myPreOutputBuffer, 0, Math.min(zSamples, zAvail));\n }\n\n audio.debugGetSourceDataLine = function () {\n return mySDLine;\n }\n\n audio.reset();\n}", "init(frameDuration){\n // Initialize variables\n\n // Frame information\n // Frame duration (e.g., 0.02 s)\n const fSize = frameDuration*sampleRate;\n // Make the framesize multiple of 128 (audio render block size)\n this._frameSize = 128*Math.round(fSize/128); // Frame duration = this._frameSize/sampleRate;\n this._frameSize = Math.max(128*2, this._frameSize); // Force a minimum of two blocks\n\n this._numBlocksInFrame = this._frameSize/128; // 8 at 48kHz and 20ms window\n // Force an even number of frames\n if (this._numBlocksInFrame % 2){\n this._numBlocksInFrame++;\n this._frameSize += 128;\n }\n // Predefined 50% overlap\n this._numBlocksOverlap = Math.floor(this._numBlocksInFrame/2); // 4 at 48kHz and 20ms window\n\n // Define frame buffers\n this._oddBuffer = new Float32Array(this._frameSize); // previous and current are reused\n this._pairBuffer = new Float32Array(this._frameSize); // previous and current are reused\n\n // We want to reuse the two buffers. This part is a bit complicated and requires a detailed description\n // Finding the block indices that belong to each buffer is complicated\n // for buffers with an odd num of blocks.\n // Instead of using full blocks, half blocks could be used. This also adds\n // another layer of complexity, so not much to gain...\n // Module denominator to compute the block index\n this._modIndexBuffer = this._numBlocksInFrame + this._numBlocksInFrame % 2; // Adds 1 to numBlocksInFrame if it's odd, otherwise adds 0\n\n // Count blocks\n this._countBlock = 0;\n\n // Computed buffers\n this._oddSynthBuffer = new Float32Array(this._frameSize);\n this._pairSynthBuffer = new Float32Array(this._frameSize);\n\n console.log(\"Frame size: \" + this._frameSize +\n \". Set frame length: \" + this._frameSize/sampleRate + \" seconds\" +\n \". Blocks per frame: \" + this._numBlocksInFrame +\n \". Blocks overlap: \" + this._numBlocksOverlap);\n\n\n\n\n // LCP variables\n this._lpcOrder = 20;\n // LPC filter coefficients\n this._lpcCoeff = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n // LPC k coefficients\n this._kCoeff = [];\n // Filter samples\n this._prevY = [];\n // Quantization\n this._quantOpt = false;\n this._quantBits = 2;\n // Reverse K's\n this._reverseKOpt = false;\n // Perfect synthesis\n this._perfectSynthOpt = false;\n\n // resampling before analysis\n this._resamplingFactor = 1;\n this._resampler = new Resampler(this._frameSize, this._resamplingFactor);\n // Unvoiced mix (adds noise to the perfect excitation signal)\n this._unvoicedMix = 0;\n // Pitch factor (modifies this._fundFreq)\n this._pitchFactor = 1;\n // Vibrato effect (modifies this._fundFreq)\n this._vibratoEffect = 0;\n\n\n\n // Synthesis\n // Create impulse signal\n this._oldTonalBuffer = new Float32Array(this._frameSize/2);\n this._excitationSignal = new Float32Array(this._frameSize);\n this._errorBuffer = new Float32Array(this._frameSize);\n this._mixedExcitationSignal = new Float32Array(this._frameSize);\n\n // autocorrelation indices for fundamental frequency estimation\n this._lowerACFBound = Math.floor(sampleRate / 200); // 200 Hz upper frequency limit -> lower limit for periodicity in samples\n this._upperACFBound = Math.ceil(sampleRate / 70); // 70 Hz lower frequency limit -> upper limit\n\n // excitation variables\n this._tonalConfidence = 0.5;\n this._confidenceTonalThreshold = 0.1;\n this._periodFactor = 1;\n\n // buffer for fundamental period estimation\n this._fundPeriodLen = this._upperACFBound - this._lowerACFBound;\n this._fundPeriodBuffer = [];\n this._oldPeriodSamples = this._upperACFBound;\n this._pulseOffset = 0;\n\n\n\n\n // Debug\n // Timer to give updates to the main thread\n this._lastUpdate = currentTime;\n // Block info\n this._block1 = new Float32Array(128);\n this._block2 = new Float32Array(128);\n\n }", "function processAudioOutput(event)\n{\n const r = window.radioclient\n\n const length = r.out.worker.bufferSize;\n const out = event.outputBuffer.getChannelData(0);\n\n if ( !r.transmitting && r.receiveQueue.length > 0 ) {\n r.on_time_receive_packets += 1;\n pointSample(\n r.receiveQueue,\n out,\n r.receiveQueue.length,\n out.length,\n r.outputInterpolationContext\n );\n }\n else {\n // No data available, just fill the array with silence.\n // At this writing, Chrome doesn't have fill() on the output array,\n // Firefox does.\n r.delayed_receive_packets += 1;\n if ( typeof(out.fill) == \"function\" )\n out.fill(0, 0, length);\n else {\n for ( var i = 0; i < length; i++ ) {\n out[i] = 0;\n }\n }\n }\n old_ratio = r.delayed_receive_packets_ratio;\n r.delayed_receive_packets_ratio = Math.round((r.delayed_receive_packets\n / (r.delayed_receive_packets + r.on_time_receive_packets))\n * 100);\n \n if ( old_ratio != r.delayed_receive_packets_ratio )\n receivingNotice();\n}", "function monoSynth() {\n userStartAudio();\n\n // let level = amplitude.getLevel();\n // let size = map(level, 0,1,0,200);\n\n if(soundLoop.isPlaying) {\n soundLoop.stop();\n } else {\n soundLoop.start();\n }\n}", "function vorbis_lpc_from_data(data, lpci, n, m){\n NOT_IMPLEMENTED();\n}", "function setupSound() {\n sound = audioContext.createBufferSource();\n sound.buffer = sampleBuffer;\n sound.loop = loop; //auto is false\n sound.playbackRate.value = playbackSlider.value;\n\n analyser.smoothingTimeConstant = .85, //0<->1. 0 is no time smoothing\n analyser.fftSize = 2048, //must be some number by the power of 2, ex. 512\n analyser.minDecibels = -150,\n analyser.maxDecibels = -10,\n\n sound.connect(filter); //can connect more than one to a node, as long as it all ends up at destination\n \n //connect source/sound var to the gain node\n filter.connect(gainNode);\n filter.connect(analyser);\n analyser.connect(scriptProcessorNode);\n scriptProcessorNode.connect(gainNode);\n gainNode.connect(panNode);\n //connect pan node to the destination (a.k.a. the speakers)\n panNode.connect(audioContext.destination);\n \n //frequencyBinCount property of the analyserNode interface is an unsigned long value half that of the fft size -MDN\n bufferLength = analyser.frequencyBinCount; \n\n //animate the bars\n scriptProcessorNode.onaudioprocess = function (audioProcessingEvent) {\n array = new Uint8Array(bufferLength);\n analyser.getByteFrequencyData(array);\n\n boost = 0;\n for (var i = 0; i < array.length; i++) {\n boost += array[i];\n }\n boost = boost / array.length;\n\n var step = Math.round(array.length / numBars);\n\n //iterate through bars and scale the z axis\n for (var i = 0; i < numBars; i++) {\n var value = array[i * step] / 4;\n value = value < 1 ? 1 : value;\n bars[i].scale.z = value;\n }\n }\n}", "pronunciationAnalysisInitAudio(recorder, dataavailableCb) {\n var self = this;\n\n // Indicate to the socket server that we're about to start recording a\n // challenge. This allows the socket server some time to fetch the metadata\n // and reference audio to start the analysis when audio is actually submitted.\n var specs = recorder.getAudioSpecs();\n this._session.call('nl.itslanguage.pronunciation.init_audio',\n [self._analysisId, specs.audioFormat], specs.audioParameters).then(\n // RPC success callback\n function(analysisId) {\n console.log('Accepted audio parameters for analysisId after init_audio: ' + self._analysisId);\n // Start listening for streaming data.\n recorder.addEventListener('dataavailable', dataavailableCb);\n },\n // RPC error callback\n function(res) {\n self.logRPCError(res);\n }\n );\n }", "function MV_Mix(voice) {\n var start;\n var length;\n var voclength;\n var position;\n var rate;\n var FixedPointBufferSize;\n\n if ((voice.length == 0)\n && (voice.GetSound(voice) != KeepPlaying)) {\n return;\n }\n\n length = MixBufferSize;\n FixedPointBufferSize = voice.FixedPointBufferSize;\n\n MV_MixDestination = MV_FooBuffer;\n MV_LeftVolume = voice.LeftVolume;\n MV_RightVolume = voice.RightVolume;\n MV_GLast = voice.GLast;\n MV_GPos = voice.GPos;\n MV_GVal = voice.GVal;\n\n if ((MV_Channels == 2) && (IS_QUIET(MV_LeftVolume))) {\n MV_LeftVolume = MV_RightVolume;\n MV_MixDestination += 8;\n }\n\n // Add this voice to the mix\n while (length > 0) {\n start = voice.sound;\n rate = voice.RateScale;\n position = voice.position;\n\n // Check if the last sample in this buffer would be\n // beyond the length of the sample block\n if ((position + FixedPointBufferSize) >= voice.length) {\n if (position < voice.length) {\n voclength = (voice.length - position + rate - 1) / rate | 0;\n }\n else {\n voice.GetSound(voice);\n return;\n }\n }\n else {\n voclength = length;\n }\n\n voice.mix(position, rate, start, voclength);\n\n if (voclength & 1) {\n MV_MixPosition += rate;\n voclength -= 1;\n }\n voice.position = MV_MixPosition;\n\n length -= voclength;\n\n if (voice.position >= voice.length) {\n // Get the next block of sound\n if (voice.GetSound(voice) != KeepPlaying) {\n return;\n }\n\n if (length > 0) {\n // Get the position of the last sample in the buffer\n FixedPointBufferSize = voice.RateScale * (length - 1);\n }\n }\n }\n}", "constructor({audioCtx, fftSize, carFreq, modAmpl, modFreq, visualCtx}) {\n this.audioCtx = audioCtx;\n this,fftSize = fftSize;\n this.carFreq = carFreq;\n this.modAmpl = modAmpl;\n this.modFreq = modFreq;\n this.visualCtx = visualCtx;\n this.play = false;\n\n\n this.animate;\n this.analyserNode = audioCtx.createAnalyser();\n this.analyserNode.smoothingTimeConstant = 0.0;\n this.analyserNode.fftSize = fftSize;\n\n // Create the array for the data values\n this.frequencyArray = new Uint8Array(this.analyserNode.frequencyBinCount);\n\n // Uses the chroma.js library by Gregor Aisch to create a color gradient\n // download from https://github.com/gka/chroma.js\n this.colorScale = new chroma.scale('Spectral').domain([1,0]);\n // Global Variables for Drawing\n this.column = 0;\n this.canvasWidth = 800;\n this.canvasHeight = 256;\n }", "function audio_onprocess(ev)\n{\n audio_firefox_watchdog++;\n\n if (audio_disconnected) return;\n \n //if (!audio_started) { kiwi_log('audio_onprocess audio_started='+ audio_started +' ql='+ audio_prepared_buffers.length +' ----------------'); }\n\tif (audio_stat_output_epoch == -1) {\n\t\taudio_stat_output_epoch = (new Date()).getTime();\n\t\taudio_stat_output_bufs = 0;\n\t}\n\n\t/*\n\t// simulate Firefox \"goes silent\" problem\n\tif (dbgUs && kiwi_isFirefox() && ((audio_stat_output_bufs & 0x1f) == 0x1f)) {\n\t\tev.outputBuffer.copyToChannel(audio_silence_buffer,0);\n if (audio_channels == 2) ev.outputBuffer.copyToChannel(audio_silence_buffer, 1);\n\t\treturn;\n\t}\n\t*/\n\t\n\t/*\n\tif (dbgUs && ((audio_stat_output_bufs & 0x1f) == 0x1f)) {\n kiwi_log('AUDIO force underrun');\n\t audio_prepared_buffers = [];\n\t}\n\t*/\n\n\taudio_stat_output_bufs++;\n\n\tif (audio_started && audio_prepared_buffers.length == 0) {\n\t\taudio_underrun_errors++;\n //kiwi_log('AUDIO UNDERRUN BUFFERING');\n audio_buffering = true;\n\t}\n\n\tif (!audio_started || audio_buffering) {\n\t\taudio_need_stats_reset = true;\n\t\tev.outputBuffer.copyToChannel(audio_silence_buffer, 0);\n if (audio_channels == 2) ev.outputBuffer.copyToChannel(audio_silence_buffer, 1);\n\t\treturn;\n\t}\n\n\tev.outputBuffer.copyToChannel(audio_prepared_buffers.shift(), 0);\n\tif (audio_channels == 2) ev.outputBuffer.copyToChannel(audio_prepared_buffers2.shift(), 1);\n\t\n\taudio_ext_sequence = audio_prepared_seq.shift();\n\n\tif (audio_change_LPF_delayed) {\n\t\taudio_recompute_LPF(0);\n\t\taudio_change_LPF_delayed = false;\n\t}\n\t\n\tsMeter_dBm_biased = audio_prepared_smeter.shift() / 10;\n\t\n\tvar flags = audio_prepared_flags.shift();\n\taudio_ext_adc_ovfl = (flags & audio_flags.SND_FLAG_ADC_OVFL)? true:false;\n\n\tif (flags & audio_flags.SND_FLAG_LPF) {\n\t\taudio_change_LPF_delayed = true;\n\t}\n\t\n\tif (audio_meas_dly_ena && audio_meas_dly_start && (flags & audio_flags.SND_FLAG_NEW_FREQ)) {\n\t\taudio_meas_dly = (new Date()).getTime() - audio_meas_dly_start;\n kiwi_log('AUDIO dly='+ audio_meas_dly);\n\t\taudio_meas_dly_start = 0;\n\t}\n}", "function manipulateaudio(){\n if(cameraaudio){\n cameraaudio = !cameraaudio;\n buttonOff(document.querySelector('.app__system--button.mic'));\n camerastream.getAudioTracks()[0].enabled = cameraaudio;\n //-------------------CREATE NEW PRODUCER-------------------------------------------\n removeOldAudioProducers();\n let audioProducer = mediasouproom.createProducer(camerastream.getAudioTracks()[0]);\n audioProducer.send(sendTransport);\n updateaudio();\n }\n}", "function process(audioStream) {\n //wraps stream in a source object allows us to connect our stream to our analyzer\n const audioSource = audioContext.createMediaStreamSource(audioStream)\n audioSource.connect(analyser)\n\n //array of audio data with has length of audioContext.fftSize\n const audioData = new Uint8Array(analyser.frequencyBinCount)\n const dataLength = audioData.length\n\n const lineHeight = canvasHeight / dataLength\n const xPosition = canvasWidth - 1\n\n contextOfCanvas.fillStyle = `hsl(280, 100%, 10%)`\n contextOfCanvas.fillRect(0, 0, canvasWidth, canvasHeight)\n\n loop()\n\n function loop() {\n //call again on next frame\n window.requestAnimationFrame(loop)\n\n //take data and move it one pixel to the left\n let imageData = contextOfCanvas.getImageData(\n 1,\n 0,\n canvasWidth - 1,\n canvasHeight\n )\n\n contextOfCanvas.fillRect(0, 0, canvasWidth, canvasHeight)\n contextOfCanvas.putImageData(imageData, 0, 0)\n\n //analyser will populate and transform data array\n analyser.getByteFrequencyData(audioData)\n\n for (let i = 0; i < dataLength; i++) {\n let ratio = audioData[i] / 255\n\n let hue = (ratio * 120 + 280) % 360\n let saturation = \"100%\"\n let lightness = 10 + 70 * ratio + \"%\"\n\n contextOfCanvas.beginPath()\n contextOfCanvas.strokeStyle = `hsl(${hue}, ${saturation}, ${lightness})`\n contextOfCanvas.lineWidth = 15\n contextOfCanvas.moveTo(xPosition, canvasHeight - i * lineHeight)\n contextOfCanvas.lineTo(\n xPosition,\n canvasHeight - (i * lineHeight + lineHeight)\n )\n contextOfCanvas.stroke()\n }\n }\n }", "function sfProcessingClass() {\t// creates sfProcessing object\n\t//--- UNIT CONVERSION functions for various units that are referenced in Soundfonts (there's a lot!)\n\tvar uc = {\t\t// Unit Conversion: For combining SF parameters, or converting to WebAudio ones.\n\t\tcent_to_semitone: function(a) { return a/100; },\n\t\tsemitone_to_cent: function(a) { return a*100; },\n\t\tmidikey_to_hertz: function(a) { return Math.pow(2, (a - 69) / 12) * 440.0;},\n\t\thertz_to_midikey: function(a) { return (Math.log(a/440.0)/Math.log(2))*12+69; },\n\t\t\n\t};\n\t//--- FUNCTIONS assigned to various data types within sound fonts, so they can \"handle\" their own operations based on their type.\n\tvar combineParmsAdding = function(a,b,parmName) {\n\t\t//--- The combine parms routines are different ways of putting a parameter from b into a, where b can override a (e.g. b could be a preset and a could be an instrument, etc.). A and B are objects with multiple parameters in them.\n\t\tif (!b.hasOwnProperty(parmName)) return;\n\t\tif (b[parmName]===null) return;\n\t\tif (!a.hasOwnProperty(parmName)) a[parmName] = b[parmName];\n\t\telse a[parmName] += b[parmName];\n\t};\n\tvar combineParmsSubstituting = function(a,b,parmName) {\n\t\tif (!b.hasOwnProperty(parmName)) return;\n\t\tif (b[parmName]===null) return;\n\t\ta[parmName] = b[parmName];\n\t};\n\tvar combineParmsIgnoring = function(a,b,parmName) { };\n\t//--- DATA about SoundFont parameters! Mostly straight from the SoundFont public implementation document!\n\tvar typeInfo = { \t\t// Types of parameters have associated functions, etc., which if they exist, override those of units.\n\t\t'index': { combine: combineParmsIgnoring, },\n\t\t'range': { combine: combineParmsIgnoring, },\n\t\t'sample': { combine: combineParmsSubstituting, },\t\t// combine is done at the unit level\n\t\t'value': { },\t\t// combine is done at the unit level\n\t\t'substitution': { combine: combineParmsSubstituting, },\n\t};\n\tvar unitInfo = {\t\t// Units of measure have associated combining functions, etc.\n\t\t'smpls': { combine: combineParmsAdding, },\n\t\t'32k_smpls': { combine: combineParmsAdding, },\n\t\t'cent_fs': { parent_unit: 'cent', },\n\t\t'cent': { combine: combineParmsAdding, },\n\t\t'cB': { combine: combineParmsAdding, },\n\t\t'cB_fs': { parent_unit: 'cB', },\n\t\t'cB_attn': { parent_unit: 'cB', },\n\t\t'tenth_percent': { combine: combineParmsAdding, },\n\t\t'minus_tenth_percent': { combine: combineParmsAdding, },\n\t\t'timecent': { combine: combineParmsAdding, },\n\t\t'tcent_per_key': { parent_unit: 'timecent', },\n\t\t'index': { combine: combineParmsSubstituting, },\n\t\t'range': { combine: combineParmsIgnoring, },\n\t\t'midikey': { combine: combineParmsSubstituting, },\n\t\t'midivel': { combine: combineParmsSubstituting, },\n\t\t'bitflags': { combine: combineParmsIgnoring, },\n\t\t'semitone': { combine: combineParmsAdding, },\n\t\t'cent_per_key': { parent_unit: 'cent', },\n\t\t'number': { combine: combineParmsIgnoring, },\n\t};\n\tvar parmInfo = {\t\t// For every parameter that might be returned by the parser, we need to know what to do from the SF2 spec.\n 'startAddrsOffset': { unit: 'smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'endAddrsOffset': { unit: 'smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'startloopAddrsOffset': {unit: 'smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'endloopAddrsOffset': {unit: 'smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'startAddrsCoarseOffset': {unit: '32k_smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'modLfoToPitch': {unit:'cent_fs',min:-12000,max:12000,default:0,type:'value',nonpreset:false,},\n 'vibLfoToPitch': {unit:'cent_fs',min:-12000,max:12000,default:0,type:'value',nonpreset:false,},\n 'modEnvToPitch': {unit:'cent_fs',min:-12000,max:12000,default:0,type:'value',nonpreset:false,},\n 'initialFilterFc': {unit: 'cent',min:1500,max:13500,default:13500,type:'value',nonpreset:false,},\n 'initialFilterQ': {unit: 'cB',min:0,max:960,default:0,type:'value',nonpreset:false,},\n 'modLfoToFilterFc': {unit:'cent_fs',min:-12000,max:12000,default:0,type:'value',nonpreset:false,},\n 'modEnvToFilterFc': {unit:'cent_fs',min:-12000,max:12000,default:0,type:'value',nonpreset:false,},\n 'endAddrsCoarseOffset': {unit: '32k_smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'modLfoToVolume': {unit: 'cB_fs',min:-960,max:960,default:0,type:'value',nonpreset:false,},\n 'chorusEffectsSend': {unit: 'tenth_percent',min:0,max:1000,default:0,type:'value',nonpreset:false,},\n 'reverbEffectsSend': {unit: 'tenth_percent',min:0,max:1000,default:0,type:'value',nonpreset:false,},\n 'pan': {unit: 'tenth_percent',min:-500,max:500,default:0,type:'value',nonpreset:false,},\n 'delayModLFO': {unit:'timecent',min:-12000,max:5000,default:-12000,type:'value',nonpreset:false,},\n 'freqModLFO': {unit: 'cent',min:-16000,max:4500,default:0,type:'value',nonpreset:false,},\n 'delayVibLFO': {unit:'timecent',min:-12000,max:5000,default:-12000,type:'value',nonpreset:false,},\n 'freqVibLFO': {unit: 'cent',min:-16000,max:4500,default:0,type:'value',nonpreset:false,},\n 'delayModEnv': {unit:'timecent',min:-12000,max:5000,default:-12000,type:'value',nonpreset:false,},\n 'attackModEnv': {unit:'timecent',min:-12000,max:8000,default:-12000,type:'value',nonpreset:false,},\n 'holdModEnv': {unit:'timecent',min:-12000,max:5000,default:-12000,type:'value',nonpreset:false,},\n 'decayModEnv': {unit:'timecent',min:-12000,max:8000,default:-12000,type:'value',nonpreset:false,},\n 'sustainModEnv': {unit:'minus_tenth_percent',min:0,max:1000,default:0,type:'value',nonpreset:false,},\n 'releaseModEnv': {unit:'timecent',min:-12000,max:8000,default:-12000,type:'value',nonpreset:false,},\n 'keynumToModEnvHold': {unit:'tcent_per_key',min:-1200,max:1200,default:0,type:'value',nonpreset:false,},\n 'keynumToModEnvDecay': {unit:'tcent_per_key',min:-1200,max:1200,default:0,type:'value',nonpreset:false,},\n 'delayVolEnv': {unit:'timecent',min:-12000,max:5000,default:-12000,type:'value',nonpreset:false,},\n 'attackVolEnv': {unit:'timecent',min:-12000,max:8000,default:-12000,type:'value',nonpreset:false,},\n 'holdVolEnv': {unit:'timecent',min:-12000,max:5000,default:-12000,type:'value',nonpreset:false,},\n 'decayVolEnv': {unit:'timecent',min:-12000,max:8000,default:-12000,type:'value',nonpreset:false,},\n 'sustainVolEnv': {unit: 'cB_attn',min:0,max:1440,default:0,type:'value',nonpreset:false,},\n 'releaseVolEnv': {unit:'timecent',min:-12000,max:8000,default:-12000,type:'value',nonpreset:false,},\n 'keynumToVolEnvHold': {unit:'tcent_per_key',min:-1200,max:1200,default:0,type:'value',nonpreset:false,},\n 'keynumToVolEnvDecay': {unit:'tcent_per_key',min:-1200,max:1200,default:0,type:'value',nonpreset:false,},\n 'instrument': {unit: 'index',min:null,max:null,default:null,type:'index',nonpreset:false,},\n 'keyRange': {unit: 'range',min:null,max:null,default:null,type:'range',nonpreset:false,},\n 'velRange': {unit: 'range',min:null,max:null,default:null,type:'range',nonpreset:false,},\n 'startloopAddrsCoarseOffset': {unit: 'smpls',min:null,max:null,default:0,type:'sample',nonpreset:true,},\n 'keynum': {unit: 'midikey',min:null,max:null,default:null,type:'substitution',nonpreset:true,},\n 'velocity': {unit: 'midivel',min:null,max:null,default:null,type:'substitution',nonpreset:true,},\n 'initialAttenuation': {unit: 'cB',min:0,max:1440,default:0,type:'value',nonpreset:false,},\n 'endloopAddrsCoarseOffset': {unit: 'smpls',min:null,max:null,default:null,type:'sample',nonpreset:true,},\n 'coarseTune': {unit: 'semitone',min:-120,max:120,default:0,type:'value',nonpreset:false,},\n 'fineTune': {unit: 'cent',min:-99,max:99,default:0,type:'value',nonpreset:false,},\n 'sampleID': {unit: 'index',min:null,max:null,default:null,type:'index',nonpreset:false,},\n 'sampleModes': {unit: 'bitflags',min:null,max:null,default:null,type:'sample',nonpreset:true,},\n 'scaleTuning': {unit: 'cent_per_key',min:0,max:1200,default:100,type:'value',nonpreset:false,},\n 'exclusiveClass': {unit: 'number',min:0,max:127,default:0,type:'sample',nonpreset:true,},\n 'overridingRootKey': {unit: 'midikey',min:null,max:null,default:null,type:'sample',nonpreset:true,}\n\t};\n\tvar setDefaults = function() {\n\t\t// Returns a default parameter object.\n\t\tvar out = { };\n\t\tfor (var thisParm in parmInfo) {\n\t\t\tout[thisParm] = parmInfo[thisParm].default;\n\t\t}\n\t\treturn out;\n\t}\n\tvar getCombiner = function(thisParm) {\n\t\t// determines the combining method for a particular sound parameter. Check type first, then unit, then parent unit.\n\t\tvar thisParmInfo = parmInfo[thisParm];\n\t\tvar combiningFunction = combineParmsIgnoring;\t\t// default to ignoring parms that might be from a newer version, etc.\n\t\tif (!thisParmInfo) return combiningFunction;\n\t\tif (typeInfo[thisParmInfo.type] && typeInfo[thisParmInfo.type].combine)\n\t\t\tcombiningFunction = typeInfo[thisParmInfo.type].combine;\n\t\telse if (unitInfo[thisParmInfo.unit] && unitInfo[thisParmInfo.unit].combine)\n\t\t\tcombiningFunction = unitInfo[thisParmInfo.unit].combine;\n\t\telse if (unitInfo[thisParmInfo.unit] && unitInfo[thisParmInfo.unit].parent_unit) {\n\t\t\tvar unitInfo2 = unitInfo[unitInfo[thisParmInfo.unit].parent_unit];\n\t\t\tif (unitInfo2.combine) combiningFunction = unitInfo2.combine; // only one level of parents please!\n\t\t}\n\t\treturn combiningFunction;\n\t}\n\tvar combineParms = function(a,b,combineOverride,skipNonPreset) {\n\t\t// Combines parameters where b can override a, using the methods appropriate to each parameter's type or unit.\n\t\t// CombineOverride is optional for when you want to force a particular combining function in a situation.\n\t\t// SkipNonPreset is optional and defaults false. You set it true, when you want to skip all parameters that aren't supposed to be in the preset (presumably b comes from the preset).\n\t\tnonPresetFlag = false;\n\t\tif (skipNonPreset===true) nonPresetFlag = true;\n\t\tfor (var thisParm in b) {\n\t\t\tvar c = { }; // we actually put the parm in here so we can remove the darn \"amount\" object tag\n\t\t\tc[thisParm] = b[thisParm];\n\t\t\tif (c[thisParm].hasOwnProperty(\"amount\")) c[thisParm] = c[thisParm].amount;\n\t\t\tvar thisParmInfo = parmInfo[thisParm];\n\t\t\tif (!thisParmInfo) continue; // ignore unsupported or new parameters\n\t\t\tif (nonPresetFlag && parmInfo[thisParm].nonpreset) continue; \n\t\t\tvar f = getCombiner(thisParm);\n\t\t\tif (combineOverride) combineOverride = f;\n\t\t\tf(a,c,thisParm);\t// actually run the function (on C, so it is a number not an \"amount object\")-- it adds, substitutes, ignores, multiplies, etc.\n\t\t\t//-- oh! and enforce the range limits!\n\t\t\tif (thisParmInfo.min !== null && a[thisParm] < thisParmInfo.min) a[thisParm] = thisParmInfo.min;\n\t\t\tif (thisParmInfo.max !== null && a[thisParm] > thisParmInfo.max) a[thisParm] = thisParmInfo.max;\n\t\t}\n\t}\n\tvar matchRange = function(k,v,parms) {\n\t\t// Looks in the parameter or generator object and returns true if the given k>ey/v>elocity\n\t\t// range matches, false otherwise.\n\t\tif (parms.hasOwnProperty('keyRange')) {\n\t\t\tif (k < parms.keyRange.lo) return false;\n\t\t\tif ( k > parms.keyRange.hi) return false;\n\t\t}\n\t\tif (parms.hasOwnProperty('velRange')) {\n\t\t\tif (v < parms.velRange.lo) return false;\n\t\t\tif (v > parms.velRange.hi) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tvar shallowClone = function(a) { return JSON.parse(JSON.stringify(a)); }\n\t//\n\t//\tAdds the MIDI Map part to the parser, which we need to quickly look up MIDI patches.\n\t//\n\tvar addMIDIMap = function (parser) {\n\t\t//-- save the results of these parser functions so we don't have to generate them again\n\t\tvar presets = parser.presets = parser.getPresets();\n\t\tvar instruments = parser.instruments = parser.getInstruments();\n\t\t//-- here's our new one\n\t\tvar MIDIMap = parser.MIDIMap = { };\n\t\t//-- now scan all the presets\n\t\tfor (var i = 0; i < presets.length; i++) {\n\t\t\tvar thisPreset = presets[i]; var thisBank = thisPreset.header.bank;\n\t\t\tvar thisMIDIProgram = thisPreset.header.preset;\n\t\t\tif (!MIDIMap.hasOwnProperty(thisBank)) MIDIMap[thisBank] = { };\n\t\t\tMIDIMap[thisBank][thisMIDIProgram] = i;\n }\n }\n \n var retypeSamples = function(parser) {\n //-- another thing to do at loading time: convert the Int16 array to a Float32Array.\n //-- TODO: check for OGG compressed samples and uncompress them\n for (var i = 0; i < parser.sample.length; i++) {\n var thisSample = parser.sample[i]; var thisSampleLength = thisSample.length | 0;\n var newSample = new Float32Array(thisSampleLength);\n for (var j = 0|0; j < thisSampleLength; j++) {\n newSample[j] = thisSample[j] / 32768.0;\n }\n parser.sample[i] = newSample;\n }\n }\n\n\t//\n\t//\tInstall the soundfont into this object. Depends of course on the sound font parsing module.\n\t//\n\tvar parser = null;\n\tthis.loadSF2File = function (arrayBufferValue) {\n\t\tvar byteBuffer = new Uint8Array(arrayBufferValue);\n\t\tparser = new sf2.Parser(byteBuffer);\n\t\tparser.parse();\n\t\twindow.parser = parser;\t\t// just for debugging purposes now-- what's in here exactly?\n addMIDIMap(parser); // make sure to add the midi map.\n retypeSamples(parser); // convert all samples to Float32.\n\t}\n\tthis.getParser = function() { return parser; }\n\t//\n\t//\tProcess a note's related parameters before playing it. Returns array of objects telling\n\t// \tthe player what to play, or false if note data is not available (then the player can fallback\n\t// \tto a lesser quality level?)\n\t//\n\tthis.processNoteSF2 = function (noteNumber, noteVelocity, programNumber, bankNumber) {\n\t\t//--- find the preset in the MIDI map\n\t\tif (!parser.MIDIMap) return false; // need the midi map generated after loading soundfont\n\t\tif (!parser.MIDIMap[bankNumber]) return false;\n\t\tif (!parser.MIDIMap[bankNumber][programNumber]) return false;\n\t\tvar presetIndex = parser.MIDIMap[bankNumber][programNumber];\n\t\tif (!parser.presets[presetIndex]) return false;\n\t\tvar preset = parser.presets[presetIndex];\n\t\t//--- set default parms and look for the global generator; at the preset level, the defaults are all zero because they are just added to instrument parameters.\n\t\tvar noteParms = { }; var globalIndex = -1;\n\t\tfor (var i = 0; i < preset.info.length; i++) {\n\t\t\tif (preset.info[i].generator && !preset.info[i].generator.instrument) {\n\t\t\t\tcombineParms(noteParms, preset.info[i].generator); // global overrides defaults\n\t\t\t\tglobalIndex = i; break;\n\t\t\t}\n\t\t}\n\t\t//--- now look for the presets matching our note and velocity. There may be more than one, so\n\t\t//--- we add to an array. Eventually at the sample level we have a tree of two levels of arrays,\n\t\t//--- which we can then compress back into a list of samples for the player to play.\n\t\tpresetMatches = [ ];\n\t\tfor (var i = 0; i < preset.info.length; i++) {\n\t\t\tif (i===globalIndex) continue;\n\t\t\tvar thisGenerator = preset.info[i].generator;\n\t\t\tif (matchRange(noteNumber, noteVelocity, thisGenerator)) {\n\t\t\t\tvar newPresetMatch = shallowClone(noteParms);\t// copy the parms from global level\n\t\t\t\tcombineParms(newPresetMatch, thisGenerator);\n\t\t\t\tnewPresetMatch.instrument = thisGenerator.instrument.amount; // this is an index (\"Ignore\") parameter, but we want it so we can link to the next level\n\t\t\t\tpresetMatches.push(newPresetMatch);\n\t\t\t}\n\t\t}\n\t\t//--- now, for each preset match, we have to locate and process the instrument.\n\t\tvar instrumentMatches = [ ];\n\t\tfor (var i = 0; i < presetMatches.length; i++) {\n\t\t\tif (presetMatches[i].instrument && parser.instruments && parser.instruments[presetMatches[i].instrument]) {\n\t\t\t\tvar instrument = parser.instruments[presetMatches[i].instrument];\n\t\t\t\tvar instParms = setDefaults(); // the instrument parms start out at standard defaults. They are absolute physical values, unlike the preset level which is offsets.\n\t\t\t\t//--- now locate the global instrument zone if it exsts.\n\t\t\t\tvar globalIndex = -1;\n\t\t\t\tfor (var j = 0; j < instrument.info.length; j++) {\n\t\t\t\t\tvar thisInfo = instrument.info[j];\n\t\t\t\t\tif (!thisInfo.generator.hasOwnProperty('sampleID')) {\n\t\t\t\t\t\t// found global: force-override defaults by always substituting\n\t\t\t\t\t\tcombineParms(instParms, thisInfo.generator, combineParmsSubstituting);\n\t\t\t\t\t\tglobalIndex = j; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//--- now that we have found the global instrument, locate and create nodes for\n\t\t\t\t//--- all the instrument samples/notes we must play (possibly multiple). For each,\n\t\t\t\t//--- we override the instrument globals with instrument locals, then find the sample\n\t\t\t\t//--- and override with sample values, then, combine (usu. add) from the preset values\n\t\t\t\t//--- we got above.\n\t\t\t\tfor (var j = 0; j < instrument.info.length; j++) {\n\t\t\t\t\tif (j===globalIndex) continue;\n\t\t\t\t\tvar thisInfo = instrument.info[j]; var thisGenerator = thisInfo.generator;\n\t\t\t\t\tif (matchRange(noteNumber, noteVelocity, thisGenerator)) {\n\t\t\t\t\t\tvar newInstrumentMatch = shallowClone(instParms);\n\t\t\t\t\t\tcombineParms(newInstrumentMatch, thisGenerator, combineParmsSubstituting); //local inst overwrites global inst\n\t\t\t\t\t\tif (thisGenerator.hasOwnProperty('sampleID')) {\n\t\t\t\t\t\t\tvar mySampleIndex = thisGenerator.sampleID.amount;\n\t\t\t\t\t\t\tif (parser.sampleHeader[mySampleIndex] && parser.sample[mySampleIndex]) {\n\t\t\t\t\t\t\t\tvar thisSampleHeader = parser.sampleHeader[mySampleIndex];\n var thisSample = parser.sample[mySampleIndex];\n for (var thisSampleProperty in thisSampleHeader) { // Samples are a straight overwrite with properties that may not be in parmInfo.\n newInstrumentMatch[thisSampleProperty] = thisSampleHeader[thisSampleProperty];\n }\n\t\t\t\t\t\t\t\tcombineParms(newInstrumentMatch, presetMatches[i], null, true);\t\t// and preset adds to inst, producing final result.\n\t\t\t\t\t\t\t\tnewInstrumentMatch.sample = thisSample;\n\t\t\t\t\t\t\t\tinstrumentMatches.push(newInstrumentMatch);\n\t\t\t\t\t\t\t} else continue;\n\t\t\t\t\t\t} else continue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else continue; // if instrument is not found, we just ignore that line\n\t\t}\n\t\t//--- yay, now we have a bunch of instrument matches with samples. We can play them!\n\t\t//--- TODO: convert the units first\n\t\tif (instrumentMatches.length===0) instrumentMatches = false;\n\t\treturn instrumentMatches;\n }\n \n //-- here's note ON for Soundfonts! It will expand to handle more and more parameters.\n //-- It will start with basic notes however, and will return false if no note could be made,\n //-- or, it will connect all its audio nodes to connectTo and start them. It will return false\n //-- if no note could be sounded, or an object that you can use to call note Off later.\n\tthis.noteOn = function (noteNumber, noteVelocity, programNumber, bankNumber, ctx, connectTo, t) {\n var percussion = (bankNumber===128); // Oh btw to get the standard drum kit you send bank = 128, patch = 0; and then we don't do pitch adjustments either.\n var sf2note = { noteNumber: noteNumber, noteVelocity: noteVelocity, programNumber: programNumber, bankNumber: bankNumber, connectTo: connectTo, t: t };\n var p = processNoteSF2(noteNumber, noteVelocity, programNumber, bankNumber);\n if (p===false) return false; // can't find note, so use another sound generation method.\n sf2.outputs = [ ];\n var stereoDone = [ ]; // keep a list of samples we already did because they were part of a stereo pair\n var stereoBackReference = [ ]; // and a corresponding list of back references to the index that we already did. ICK, STEREO!\n for (var i = 0; i < p.length; i++) {\n var tp = p[i]; var thisOutput = { bufferNodes: [ ], gainNodes: [ ] }; \n sf2.outputs.push(thisOutput);\n //--- determine loop status: 0 = no loop, 1 = loops continuously, 2 = no loop, 3 loops till release then plays to end\n var loopStatus = thisOutput.loopStatus = (tp.hasOwnProperty(\"sampleModes\") ? (tp.sampleModes & 3) : 0);\n //--- determine stereo status\n var stereoType = \"mono\";\n if (tp.hasOwnProperty(\"sampleType\")) {\n var sampleTypeBitflag = tp.sampleType & 0x0F;\n switch(sampleTypeBitflag) {\n case 1: stereoType = \"mono\"; break;\n case 2: stereoType = \"right\"; stereoLink = tp.sampleLink; break;\n case 4: stereoType = \"left\"; stereoLink = tp.sampleLink; break;\n default: stereoType = \"mono\"; break;\n }\n }\n //--- determine and store the actual note number and velocity to use\n var actualNote = noteNumber; var actualVelocity = noteVelocity;\n if (tp.keynum && tp.keynum > 0) actualNote = tp.keynum;\n if (tp.velocity !== undefined && tp.velocity !== null) actualVelocity = tp.velocity;\n thisOutput.actualVelocity = actualVelocity; thisOutput.actualNote =actualNote;\n //--- determine the sample rate based on pitch adjustments\n actualNote += tp.coarseTune; // add tonal adjustments\n actualNote += tp.fineTune / 100;\n var sampleNote = tp.originalPitch; // the note for the actual sample could be this\n if (tp.hasOwnProperty(\"overridingRootKey\")) sampleNote = tp.overridingRootKey; // but it's probably this\n var deltaSemitones = actualNote - sampleNote;\n var freqFactor = Math.pow(2,deltaSemitones/12);\n var newRate = tp.sampleRate * freqFactor;\n //--- now determine the positions for start, end and loop, and the subarray to actually play\n var startAtSample = 0 + 32768*tp.startAddrsCoarseOffset + tp.startAddrsOffset;\n var endAtSample = tp.sample.length + 32768*tp.endAddrsCoarseOffset + tp.endAddrsOffset - 1;\n var startLoopSample = tp.startLoop + 32768*tp.startloopAddrsCoarseOffset + tp.startloopAddrsOffset - startLoopSample;\n var endLoopSample = tp.endLoop + 32768*tp.endloopAddrsCoarseOffset + tp.endloopAddrsOffset - endLoopSample;\n var startLoopTime = startLoopSample / newRate;\n var endLoopTime = endLoopSample / newRate;\n var actualSample = tp.sample.subarray(startAtSample,endAtSample+1);\n //--- create buffer node\n var ab;\n if (stereoType===\"mono\") { // mono: just copy the sample to both channels, easy!\n ab = ctx.createBuffer(2,actualSample.length,newRate);\n ab.copyToChannel(actualSample,0);\n ab.copyToChannel(actualSample,1);\n } else if (stereoType===\"left\" || stereoType===\"right\") {\n var k = stereoDone.indexOf(tp.sampleLink); \n if (k > 0) { //-- stereo, and we need to copy to a buffer we alreaady encountered\n ab = p[stereoBackReference[k]].bufferNode;\n ab.copyToChannel(actualSample,1);\n } else { // stereo, and we haven't encountered the other channel yet\n ab = ctx.createBuffer(2,actualSample.length,newRate);\n ab.copyToChannel(actualSample,0);\n stereoDone.push(tp.sampleID);\n stereoBackReference.push(i);\n }\n }\n tp.bufferNode = ab;\n var abs = ctx.createBufferSource();\n abs.buffer = ab;\n //--- set up looping on the buffer node\n if (loopStatus===1 || loopStatus===3) { // 1 & 3 are different but only in noteoff\n abs.loop = true; abs.loopStart = startLoopTime; abs.loopEnd = endLoopTime;\n }\n //--- create gain node for volume envelope and lfo\n var g = ctx.createGain(); abs.connect(g);\n \n }\n return sf2note;\n }\n\n this.noteOff = function (sf2note) {\n\n }\n}", "createAudioPacket(opusPacket, connectionData) {\n const packetBuffer = Buffer.alloc(12);\n packetBuffer[0] = 0x80;\n packetBuffer[1] = 0x78;\n const { sequence, timestamp, ssrc } = connectionData;\n packetBuffer.writeUIntBE(sequence, 2, 2);\n packetBuffer.writeUIntBE(timestamp, 4, 4);\n packetBuffer.writeUIntBE(ssrc, 8, 4);\n packetBuffer.copy(nonce, 0, 0, 12);\n return Buffer.concat([packetBuffer, ...this.encryptOpusPacket(opusPacket, connectionData)]);\n }", "function StereoAudioRecorderHelper(mediaStream, root) {\n\n // variables \n var deviceSampleRate = 44100; // range: 22050 to 96000\n\n if (!ObjectStore.AudioContextConstructor) {\n ObjectStore.AudioContextConstructor = new ObjectStore.AudioContext();\n }\n\n // check device sample rate\n deviceSampleRate = ObjectStore.AudioContextConstructor.sampleRate;\n\n var leftchannel = [];\n var rightchannel = [];\n var scriptprocessornode;\n var recording = false;\n var recordingLength = 0;\n var volume;\n var audioInput;\n var sampleRate = root.sampleRate || deviceSampleRate;\n\n var mimeType = root.mimeType || 'audio/wav';\n var isPCM = mimeType.indexOf('audio/pcm') > -1;\n\n var context;\n\n var numChannels = root.audioChannels || 2;\n\n this.record = function() {\n recording = true;\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = 0;\n recordingLength = 0;\n };\n\n this.requestData = function() {\n if (isPaused) {\n return;\n }\n\n if (recordingLength === 0) {\n requestDataInvoked = false;\n return;\n }\n\n requestDataInvoked = true;\n // clone stuff\n var internalLeftChannel = leftchannel.slice(0);\n var internalRightChannel = rightchannel.slice(0);\n var internalRecordingLength = recordingLength;\n\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = [];\n recordingLength = 0;\n requestDataInvoked = false;\n\n // we flat the left and right channels down\n var leftBuffer = mergeBuffers(internalLeftChannel, internalRecordingLength);\n\n var interleaved = leftBuffer;\n\n // we interleave both channels together\n if (numChannels === 2) {\n var rightBuffer = mergeBuffers(internalRightChannel, internalRecordingLength); // bug fixed via #70,#71\n interleaved = interleave(leftBuffer, rightBuffer);\n }\n\n if (isPCM) {\n // our final binary blob\n var blob = new Blob([convertoFloat32ToInt16(interleaved)], {\n type: 'audio/pcm'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n root.ondataavailable(blob);\n return;\n }\n\n // we create our wav file\n var buffer = new ArrayBuffer(44 + interleaved.length * 2);\n var view = new DataView(buffer);\n\n // RIFF chunk descriptor\n writeUTFBytes(view, 0, 'RIFF');\n\n // -8 (via #97)\n view.setUint32(4, 44 + interleaved.length * 2 - 8, true);\n\n writeUTFBytes(view, 8, 'WAVE');\n // FMT sub-chunk\n writeUTFBytes(view, 12, 'fmt ');\n view.setUint32(16, 16, true);\n view.setUint16(20, 1, true);\n // stereo (2 channels)\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, sampleRate * numChannels * 2, true); // numChannels * 2 (via #71)\n view.setUint16(32, numChannels * 2, true);\n view.setUint16(34, 16, true);\n // data sub-chunk\n writeUTFBytes(view, 36, 'data');\n view.setUint32(40, interleaved.length * 2, true);\n\n // write the PCM samples\n var lng = interleaved.length;\n var index = 44;\n var volume = 1;\n for (var i = 0; i < lng; i++) {\n view.setInt16(index, interleaved[i] * (0x7FFF * volume), true);\n index += 2;\n }\n\n // our final binary blob\n var blob = new Blob([view], {\n type: 'audio/wav'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n\n root.ondataavailable(blob);\n };\n\n this.stop = function() {\n // we stop recording\n recording = false;\n this.requestData();\n\n audioInput.disconnect();\n };\n\n function interleave(leftChannel, rightChannel) {\n var length = leftChannel.length + rightChannel.length;\n var result = new Float32Array(length);\n\n var inputIndex = 0;\n\n for (var index = 0; index < length;) {\n result[index++] = leftChannel[inputIndex];\n result[index++] = rightChannel[inputIndex];\n inputIndex++;\n }\n return result;\n }\n\n function mergeBuffers(channelBuffer, recordingLength) {\n var result = new Float32Array(recordingLength);\n var offset = 0;\n var lng = channelBuffer.length;\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n return result;\n }\n\n function writeUTFBytes(view, offset, string) {\n var lng = string.length;\n for (var i = 0; i < lng; i++) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n }\n\n function convertoFloat32ToInt16(buffer) {\n var l = buffer.length;\n var buf = new Int16Array(l)\n\n while (l--) {\n buf[l] = buffer[l] * 0xFFFF; //convert to 16 bit\n }\n return buf.buffer\n }\n\n // creates the audio context\n var context = ObjectStore.AudioContextConstructor;\n\n // creates a gain node\n ObjectStore.VolumeGainNode = context.createGain();\n\n var volume = ObjectStore.VolumeGainNode;\n\n // creates an audio node from the microphone incoming stream\n ObjectStore.AudioInput = context.createMediaStreamSource(mediaStream);\n\n // creates an audio node from the microphone incoming stream\n var audioInput = ObjectStore.AudioInput;\n\n // connect the stream to the gain node\n audioInput.connect(volume);\n\n /* From the spec: This value controls how frequently the audioprocess event is\n dispatched and how many sample-frames need to be processed each call.\n Lower values for buffer size will result in a lower (better) latency.\n Higher values will be necessary to avoid audio breakup and glitches \n Legal values are 256, 512, 1024, 2048, 4096, 8192, and 16384.*/\n var bufferSize = root.bufferSize || 2048;\n if (root.bufferSize === 0) {\n bufferSize = 0;\n }\n\n if (context.createJavaScriptNode) {\n scriptprocessornode = context.createJavaScriptNode(bufferSize, numChannels, numChannels);\n } else if (context.createScriptProcessor) {\n scriptprocessornode = context.createScriptProcessor(bufferSize, numChannels, numChannels);\n } else {\n throw 'WebAudio API has no support on this browser.';\n }\n\n bufferSize = scriptprocessornode.bufferSize;\n\n console.debug('using audio buffer-size:', bufferSize);\n\n var requestDataInvoked = false;\n\n // sometimes \"scriptprocessornode\" disconnects from he destination-node\n // and there is no exception thrown in this case.\n // and obviously no further \"ondataavailable\" events will be emitted.\n // below global-scope variable is added to debug such unexpected but \"rare\" cases.\n window.scriptprocessornode = scriptprocessornode;\n\n if (numChannels === 1) {\n console.debug('All right-channels are skipped.');\n }\n\n var isPaused = false;\n\n this.pause = function() {\n isPaused = true;\n };\n\n this.resume = function() {\n isPaused = false;\n };\n\n // http://webaudio.github.io/web-audio-api/#the-scriptprocessornode-interface\n scriptprocessornode.onaudioprocess = function(e) {\n if (!recording || requestDataInvoked || isPaused) {\n return;\n }\n\n var left = e.inputBuffer.getChannelData(0);\n leftchannel.push(new Float32Array(left));\n\n if (numChannels === 2) {\n var right = e.inputBuffer.getChannelData(1);\n rightchannel.push(new Float32Array(right));\n }\n recordingLength += bufferSize;\n };\n\n volume.connect(scriptprocessornode);\n scriptprocessornode.connect(context.destination);\n}", "function StereoAudioRecorderHelper(mediaStream, root) {\n\n // variables \n var deviceSampleRate = 44100; // range: 22050 to 96000\n\n if (!ObjectStore.AudioContextConstructor) {\n ObjectStore.AudioContextConstructor = new ObjectStore.AudioContext();\n }\n\n // check device sample rate\n deviceSampleRate = ObjectStore.AudioContextConstructor.sampleRate;\n\n var leftchannel = [];\n var rightchannel = [];\n var scriptprocessornode;\n var recording = false;\n var recordingLength = 0;\n var volume;\n var audioInput;\n var sampleRate = root.sampleRate || deviceSampleRate;\n\n var mimeType = root.mimeType || 'audio/wav';\n var isPCM = mimeType.indexOf('audio/pcm') > -1;\n\n var context;\n\n var numChannels = root.audioChannels || 2;\n\n this.record = function() {\n recording = true;\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = 0;\n recordingLength = 0;\n };\n\n this.requestData = function() {\n if (isPaused) {\n return;\n }\n\n if (recordingLength === 0) {\n requestDataInvoked = false;\n return;\n }\n\n requestDataInvoked = true;\n // clone stuff\n var internalLeftChannel = leftchannel.slice(0);\n var internalRightChannel = rightchannel.slice(0);\n var internalRecordingLength = recordingLength;\n\n // reset the buffers for the new recording\n leftchannel.length = rightchannel.length = [];\n recordingLength = 0;\n requestDataInvoked = false;\n\n // we flat the left and right channels down\n var leftBuffer = mergeBuffers(internalLeftChannel, internalRecordingLength);\n\n var interleaved = leftBuffer;\n\n // we interleave both channels together\n if (numChannels === 2) {\n var rightBuffer = mergeBuffers(internalRightChannel, internalRecordingLength); // bug fixed via #70,#71\n interleaved = interleave(leftBuffer, rightBuffer);\n }\n\n if (isPCM) {\n // our final binary blob\n var blob = new Blob([convertoFloat32ToInt16(interleaved)], {\n type: 'audio/pcm'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n root.ondataavailable(blob);\n return;\n }\n\n // we create our wav file\n var buffer = new ArrayBuffer(44 + interleaved.length * 2);\n var view = new DataView(buffer);\n\n // RIFF chunk descriptor\n writeUTFBytes(view, 0, 'RIFF');\n\n // -8 (via #97)\n view.setUint32(4, 44 + interleaved.length * 2 - 8, true);\n\n writeUTFBytes(view, 8, 'WAVE');\n // FMT sub-chunk\n writeUTFBytes(view, 12, 'fmt ');\n view.setUint32(16, 16, true);\n view.setUint16(20, 1, true);\n // stereo (2 channels)\n view.setUint16(22, numChannels, true);\n view.setUint32(24, sampleRate, true);\n view.setUint32(28, sampleRate * numChannels * 2, true); // numChannels * 2 (via #71)\n view.setUint16(32, numChannels * 2, true);\n view.setUint16(34, 16, true);\n // data sub-chunk\n writeUTFBytes(view, 36, 'data');\n view.setUint32(40, interleaved.length * 2, true);\n\n // write the PCM samples\n var lng = interleaved.length;\n var index = 44;\n var volume = 1;\n for (var i = 0; i < lng; i++) {\n view.setInt16(index, interleaved[i] * (0x7FFF * volume), true);\n index += 2;\n }\n\n // our final binary blob\n var blob = new Blob([view], {\n type: 'audio/wav'\n });\n\n console.debug('audio recorded blob size:', bytesToSize(blob.size));\n\n root.ondataavailable(blob);\n };\n\n this.stop = function() {\n // we stop recording\n recording = false;\n this.requestData();\n\n audioInput.disconnect();\n };\n\n function interleave(leftChannel, rightChannel) {\n var length = leftChannel.length + rightChannel.length;\n var result = new Float32Array(length);\n\n var inputIndex = 0;\n\n for (var index = 0; index < length;) {\n result[index++] = leftChannel[inputIndex];\n result[index++] = rightChannel[inputIndex];\n inputIndex++;\n }\n return result;\n }\n\n function mergeBuffers(channelBuffer, recordingLength) {\n var result = new Float32Array(recordingLength);\n var offset = 0;\n var lng = channelBuffer.length;\n for (var i = 0; i < lng; i++) {\n var buffer = channelBuffer[i];\n result.set(buffer, offset);\n offset += buffer.length;\n }\n return result;\n }\n\n function writeUTFBytes(view, offset, string) {\n var lng = string.length;\n for (var i = 0; i < lng; i++) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n }\n\n function convertoFloat32ToInt16(buffer) {\n var l = buffer.length;\n var buf = new Int16Array(l)\n\n while (l--) {\n buf[l] = buffer[l] * 0xFFFF; //convert to 16 bit\n }\n return buf.buffer\n }\n\n // creates the audio context\n var context = ObjectStore.AudioContextConstructor;\n\n // creates a gain node\n ObjectStore.VolumeGainNode = context.createGain();\n\n var volume = ObjectStore.VolumeGainNode;\n\n // creates an audio node from the microphone incoming stream\n ObjectStore.AudioInput = context.createMediaStreamSource(mediaStream);\n\n // creates an audio node from the microphone incoming stream\n var audioInput = ObjectStore.AudioInput;\n\n // connect the stream to the gain node\n audioInput.connect(volume);\n\n /* From the spec: This value controls how frequently the audioprocess event is\n dispatched and how many sample-frames need to be processed each call.\n Lower values for buffer size will result in a lower (better) latency.\n Higher values will be necessary to avoid audio breakup and glitches \n Legal values are 256, 512, 1024, 2048, 4096, 8192, and 16384.*/\n var bufferSize = root.bufferSize || 2048;\n if (root.bufferSize === 0) {\n bufferSize = 0;\n }\n\n if (context.createJavaScriptNode) {\n scriptprocessornode = context.createJavaScriptNode(bufferSize, numChannels, numChannels);\n } else if (context.createScriptProcessor) {\n scriptprocessornode = context.createScriptProcessor(bufferSize, numChannels, numChannels);\n } else {\n throw 'WebAudio API has no support on this browser.';\n }\n\n bufferSize = scriptprocessornode.bufferSize;\n\n console.debug('using audio buffer-size:', bufferSize);\n\n var requestDataInvoked = false;\n\n // sometimes \"scriptprocessornode\" disconnects from he destination-node\n // and there is no exception thrown in this case.\n // and obviously no further \"ondataavailable\" events will be emitted.\n // below global-scope variable is added to debug such unexpected but \"rare\" cases.\n window.scriptprocessornode = scriptprocessornode;\n\n if (numChannels === 1) {\n console.debug('All right-channels are skipped.');\n }\n\n var isPaused = false;\n\n this.pause = function() {\n isPaused = true;\n };\n\n this.resume = function() {\n isPaused = false;\n };\n\n // http://webaudio.github.io/web-audio-api/#the-scriptprocessornode-interface\n scriptprocessornode.onaudioprocess = function(e) {\n if (!recording || requestDataInvoked || isPaused) {\n return;\n }\n\n var left = e.inputBuffer.getChannelData(0);\n leftchannel.push(new Float32Array(left));\n\n if (numChannels === 2) {\n var right = e.inputBuffer.getChannelData(1);\n rightchannel.push(new Float32Array(right));\n }\n recordingLength += bufferSize;\n };\n\n volume.connect(scriptprocessornode);\n scriptprocessornode.connect(context.destination);\n}", "_transform(chunk,encoding,cb) {\n\n const uint8_view = new Uint8Array(chunk, 0, chunk.length);\n var dataView = new DataView(uint8_view.buffer);\n\n let iFloat = Array(this.sz*2);\n let asComplex = Array(this.sz);\n\n\n // for(let i = 0; i < this.sz*2; i+=1) {\n // iFloat[i] = dataView.getFloat64(i*8, true);\n // }\n\n for(let i = 0; i < this.sz*2; i+=2) {\n let re = dataView.getFloat64(i*8, true);\n let im = dataView.getFloat64((i*8)+8, true);\n\n asComplex[i/2] = mt.complex(re,im);\n\n iFloat[i] = re;\n iFloat[i+1] = im;\n\n // if( i < 16 ) {\n // console.log(re);\n // }\n\n }\n\n let iShort = mutil.IFloatToIShortMulti(iFloat);\n\n if( this.onFrameIShort !== null ) {\n this.onFrameIShort(iShort);\n }\n\n // console.log(\"iFloat length \" + iFloat.length);\n // console.log(iFloat.slice(0,16));\n\n // console.log(\"iShort length \" + iShort.length);\n // console.log(iShort.slice(0,16));\n\n\n this.handleDefaultStream(iFloat,iShort,asComplex);\n this.handleFineSync(iFloat,iShort,asComplex);\n this.handleAllSubcarriers(iFloat,iShort,asComplex);\n this.handleDemodData(iFloat,iShort,asComplex);\n\n\n // for(x of iFloat) {\n // console.log(x);\n // }\n\n\n this.uint.frame_track_counter++;\n cb();\n }", "function writeReceivedData() {\n // console.log('writeReceivedData');\n\n // how many complex samples are shared by all buffers\n let thisRun = _.min(datas.map((x)=>x.length));\n\n let a,b; // indices into the phase matrix\n\n for(let rxradio = 0; rxradio < radioCount; rxradio++) {\n \n let thebuffer = new ArrayBuffer(thisRun*8*2); // in bytes\n let uint8_view = new Uint8Array(thebuffer);\n let float64_view = new Float64Array(thebuffer);\n\n for(let i = 0; i < thisRun; i++) {\n\n let sam = mt.complex(\n 0.0075*Math.random()-0.00375,\n 0.0075*Math.random()-0.00375\n );\n\n for(let txradio = 0; txradio < radioCount; txradio++) {\n if(rxradio === txradio) {\n continue; // FIXME this forces 'hearself' to false\n }\n\n [a,b] = mutil.lowerTriangular(txradio,rxradio);\n\n let phasor = matrix[a][b];\n\n sam = sam.add( datas[txradio][i].mul(phasor) );\n // console.log('Phasor between ' + rxradio + ' and ' + txradio + ' is ' + phasor.toString());\n\n } // for tx radio\n\n // sam is now a complex object with contributions from each radio\n // we convert it into float,float (real,imag)\n\n float64_view[i*2 ] = sam.re;\n float64_view[(i*2)+1] = sam.im;\n\n // if(rxradio === 1 && i < 16) {\n // console.log(sam.re);\n // }\n\n } // for sample of rx radio\n\n // console.log('done with rx for radio ' + rxradio);\n // console.log(float64_view);\n\n // push data back into the radio\n // console.log(\"r\" + rxradio + \" \" + uint8_view);\n r[rxradio].rx.ours.push(uint8_view);\n\n } // for rx radio\n\n let unblockSystem = () => {\n\n // second pass to cleanup and callback\n for(let rxradio = 0; rxradio < radioCount; rxradio++) {\n var fncopy = outstandingCbs[rxradio]; // copy the callback\n outstandingCbs[rxradio] = undefined; // wipe out the entry, this is for writeCompleted()\n datas[rxradio] = datas[rxradio].slice(thisRun); // delete our copy of the data\n\n // call the callback, this will unblock the incoming stream for this radio\n // seems like this needs to be inside setImmediate or else streams will get data before this loop gets\n // to the next iteration\n setImmediate(fncopy);\n }\n }\n\n\n\n\n now = Date.now();\n\n sampleCountAccumulated += thisRun;\n\n const averagePeriod = 100; // ms\n\n let delayBy = 0;\n\n // how many times has this function been called?\n if( timesWrittenBack > 0) {\n if( rateLimit != 0 ) {\n let deltaMs = now - then;\n if( deltaMs >= averagePeriod ) {\n\n // console.log(now + ', ' + sampleCountAccumulated);\n // how many samples did we chew through since last check\n let deltaSamples = sampleCountAccumulated - sampleCountLatched;\n // how many should we expect if perfectly at rate limit\n let expectedForPeriod = deltaMs * (rateLimit/1000);\n // console.log('expected: ' + expectedForPeriod);\n // console.log('deltaMs: ' + deltaMs + ' samples since last check: ' + deltaSamples + ' samples at ' + sampleCountAccumulated/125E6);\n\n if( deltaSamples > expectedForPeriod ) {\n let rateForThisPeriod = deltaSamples / averagePeriod; // in samples per ms\n // how many samples did we do extra\n let overage = deltaSamples - expectedForPeriod;\n\n let desiredDelay = overage / rateForThisPeriod;\n\n let desiredDelayRound = Math.round(desiredDelay);\n\n if( desiredDelayRound > 0 ) {\n delayBy = desiredDelayRound;\n }\n\n // console.log('overage: ' + overage + ' delay by ' + desiredDelay + ' ms at rate ' + rateForThisPeriod);\n }\n\n then = now;\n sampleCountLatched = sampleCountAccumulated;\n }\n }\n } else {\n\n then = now;\n }\n\n if( delayBy === 0 ) {\n unblockSystem();\n } else {\n setTimeout(unblockSystem, delayBy);\n }\n\n // console.log('writeReceivedData exiting');\n\n timesWrittenBack++;\n\n}", "function AudioInputStream() {\n }", "function PercussionPresets(){\n\n\tthis.input = audioCtx.createGain();\n\tthis.output = audioCtx.createGain();\n\tthis.startArray = [];\n\n}", "function play(sendTime, duration, bytes, notes, callback) {\n\n function onended() {\n\n console.log(\"AUDIOMOTH CHIME: Done\");\n\n callback();\n\n }\n\n function perform() {\n\n var i, now, delay, source, buffer, channel, waveform;\n\n /* Initialize audio context */\n\n if (!audioContext) {\n if (window.AudioContext) {\n audioContext = new window.AudioContext();\n } else {\n audioContext = new window.webkitAudioContext();\n }\n }\n\n if (audioContext.state === 'suspended') {\n audioContext.resume();\n }\n\n /* Generate the waveform */\n\n waveform = createWaveform(duration, bytes, notes);\n\n /* Generate the waveform */\n\n buffer = audioContext.createBuffer(1, waveform.length, audioContext.sampleRate);\n\n channel = buffer.getChannelData(0);\n\n for (i = 0; i < waveform.length; i += 1) {\n\n channel[i] = waveform[i];\n\n }\n\n source = audioContext.createBufferSource();\n\n source.buffer = buffer;\n\n source.onended = onended;\n\n source.connect(audioContext.destination);\n\n /* Play the waveform at the appropriate time */\n\n delay = 0;\n\n if (sendTime) {\n\n now = new Date();\n\n delay = sendTime.getTime() - now.getTime();\n\n }\n \n if (delay <= 0) {\n\n console.log(\"AUDIOMOTH CHIME: Start\");\n \n source.start();\n \n } else {\n\n console.log(\"AUDIOMOTH CHIME: Waiting \" + delay + \" milliseconds\");\n\n setTimeout(function() {\n\n console.log(\"AUDIOMOTH CHIME: Start\");\n \n source.start()\n \n }, delay);\n \n }\n\n }\n\n /* Play the sound */\n \n setTimeout(perform, 0);\n\n }", "function AudioMic() {\n if (navigator.getUserMedia) {\n navigator.getUserMedia({audio: true}, function(stream) {\n if (audioCtx == null) {\n audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n }\n \n analyzer = audioCtx.createAnalyser();\n analyzer.fftsize = 512;\n\n source = audioCtx.createMediaStreamSource(stream);\n source.connect(analyzer);\n source.connect(audioCtx.destination);\n analyzer.connect(audioCtx.destination);\n micAudio = new Recorder(audioCtx.createGain());\n micAudio.record();\n\n dataArray = new Uint8Array(analyzer.frequencyBinCount);\n analyzer.getByteFrequencyData(dataArray);\n }, function(e) {\n alert('Give me access pls');\n });\n }\n}", "function SinusPlayer() {\n // check if the Audio context is enabled\n if (! window.AudioContext) {\n if (! window.webkitAudioContext) {\n alert('no audiocontext found');\n }\n window.AudioContext = window.webkitAudioContext;\n }\n\n /*\n An audio context controls the creation of the nodes it contains\n and the execution of the audio processing, or decoding.\n */\n this.context = new AudioContext();\n\n /*\n Declared var for the createBuffer() method of the AudioContext.\n Which can then be populated by data, and played via an AudioBufferSourceNode.\n @Returns: empty AudioBuffer object\n */\n this.audioBuffer;\n this.sourceNode;\n\n this.loaded = false;\n this.run = false;\n\n //Set up our canvas\n this.canvas = document.getElementById(\"canvas\");\n this.width = canvas.width;\n this.height = canvas.height;\n this.canvas.style.width = (this.width)+'px';\n this.canvas.style.height = (this.height)+'px';\n this.ctx = this.canvas.getContext(\"2d\");\n\n this.javascriptNode;\n this.analyser;\n this.array;\n this.average;\n\n}", "function channelEffects() {\n\n 'use strict';\n\n var\n\n id = 0,\n context,\n\n zeroValue = 0.00000000000000001,\n\n createClass, // defined in util.js\n getSample, // defined in instrument_manager.js\n\n Reverb,\n Panner,\n Panner2,\n Delay,\n BiQuadFilter,\n Compressor;\n\n\n function Effect(config) {\n this.id = 'FX' + id++ + '' + new Date().getTime();\n this.type = config.type;\n this.buffer = config.buffer;\n this.config = config;\n\n this.bypass = false;\n this.amount = 0;//0.5;\n\n this.output = context.createGainNode();\n this.wetGain = context.createGainNode();\n this.dryGain = context.createGainNode();\n\n this.output.gain.value = 1;\n this.wetGain.gain.value = this.amount;\n this.dryGain.gain.value = 1 - this.amount;\n }\n\n\n Effect.prototype.setInput = function (input) {\n // input.connect(this.node);\n // return;\n\n // dry channel\n input.connect(this.dryGain);\n this.dryGain.connect(this.output);\n\n // wet channel\n input.connect(this.node);\n this.node.connect(this.wetGain);\n this.wetGain.connect(this.output);\n };\n\n /*\n Effect.prototype.setOutput = function(output){\n this.output.disconnect(0);\n this.output.connect(output);\n };\n */\n\n Effect.prototype.setAmount = function (value) {\n /*\n this.amount = value < 0 ? 0 : value > 1 ? 1 : value;\n var gain1 = Math.cos(this.amount * 0.5 * Math.PI),\n gain2 = Math.cos((1.0 - this.amount) * 0.5 * Math.PI);\n this.gainNode.gain.value = gain2 * this.ratio;\n */\n\n this.amount = value < 0 ? 0 : value > 1 ? 1 : value;\n this.wetGain.gain.value = this.amount;\n this.dryGain.gain.value = 1 - this.amount;\n //console.log('wet',this.wetGain.gain.value,'dry',this.dryGain.gain.value);\n };\n\n\n Effect.prototype.copy = function () {\n switch (this.type) {\n case 'reverb':\n return new Reverb(this.config);\n case 'panner':\n return new Panner(this.config);\n case 'panner2':\n return new Panner2(this.config);\n case 'delay':\n return new Delay(this.config);\n case 'compressor':\n return new Compressor(this.config);\n }\n };\n\n\n sequencer.createReverb = function (id) {\n var buffer = getSample(id);\n if (buffer === false) {\n console.warn('no reverb with id', id, 'loaded');\n return false;\n }\n var config = {\n type: 'reverb',\n buffer: buffer\n };\n return new Reverb(config);\n };\n\n\n sequencer.createPanner = function (config) {\n config = config || {};\n config.type = 'panner';\n return new Panner(config);\n };\n\n\n sequencer.createPanner2 = function (config) {\n config = config || {};\n config.type = 'panner2';\n return new Panner2(config);\n };\n\n\n sequencer.createDelay = function (config) {\n config = config || {};\n config.type = 'delay';\n return new Delay(config);\n };\n\n\n sequencer.createCompressor = function (config) {\n config = config || {};\n config.type = 'compressor';\n return new Compressor(config);\n };\n\n\n sequencer.createBiQuadFilter = function (config) {\n config = config || {};\n config.type = 'biquadfilter';\n return new BiQuadFilter(config);\n };\n\n\n sequencer.protectedScope.addInitMethod(function () {\n context = sequencer.protectedScope.context;\n createClass = sequencer.protectedScope.createClass;\n getSample = sequencer.getSample;\n\n Reverb = createClass(Effect, function (config) {\n this.node = context.createConvolver();\n this.node.buffer = config.buffer;\n //console.log(this.node.buffer);\n });\n\n Panner = createClass(Effect, function (config) {\n this.node = context.createPanner();\n this.node.panningModel = 'equalpower';\n this.node.setPosition(zeroValue, zeroValue, zeroValue);\n });\n\n Panner2 = createClass(Effect, function (config) {\n this.node = context.createPanner();\n this.node.panningModel = 'HRTF';\n this.node.setPosition(zeroValue, zeroValue, zeroValue);\n });\n\n Delay = createClass(Effect, function (config) {\n this.node = context.createDelay();\n this.node.delayTime.value = 0.3;\n });\n\n Compressor = createClass(Effect, function (config) {\n this.node = context.createDynamicsCompressor();\n });\n\n\n BiQuadFilter = createClass(Effect, function (config) {\n this.node = context.createBiquadFilter();\n this.node.type = 0;\n this.node.Q.value = 4;\n this.node.frequency.value = 1600;\n });\n\n /*\n Panner.prototype.setPosition = function(x, y, z){\n var multiplier = 5;\n console.log(x * multiplier);\n this.node.setPosition(x * multiplier, y * multiplier, z * multiplier);\n };\n */\n\n Panner.prototype.setPosition = function (value) {\n var x = value,\n y = 0,\n z = 1 - Math.abs(x);\n\n x = x === 0 ? zeroValue : x;\n y = y === 0 ? zeroValue : y;\n z = z === 0 ? zeroValue : z;\n this.node.setPosition(x, y, z);\n //console.log(1,x,y,z);\n };\n\n Panner2.prototype.setPosition = function (value) {\n var xDeg = parseInt(value),\n zDeg = xDeg + 90,\n x, y, z;\n if (zDeg > 90) {\n zDeg = 180 - zDeg;\n }\n x = Math.sin(xDeg * (Math.PI / 180));\n y = 0;\n z = Math.sin(zDeg * (Math.PI / 180));\n x = x === 0 ? zeroValue : x;\n y = y === 0 ? zeroValue : y;\n z = z === 0 ? zeroValue : z;\n this.node.setPosition(x, y, z);\n //console.log(2,x,y,z);\n };\n\n Delay.prototype.setTime = function (value) {\n this.node.delayTime.value = value;\n };\n\n });\n}", "function ampwave(wave,a){\r\n\tvar wl = wave[0].length, starttime = Date.now();\r\n\tfor(var i=0; i<wl; i++){ wave[0][i] *= a; wave[1][i] *= a; }\r\n\tlog('ampwave() took '+(Date.now()-starttime)+' ms.');\r\n\treturn wave;\r\n}// End of ampwave()", "function audioGraph(audioData) {\n var convolver;\n \n soundSource = context.createBufferSource();\n soundBuffer = context.createBuffer(audioData, true);\n soundSource.buffer = soundBuffer;\n // Again, the context handles the difficult bits\n convolver = context.createConvolver();\n // Wiring\n soundSource.connect(convolver);\n convolver.connect(context.destination);\n // Loading the 'Sound Snapshot' to apply to our audio\n setReverbImpulseResponse('echo.mp3', convolver, function() {playSound()});\n }", "function initMp3Player(){\r\n context = new AudioContext();\r\n analyser = context.createAnalyser();\r\n analyser.fftSize = 256;\r\n canvas = document.getElementById('analyser_render');\r\n canvas.width = bars*bar_spacing;\r\n ctx = canvas.getContext('2d');\r\n source = context.createMediaElementSource(document.getElementById(\"audio-player\"));\r\n source.connect(analyser);\r\n analyser.connect(context.destination);\r\n fbc_array = new Uint8Array(analyser.frequencyBinCount);\r\n}", "function ma(a,b,c,d,e,f,h,g){this.id=a;this.bandwidth=b||0;this.lang=c||\"unknown\";this.streamInfoID=d;this.mimeType=e||\"\";this.codecs=f||\"\";this.channels=h||null;this.samplingRate=g||null;this.active=!1}", "toMuLaw() {\n this.assure16Bit_();\n let output = new Int16Array(this.data.samples.length / 2);\n unpackArrayTo(this.data.samples, this.dataType, output);\n this.fromScratch(\n this.fmt.numChannels,\n this.fmt.sampleRate,\n '8m',\n alawmulaw.mulaw.encode(output),\n {container: this.correctContainer_()});\n }", "function applyPhaser(params, samples) {\n var SAMPLE_RATE = SUPERSAMPLES * 44100;\n var PHASER_SIZE = Math.floor(SAMPLE_RATE * 0.0029);\n var phaser_buffer = new Float64Array(PHASER_SIZE);\n for (var i = 0; i < PHASER_SIZE; ++i) {\n phaser_buffer[i] = 0.0;\n }\n\n var fphase = Math.pow(params.pha_offset, 2.0) * (255 / 256 * PHASER_SIZE);\n if (params.pha_offset < 0.0) fphase = -fphase;\n\n var fdphase = Math.pow(params.pha_ramp, 2.0) * 44100 / SAMPLE_RATE;\n if (params.pha_ramp < 0.0) fdphase = -fdphase;\n\n var len = samples.length;\n var out = new Float64Array(len);\n var j = 0;\n for (var i = 0; i < len; i++) {\n var y = samples[i];\n phaser_buffer[j] = y;\n\n fphase += fdphase;\n var iphase = Math.abs(Math.floor(fphase));\n if (iphase > PHASER_SIZE - 1) iphase = PHASER_SIZE - 1;\n out[i] = y + phaser_buffer[(j + PHASER_SIZE - iphase) % PHASER_SIZE];\n j = (j + 1) % PHASER_SIZE;\n }\n return out;\n}", "function processSong(data) {\n\t\taudioFile.src = \"data:\" + data.mime + \";base64,\" + data.base64;\n\t\taudioFile.volume = volume / 100;\n\t\taudioFile.load();\n\t\taudioFile.play();\n\t\tdivListview.classList.add(\"active\");\n\t\tdivAudioBanner.classList.remove(\"hidden\");\n\t\tdivAudioPlayer.classList.remove(\"hidden\");\n\t\tshowPause();\n\t}", "function ma(a,b,c,d,e,f,g,h){this.id=a;this.bandwidth=b||0;this.lang=c||\"unknown\";this.streamInfoID=d;this.mimeType=e||\"\";this.codecs=f||\"\";this.channels=g||null;this.samplingRate=h||null;this.active=!1}", "function MidiFile(data) {\n function readChunk(stream) {\n let id = stream.read(4);\n let length = stream.readInt32();\n return {\n 'id': id,\n 'length': length,\n 'data': stream.read(length)\n };\n }\n\n let lastEventTypeByte;\n\n function readEvent(stream) {\n let event = {};\n event.deltaTime = stream.readletInt();\n let eventTypeByte = stream.readInt8();\n if ((eventTypeByte & 0xf0) == 0xf0) {\n /* system / meta event */\n if (eventTypeByte == 0xff) {\n /* meta event */\n event.type = 'meta';\n let subtypeByte = stream.readInt8();\n let length = stream.readletInt();\n switch (subtypeByte) {\n case 0x00:\n event.subtype = 'sequenceNumber';\n if (length != 2) throw \"Expected length for sequenceNumber event is 2, got \" + length;\n event.number = stream.readInt16();\n return event;\n case 0x01:\n event.subtype = 'text';\n event.text = stream.read(length);\n return event;\n case 0x02:\n event.subtype = 'copyrightNotice';\n event.text = stream.read(length);\n return event;\n case 0x03:\n event.subtype = 'trackName';\n event.text = stream.read(length);\n return event;\n case 0x04:\n event.subtype = 'instrumentName';\n event.text = stream.read(length);\n return event;\n case 0x05:\n event.subtype = 'lyrics';\n event.text = stream.read(length);\n return event;\n case 0x06:\n event.subtype = 'marker';\n event.text = stream.read(length);\n return event;\n case 0x07:\n event.subtype = 'cuePoint';\n event.text = stream.read(length);\n return event;\n case 0x20:\n event.subtype = 'midiChannelPrefix';\n if (length != 1) throw \"Expected length for midiChannelPrefix event is 1, got \" + length;\n event.channel = stream.readInt8();\n return event;\n case 0x2f:\n event.subtype = 'endOfTrack';\n if (length != 0) throw \"Expected length for endOfTrack event is 0, got \" + length;\n return event;\n case 0x51:\n event.subtype = 'setTempo';\n if (length != 3) throw \"Expected length for setTempo event is 3, got \" + length;\n event.microsecondsPerBeat = (\n (stream.readInt8() << 16) + (stream.readInt8() << 8) + stream.readInt8()\n )\n return event;\n case 0x54:\n event.subtype = 'smpteOffset';\n if (length != 5) throw \"Expected length for smpteOffset event is 5, got \" + length;\n let hourByte = stream.readInt8();\n event.frameRate = {\n 0x00: 24,\n 0x20: 25,\n 0x40: 29,\n 0x60: 30\n }[hourByte & 0x60];\n event.hour = hourByte & 0x1f;\n event.min = stream.readInt8();\n event.sec = stream.readInt8();\n event.frame = stream.readInt8();\n event.subframe = stream.readInt8();\n return event;\n case 0x58:\n event.subtype = 'timeSignature';\n if (length != 4) throw \"Expected length for timeSignature event is 4, got \" + length;\n event.numerator = stream.readInt8();\n event.denominator = Math.pow(2, stream.readInt8());\n event.metronome = stream.readInt8();\n event.thirtyseconds = stream.readInt8();\n return event;\n case 0x59:\n event.subtype = 'keySignature';\n if (length != 2) throw \"Expected length for keySignature event is 2, got \" + length;\n event.key = stream.readInt8(true);\n event.scale = stream.readInt8();\n return event;\n case 0x7f:\n event.subtype = 'sequencerSpecific';\n event.data = stream.read(length);\n return event;\n default:\n // console.log(\"Unrecognised meta event subtype: \" + subtypeByte);\n event.subtype = 'unknown'\n event.data = stream.read(length);\n return event;\n }\n event.data = stream.read(length);\n return event;\n } else if (eventTypeByte == 0xf0) {\n event.type = 'sysEx';\n let length = stream.readletInt();\n event.data = stream.read(length);\n return event;\n } else if (eventTypeByte == 0xf7) {\n event.type = 'dividedSysEx';\n let length = stream.readletInt();\n event.data = stream.read(length);\n return event;\n } else {\n throw \"Unrecognised MIDI event type byte: \" + eventTypeByte;\n }\n } else {\n /* channel event */\n let param1;\n if ((eventTypeByte & 0x80) == 0) {\n /* running status - reuse lastEventTypeByte as the event type.\n \teventTypeByte is actually the first parameter\n */\n param1 = eventTypeByte;\n eventTypeByte = lastEventTypeByte;\n } else {\n param1 = stream.readInt8();\n lastEventTypeByte = eventTypeByte;\n }\n let eventType = eventTypeByte >> 4;\n event.channel = eventTypeByte & 0x0f;\n event.type = 'channel';\n switch (eventType) {\n case 0x08:\n event.subtype = 'noteOff';\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n return event;\n case 0x09:\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n if (event.velocity == 0) {\n event.subtype = 'noteOff';\n } else {\n event.subtype = 'noteOn';\n }\n return event;\n case 0x0a:\n event.subtype = 'noteAftertouch';\n event.noteNumber = param1;\n event.amount = stream.readInt8();\n return event;\n case 0x0b:\n event.subtype = 'controller';\n event.controllerType = param1;\n event.value = stream.readInt8();\n return event;\n case 0x0c:\n event.subtype = 'programChange';\n event.programNumber = param1;\n return event;\n case 0x0d:\n event.subtype = 'channelAftertouch';\n event.amount = param1;\n return event;\n case 0x0e:\n event.subtype = 'pitchBend';\n event.value = param1 + (stream.readInt8() << 7);\n return event;\n default:\n throw \"Unrecognised MIDI event type: \" + eventType\n /* \n console.log(\"Unrecognised MIDI event type: \" + eventType);\n stream.readInt8();\n event.subtype = 'unknown';\n return event;\n */\n }\n }\n }\n\n let stream = new Stream(data);\n let headerChunk = readChunk(stream);\n if (headerChunk.id != 'MThd' || headerChunk.length != 6) {\n throw \"Bad .mid file - header not found\";\n }\n const headerStream = new Stream(headerChunk.data);\n const formatType = headerStream.readInt16();\n const trackCount = headerStream.readInt16();\n const timeDivision = headerStream.readInt16();\n\n if (timeDivision & 0x8000) {\n throw \"Expressing time division in SMTPE frames is not supported yet\"\n }\n const ticksPerBeat = timeDivision;\n\n const header = {\n 'formatType': formatType,\n 'trackCount': trackCount,\n 'ticksPerBeat': ticksPerBeat\n }\n const tracks = [];\n for (let i = 0; i < header.trackCount; i++) {\n tracks[i] = [];\n let trackChunk = readChunk(stream);\n if (trackChunk.id != 'MTrk') {\n throw \"Unexpected chunk - expected MTrk, got \" + trackChunk.id;\n }\n let trackStream = new Stream(trackChunk.data);\n while (!trackStream.eof()) {\n let event = readEvent(trackStream);\n tracks[i].push(event);\n //console.log(event);\n }\n }\n\n return {\n 'header': header,\n 'tracks': tracks\n }\n}", "function audio_init(is_local, less_buffering, compression)\n{\n audio_running = false;\n \n console.log('--------------------------');\n //console.log('AUDIO audio_init CALLED is_local='+ is_local +' less_buffering='+ less_buffering +' compression='+ compression);\n\n less_buffering = false; // DEPRECATED\n \n //console.log('AUDIO audio_init LAST audio_last_is_local='+ audio_last_is_local +' audio_last_compression='+ audio_last_compression);\n if (is_local == null) is_local = audio_last_is_local;\n audio_last_is_local = is_local;\n if (compression == null) compression = audio_last_compression;\n audio_last_compression = compression;\n\n console.log('AUDIO audio_init FINAL is_local='+ is_local +' less_buffering='+ less_buffering +' compression='+ compression);\n\n if (audio_source != undefined) {\n //console.log('AUDIO audio_init audio_disconnect');\n audio_disconnect();\n }\n\n // reset globals\n audio_started = false;\n audio_last_output_offset = 0;\n audio_mode_iq = false;\n audio_compression = compression? true:false;\n audio_stat_input_epoch = -1;\n audio_prepared_buffers = Array();\n audio_prepared_buffers2 = Array();\n audio_prepared_seq = Array();\n audio_prepared_flags = Array();\n audio_prepared_smeter = Array();\n audio_buffering = false;\n audio_convolver_running = false;\n audio_meas_dly = 0;\n audio_meas_dly_start = 0;\n resample_new = kiwi_isMobile()? false : resample_new_default;\n resample_old = !resample_new;\n resample_init1 = false;\n resample_init2 = false;\n resample_input_buffer = [];\n resample_input_available = 0;\n resample_input_processed = 0;\n resample_last_taps_delay = 0;\n resample_output_buffer = [];\n resample_output_buffer2 = [];\n resample_taps = [];\n resample_last = 0;\n resample_last2 = 0;\n comp_lpf_freq = 0;\n comp_lpf_taps = [];\n comp_lpf_taps_length = 255;\n audio_adpcm.index = 0;\n audio_adpcm.previousValue = 0;\n audio_ext_adc_ovfl = false;\n audio_need_stats_reset = true;\n audio_change_LPF_latch = false;\n audio_change_freq_latch = false;\n \n var buffering_scheme = 0;\n var scheme_s;\n\tvar a = kiwi_url_param('abuf', null, null);\n var abuf = 0;\n \n if (a != null) {\n var a2 = a.split(',');\n abuf = parseFloat(a2[0]);\n if (!isNaN(abuf) && abuf >= 0.25 && abuf <= 5.0) {\n console.log('AUDIO override abuf='+ a);\n var max = abuf * 3;\n if (a2.length >= 2) {\n var m = parseFloat(a2[1]);\n if (!isNaN(m) && m >= 0.25 && m <= 5.0 && m > abuf) {\n max = m;\n }\n } else {\n max = abuf * 3;\n }\n audio_buffer_min_length_sec = abuf;\n audio_buffer_max_length_sec = max;\n audio_buffer_size = 8192;\n buffering_scheme = 9;\n scheme_s = 'abuf=';\n } else {\n abuf = 0;\n }\n }\n \n if (abuf == 0) {\n if (less_buffering) {\n if (is_local)\n buffering_scheme = 2;\n else\n buffering_scheme = 1;\n } else {\n buffering_scheme = 0;\n }\n\n // 2048 = 46 ms/buf 21.5 /sec @ 44.1 kHz\n // 4096 = 93 ms/buf 10.8 /sec @ 44.1 kHz\n // 8192 = 186 ms/buf 5.4 /sec @ 44.1 kHz\n \n if (buffering_scheme == 2) {\n audio_buffer_size = 8192;\n audio_buffer_min_length_sec = 0.37; // min_nbuf = 2 @ 44.1 kHz\n audio_buffer_max_length_sec = 2.00;\n scheme_s = 'less buf, local';\n } else\n \n if (buffering_scheme == 1) {\n audio_buffer_size = 8192;\n audio_buffer_min_length_sec = 0.74; // min_nbuf = 4 @ 44.1 kHz\n audio_buffer_max_length_sec = 3.00;\n scheme_s = 'less buf, remote';\n } else\n \n if (buffering_scheme == 0) {\n audio_buffer_size = 8192;\n audio_buffer_min_length_sec = 0.85; // min_nbuf = 5 @ 44.1 kHz\n audio_buffer_max_length_sec = 3.40;\n scheme_s = 'more buf';\n }\n }\n \n\taudio_data = new Int16Array(audio_buffer_size);\n\taudio_last_output_buffer = new Float32Array(audio_buffer_size)\n\taudio_last_output_buffer2 = new Float32Array(audio_buffer_size)\n\taudio_silence_buffer = new Float32Array(audio_buffer_size);\n\tconsole.log('AUDIO buffer_size='+ audio_buffer_size +' buffering_scheme: '+ scheme_s);\n\t\n\tkiwi_clearInterval(audio_stats_interval);\n\taudio_stats_interval = setInterval(audio_stats, 1000);\n\n\t//https://github.com/0xfe/experiments/blob/master/www/tone/js/sinewave.js\n\ttry {\n\t\twindow.AudioContext = window.AudioContext || window.webkitAudioContext;\n\t\taudio_context = new AudioContext();\n\t\taudio_context.sampleRate = 44100;\t\t// attempt to force a lower rate\n\t\taudio_output_rate = audio_context.sampleRate;\t\t// see what rate we're actually getting\n\t\t\n\t\ttry {\n\t\t audio_panner = audio_context.createStereoPanner();\n\t\t audio_panner_ui_init();\n\t\t} catch(e) {\n\t\t audio_panner = null;\n\t\t}\n\t\t\n if (kiwi_isSmartTV()) audio_gain = audio_context.createGain();\n\t} catch(e) {\n\t\tkiwi_serious_error(\"Your browser does not support Web Audio API, which is required for OpenWebRX to run. Please use an HTML5 compatible browser.\");\n\t\taudio_context = null;\n\t\taudio_output_rate = 0;\n\t\treturn true;\n\t}\n\nsetTimeout(\"snd_send('SET little-endian'); // we can accept arm native little-endian data\", 10000);\n audio_running = true;\n return false;\n}", "playAudio() {}", "function Instrument(){\n\n\tthis.input = audioCtx.createGain();\n\tthis.output = audioCtx.createGain();\n\tthis.startArray = [];\n\n}", "readSample() {\n return 0;\n }", "function pcmGetRms(src) {\r\n var numSamples = src.length;\r\n var rms = 0;\r\n for (var i = 0; i < numSamples; i++) {\r\n rms += Math.pow(src[i], 2);\r\n }\r\n return Math.sqrt(rms / numSamples);\r\n }", "toMuLaw() {\r\n this.assure16Bit_();\r\n /** @type {!Int16Array} */\r\n let output = new Int16Array(this.data.samples.length / 2);\r\n unpackArrayTo(this.data.samples, this.dataType, output);\r\n this.fromScratch(\r\n this.fmt.numChannels,\r\n this.fmt.sampleRate,\r\n '8m',\r\n alawmulaw.mulaw.encode(output),\r\n {container: this.correctContainer_()});\r\n }", "function audioSetup(){ audioContext = new AudioContext();\n\t//audioplyr.currentTime = 0\n\t// analyser (for audio visualization)\n\t analyser = audioContext.createAnalyser();\n\t analyser.fftSize = 2048;\n\t analyser.smoothingTimeConstant = 0.5;\n\t analyser.maxDecibels = -30;\n\t analyser.minDecibels = -100;\n\t analyser.smoothingTimeConstant = 0.1;\n\n\t frequencyData = new Float32Array(analyser.frequencyBinCount);\n\t // audioplyr.setAttribute('src', \"audio/mahsiv.mp3\");\n\t // create an oscillator\n\t var oscillator = audioContext.createOscillator();\n\t oscillator.type = \"sine\";\n\t oscillator.frequency.setValueAtTime(400, audioContext.currentTime);\n\t oscillator.start();\n\t // oscillator.connect(analyser);\n\t // oscillator.connect(audioContext.destination);\n\t \n\t // audio player gain\n\t audioGain = audioContext.createGain();\n\t audioGain.gain.setValueAtTime(1, audioContext.currentTime);\n\t audioGain.connect(analyser);\n\t audioGain.connect(audioContext.destination);\n\t \n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/9/9b/Bruckner_Symphony_No._5%2C_opening.wav\");\n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/3/32/Danse_Macabre_-_Busy_Strings_%28ISRC_USUAN1100556%29.mp3\");\n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/d/d6/Danse_Macabre_-_Light_Dance_%28ISRC_USUAN1100553%29.mp3\");\n\t //drawURL(\"https://upload.wikimedia.org/wikipedia/commons/c/c6/Canon_in_D_Major_%28ISRC_USUAN1100301%29.mp3\");\n\n\t myOscilloscope.resume();\n\tradioSrc = audioContext.createMediaElementSource(audioplyr);\n\t radioSrc.connect(audioGain);\n\t \n\t splitter = audioContext.createChannelSplitter();\n\n\t analyserL = audioContext.createAnalyser();\n\t analyserL.smoothingTimeConstant = 0.7;\n\n\t analyserR = audioContext.createAnalyser();\n\t analyserR.smoothingTimeConstant = 0.7;\n\n\t //sourceNode = audioContext.createMediaElementSource(audio);\n\t radioSrc.connect(splitter);\n\t //sourceNode.connect(audioContext.destination);\n\n\t splitter.connect(analyserL,0,0);\n\t splitter.connect(analyserR,1,0);\n\n\t //audio.play();\n\t analyserL.fftSize = 4096;\n\t analyserR.fftSize = 4096;\n\t bufferLength = analyserL.fftSize;\n\t dataArrayL = new Float32Array(bufferLength);\n\t dataArrayR = new Float32Array(bufferLength);\n\t}", "enableAudio() {\n // Create the audio context. We have to do this as a result of a user action, like a mouse click.\n this.audioContext = new AudioContext({\n latencyHint: \"interactive\",\n });\n const audioContext = this.audioContext;\n // Load our module.\n const moduleUrl = \"data:text/javascript;base64,\" + btoa(PROCESSOR_JS);\n this.audioContext.audioWorklet.addModule(moduleUrl).then(() => {\n // I don't know why we need this, but I can't figure out a way to \"start\" our own node.\n const constantSourceNode = audioContext.createConstantSource();\n // Our own node, which ignores its input and generates the audio.\n const node = new Trs80SoundNode(audioContext);\n // Into this parameter we'll write the actual audio values.\n this.audioValue = node.parameters.get(\"audioValue\");\n if (this.audioValue === undefined) {\n throw new Error(\"Unknown param audioValue\");\n }\n // Automatically suspend the audio if we've not played sound in a while.\n setInterval(() => this.checkAutoSuspend(), 1000);\n // Hook up the pipeline.\n constantSourceNode.connect(node).connect(audioContext.destination);\n constantSourceNode.start();\n });\n }", "createAudio(frequency, waveform) {\n if (!this.audioCount) {\n this.audioCount = 0;\n }\n\n const AUDIO_ID = `${this.audioCount}-${this.id}`;\n this.audioCount += 1;\n\n postMessage({\n type: 'audio',\n payload: {\n command: 'create',\n id: AUDIO_ID,\n frequency,\n waveform: waveform.toLowerCase(),\n },\n });\n\n const play = () =>\n postMessage({\n type: 'audio',\n payload: {\n command: 'play',\n id: AUDIO_ID,\n },\n });\n\n const pause = () =>\n postMessage({\n type: 'audio',\n payload: { command: 'pause', id: AUDIO_ID },\n });\n\n const setFrequency = freq =>\n postMessage({\n type: 'audio',\n payload: {\n command: 'setFrequency',\n id: AUDIO_ID,\n frequency: freq,\n },\n });\n\n const setWaveform = wf =>\n postMessage({\n type: 'audio',\n payload: {\n command: 'setWaveform',\n id: AUDIO_ID,\n waveform: wf,\n },\n });\n\n return {\n play,\n pause,\n setFrequency,\n setWaveform,\n };\n }", "function simpleSynth(buf, pitch, pitchFun, formantShift, dontStart) {\n formantShift = formantShift || 1.0;\n var rate = audioCtx.sampleRate;\n var start = audioCtx.currentTime;\n var t = 0;\n var choose = 0;\n var outbuf = audioCtx.createBuffer(1, buf.length, audioCtx.sampleRate);\n var out = outbuf.getChannelData(0);\n for (var i = 0; i < pitch.length-1; i++) {\n var delta = pitch[i][1] ? 1/pitch[i][1] : Math.random() * 0.004 + 0.008;\n \n while (t < pitch[i+1][0]) {\n while (choose < t) choose += delta;\n var from = (t-delta/formantShift) * rate | 0;\n var to = (t+delta/formantShift) * rate | 0;\n for (var j = from; j < to; j++) {\n var w = (j - t*rate) / (delta*rate) * formantShift;\n w = Math.cos(w * Math.PI) * 0.5 + 0.5;\n var pos = choose * rate + (j - from) * formantShift;\n if (pos < buf.length-1) {\n var frac = pos - Math.floor(pos);\n var h = Math.floor(pos);\n out[j] += w * ((1-frac) * buf[h] + frac * buf[h+1]);\n }\n }\n if (pitch[i][1] > 1) {\n t += 1/pitchFun(pitch[i][1]);\n }\n else {\n // unvoiced\n t += delta;\n }\n }\n }\n var n = audioCtx.createBufferSource();\n n.connect(audioCtx.destination);\n n.buffer = outbuf;\n n.onended = function () {\n showProgress(\"finished\");\n };\n if (!dontStart) n.start(start);\n return n;\n}", "function AudioManager() {\n\n /**\n * Stores all audio buffers.\n * @property buffers\n * @type gs.AudioBuffer[]\n * @protected\n */\n this.audioBuffers = [];\n\n /**\n * Stores all audio buffers by layer.\n * @property buffers\n * @type gs.AudioBuffer[]\n * @protected\n */\n this.audioBuffersByLayer = [];\n\n /**\n * Stores all audio buffer references for sounds.\n * @property soundReferences\n * @type gs.AudioBufferReference[]\n * @protected\n */\n this.soundReferences = {};\n\n /**\n * Current Music (Layer 0)\n * @property music\n * @type Object\n * @protected\n */\n this.music = null;\n\n /**\n * Current music volume.\n * @property musicVolume\n * @type number\n * @protected\n */\n this.musicVolume = 100;\n\n /**\n * Current sound volume.\n * @property soundVolume\n * @type number\n * @protected\n */\n this.soundVolume = 100;\n\n /**\n * Current voice volume.\n * @property voiceVolume\n * @type number\n * @protected\n */\n this.voiceVolume = 100;\n\n /**\n * General music volume\n * @property generalMusicVolume\n * @type number\n * @protected\n */\n this.generalMusicVolume = 100;\n\n /**\n * General sound volume\n * @property generalSoundVolume\n * @type number\n * @protected\n */\n this.generalSoundVolume = 100;\n\n /**\n * General voice volume\n * @property generalVoiceVolume\n * @type number\n * @protected\n */\n this.generalVoiceVolume = 100;\n\n /**\n * Stores audio layer info-data for each layer.\n * @property audioLayers\n * @type gs.AudioLayerInfo[]\n * @protected\n */\n this.audioLayers = [];\n }", "function prime_audio(subject, callback) {\n if (p==1) {aud_play_pause();} else {\n audio1.play();\n audio1.pause();\n console.log(\"audio primed\");\n p=1;\n callback();\n}\n}", "function MV_ServiceVoc() {\n var voice;\n var next;\n\n // Toggle which buffer we'll mix next\n MV_MixPage++;\n if ( MV_MixPage >= MV_NumberOfBuffers )\n {\n MV_MixPage -= MV_NumberOfBuffers;\n }\n\t\n {\n ClearBuffer_DW( MV_FooBuffer, 0, (8 / 4 * MV_BufferSize / MV_SampleSize * MV_Channels) | 0);\n MV_BufferEmpty[ MV_MixPage ] = 1;\n }\n\t\n // Play any waiting voices\n for( voice = VoiceList.next; voice != VoiceList; voice = next )\n {\n // if ( ( voice < &MV_Voices[ 0 ] ) || ( voice > &MV_Voices[ 8 ] ) )\n // {\n // SetBorderColor(backcolor++);\n // break;\n // }\n\n if(!voice.GetSound)\n {\n console.debug(\"MV_ServiceVoc() voice.GetSound == NULL, break;\\n\");\n\n // This sound is null, early out, or face a nasty crash.\n break;\t\t\n }\n\t\t\n MV_BufferEmpty[ MV_MixPage ] = 0;\n\t\t\n MV_MixFunction( voice );\n\t\n next = voice.next;\n\t\t\n // Is this voice done?\n if ( !voice.Playing )\n {\n MV_StopVoice( voice );\n\t\t\t\n if ( MV_CallBackFunc )\n {\n MV_CallBackFunc( voice.callbackval );\n }\n }\n }\n\t\n if ( MV_ReverbLevel > 0)\n {\n if (MV_ReverbTable != -1) MV_FPReverb(MV_ReverbTable);\n }\n\n {\n \n // TODO: NEEDED??\n //var dest;\n //var count;\n\t\t\n //dest = MV_MixBuffer[ MV_MixPage ];\n //count = (MV_BufferSize / MV_SampleSize * MV_Channels) | 0;\n //if ( MV_Bits == 16 )\n //{\n // MV_16BitDownmix(dest, count);\n //}\n //else\n //{\n // MV_8BitDownmix(dest, count);\n //}\n\t\t\t\n }\n}", "function analyzeData() {\n let tdMaxsTotal = tdMinsTotal = tdAvgsTotal = tdTotalRanges = 0;\n let frTotalMaxs = frTotalMins = frTotalAvgs = frTotalRanges = 0;\n\n frAnalyserNode.getFloatFrequencyData(soundData.frBuffer);\n soundData.frBufferHistory.push(soundData.frBuffer.slice(0));\n if (soundData.frBufferHistory.length > frBufferLength) soundData.frBufferHistory.shift();\n\n tdAnalyserNode.getFloatTimeDomainData(soundData.tdBuffer);\n soundData.tdBufferHistory.push(soundData.tdBuffer.slice(0));\n if (soundData.tdBufferHistory.length > tdBufferLength) soundData.tdBufferHistory.shift();\n\n // Calculate sound wave time data min and max and get total for averaging\n // td {-1, 1}\n soundData.tdMax = {\n index: 0,\n value: -500\n };\n soundData.tdMin = {\n index: 0,\n value: 500\n };\n soundData.tdTot = 0;\n\n for (let i = 0; i < tdBufferLength; i++) {\n if (soundData.tdBuffer[i] > soundData.tdMax.value) soundData.tdMax = {\n index: i,\n value: soundData.tdBuffer[i]\n };\n if (soundData.tdBuffer[i] < soundData.tdMin.value) soundData.tdMin = {\n index: i,\n value: soundData.tdBuffer[i]\n };\n soundData.tdTot += soundData.tdBuffer[i];\n\n if (soundData.tdBuffer[i] > soundData.tdMaxAllTime) soundData.tdMaxAllTime = soundData.tdBuffer[i];\n if (soundData.tdBuffer[i] < soundData.tdMinAllTime) soundData.tdMinAllTime = soundData.tdBuffer[i];\n\n }\n\n soundData.tdMaxs.push(soundData.tdMax);\n if (soundData.tdMaxs.length > arraySize) soundData.tdMaxs.shift();\n\n soundData.tdMins.push(soundData.tdMin);\n if (soundData.tdMins.length > arraySize) soundData.tdMins.shift();\n\n // Calculate average\n soundData.tdAvg = soundData.tdTot / tdBufferLength;\n soundData.tdAvgs.push(soundData.tdAvg);\n if (soundData.tdAvgs.length > arraySize) soundData.tdAvgs.shift();\n\n // Calculate range\n soundData.tdRange = soundData.tdMax.value - soundData.tdMin.value;\n soundData.tdRanges.push(soundData.tdRange);\n if (soundData.tdRanges.length > arraySize) soundData.tdRanges.shift();\n\n\n\n // Calculate frequency min and max and get total for averaging\n // fr {-180, -12 }\n soundData.frMax = {\n index: 0,\n value: -500\n };\n soundData.frMin = {\n index: 0,\n value: 500\n };\n soundData.frTot = 0;\n\n for (let i = 0; i < frBufferLength; i++) {\n if (soundData.frBuffer[i] > soundData.frMax.value) soundData.frMax = {\n index: i,\n value: soundData.frBuffer[i]\n };\n if (soundData.frBuffer[i] < soundData.frMin.value) soundData.frMin = {\n index: i,\n value: soundData.frBuffer[i]\n };\n soundData.frTot += soundData.frBuffer[i];\n\n if (soundData.frBuffer[i] > soundData.frMaxAllTime) soundData.frMaxAllTime = soundData.frBuffer[i];\n if (soundData.frBuffer[i] < soundData.frMinAllTime && soundData.frBuffer[i] > -100000) soundData.frMinAllTime = soundData.frBuffer[i];\n }\n\n soundData.frMaxs.push(soundData.frMax);\n if (soundData.frMaxs.length > arraySize) soundData.frMaxs.shift();\n\n soundData.frMins.push(soundData.frMin);\n if (soundData.frMins.length > arraySize) soundData.frMins.shift();\n\n // Calculate average \n soundData.frAvg = soundData.frTot / frBufferLength;\n soundData.frAvgs.push(soundData.frAvg);\n if (soundData.frAvgs.length > arraySize) soundData.frAvgs.shift();\n\n // Calculate range\n soundData.frRange = soundData.frMax.value - soundData.frMin.value;\n soundData.frRanges.push(soundData.frRange);\n if (soundData.frRanges.length > arraySize) soundData.frRanges.shift();\n\n\n // \n\n for (let index = 0; index < arraySize; index++) {\n tdMaxsTotal += soundData.tdMaxs[index].value;\n tdMinsTotal += soundData.tdMins[index].value;\n tdAvgsTotal += soundData.tdAvgs[index];\n tdTotalRanges += soundData.tdRanges[index];\n\n frTotalMaxs += soundData.frMaxs[index].value;\n frTotalMins += soundData.frMins[index].value;\n frTotalAvgs += soundData.frAvgs[index];\n frTotalRanges += soundData.frRanges[index];\n\n };\n\n soundData.tdAvgTotalMaxs = tdMaxsTotal / arraySize;\n soundData.tdAvgTotalMins = tdMinsTotal / arraySize;\n soundData.tdAvgTotalAvgs = tdAvgsTotal / arraySize;\n soundData.tdAvgTotalRanges = tdTotalRanges / arraySize;\n\n soundData.frAvgTotalMaxs = frTotalMaxs / arraySize;\n soundData.frAvgTotalMins = frTotalMins / arraySize;\n soundData.frAvgTotalAvgs = frTotalAvgs / arraySize;\n soundData.frAvgTotalRanges = frTotalRanges / arraySize;\n }", "function XAudioJSMediaStreamPushAudio(event) {\n var index = 0;\n var audioLengthRequested = event.data;\n var samplesPerCallbackAll = XAudioJSSamplesPerCallback * XAudioJSChannelsAllocated;\n var XAudioJSMediaStreamLengthAlias = audioLengthRequested % XAudioJSSamplesPerCallback;\n audioLengthRequested = audioLengthRequested - (XAudioJSMediaStreamLengthAliasCounter - (XAudioJSMediaStreamLengthAliasCounter % XAudioJSSamplesPerCallback)) - XAudioJSMediaStreamLengthAlias + XAudioJSSamplesPerCallback;\n XAudioJSMediaStreamLengthAliasCounter -= XAudioJSMediaStreamLengthAliasCounter - (XAudioJSMediaStreamLengthAliasCounter % XAudioJSSamplesPerCallback);\n XAudioJSMediaStreamLengthAliasCounter += XAudioJSSamplesPerCallback - XAudioJSMediaStreamLengthAlias;\n if (XAudioJSMediaStreamBuffer.length != samplesPerCallbackAll) {\n XAudioJSMediaStreamBuffer = new Float32Array(samplesPerCallbackAll);\n }\n XAudioJSResampleRefill();\n while (index < audioLengthRequested) {\n var index2 = 0;\n while (index2 < samplesPerCallbackAll && XAudioJSResampleBufferStart != XAudioJSResampleBufferEnd) {\n XAudioJSMediaStreamBuffer[index2++] = XAudioJSResampledBuffer[XAudioJSResampleBufferStart++];\n if (XAudioJSResampleBufferStart == XAudioJSResampleBufferSize) {\n XAudioJSResampleBufferStart = 0;\n }\n }\n XAudioJSMediaStreamWorker.postMessage([0, XAudioJSMediaStreamBuffer]);\n index += XAudioJSSamplesPerCallback;\n }\n}", "function playFromFile() {\n var reader = new FileReader();\n\n if (audioCtx == null) {\n audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n }\n\n analyzer = audioCtx.createAnalyser();\n analyzer.fftsize = 512;\n document.getElementById('loading').style.display = 'block';\n // creates audio source and analyzer from inputed file\n reader.onload = function (e) {\n audioCtx.decodeAudioData(e.target.result, function (buf) {\n document.getElementById('loading').style.display = 'none';\n document.getElementById('song' + index).style.color = 'green';\n source = audioCtx.createBufferSource();\n source.connect(analyzer);\n //source.connect(audioCtx.destination); // causes distortion\n analyzer.connect(audioCtx.destination);\n source.buffer = buf;\n source.start(0);\n source.onended = function() {// plays next song if any in queue\n document.getElementById('song' + index).style.color = 'black';\n\n if (index !== files.length - 1) {\n index++;\n playFromFile();\n }\n };\n\n })\n };\n reader.readAsArrayBuffer(files[index]);\n \n dataArray = new Uint8Array(analyzer.frequencyBinCount);\n analyzer.getByteFrequencyData(dataArray); // sets audio data\n}", "function addEqualiser() {\n\n var gainDb = -40.0; // atenuation When it takes a positive value it is a real gain, when negative it is an attenuation. It is expressed in dB, has a default value of 0 and can take a value in a nominal range of -40 to 40.\n var bandSplit = [360, 3600];\n context_player = new AudioContext();\n\n for (var i = 0; i < 2; i++) {\n\n mediaElement_player.push(null);\n sourceNode_player.push(null);\n source_player.push(null);\n lGain_player.push(null);\n mGain_player.push(null);\n hGain_player.push(null);\n sum_player.push(null);\n volumeNodes.push(null);\n\n\n mediaElement_player[i] = document.getElementById('jp_audio_' + i);\n source_player[i] = context_player.createMediaElementSource(mediaElement_player[i]);\n\n initFrequencyQuality(i);\n\n // affects the ammount of treble in a sound - treble knob - atenuates the sounds below the 3600 frequencies\n var lBand_player = context_player.createBiquadFilter();\n lBand_player.type = \"lowshelf\";\n lBand_player.frequency.value = bandSplit[1];\n lBand_player.gain.value = gainDb;\n\n // affects the ammount of bass in a sound - bass knob - atenuates the sounds higher than 360 frequencies\n var hBand_player = context_player.createBiquadFilter();\n hBand_player.type = \"highshelf\";\n hBand_player.frequency.value = bandSplit[0];\n hBand_player.gain.value = gainDb;\n\n var hInvert_player = context_player.createGain();\n hInvert_player.gain.value = -1.0;\n\n //Subtract low and high frequencies (add invert) from the source for the mid frequencies\n var mBand_player = context_player.createGain();\n\n //or use picking\n //mBand_player = context_player.createBiquadFilter();\n //mBand_player.type = \"peaking\";\n //mBand_player.frequency.value = bandSplit[0];\n //mBand_player.gain.value = gainDb;\n\n var lInvert_player = context_player.createGain();\n lInvert_player.gain.value = -1.0;\n\n sourceNode_player[i].connect(lBand_player);\n sourceNode_player[i].connect(mBand_player);\n sourceNode_player[i].connect(hBand_player);\n\n hBand_player.connect(hInvert_player);\n lBand_player.connect(lInvert_player);\n\n hInvert_player.connect(mBand_player);\n lInvert_player.connect(mBand_player);\n\n\n lGain_player[i] = context_player.createGain();\n mGain_player[i] = context_player.createGain();\n hGain_player[i] = context_player.createGain();\n\n lBand_player.connect(lGain_player[i]);\n mBand_player.connect(mGain_player[i]);\n hBand_player.connect(hGain_player[i]);\n\n sum_player[i] = context_player.createGain();\n lGain_player[i].connect(sum_player[i]);\n mGain_player[i].connect(sum_player[i]);\n hGain_player[i].connect(sum_player[i]);\n\n lGain_player[i].gain.value = 1;\n mGain_player[i].gain.value = 1;\n hGain_player[i].gain.value = 1;\n\n volumeNodes[i] = context_player.createGain();\n sum_player[i].connect(volumeNodes[i]);\n volumeNodes[i].connect(context_player.destination);\n }\n\n //set volume\n var x = 50 / 100;\n // Use an equal-power crossfading curve:\n var gain1 = Math.cos(x * 0.5 * Math.PI);\n var gain2 = Math.cos((1.0 - x) * 0.5 * Math.PI);\n volumeNodes[0].gain.value = gain1;\n volumeNodes[1].gain.value = gain2;\n\n //create audio Recording node\n audioRecordNode = context_player.createGain();\n volumeNodes[0].connect(audioRecordNode);\n volumeNodes[1].connect(audioRecordNode);\n audioRecorder = new Recorder(audioRecordNode);\n}", "function MidiFile(data) {\n\tfunction readChunk(stream) {\n\t\tvar id = stream.read(4);\n\t\tvar length = stream.readInt32();\n\t\treturn {\n\t\t\t'id': id,\n\t\t\t'length': length,\n\t\t\t'data': stream.read(length)\n\t\t};\n\t}\n\t\n\tvar lastEventTypeByte;\n\t\n\tfunction readEvent(stream) {\n\t\tvar event = {};\n\t\tevent.deltaTime = stream.readVarInt();\n\t\tvar eventTypeByte = stream.readInt8();\n\t\tif ((eventTypeByte & 0xf0) == 0xf0) {\n\t\t\t/* system / meta event */\n\t\t\tif (eventTypeByte == 0xff) {\n\t\t\t\t/* meta event */\n\t\t\t\tevent.type = 'meta';\n\t\t\t\tvar subtypeByte = stream.readInt8();\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tswitch(subtypeByte) {\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\tevent.subtype = 'sequenceNumber';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for sequenceNumber event is 2, got \" + length;\n\t\t\t\t\t\tevent.number = stream.readInt16();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x01:\n\t\t\t\t\t\tevent.subtype = 'text';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x02:\n\t\t\t\t\t\tevent.subtype = 'copyrightNotice';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x03:\n\t\t\t\t\t\tevent.subtype = 'trackName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x04:\n\t\t\t\t\t\tevent.subtype = 'instrumentName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x05:\n\t\t\t\t\t\tevent.subtype = 'lyrics';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x06:\n\t\t\t\t\t\tevent.subtype = 'marker';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x07:\n\t\t\t\t\t\tevent.subtype = 'cuePoint';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x20:\n\t\t\t\t\t\tevent.subtype = 'midiChannelPrefix';\n\t\t\t\t\t\tif (length != 1) throw \"Expected length for midiChannelPrefix event is 1, got \" + length;\n\t\t\t\t\t\tevent.channel = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x2f:\n\t\t\t\t\t\tevent.subtype = 'endOfTrack';\n\t\t\t\t\t\tif (length != 0) throw \"Expected length for endOfTrack event is 0, got \" + length;\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x51:\n\t\t\t\t\t\tevent.subtype = 'setTempo';\n\t\t\t\t\t\tif (length != 3) throw \"Expected length for setTempo event is 3, got \" + length;\n\t\t\t\t\t\tevent.microsecondsPerBeat = (\n\t\t\t\t\t\t\t(stream.readInt8() << 16)\n\t\t\t\t\t\t\t+ (stream.readInt8() << 8)\n\t\t\t\t\t\t\t+ stream.readInt8()\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x54:\n\t\t\t\t\t\tevent.subtype = 'smpteOffset';\n\t\t\t\t\t\tif (length != 5) throw \"Expected length for smpteOffset event is 5, got \" + length;\n\t\t\t\t\t\tvar hourByte = stream.readInt8();\n\t\t\t\t\t\tevent.frameRate = {\n\t\t\t\t\t\t\t0x00: 24, 0x20: 25, 0x40: 29, 0x60: 30\n\t\t\t\t\t\t}[hourByte & 0x60];\n\t\t\t\t\t\tevent.hour = hourByte & 0x1f;\n\t\t\t\t\t\tevent.min = stream.readInt8();\n\t\t\t\t\t\tevent.sec = stream.readInt8();\n\t\t\t\t\t\tevent.frame = stream.readInt8();\n\t\t\t\t\t\tevent.subframe = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x58:\n\t\t\t\t\t\tevent.subtype = 'timeSignature';\n\t\t\t\t\t\tif (length != 4) throw \"Expected length for timeSignature event is 4, got \" + length;\n\t\t\t\t\t\tevent.numerator = stream.readInt8();\n\t\t\t\t\t\tevent.denominator = Math.pow(2, stream.readInt8());\n\t\t\t\t\t\tevent.metronome = stream.readInt8();\n\t\t\t\t\t\tevent.thirtyseconds = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x59:\n\t\t\t\t\t\tevent.subtype = 'keySignature';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for keySignature event is 2, got \" + length;\n\t\t\t\t\t\tevent.key = stream.readInt8(true);\n\t\t\t\t\t\tevent.scale = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x7f:\n\t\t\t\t\t\tevent.subtype = 'sequencerSpecific';\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// console.log(\"Unrecognised meta event subtype: \" + subtypeByte);\n\t\t\t\t\t\tevent.subtype = 'unknown'\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t}\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf0) {\n\t\t\t\tevent.type = 'sysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf7) {\n\t\t\t\tevent.type = 'dividedSysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else {\n\t\t\t\tthrow \"Unrecognised MIDI event type byte: \" + eventTypeByte;\n\t\t\t}\n\t\t} else {\n\t\t\t/* channel event */\n\t\t\tvar param1;\n\t\t\tif ((eventTypeByte & 0x80) == 0) {\n\t\t\t\t/* running status - reuse lastEventTypeByte as the event type.\n\t\t\t\t\teventTypeByte is actually the first parameter\n\t\t\t\t*/\n\t\t\t\tparam1 = eventTypeByte;\n\t\t\t\teventTypeByte = lastEventTypeByte;\n\t\t\t} else {\n\t\t\t\tparam1 = stream.readInt8();\n\t\t\t\tlastEventTypeByte = eventTypeByte;\n\t\t\t}\n\t\t\tvar eventType = eventTypeByte >> 4;\n\t\t\tevent.channel = eventTypeByte & 0x0f;\n\t\t\tevent.type = 'channel';\n\t\t\tswitch (eventType) {\n\t\t\t\tcase 0x08:\n\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x09:\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\tif (event.velocity == 0) {\n\t\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tevent.subtype = 'noteOn';\n\t\t\t\t\t}\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0a:\n\t\t\t\t\tevent.subtype = 'noteAftertouch';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.amount = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0b:\n\t\t\t\t\tevent.subtype = 'controller';\n\t\t\t\t\tevent.controllerType = param1;\n\t\t\t\t\tevent.value = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0c:\n\t\t\t\t\tevent.subtype = 'programChange';\n\t\t\t\t\tevent.programNumber = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0d:\n\t\t\t\t\tevent.subtype = 'channelAftertouch';\n\t\t\t\t\tevent.amount = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0e:\n\t\t\t\t\tevent.subtype = 'pitchBend';\n\t\t\t\t\tevent.value = param1 + (stream.readInt8() << 7);\n\t\t\t\t\treturn event;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow \"Unrecognised MIDI event type: \" + eventType\n\t\t\t\t\t/* \n\t\t\t\t\tconsole.log(\"Unrecognised MIDI event type: \" + eventType);\n\t\t\t\t\tstream.readInt8();\n\t\t\t\t\tevent.subtype = 'unknown';\n\t\t\t\t\treturn event;\n\t\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t}\n\t\n\tstream = Stream(data);\n\tvar headerChunk = readChunk(stream);\n\tif (headerChunk.id != 'MThd' || headerChunk.length != 6) {\n\t\tthrow \"Bad .mid file - header not found\";\n\t}\n\tvar headerStream = Stream(headerChunk.data);\n\tvar formatType = headerStream.readInt16();\n\tvar trackCount = headerStream.readInt16();\n\tvar timeDivision = headerStream.readInt16();\n\t\n\tif (timeDivision & 0x8000) {\n\t\tthrow \"Expressing time division in SMTPE frames is not supported yet\"\n\t} else {\n\t\tticksPerBeat = timeDivision;\n\t}\n\t\n\tvar header = {\n\t\t'formatType': formatType,\n\t\t'trackCount': trackCount,\n\t\t'ticksPerBeat': ticksPerBeat\n\t}\n\tvar tracks = [];\n\tfor (var i = 0; i < header.trackCount; i++) {\n\t\ttracks[i] = [];\n\t\tvar trackChunk = readChunk(stream);\n\t\tif (trackChunk.id != 'MTrk') {\n\t\t\tthrow \"Unexpected chunk - expected MTrk, got \"+ trackChunk.id;\n\t\t}\n\t\tvar trackStream = Stream(trackChunk.data);\n\t\twhile (!trackStream.eof()) {\n\t\t\tvar event = readEvent(trackStream);\n\t\t\ttracks[i].push(event);\n\t\t\t//console.log(event);\n\t\t}\n\t}\n\t\n\treturn {\n\t\t'header': header,\n\t\t'tracks': tracks\n\t}\n}", "function MidiFile(data) {\n\tfunction readChunk(stream) {\n\t\tvar id = stream.read(4);\n\t\tvar length = stream.readInt32();\n\t\treturn {\n\t\t\t'id': id,\n\t\t\t'length': length,\n\t\t\t'data': stream.read(length)\n\t\t};\n\t}\n\t\n\tvar lastEventTypeByte;\n\t\n\tfunction readEvent(stream) {\n\t\tvar event = {};\n\t\tevent.deltaTime = stream.readVarInt();\n\t\tvar eventTypeByte = stream.readInt8();\n\t\tif ((eventTypeByte & 0xf0) == 0xf0) {\n\t\t\t/* system / meta event */\n\t\t\tif (eventTypeByte == 0xff) {\n\t\t\t\t/* meta event */\n\t\t\t\tevent.type = 'meta';\n\t\t\t\tvar subtypeByte = stream.readInt8();\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tswitch(subtypeByte) {\n\t\t\t\t\tcase 0x00:\n\t\t\t\t\t\tevent.subtype = 'sequenceNumber';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for sequenceNumber event is 2, got \" + length;\n\t\t\t\t\t\tevent.number = stream.readInt16();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x01:\n\t\t\t\t\t\tevent.subtype = 'text';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x02:\n\t\t\t\t\t\tevent.subtype = 'copyrightNotice';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x03:\n\t\t\t\t\t\tevent.subtype = 'trackName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x04:\n\t\t\t\t\t\tevent.subtype = 'instrumentName';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x05:\n\t\t\t\t\t\tevent.subtype = 'lyrics';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x06:\n\t\t\t\t\t\tevent.subtype = 'marker';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x07:\n\t\t\t\t\t\tevent.subtype = 'cuePoint';\n\t\t\t\t\t\tevent.text = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x20:\n\t\t\t\t\t\tevent.subtype = 'midiChannelPrefix';\n\t\t\t\t\t\tif (length != 1) throw \"Expected length for midiChannelPrefix event is 1, got \" + length;\n\t\t\t\t\t\tevent.channel = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x2f:\n\t\t\t\t\t\tevent.subtype = 'endOfTrack';\n\t\t\t\t\t\tif (length != 0) throw \"Expected length for endOfTrack event is 0, got \" + length;\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x51:\n\t\t\t\t\t\tevent.subtype = 'setTempo';\n\t\t\t\t\t\tif (length != 3) throw \"Expected length for setTempo event is 3, got \" + length;\n\t\t\t\t\t\tevent.microsecondsPerBeat = (\n\t\t\t\t\t\t\t(stream.readInt8() << 16)\n\t\t\t\t\t\t\t+ (stream.readInt8() << 8)\n\t\t\t\t\t\t\t+ stream.readInt8()\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x54:\n\t\t\t\t\t\tevent.subtype = 'smpteOffset';\n\t\t\t\t\t\tif (length != 5) throw \"Expected length for smpteOffset event is 5, got \" + length;\n\t\t\t\t\t\tvar hourByte = stream.readInt8();\n\t\t\t\t\t\tevent.frameRate = {\n\t\t\t\t\t\t\t0x00: 24, 0x20: 25, 0x40: 29, 0x60: 30\n\t\t\t\t\t\t}[hourByte & 0x60];\n\t\t\t\t\t\tevent.hour = hourByte & 0x1f;\n\t\t\t\t\t\tevent.min = stream.readInt8();\n\t\t\t\t\t\tevent.sec = stream.readInt8();\n\t\t\t\t\t\tevent.frame = stream.readInt8();\n\t\t\t\t\t\tevent.subframe = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x58:\n\t\t\t\t\t\tevent.subtype = 'timeSignature';\n\t\t\t\t\t\tif (length != 4) throw \"Expected length for timeSignature event is 4, got \" + length;\n\t\t\t\t\t\tevent.numerator = stream.readInt8();\n\t\t\t\t\t\tevent.denominator = Math.pow(2, stream.readInt8());\n\t\t\t\t\t\tevent.metronome = stream.readInt8();\n\t\t\t\t\t\tevent.thirtyseconds = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x59:\n\t\t\t\t\t\tevent.subtype = 'keySignature';\n\t\t\t\t\t\tif (length != 2) throw \"Expected length for keySignature event is 2, got \" + length;\n\t\t\t\t\t\tevent.key = stream.readInt8(true);\n\t\t\t\t\t\tevent.scale = stream.readInt8();\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tcase 0x7f:\n\t\t\t\t\t\tevent.subtype = 'sequencerSpecific';\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// console.log(\"Unrecognised meta event subtype: \" + subtypeByte);\n\t\t\t\t\t\tevent.subtype = 'unknown'\n\t\t\t\t\t\tevent.data = stream.read(length);\n\t\t\t\t\t\treturn event;\n\t\t\t\t}\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf0) {\n\t\t\t\tevent.type = 'sysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else if (eventTypeByte == 0xf7) {\n\t\t\t\tevent.type = 'dividedSysEx';\n\t\t\t\tvar length = stream.readVarInt();\n\t\t\t\tevent.data = stream.read(length);\n\t\t\t\treturn event;\n\t\t\t} else {\n\t\t\t\tthrow \"Unrecognised MIDI event type byte: \" + eventTypeByte;\n\t\t\t}\n\t\t} else {\n\t\t\t/* channel event */\n\t\t\tvar param1;\n\t\t\tif ((eventTypeByte & 0x80) == 0) {\n\t\t\t\t/* running status - reuse lastEventTypeByte as the event type.\n\t\t\t\t\teventTypeByte is actually the first parameter\n\t\t\t\t*/\n\t\t\t\tparam1 = eventTypeByte;\n\t\t\t\teventTypeByte = lastEventTypeByte;\n\t\t\t} else {\n\t\t\t\tparam1 = stream.readInt8();\n\t\t\t\tlastEventTypeByte = eventTypeByte;\n\t\t\t}\n\t\t\tvar eventType = eventTypeByte >> 4;\n\t\t\tevent.channel = eventTypeByte & 0x0f;\n\t\t\tevent.type = 'channel';\n\t\t\tswitch (eventType) {\n\t\t\t\tcase 0x08:\n\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x09:\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.velocity = stream.readInt8();\n\t\t\t\t\tif (event.velocity == 0) {\n\t\t\t\t\t\tevent.subtype = 'noteOff';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tevent.subtype = 'noteOn';\n\t\t\t\t\t}\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0a:\n\t\t\t\t\tevent.subtype = 'noteAftertouch';\n\t\t\t\t\tevent.noteNumber = param1;\n\t\t\t\t\tevent.amount = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0b:\n\t\t\t\t\tevent.subtype = 'controller';\n\t\t\t\t\tevent.controllerType = param1;\n\t\t\t\t\tevent.value = stream.readInt8();\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0c:\n\t\t\t\t\tevent.subtype = 'programChange';\n\t\t\t\t\tevent.programNumber = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0d:\n\t\t\t\t\tevent.subtype = 'channelAftertouch';\n\t\t\t\t\tevent.amount = param1;\n\t\t\t\t\treturn event;\n\t\t\t\tcase 0x0e:\n\t\t\t\t\tevent.subtype = 'pitchBend';\n\t\t\t\t\tevent.value = param1 + (stream.readInt8() << 7);\n\t\t\t\t\treturn event;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow \"Unrecognised MIDI event type: \" + eventType\n\t\t\t\t\t/* \n\t\t\t\t\tconsole.log(\"Unrecognised MIDI event type: \" + eventType);\n\t\t\t\t\tstream.readInt8();\n\t\t\t\t\tevent.subtype = 'unknown';\n\t\t\t\t\treturn event;\n\t\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t}\n\t\n\tstream = Stream(data);\n\tvar headerChunk = readChunk(stream);\n\tif (headerChunk.id != 'MThd' || headerChunk.length != 6) {\n\t\tthrow \"Bad .mid file - header not found\";\n\t}\n\tvar headerStream = Stream(headerChunk.data);\n\tvar formatType = headerStream.readInt16();\n\tvar trackCount = headerStream.readInt16();\n\tvar timeDivision = headerStream.readInt16();\n\t\n\tif (timeDivision & 0x8000) {\n\t\tthrow \"Expressing time division in SMTPE frames is not supported yet\"\n\t} else {\n\t\tticksPerBeat = timeDivision;\n\t}\n\t\n\tvar header = {\n\t\t'formatType': formatType,\n\t\t'trackCount': trackCount,\n\t\t'ticksPerBeat': ticksPerBeat\n\t}\n\tvar tracks = [];\n\tfor (var i = 0; i < header.trackCount; i++) {\n\t\ttracks[i] = [];\n\t\tvar trackChunk = readChunk(stream);\n\t\tif (trackChunk.id != 'MTrk') {\n\t\t\tthrow \"Unexpected chunk - expected MTrk, got \"+ trackChunk.id;\n\t\t}\n\t\tvar trackStream = Stream(trackChunk.data);\n\t\twhile (!trackStream.eof()) {\n\t\t\tvar event = readEvent(trackStream);\n\t\t\ttracks[i].push(event);\n\t\t\t//console.log(event);\n\t\t}\n\t}\n\t\n\treturn {\n\t\t'header': header,\n\t\t'tracks': tracks\n\t}\n}", "function getImageAudio_DataIndex() {\n\treturn 4; \n}", "_read(sz){\n // console.log('sz ' + sz);\n // console.log('pushing');\n \n let ret = true;\n while(ret && this.count > 0) {\n\n\n let j = mt.complex(0,1);\n for(let i = 0; i < this.chunk; i++) {\n // console.log('' + this.factor + ' - ' + this.phase);\n let res = mt.exp(mt.multiply(j,this.phase));\n this.phase += this.factor;\n // cdata.push(res);\n\n\n this.float64_view[2*i] = res.re;\n this.float64_view[(2*i)+1] = res.im;\n\n // this.float64_view[2*i] = this.debug_count++;\n // this.float64_view[(2*i)+1] = 0;\n\n // combdata.push(res.re);\n // combdata.push(res.im);\n // data.push(Math.random()*100);\n }\n\n\n // seems like we need to copy the buffer here\n // because the code above uses the same buffer over and over for this class\n // if we allocated a new buffer above we could remove the slice here\n ret = this.push(this.uint8_view.slice(0));\n this.count--;\n\n\n }\n }", "function AudioOutputStream() {\n }", "function onMidi0(status, data1, data2) {\n if (isChannelController(status))\n {\n if (isInDeviceParametersRange(data1))\n {\n var index = data1 - DEVICE_START_CC;\n remoteControls.getParameter(index).getAmount().value().set(data2, 128);\n }\n //reserved for assigning top buttons CCs, and using for different functions\n else if (isInFcnRange(data1))\n {\n if(data1==FCN_START_CC){\n //implement a function\n }\n if(data1==(FCN_START_CC+1)){\n //implement a function\n }\n if(data1==(FCN_START_CC+2)){\n //implement a function\n }\n if(data1==(FCN_START_CC+3)){\n //implement a function\n }\n if(data1==(FCN_START_CC+4)){\n //implement a function\n }\n if(data1==(FCN_START_CC+5)){\n //implement a function\n }\n if(data1==(FCN_START_CC+6)){\n //implement a function\n }\n if(data1==(FCN_START_CC+7)){\n //implement a function\n }\n }\n }\n}", "function cust_audioStarted(ref,src){\n \n}", "function onMidi(status, data1, data2)\r\n{\r\n\t//printMidi(status, data1, data2)\r\n\tif (isChannelController(status)) //&& MIDIChannel(status) == alias_channel) //removing status check to include MasterFader\r\n\t{\r\n\t\tvar chMult = (status-177)*8;\r\n\t\t//post('CC: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tif(data1==10){\r\n\t\t\tCC_OBJECTS[chMult].receive(data2);\r\n\t\t\t//post(CC_OBJECTS[chMult]._name + ' ' + data2);\r\n\t\t}\r\n\t\telse if(data1==11){\r\n\t\t\tCC_OBJECTS[chMult+1].receive(data2);\r\n\t\t}\r\n\t\telse if(data1==12){\r\n\t\t\tCC_OBJECTS[chMult+2].receive(data2);\r\n\t\t}\r\n\t}\r\n\telse if (isNoteOn(status)) //&& MIDIChannel(status) == alias_channel)\r\n\t{\r\n\t\t//post('NOTE: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tNOTE_OBJECTS[data1].receive(data2);\r\n\t}\r\n\telse if (isNoteOff(status)) //&& MIDIChannel(status) == alias_channel)\r\n\t{\r\n\t\t//post('NOTE: ' + status + ' ' + data1 + ' ' + data2);\r\n\t\tNOTE_OBJECTS[data1].receive(data2);\r\n\t}\r\n}", "function synthesize(params) {\n // The first few passes operate on \"period samples\"---that is, each\n // sample is the inverse of the sound's frequency at that point.\n var samples_f64 = computePeriodSamples(params);\n samples_f64 = applyArpeggio(params, samples_f64);\n samples_f64 = applyVibrato(params, samples_f64);\n samples_f64 = quantizePeriodSamples(samples_f64);\n samples_f64 = stretch(SUPERSAMPLES, samples_f64);\n\n // This step applies an actual waveform so that we have playable sound.\n samples_f64 = applyBaseWaveform(params, samples_f64);\n\n // The remaining passes apply to actual time-domain samples.\n samples_f64 = applyFilters(params, samples_f64);\n samples_f64 = applyPhaser(params, samples_f64);\n samples_f64 = compress(SUPERSAMPLES * Math.floor(44100 / params.sample_rate), samples_f64);\n samples_f64 = applyEnvelope(params, samples_f64);\n return digitize(params.sample_size, samples_f64);\n}", "function handleArrayBuffer(musicArrayBuffer, currentSong) {\n omniButtonIcon.classList = \"fa fa-cog fa-spin omniButtonIconNoVisualization\"\n\n\n var musicDataView = new DataView(musicArrayBuffer);\n\n var frameCount = 0;\n var tagIndex = 0;\n var sampleCount = 0;\n\n var frameType = mp3Parser.readTags(musicDataView)[0]._section.type;\n\n //Skips any frames at the start that dont contain music data\n var frameType = mp3Parser.readTags(musicDataView)[0]._section.type;\n while (frameType != \"frame\") {\n tagIndex++;\n frameType = mp3Parser.readTags(musicDataView)[tagIndex]._section.type\n }\n var samplingRate = mp3Parser.readTags(musicDataView)[tagIndex].header.samplingRate\n currentSong.samplingRate = samplingRate;\n\n var mp3tags = mp3Parser.readTags(musicDataView)[tagIndex];\n while (true) {\n if (mp3tags._section.type === 'frame') {\n frameCount++;\n sampleCount = sampleCount + mp3tags._section.sampleLength;\n } else {\n //If it doesnt contain music data? TRASH IT!\n musicArrayBuffer.splice(mp3tags._section.nextFrameIndex - mp3tags._section.sampleLength, mp3tags_section.nextFrameIndex);\n }\n mp3tags = mp3Parser.readFrame(musicDataView, mp3tags._section.nextFrameIndex);\n if (mp3tags == null) {\n break;\n }\n }\n //Clear up memory\n musicDataView = null;\n //Put the data into the audiotag\n\n currentSong.musicArrayBuffer = musicArrayBuffer;\n var songBlob = new Blob([musicArrayBuffer], { type: \"audio/mpeg3\" });\n currentSong.songObjectURL = window.URL.createObjectURL(songBlob);\n\n getMusicData(musicArrayBuffer, sampleCount, samplingRate, currentSong);\n songs.push(currentSong);\n\n //Clear up memory\n musicArrayBuffer = null;\n\n}", "function MidiSynthCustomOscillator(sampleFreq, bufferLen, func) {\r\n MidiSynthOscillator.call(this, sampleFreq, bufferLen);\r\n this.normalizedPhase = 0;\r\n this.phaseStep = 0;\r\n this.func = func;\r\n this.setFrequency(this.freq);\r\n}", "function Replayer(midiFile, synth) {\r\n var trackStates = [];\r\n var trackAccumulatedDelta = [{noteNumber:0,total:0,track:0}];\r\n var beatsPerMinute = 120;\r\n var millisecondsPerBeat= beatsPerMinute * 60000000;\r\n var ticksPerBeat = midiFile.header.ticksPerBeat;\r\n var channelCount = 16;\r\n\r\n\r\n var i;\r\n for (i = 0; i < midiFile.tracks.length; i++) {\r\n trackStates[i] = {\r\n 'nextEventIndex': 0,\r\n 'ticksToNextEvent': (\r\n midiFile.tracks[i].length ?\r\n midiFile.tracks[i][0].deltaTime :\r\n null\r\n )\r\n };\r\n }\r\n \r\n function Channel() {\r\n \r\n var generatorsByNote = {};\r\n var currentProgram = $synthService.PianoProgram; // NOT USED\r\n \r\n function noteOn(noteEvent) {\r\n if (generatorsByNote[noteEvent.event.noteNumber] && !generatorsByNote[noteEvent.event.noteNumber].released) {\r\n /* playing same note before releasing the last one. BOO */\r\n generatorsByNote[noteEvent.event.noteNumber].noteOff(); /* TODO: check whether we ought to be passing a velocity in */\r\n $rootScope.$broadcast('playmyband.midi.noteOffEvent',noteEvent);\r\n }\r\n //console.log('playing note' + note);\r\n $rootScope.$broadcast('playmyband.midi.noteEvent',noteEvent);\r\n var generator = currentProgram.createNote(noteEvent.event.noteNumber, noteEvent.event.velocity);\r\n synth.addGenerator(generator);\r\n generatorsByNote[noteEvent.noteNumber] = generator;\r\n }\r\n function noteOff(noteEvent) {\r\n if (generatorsByNote[noteEvent.event.noteNumber] && !generatorsByNote[noteEvent.event.noteNumber].released) {\r\n generatorsByNote[noteEvent.noteNumber].noteOff(noteEvent.event.velocity);\r\n }\r\n $rootScope.$broadcast('playmyband.midi.noteOffEvent',noteEvent);\r\n\r\n }\r\n function setProgram(programNumber) {\r\n console.debug(programNumber);\r\n currentProgram = $synthService.PianoProgram; // TODO --> custom programs PROGRAMS[programNumber] || $synthService.PianoProgram;\r\n }\r\n \r\n return {\r\n 'setProgram': setProgram,\r\n 'noteOn': noteOn,\r\n 'noteOff': noteOff\r\n };\r\n }\r\n \r\n var channels = [];\r\n for (i = 0; i < channelCount; i++) {\r\n channels[i] = new Channel();\r\n }\r\n \r\n var nextEventInfo;\r\n var samplesToNextEvent = 0;\r\n \r\n function getNextEvent() {\r\n var ticksToNextEvent = null;\r\n var nextEventTrack = null;\r\n var nextEventIndex = null;\r\n \r\n var i;\r\n for (i = 0; i < trackStates.length; i++) {\r\n if (trackStates[i].ticksToNextEvent !== null && (ticksToNextEvent === null || trackStates[i].ticksToNextEvent < ticksToNextEvent) ) {\r\n ticksToNextEvent = trackStates[i].ticksToNextEvent;\r\n nextEventTrack = i;\r\n nextEventIndex = trackStates[i].nextEventIndex;\r\n }\r\n }\r\n if (nextEventTrack !== null) {\r\n /* consume event from that track */\r\n var nextEvent = midiFile.tracks[nextEventTrack][nextEventIndex];\r\n if (midiFile.tracks[nextEventTrack][nextEventIndex + 1]) {\r\n trackStates[nextEventTrack].ticksToNextEvent += midiFile.tracks[nextEventTrack][nextEventIndex + 1].deltaTime;\r\n } else {\r\n trackStates[nextEventTrack].ticksToNextEvent = null;\r\n }\r\n trackStates[nextEventTrack].nextEventIndex += 1;\r\n /* advance timings on all tracks by ticksToNextEvent */\r\n for (i = 0; i < trackStates.length; i++) {\r\n if (trackStates[i].ticksToNextEvent !== null) {\r\n trackStates[i].ticksToNextEvent -= ticksToNextEvent;\r\n }\r\n }\r\n nextEventInfo = {\r\n 'ticksToEvent': ticksToNextEvent,\r\n 'event': nextEvent,\r\n 'track': nextEventTrack\r\n };\r\n var beatsToNextEvent = ticksToNextEvent / ticksPerBeat;\r\n var secondsToNextEvent = beatsToNextEvent / (beatsPerMinute / 60);\r\n //if (typeof(nextEvent.noteNumber) !== 'undefined') {\r\n //console.debug('track:' + nextEventTrack + 'last accumulated:' + trackAccumulatedDelta[trackAccumulatedDelta.length - 1].total + 'secondToNextEvet:' + (secondsToNextEvent * 1000));\r\n var millisecondsToNextEvent= beatsToNextEvent * millisecondsPerBeat;\r\n\r\n var nextAccumulatedDelta = trackAccumulatedDelta[trackAccumulatedDelta.length - 1].total + millisecondsToNextEvent;\r\n //console.log(nextEventTrack+') nextAccumulatedDelta: '+nextAccumulatedDelta);\r\n\r\n\r\n trackAccumulatedDelta[trackAccumulatedDelta.length] = { noteNumber : nextEvent.noteNumber, total : nextAccumulatedDelta, track : nextEventTrack}; \r\n nextEvent.accumulatedDelta=nextAccumulatedDelta;\r\n //}\r\n samplesToNextEvent += secondsToNextEvent * synth.sampleRate;\r\n } else {\r\n nextEventInfo = null;\r\n samplesToNextEvent = null;\r\n self.finished = true;\r\n }\r\n }\r\n \r\n getNextEvent();\r\n \r\n function generate(samples) {\r\n var data = new Array(samples*2);\r\n var samplesRemaining = samples;\r\n var dataOffset = 0;\r\n \r\n while (true) {\r\n if (samplesToNextEvent !== null && samplesToNextEvent <= samplesRemaining) {\r\n /* generate samplesToNextEvent samples, process event and repeat */\r\n var samplesToGenerate = Math.ceil(samplesToNextEvent);\r\n if (samplesToGenerate > 0) {\r\n synth.generateIntoBuffer(samplesToGenerate, data, dataOffset);\r\n dataOffset += samplesToGenerate * 2;\r\n samplesRemaining -= samplesToGenerate;\r\n samplesToNextEvent -= samplesToGenerate;\r\n }\r\n \r\n handleEvent();\r\n getNextEvent();\r\n } else {\r\n /* generate samples to end of buffer */\r\n if (samplesRemaining > 0) {\r\n synth.generateIntoBuffer(samplesRemaining, data, dataOffset);\r\n samplesToNextEvent -= samplesRemaining;\r\n }\r\n break;\r\n }\r\n }\r\n return data;\r\n }\r\n \r\n function handleEvent() {\r\n var event = nextEventInfo.event;\r\n switch (event.type) {\r\n case 'meta':\r\n switch (event.subtype) {\r\n case 'setTempo':\r\n beatsPerMinute = 60000000 / event.microsecondsPerBeat;\r\n millisecondsPerBeat= event.microsecondsPerBeat/1000;\r\n //console.log('\\n\\n\\nBeats per minute '+beatsPerMinute);\r\n }\r\n break;\r\n case 'channel':\r\n switch (event.subtype) {\r\n case 'noteOn':\r\n channels[event.channel].noteOn(nextEventInfo); \r\n break;\r\n case 'noteOff':\r\n channels[event.channel].noteOff(nextEventInfo);\r\n break;\r\n case 'programChange':\r\n //console.log('program change to ' + event.programNumber);\r\n channels[event.channel].setProgram(event.programNumber);\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n function replay(audio) {\r\n console.log('replay');\r\n audio.write(generate(44100));\r\n setTimeout(function() {replay(audio);}, 10);\r\n }\r\n\r\n function isANoteThere(noteNumber, accumulatedDelta, marginOfError, track)\r\n {\r\n var isThere = false;\r\n var i = trackAccumulatedDelta.length;\r\n //start from the back, where more recent notes should match\r\n while (i--) {\r\n //for (var i = 0; i < trackAccumulatedDelta.length; i++) {\r\n var userNoteDif = Math.abs(trackAccumulatedDelta[i].total - accumulatedDelta);\r\n //console.debug('UserNoteDif:' + userNoteDif);\r\n if ( trackAccumulatedDelta[i].track === track &&\r\n trackAccumulatedDelta[i].noteNumber &&\r\n trackAccumulatedDelta[i].noteNumber>0 &&\r\n trackAccumulatedDelta[i].noteNumber === noteNumber && \r\n userNoteDif <= marginOfError) {\r\n isThere = true;\r\n break;\r\n } else if (userNoteDif > 10000) {\r\n //remove accumulated, no longer required. reduces comparisons on next note\r\n trackAccumulatedDelta.splice(i,1);\r\n //by now just stop\r\n break;\r\n }\r\n }\r\n return isThere;\r\n }\r\n \r\n var self = {\r\n 'replay': replay,\r\n 'generate': generate,\r\n 'finished': false,\r\n 'isANoteThere': isANoteThere\r\n };\r\n return self;\r\n }", "function music_start() {\n\t// get samples \n\tdata_array = new Float32Array(analyser.frequencyBinCount);\n\tanalyser.getFloatFrequencyData(data_array);\n\n\t// camera gray scale\n\tvar gScale = data_array[4] + 26.5\n\n\t// color and filter with Kick\n\tif ( (data_array[4] > slider_value) && (pre + 5<data_array[4]) ){\n\t\ta = a + 100;\n\t\ta = a % 360;\n\t\tgScale_env = gScale;\n\t\t//first beat pass\n\t\tif (f==1){\n\t\t\trandom_select();\n\t\t\trandom_interval = setInterval(random_select,count_value*1000*beat_interval)\n\t\t}\n\t\tf=0;\n\t}\n\telse{\n\t\tgScale_env = gScale_env - 0.5;\n\t\t//saturate = saturate-0.3;\n\t\tif (gScale_env<0){\n\t\t\tgScale_env = 0;\n\t\t}\n\t\telse if (gScale_env>10){\n\t\t\tconsole.log(gScale_env)\n\t\t\tgScale_env=10;\n\t\t}\n\t}\n\tpre = data_array[4];\n\tdocument.getElementById(\"videoCanvas\").style.filter=\"blur(\" + gScale_env +\"px) saturate(\" + saturate +\") invert(\" + invert +\"%) sepia(\" + sepia + \"%) contrast(\" + contrast +\"%)\";\n\tdraw_visualizer()\n}", "function PlayMonotone(data)\r\n{\r\n try\r\n {\r\n gb_buf_send_monotone = data;\r\n gb_total_array_monotone= 0;\r\n gb_current_array_monotone = 0;\r\n gb_play_array_monotone= true;\r\n gb_begin_monotone = false;\r\n gb_end_monotone = false;\r\n gb_begin_silence = false;\r\n gb_end_silence = false;\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n } \r\n}", "function ArithmeticDecoder(data,start,end){this.data=data;this.bp=start;this.dataEnd=end;this.chigh=data[start];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&0xFFFF|this.clow>>9&0x7F;this.clow=this.clow<<7&0xFFFF;this.ct-=7;this.a=0x8000;}", "function Microphone(_options) {\n var options = _options || {};\n\n // we record in mono because the speech recognition service\n // does not support stereo.\n this.bufferSize = options.bufferSize || 8192;\n this.inputChannels = options.inputChannels || 1;\n this.outputChannels = options.outputChannels || 1;\n this.recording = false;\n this.requestedAccess = false;\n this.sampleRate = 16000;\n // auxiliar buffer to keep unused samples (used when doing downsampling)\n this.bufferUnusedSamples = new Float32Array(0);\n this.samplesAll = new Float32Array(20000000);\n this.samplesAllOffset = 0;\n\n // Chrome or Firefox or IE User media\n if (!navigator.getUserMedia) {\n navigator.getUserMedia = navigator.webkitGetUserMedia ||\n navigator.mozGetUserMedia || navigator.msGetUserMedia;\n }\n\n}", "function MidiFile(data) {\n var lastEventTypeByte;\n\n function readChunk(stream) {\n var id = stream.read(4);\n var length = stream.readInt32();\n return {\n id: id,\n length: length,\n data: stream.read(length)\n };\n }\n\n function readEvent(stream) {\n var event = {};\n event.deltaTime = stream.readVarInt();\n var eventTypeByte = stream.readInt8();\n\n if ((eventTypeByte & 0xf0) === 0xf0) {\n /* system / meta event */\n if (eventTypeByte === 0xff) {\n /* meta event */\n event.type = 'meta';\n var subtypeByte = stream.readInt8();\n var length = stream.readVarInt();\n\n switch (subtypeByte) {\n case 0x00:\n event.subtype = 'sequenceNumber';\n if (length !== 2) throw new Error(\"Expected length for sequenceNumber event is 2, got \".concat(length));\n event.number = stream.readInt16();\n return event;\n\n case 0x01:\n event.subtype = 'text';\n event.text = stream.read(length);\n return event;\n\n case 0x02:\n event.subtype = 'copyrightNotice';\n event.text = stream.read(length);\n return event;\n\n case 0x03:\n event.subtype = 'trackName';\n event.text = stream.read(length);\n return event;\n\n case 0x04:\n event.subtype = 'instrumentName';\n event.text = stream.read(length);\n return event;\n\n case 0x05:\n event.subtype = 'lyrics';\n event.text = stream.read(length);\n return event;\n\n case 0x06:\n event.subtype = 'marker';\n event.text = stream.read(length);\n return event;\n\n case 0x07:\n event.subtype = 'cuePoint';\n event.text = stream.read(length);\n return event;\n\n case 0x20:\n event.subtype = 'midiChannelPrefix';\n if (length !== 1) throw new Error(\"Expected length for midiChannelPrefix event is 1, got \".concat(length));\n event.channel = stream.readInt8();\n return event;\n\n case 0x2f:\n event.subtype = 'endOfTrack';\n if (length !== 0) throw new Error(\"Expected length for endOfTrack event is 0, got \".concat(length));\n return event;\n\n case 0x51:\n event.subtype = 'setTempo';\n if (length !== 3) throw new Error(\"Expected length for setTempo event is 3, got \".concat(length));\n event.microsecondsPerBeat = (stream.readInt8() << 16) + (stream.readInt8() << 8) + stream.readInt8();\n return event;\n\n case 0x54:\n event.subtype = 'smpteOffset';\n if (length !== 5) throw new Error(\"Expected length for smpteOffset event is 5, got \".concat(length));\n var hourByte = stream.readInt8();\n event.frameRate = {\n 0x00: 24,\n 0x20: 25,\n 0x40: 29,\n 0x60: 30\n }[hourByte & 0x60];\n event.hour = hourByte & 0x1f;\n event.min = stream.readInt8();\n event.sec = stream.readInt8();\n event.frame = stream.readInt8();\n event.subframe = stream.readInt8();\n return event;\n\n case 0x58:\n event.subtype = 'timeSignature';\n if (length !== 4) throw new Error(\"Expected length for timeSignature event is 4, got \".concat(length));\n event.numerator = stream.readInt8();\n event.denominator = Math.pow(2, stream.readInt8());\n event.metronome = stream.readInt8();\n event.thirtyseconds = stream.readInt8();\n return event;\n\n case 0x59:\n event.subtype = 'keySignature';\n if (length !== 2) throw new Error(\"Expected length for keySignature event is 2, got \".concat(length));\n event.key = stream.readInt8(true);\n event.scale = stream.readInt8();\n return event;\n\n case 0x7f:\n event.subtype = 'sequencerSpecific';\n event.data = stream.read(length);\n return event;\n\n default:\n // console.log(\"Unrecognised meta event subtype: \" + subtypeByte)\n event.subtype = 'unknown';\n event.data = stream.read(length);\n return event;\n }\n /*\n * event.data = stream.read(length)\n * return event\n */\n\n } else if (eventTypeByte === 0xf0) {\n event.type = 'sysEx';\n\n var _length = stream.readVarInt();\n\n event.data = stream.read(_length);\n return event;\n } else if (eventTypeByte === 0xf7) {\n event.type = 'dividedSysEx';\n\n var _length2 = stream.readVarInt();\n\n event.data = stream.read(_length2);\n return event;\n } else {\n throw new Error(\"Unrecognised MIDI event type byte: \".concat(eventTypeByte));\n }\n } else {\n /* channel event */\n var param1;\n\n if ((eventTypeByte & 0x80) === 0) {\n /*\n * running status - reuse lastEventTypeByte as the event type.\n * eventTypeByte is actually the first parameter\n */\n param1 = eventTypeByte;\n eventTypeByte = lastEventTypeByte;\n } else {\n param1 = stream.readInt8();\n lastEventTypeByte = eventTypeByte;\n }\n\n var eventType = eventTypeByte >> 4;\n event.channel = eventTypeByte & 0x0f;\n event.type = 'channel';\n\n switch (eventType) {\n case 0x08:\n event.subtype = 'noteOff';\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n return event;\n\n case 0x09:\n event.noteNumber = param1;\n event.velocity = stream.readInt8();\n\n if (event.velocity === 0) {\n event.subtype = 'noteOff';\n } else {\n event.subtype = 'noteOn';\n }\n\n return event;\n\n case 0x0a:\n event.subtype = 'noteAftertouch';\n event.noteNumber = param1;\n event.amount = stream.readInt8();\n return event;\n\n case 0x0b:\n event.subtype = 'controller';\n event.controllerType = param1;\n event.value = stream.readInt8();\n return event;\n\n case 0x0c:\n event.subtype = 'programChange';\n event.programNumber = param1;\n return event;\n\n case 0x0d:\n event.subtype = 'channelAftertouch';\n event.amount = param1;\n return event;\n\n case 0x0e:\n event.subtype = 'pitchBend';\n event.value = param1 + (stream.readInt8() << 7);\n return event;\n\n default:\n throw new Error(\"Unrecognised MIDI event type: \".concat(eventType));\n\n /*\n *console.log(\"Unrecognised MIDI event type: \" + eventType)\n *stream.readInt8()\n *event.subtype = 'unknown'\n *return event\n */\n }\n }\n }\n\n var stream = Object(_stream__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data);\n var headerChunk = readChunk(stream);\n\n if (headerChunk.id !== 'MThd' || headerChunk.length !== 6) {\n throw new Error('Bad .mid file - header not found');\n }\n\n var headerStream = Object(_stream__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(headerChunk.data);\n var formatType = headerStream.readInt16();\n var trackCount = headerStream.readInt16();\n var timeDivision = headerStream.readInt16();\n var ticksPerBeat;\n\n if (timeDivision & 0x8000) {\n throw new Error('Expressing time division in SMTPE frames is not supported yet');\n } else {\n ticksPerBeat = timeDivision;\n }\n\n var header = {\n formatType: formatType,\n trackCount: trackCount,\n ticksPerBeat: ticksPerBeat\n };\n var tracks = [];\n\n for (var i = 0; i < header.trackCount; i++) {\n tracks[i] = [];\n var trackChunk = readChunk(stream);\n\n if (trackChunk.id !== 'MTrk') {\n throw new Error(\"Unexpected chunk - expected MTrk, got \".concat(trackChunk.id));\n }\n\n var trackStream = Object(_stream__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(trackChunk.data);\n\n while (!trackStream.eof()) {\n var event = readEvent(trackStream);\n tracks[i].push(event); // console.log(event)\n }\n }\n\n return {\n header: header,\n tracks: tracks\n };\n}", "function audio_start()\n{\n //console.log('AUDIO audio_start');\n\tif (audio_context == null) return;\n\n\taudio_started = true;\n\taudio_connect(0);\n\twindow.setInterval(audio_periodic, audio_periodic_interval_ms);\n\n\ttry {\n\t\tdemodulator_analog_replace(init_mode);\t\t//needs audio_output_rate to exist\n\t} catch(ex) {\n\t\tsnd_send(\"SET x-DEBUG audio_start.demodulator_analog_replace: catch: \"+ ex.toString());\n\n\t\t// message too big -- causes server crash\n\t\t//snd_send(\"SET x-DEBUG audio_start.demodulator_analog_replace: catch: \"+ ex.stack);\n\t}\n}", "readBufferProcessEvent(e) {\n\t\tlet l = e.outputBuffer.getChannelData(0)\n\t\tlet r = e.outputBuffer.getChannelData(1)\n\t\tconst len = e.inputBuffer.length\n\t\tconst half = this._bufferSize >> 1\n\t\tconst sources = this.targets.lightness\n\t\tconst averages = this.buffers.lightness\n\n\t\tfor (let idx = 0; idx < len; idx++) {\n\t\t\tconst t = this._sample / 44100\n\t\t\t\n\t\t\t// Zero before summing\n\t\t\tl[idx] = 0\n\t\t\tr[idx] = 0\n\n\t\t\t// Iterate through all possible tones, summing\n\t\t\tfor (let tone_idx = 0; tone_idx < half; tone_idx++) {\n\t\t\t\tconst tone = Math.sin(t * this._frequencies[tone_idx])\n\t\t\t\t// Smooth (moving average)\n\t\t\t\taverages[tone_idx] = (sources[this._hilbert[tone_idx]] + averages[tone_idx]) / 2\n\t\t\t\taverages[half+tone_idx] = (sources[this._hilbert[half+tone_idx]] + averages[tone_idx]) / 2\n\n\t\t\t\t// TODO: compression\n\t\t\t\tl[idx] += (tone * averages[tone_idx] )/half\n\t\t\t\tr[idx] += (tone * averages[half + tone_idx] )/half\n\t\t\t}\n\n\t\t\t// Decrease dynamic range\n\t\t\t// Technically we should use abs values here because the output range is [-1 1] but\n\t\t\t// this loop is probably expensive enough already and it will function approximately\n\t\t\t// the same\n\t\t\tif (l[idx] > this.maxLoudness || r[idx] > this.maxLoudness)\n\t\t\t\tthis.maxLoudness += 1e-5\n\n\t\t\tif (this.maxLoudness > 0 && this.compression > 0) {\n\t\t\t\tl[idx] = l[idx] / (this.maxLoudness + (1-this.maxLoudness)*(1-this.compression))\n\t\t\t\tr[idx] = r[idx] / (this.maxLoudness + (1-this.maxLoudness)*(1-this.compression))\n\t\t\t}\n\n\t\t\t// Reduce to effect maximum compression\n\t\t\tthis.maxLoudness -= 1e-6 // will reset back to zero after 10 seconds\n\n\t\t\tthis._sample++\n\t\t}\n\n\t\tconst hues = this.targets.hue\n\t\tconst saturations = this.targets.saturation\n\n\t\tlet average_hueL = 0,\n\t\t average_hueR = 0,\n\t\t count_hueL = 0,\n\t\t\tcount_hueR = 0,\n\t\t\taverage_satL = 0,\n\t\t\taverage_satR = 0\n\t\t// Only look at the central quarter of the image for colour detection\n\t\tfor (let idx = 0; idx < half/4; idx++) {\n\t\t\taverage_satL += saturations[ idx+half/4+half/8]\n\t\t\taverage_satR += saturations[half + idx+half/4+half/8]\n\t\t\tif (!Number.isNaN(hues[idx+half/4+half/8])) {\n\t\t\t\taverage_hueL += hues[idx+half/4+half/8]\n\t\t\t\tcount_hueL++\n\t\t\t}\n\t\t\tif (!Number.isNaN(hues[half+idx+half/4+half/8])) {\n\t\t\t\taverage_hueR += hues[half+idx+half/4+half/8]\n\t\t\t\tcount_hueR++\n\t\t\t}\n\t\t}\n\n\t\t// Modulate frequency for hue\n\t\tif (count_hueL > 0) { \n\t\t\taverage_hueL = average_hueL/count_hueL\n\t\t\tthis.sawtoothNodeL.frequency.value = average_hueL * 1320 + 440\n\t\t}\n\n\t\tif (count_hueR > 0) { \n\t\t\taverage_hueR = average_hueR/count_hueR\n\t\t\tthis.sawtoothNodeR.frequency.value = average_hueR * 1320 + 440\n\t\t}\n\n\t\t// And distortion and amplitude for saturation\n\t\tthis.distortionL.distortion = this.scaleL.max = (average_satL/(half/4)) * this.fmVolume\n\t\tthis.distortionR.distortion = this.scaleR.max = (average_satR/(half/4)) * this.fmVolume\n\t}", "function Sound(name,urlOrArrayBuffer,scene,readyToPlayCallback,options){var _this=this;this.autoplay=false;this.loop=false;this.useCustomAttenuation=false;this.spatialSound=false;this.refDistance=1;this.rolloffFactor=1;this.maxDistance=100;this.distanceModel=\"linear\";this._panningModel=\"equalpower\";this._playbackRate=1;this._streaming=false;this._startTime=0;this._startOffset=0;this._position=BABYLON.Vector3.Zero();this._localDirection=new BABYLON.Vector3(1,0,0);this._volume=1;this._isLoaded=false;this._isReadyToPlay=false;this.isPlaying=false;this.isPaused=false;this._isDirectional=false;// Used if you'd like to create a directional sound.\n// If not set, the sound will be omnidirectional\nthis._coneInnerAngle=360;this._coneOuterAngle=360;this._coneOuterGain=0;this._isOutputConnected=false;this._urlType=\"Unknown\";this.name=name;this._scene=scene;this._readyToPlayCallback=readyToPlayCallback;// Default custom attenuation function is a linear attenuation\nthis._customAttenuationFunction=function(currentVolume,currentDistance,maxDistance,refDistance,rolloffFactor){if(currentDistance<maxDistance){return currentVolume*(1-currentDistance/maxDistance);}else{return 0;}};if(options){this.autoplay=options.autoplay||false;this.loop=options.loop||false;// if volume === 0, we need another way to check this option\nif(options.volume!==undefined){this._volume=options.volume;}this.spatialSound=options.spatialSound||false;this.maxDistance=options.maxDistance||100;this.useCustomAttenuation=options.useCustomAttenuation||false;this.rolloffFactor=options.rolloffFactor||1;this.refDistance=options.refDistance||1;this.distanceModel=options.distanceModel||\"linear\";this._playbackRate=options.playbackRate||1;this._streaming=options.streaming||false;}if(BABYLON.Engine.audioEngine.canUseWebAudio){this._soundGain=BABYLON.Engine.audioEngine.audioContext.createGain();this._soundGain.gain.value=this._volume;this._inputAudioNode=this._soundGain;this._ouputAudioNode=this._soundGain;if(this.spatialSound){this._createSpatialParameters();}this._scene.mainSoundTrack.AddSound(this);var validParameter=true;// if no parameter is passed, you need to call setAudioBuffer yourself to prepare the sound\nif(urlOrArrayBuffer){if(typeof urlOrArrayBuffer===\"string\")this._urlType=\"String\";if(Array.isArray(urlOrArrayBuffer))this._urlType=\"Array\";if(urlOrArrayBuffer instanceof ArrayBuffer)this._urlType=\"ArrayBuffer\";var urls=[];var codecSupportedFound=false;switch(this._urlType){case\"ArrayBuffer\":if(urlOrArrayBuffer.byteLength>0){codecSupportedFound=true;this._soundLoaded(urlOrArrayBuffer);}break;case\"String\":urls.push(urlOrArrayBuffer);case\"Array\":if(urls.length===0)urls=urlOrArrayBuffer;// If we found a supported format, we load it immediately and stop the loop\nfor(var i=0;i<urls.length;i++){var url=urls[i];if(url.indexOf(\".mp3\",url.length-4)!==-1&&BABYLON.Engine.audioEngine.isMP3supported){codecSupportedFound=true;}if(url.indexOf(\".ogg\",url.length-4)!==-1&&BABYLON.Engine.audioEngine.isOGGsupported){codecSupportedFound=true;}if(url.indexOf(\".wav\",url.length-4)!==-1){codecSupportedFound=true;}if(codecSupportedFound){// Loading sound using XHR2\nif(!this._streaming){BABYLON.Tools.LoadFile(url,function(data){_this._soundLoaded(data);},null,this._scene.database,true);}else{this._htmlAudioElement=new Audio(url);this._htmlAudioElement.controls=false;this._htmlAudioElement.loop=this.loop;this._htmlAudioElement.crossOrigin=\"anonymous\";this._htmlAudioElement.preload=\"auto\";this._htmlAudioElement.addEventListener(\"canplaythrough\",function(){_this._isReadyToPlay=true;if(_this.autoplay){_this.play();}if(_this._readyToPlayCallback){_this._readyToPlayCallback();}});document.body.appendChild(this._htmlAudioElement);}break;}}break;default:validParameter=false;break;}if(!validParameter){BABYLON.Tools.Error(\"Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.\");}else{if(!codecSupportedFound){this._isReadyToPlay=true;// Simulating a ready to play event to avoid breaking code path\nif(this._readyToPlayCallback){window.setTimeout(function(){_this._readyToPlayCallback();},1000);}}}}}else{// Adding an empty sound to avoid breaking audio calls for non Web Audio browsers\nthis._scene.mainSoundTrack.AddSound(this);if(!BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported){BABYLON.Tools.Error(\"Web Audio is not supported by your browser.\");BABYLON.Engine.audioEngine.WarnedWebAudioUnsupported=true;}// Simulating a ready to play event to avoid breaking code for non web audio browsers\nif(this._readyToPlayCallback){window.setTimeout(function(){_this._readyToPlayCallback();},1000);}}}", "function AudioClip(audio_system, audio_buffer, volume = 0.25, fft_size = 2048)\n{\n\tthis._audio_system = audio_system;\n\tthis._audio_buffer = audio_buffer;\n\tthis._volume = volume;\n\tthis._fft_size = fft_size;\n\n\tthis._source = null;\n\tthis._is_playing = false;\n\n\tthis._stop_event_listeners = [];\n}", "function makeSamples(groove, color, data){\n\n\tvar oneSecond = 44100;\n\tvar loop = false;\n\tvar repeats = 4;\n\tvar repeated = 0;\n\tvar PI = Math.PI;\n\n\tvar maxSamples = (groove.duration * oneSecond ) / 1000 ;\t\n var instrumentType = \"sin\";\n var delay = false;\n if (color == 0) {\n\tdelay = true;\n } \n else if (color == 1) {\n } \n else if (color == 2) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 3) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 4) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 5) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 6) {\n\tinstrumentType = \"sqr\";\n\tdelay = true;\n } \n else if (color == 7) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 8) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 9) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 10) {\n\tinstrumentType = \"saw\";\n } \n\n var freqs = data[0];\n var times = data[1];\n\tdebugfreqs = freqs;\n \tdebugtimes = times;\n\n var samples = [];\n ii = 0;\n var tcounter = 0;\n for (var j = 0; j < freqs.length - 1; j++) {\n\t\tif (j == 0 && times[0] > groove.startLine){\n\t\t\tvar freqDur = times[j] / groove.lineLength;\n\t \n\t\t\tfreqDur = freqDur * groove.duration;\n\t\t\tfreqDur = freqDur * 44100;\n\t\t\tfreqDur = Math.floor(freqDur / 1000);\n\t \n\t \tfor (var i = 0; i < freqDur; i++) {\n\t \t var t = i / oneSecond; \n\t \t samples[ii] = 0;\n\t \t ii++;\n\t\t }\n\t\t}\n var frequency = freqs[j];\n//\tif (freqs.length > j + 1 && freqs[j + 1] == 0){\n//\t\tfrequency = 0;\n//\t}\n\n var freqDur = times[j + 1] / groove.lineLength;\n \n freqDur = freqDur * groove.duration;\n freqDur = freqDur * 44100;\n freqDur = Math.floor(freqDur / 1000);\n\n// \tfor (var i = 0; i < freqDur; i++){\n\t\tvar i = 0;\n while (true){\n var t = i / oneSecond; // time from 0 to 1\n if (frequency == 0){\n samples[ii] = 0;\n }\n\t\t else if (instrumentType == \"sin\"){\n\t\t samples[ii] = Math.sin(frequency * 2 * PI * t); // wave equation (between -1,+1)\n\t\t }\n else if (instrumentType == \"sqr\") {\n\t\t\t if (Math.sin(frequency * 2 * PI * t) > 0){\n\t\t\t\t\tsamples[ii] = 1; } else { samples[ii] = -1;\n\t\t\t\t}\n\t\t }\n else if (instrumentType == \"saw\") {\n \tsamples[ii] = 1 - ((frequency*t)%1);\n\t\t }\n samples[ii] = samples[ii] * 0.25;\n\n\t\t\tif (i >= freqDur){\n\t\t\t\tif (instrumentType == \"sin\"){\n\t\t\t\t\tif (samples[ii] == 0 || (samples[ii -1] < samples[ii] && samples[ii] < 0.01 && samples[ii] > -0.01)){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\n\t\t\t}\n ii++;\n if (maxSamples > 0 && ii >= maxSamples){\n\t\t\t\tbreak;\n\t\t }\n\t\t i++;\n }\n if (maxSamples > 0 && ii >= maxSamples){\n\t\t\tbreak;\n\t }\n }\n if (maxSamples == 0){\n\t\tmaxSamples = ii;\n }\n else {\n\t\twhile (ii < maxSamples){\n\t \t\tsamples[ii] = 0;\n\t \tii++;\n\t\t}\n }\n//\tdocument.write(ii);\n//\tdocument.write(\"<br/>\");\n// var delayLine = new Array;\n// var pointer = 0;\n// var delayLength = oneSecond / 2;\n// for (var ijj = 0; ijj < groove.lineLength; ijj++){\n//\t\tdelayLine[ijj] = 0;\n// }\n for (var repeat = 1 ; repeat < repeats; repeat++){\n for (var jj = 0 ; jj < ii ; jj++){\n samples[jj + ii * repeat] = samples[jj];\n\t if (delay){\n//\t\tsamples[jj + ii * repeat] = samples[jj + ii * repeat] - 0.5*delayLine[pointer];\n//\t\tdelayLine[pointer] = samples[jj + ii * repeat];\n//\t\tpointer = (pointer+1)%lineLength;\n }\n\t }\n\t}\n return samples;\n}", "function WavAudio(sampleRate, channels, bitsPerSample) {\r\n if (channels === void 0) { channels = 1; }\r\n if (bitsPerSample === void 0) { bitsPerSample = 16; }\r\n var _this = _super.call(this) || this;\r\n _this.sampleRate = sampleRate;\r\n _this.channels = channels;\r\n _this.bitsPerSample = bitsPerSample;\r\n // Write WAV file header\r\n // Reference: http://www.topherlee.com/software/pcm-tut-wavformat.html\r\n var headerBuffer = new ArrayBuffer(44);\r\n var header = new DataStream(headerBuffer);\r\n // 'RIFF' indent\r\n header.writeChars('RIFF');\r\n // filesize (set later)\r\n header.writeUint32(0);\r\n // 'WAVE' indent\r\n header.writeChars('WAVE');\r\n // 'fmt ' section header\r\n header.writeChars('fmt ');\r\n // fmt section length\r\n header.writeUint32(16);\r\n // specify audio format is pcm (type 1)\r\n header.writeUint16(1);\r\n // number of audio channels\r\n header.writeUint16(_this.channels);\r\n // audio sample rate\r\n header.writeUint32(_this.sampleRate);\r\n // byterate = (sampleRate * bitsPerSample * channelCount) / 8\r\n header.writeUint32((_this.sampleRate * _this.bitsPerSample * _this.channels) / 8);\r\n // blockalign = (bitsPerSample * channels) / 8\r\n header.writeUint16((_this.bitsPerSample * _this.channels) / 8);\r\n // bits per sample\r\n header.writeUint16(_this.bitsPerSample);\r\n // 'data' section header\r\n header.writeChars('data');\r\n // data section length (set later)\r\n header.writeUint32(0);\r\n _this.header = header;\r\n _this.pcmData = null;\r\n return _this;\r\n }", "function process(d) {\n const waveD = getMinMaxAvg(d.wave, true);\n const freqD = getMinMaxAvg(d.freq);\n \n ampWindow.add(waveD.avg); // Keep track of average amplitude over time\n const ampAvg = ampWindow.avg();\n \n for (let p of particles) {\n // Modify particle based on the frequency band it is assigned to\n p.affect(d.freq[p.freq], freqD, ampAvg);\n }\n \n // Increase size with average amplitude\n size += (ampAvg*0.2);\n \n // Reduce size on its own accord\n size -= size*.001;\n \n //console.log(size +' - ' + ampAvg);\n // Slowly migrate to center\n pointerX *= 0.9999;\n pointerY *= 0.9999;\n qualityControl();\n}", "createSoundWave() {\n this.canvasCtx = this.canvas.getContext('2d');\n this.analyser = this.context.createAnalyser();\n const source = this.context.createMediaStreamSource(this.stream);\n source.connect(this.analyser);\n this.freqs = new Uint8Array(this.analyser.frequencyBinCount);\n this.stopId = requestAnimationFrame(() => this.draw());\n }", "function parsePlayTS(ts){\n //Empty out the charts..\n //$('#originalValues, #dspValues, #pitchValues').empty();\n var Synth = function() {\n this.audiolet = new Audiolet();\n\n this.min = null, this.max = null;\n this.pitchPoints = [], this.dspPoints = [], this.timePoints = [], this.originalPoints = [];\n\n // Define a Sine Wave\n this.sine = new Sine(this.audiolet, 400);\n\n // Let's figure out the Time Increments for the Envelope\n this.audiolet.envelopeTimeIncrement = (ts.length / this.audiolet.device.sampleRate) * props.seconds;\n\n //this.synth.pitchPoints = [], this.timePoints = [], this.dspPoints = [];\n this.min = props.lowPitch, this.max = 0.0;\n\n // Parse the TimeSeries numbers from the \"server\" or ajax response\n\n // Build two arrays, pitchPoints and timePoints, that will be used to build the Envelope\n // Track the low and hi points from the TimeSeries (TODO: use low-hi for something in the future..)\n for(var i = 0; i < ts.length; i++){\n var parsed = parseExp(ts[i]);\n\n if(parsed < this.min) this.min = parsed;\n if(parsed > this.max) this.max = parsed;\n this.originalPoints.push(parsed);\n this.timePoints.push(this.audiolet.envelopeTimeIncrement);\n }\n\n // Normalize vals to range between 0-1 for general DSP processing parameters (pan, gain, etc. all happens\n // with 0-1)\n for(var i = 0; i < this.originalPoints.length; i++){\n this.dspPoints[i] = norm(this.originalPoints[i], this.min, this.max);\n }\n\n // Map pitchPoints array to a different range\n for(var i = 0; i < this.originalPoints.length; i++){\n this.pitchPoints[i] = map(this.originalPoints[i], this.min, this.max, props.lowPitch, props.highPitch);\n }\n\n // Make an Envelope from the pitchPoints and timePoints arrays.. with an onComplete\n // function that removes itself from the env.\n this.envelope = new Envelope(this.audiolet, 1, this.pitchPoints, this.timePoints);\n\n // The Signal Path\n // 1. Attach the envelope to the Sine Wave\n this.envelope.connect(this.sine);\n\n // 2. Send the Sine wave to the output\n this.sine.connect(this.audiolet.output);\n\n // Draw Charts\n drawCharts(this.originalPoints, this.dspPoints, this.pitchPoints);\n };\n\n //Play\n this.synth = new Synth();\n}", "function Musician(instrument) {\n this.instrument = instrument;\n this.sound = instruments.get(requestedInstrument);\n this.activeSince = new Date().toISOString();\n this.uuid = uuid.v4();\n\n /*\n * We will simulate the sound emission on a regular basis. That is something that\n * we implement in a class method (via the prototype)\n */\n Musician.prototype.update = function() {\n\n /*\n * Let's create the sound emission as a dynamic javascript object,\n * add the properties (uuid, sound, timestamp)\n * and serialize the object to a JSON string\n */\n var musicianPlays = {\n uuid: this.uuid,\n sound: this.sound,\n activeSince: this.activeSince\n };\n var payload = JSON.stringify(musicianPlays);\n /*\n * Finally, let's encapsulate the payload in a UDP datagram, which we publish on\n * the multicast address. All subscribers to this address will receive the message.\n */\n var message = new Buffer(payload);\n socket.send(message, 0, message.length, protocol.PROTOCOL_PORT_MUSICIANS, protocol.PROTOCOL_MULTICAST_ADDRESS, function(err, bytes) {\n console.log(\"Sending payload: \" + payload + \" via port \" + socket.address().port);\n });\n }\n /*\n * Let's take and send a measure every 1000 ms\n */\n setInterval(this.update.bind(this), 1000);\n}", "function process(event)\n{\n\t// Get array associated with the output port.\n var outputArray = event.outputBuffer.getChannelData(0);\n var n = outputArray.length;\n\n\tfor (var i = 0; i < n; ++i)\n\t{\n\t\t// Generate a sine wave.\n\t\tvar sample = Math.sin(phase);\n\t\toutputArray[i] = sample * 0.6;\n\t \n\t\t// Increment and wrap phase.\n\t\tphase += phaseIncrement;\n\t\tif (phase > kTwoPi)\n\t\t{\n\t\t\tphase -= kTwoPi;\n\t\t}\n\t}\n}", "function PitchedPresets(){\n\n\tthis.input = audioCtx.createGain();\n\tthis.output = audioCtx.createGain();\n\tthis.startArray = [];\n\n}", "addSignal(signal) {\n for (var i = 0; i < signal.length; i++) {\n if (i >= this.bufferSize) {\n break;\n }\n this.signal[i] += signal[i];\n\n /*\n // Constrain amplitude\n if ( this.signal[i] > 1 ) {\n this.signal[i] = 1;\n } else if ( this.signal[i] < -1 ) {\n this.signal[i] = -1;\n }\n */\n }\n return this.signal;\n }", "function analyzeSong(songData, samplingRate, songOptions, currentSong, cb) {\n var pps;\n var sm;\n if (songOptions.peaksPerSecond) {\n pps = peaksPerSecond;\n } else {\n pps = 2;\n }\n if (songOptions.sectionMargin) {\n sm = songOptions.sectionMargin\n } else {\n sm = 1.5;\n }\n\n var worker = new Worker(URL.createObjectURL(new Blob([\"(\" + worker_function.toString() + \")()\"], { type: 'text/javascript' })));\n\n var workerPeaks;\n var workerSongData;\n\n worker.addEventListener('message', function (e) {\n var data = e.data;\n if (data.returnType == \"peaks\") {\n workerPeaks = data.peaks;\n workerSongData = data.songData\n getWorkerSections(workerSongData, workerPeaks, data.samplingRate, sm);\n } else if (data.returnType == \"sections\") {\n var sections = data.sections;\n currentSong.analyzedData.sections = data.sections;\n currentSong.analyzedData.peaks = workerPeaks;\n cb(currentSong);\n }\n }, false);\n\n function getWorkerPeaks(songData, samplingRate, peaksPerSecond) {\n worker.postMessage({ 'cmd': 'getPeaks', 'songData': songData, 'samplingRate': samplingRate, 'peaksPerSecond': peaksPerSecond });\n }\n\n function getWorkerIntervals(peaks, samplingRate, sm) {\n worker.postMesssage({ 'cmd': 'getIntervals', 'peaks': peaks, 'samplingRate': samplingRate, 'sectionMargin': sm });\n }\n\n function getWorkerSections(songData, peaks, samplingRate) {\n worker.postMessage({ 'cmd': 'getSections', 'peaks': peaks, 'samplingRate': samplingRate, 'songData': songData, 'sectionMargin': sm });\n }\n\n\n getWorkerPeaks(songData, samplingRate, pps);\n\n\n}", "function stageOneMusic () {\n Clock.rate = 0.6\n\n a = EDrums('x...ox.x....o...')\n a.snare.snappy = 1.5\n a.kick.decay = 0.3\n a.amp = 2\n\n b = Synth({ maxVoices:4, waveform:'Saw', attack:ms(200), decay:ms(3000) })\n c = FM('bass',{decay:ms(200)})\n\n score = Score([\n 0, c.note.score( [],2 ),\n measures(1), function() {\n b.amp = 0.2\n c.amp = 2\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(4), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n b.chord.seq(['e3min9'],1)\n c.note.seq(['e2'],[1.5/16,1.5/16,1.5/16,1.5/16,2/16])\n },\n measures(0.5), function() {\n c.note.seq(['c2','eb2','c2','eb2'], [11/16,5/16])\n b.chord.seq(['c3m11', 'c3maj9','c3min9',],[3/2,1/2,2])\n },\n measures(2), function() {\n c.note.seq(['c2','c3','a#3','c3','f3','g3','a#2','c2'], [2/16,2/16,1/16,3/16,1/16,1/16,1/16,5/16])\n },\n ]).start()\n}", "volume(length){ // 1 parameter but method name same in this class\r\nreturn length**3;\r\n}", "playMusic(routineMusic) {\n // Load the sound file from the app bundle\n let music = new Sound(routineMusic, Sound.MAIN_BUNDLE, (error) => {\n if (error) {\n console.log('failed to load the sound', error);\n return;\n }\n // loaded successfully\n console.log('duration in seconds: ' + music.getDuration() + 'number of channels: ' + music.getNumberOfChannels());\n music.setNumberOfLoops(-1); // loop indefinitely until stop() called\n music.play((success) => {\n if (success) {\n console.log('successfully finished playing');\n } else {\n console.log('playback failed due to audio decoding errors');\n music.reset();\n }\n });\n });\n\n return music;\n }", "function updateApplication() \n{\n var dsp = {};\n var stream = {};\n var update = {};\n var total = {};\n var result;\n \n result = gSystemLowLevel.getCPUUsage(dsp, stream, null, update, total);\n CHECK_RESULT(result);\n\n var channelsplaying = {};\n result = gSystemLowLevel.getChannelsPlaying(channelsplaying, null);\n CHECK_RESULT(result);\n\n document.querySelector(\"#display_out\").value = \"Channels Playing = \" + channelsplaying.val + \n \" : CPU = dsp \" + dsp.val.toFixed(2) + \n \"% stream \" + stream.val.toFixed(2) + \n \"% update \" + update.val.toFixed(2) + \n \"% total \" + total.val.toFixed(2) + \n \"%\";\n var numbuffers = {};\n var buffersize = {};\n result = gSystemLowLevel.getDSPBufferSize(buffersize, numbuffers);\n CHECK_RESULT(result) \n\n var rate = {};\n result = gSystemLowLevel.getSoftwareFormat(rate, null, null);\n CHECK_RESULT(result);\n\n var sysrate = {};\n result = gSystemLowLevel.getDriverInfo(0, null, null, sysrate, null, null);\n CHECK_RESULT(result);\n \n var ms = numbuffers.val * buffersize.val * 1000 / rate.val;\n document.querySelector(\"#display_out2\").value = \"Mixer rate = \" + rate.val + \"hz : System rate = \" + sysrate.val + \"hz : DSP buffer size = \" + numbuffers.val + \" buffers of \" + buffersize.val + \" samples (\" + ms.toFixed(2) + \" ms)\";\n\n var rect;\n var pos = FMOD.VECTOR();\n var vel = FMOD.VECTOR();\n\n rect = document.getElementById(\"listener\").getBoundingClientRect();\n pos.x = rect.left + (rect.width / 2);\n pos.y = 0;\n pos.z = rect.top + (rect.height / 2);\n vel.x = (pos.x - gLastListenerPos.x) / 50; // setinterval is set to 20ms, so 50 times a second. We need units moved per second, not per update.\n vel.z = (pos.z - gLastListenerPos.z) / 50; // setinterval is set to 20ms, so 50 times a second. We need units moved per second, not per update.\n update3DPosition(\"listener\", pos, vel)\n gLastListenerPos.x = pos.x;\n gLastListenerPos.z = pos.z;\n\n rect = document.getElementById(\"event1\").getBoundingClientRect();\n pos.x = rect.left + (rect.width / 2);\n pos.y = 0;\n pos.z = rect.top + (rect.height / 2);\n vel.x = (pos.x - gLastEventPos.x) / 50; // setinterval is set to 20ms, so 50 times a second. We need units moved per second, not per update.\n vel.z = (pos.z - gLastEventPos.z) / 50; // setinterval is set to 20ms, so 50 times a second. We need units moved per second, not per update.\n update3DPosition(\"event1\", pos, vel)\n gLastEventPos.x = pos.x;\n gLastEventPos.z = pos.z;\n\n // Update FMOD\n result = gSystem.update();\n CHECK_RESULT(result);\n}", "feedAudioContent(aBuffer) {\n binding.FeedAudioContent(this._impl, aBuffer);\n }", "function generateAudioBuffer( freq, fn, duration, volume ) {\n var length = duration * sampleRate;\n\n var buffer = audioContext.createBuffer( 1, length, sampleRate );\n var channel = buffer.getChannelData(0);\n for ( var i = 0; i < length; i++ ) {\n channel[i] = fn( freq * i / sampleRate, i / length ) * volume;\n }\n\n return buffer;\n}", "constructor({ audioCtx, spectro }) {\n this.audioCtx = audioCtx;\n this.spectro = spectro;\n this.masterGain = this.audioCtx.createGain();\n this.masterGain.gain.value = 0.3;\n\n this.mod = null;\n this.modGain = null;\n this.car = null;\n this.carGain = null;\n }" ]
[ "0.6633939", "0.6182436", "0.61664873", "0.5997021", "0.597515", "0.59680074", "0.5922837", "0.5872827", "0.5725503", "0.56994855", "0.5684742", "0.5634318", "0.5585186", "0.55558264", "0.5546597", "0.54904324", "0.5489873", "0.5473008", "0.5442178", "0.54232836", "0.5414246", "0.5413157", "0.53890324", "0.53424233", "0.53378767", "0.53347784", "0.53155804", "0.53155804", "0.5310991", "0.5299113", "0.5298569", "0.5287633", "0.52699906", "0.52556705", "0.5249103", "0.5244981", "0.52391297", "0.52324253", "0.52287626", "0.5219341", "0.5218648", "0.521399", "0.5202628", "0.5201368", "0.51891315", "0.5170272", "0.5168062", "0.5146494", "0.51461214", "0.5142657", "0.513719", "0.51361716", "0.5119712", "0.51167595", "0.5108325", "0.5107376", "0.5101309", "0.5099742", "0.5098733", "0.509739", "0.5092935", "0.5077881", "0.50775933", "0.50775933", "0.5076853", "0.50694513", "0.50665754", "0.5064837", "0.50647795", "0.506018", "0.5058205", "0.5052712", "0.50476474", "0.50390834", "0.5035958", "0.50305796", "0.50297993", "0.5027242", "0.5025174", "0.50190514", "0.5007282", "0.49987695", "0.49962443", "0.49871624", "0.49865252", "0.49863648", "0.49847868", "0.4980981", "0.4965222", "0.49639374", "0.49600458", "0.49587706", "0.49578813", "0.49455774", "0.4944921", "0.4943668", "0.49353844", "0.49259788", "0.49218306", "0.4921266" ]
0.49611503
90
valida competidor (tratamento de erros) e adiciona erros no vetor de erros
function validaCompetidor(competidor) { var erros = []; if (competidor.largada.length == 0) { erros.push("A largada não pode ser em branco"); } if (competidor.competidor.length == 0) { erros.push("O competidor não pode ser em branco"); } if (competidor.tempo.length == 0) { erros.push("O tempo não pode ser em branco"); } if (!validaLargada(competidor.largada)) { erros.push("A largada é inválida"); } if (!validaTempo(competidor.tempo)) { erros.push("O tempo é inválido"); } return erros; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doAceptar(){\r\n\tvar error = \"\";\r\n\t$j(\".error\").each( function(){ $j(this).removeClass(\"error\");});\r\n\t\r\n\tif ( $j('#nombre').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Cliente</li>\";\r\n\t\t$j('#nombre').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#email').val().replace(/^\\s*/, '')==\"\" || !isValidEmailAddress($j('#email').val()) ){\r\n\t\terror += \"<li>E-mail no es correcto</li>\";\r\n\t\t$j('#email').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#password').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Contrase&ntilde;a</li>\";\r\n\t\t$j('#password').addClass(\"error\");\r\n\t}else{\r\n\t\tif ( $j('#password').val().length < 3 ){\r\n\t\t\terror += \"<li>Contrase&ntilde;a corta (min. 4)</li>\";\r\n\t\t\t$j('#password').addClass(\"error\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tif ( $j('#estado').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Estado</li>\";\r\n\t\t$j('#estado').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#suscripcion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Recibir informaci&oacute;n</li>\";\r\n\t\t$j('#suscripcion').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#direccion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Direccion de env&iacute;o</li>\";\r\n\t\t$j('#direccion').addClass(\"error\");\r\n\t}\t\r\n\t\r\n\tif ( $j('#poblacion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Poblaci&oacute;n de env&iacute;o</li>\";\r\n\t\t$j('#poblacion').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#id_provincia').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Provincia de env&iacute;o</li>\";\r\n\t\t$j('#id_provincia').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#cpostal').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\terror += \"<li>Codigo Postal de env&iacute;o</li>\";\r\n\t\t$j('#cpostal').addClass(\"error\");\r\n\t}\r\n\t\r\n\tif ( $j('#f_id_pais').val().replace(/^\\s*/, '')!=\"\" ){\t\t\r\n\t\tif ( $j('#razon').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Razon social</li>\";\r\n\t\t\t$j('#razon').addClass(\"error\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#nifcif').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>DNI/CIF</li>\";\r\n\t\t\t$j('#nifcif').addClass(\"error\");\r\n\t\t}else{\r\n\t\t\tif ( $j('#nifcif').val().length < 7 ){\r\n\t\t\t\terror += \"<li>DNI/CIF no es correcto</li>\";\r\n\t\t\t\t$j('#nifcif').addClass(\"error\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#fdireccion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Direcci&oacute;n de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#fdireccion').addClass(\"error\");\r\n\t\t}\t\r\n\t\t\r\n\t\tif ( $j('#fpoblacion').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Poblaci&oacute;n de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#fpoblacion').addClass(\"error\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#f_id_provincia').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Provincia de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#f_id_provincia').addClass(\"error\");\r\n\t\t}\r\n\t\t\r\n\t\tif ( $j('#fcpostal').val().replace(/^\\s*/, '')==\"\" ){\r\n\t\t\terror += \"<li>Codigo Postal de facturaci&oacute;n</li>\";\r\n\t\t\t$j('#fcpostal').addClass(\"error\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif ( error ){\r\n\t\t$j( \"<div>Los siguientes campos resaltados tienen alg&uacute;n error:<br><br>\"+error+\"<br></div>\" ).dialog({\r\n\t\t modal: true,\r\n\t\t buttons: {\r\n\t\t VALE: function(){ $j( this ).dialog( \"close\" ); }\t \r\n\t\t }\r\n\t\t});\r\n\t\treturn false;\r\n\t}\t\r\n\tsendForm(\"doUpdate\",\"html\");\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 validarEquipasEpisodios() {\n var listaToAdd = [];\n var erros = [];\n \n episodios.forEach(function(episodio, it) {\n if($(\"#pendente_secretariado_\"+it).is(':checked')){\n if(parseInt(episodio['cir_segura']) == 0){\n var erro = {\n episodio: episodio,\n tipo: 'warning',\n erro: 'não está marcado como cirurgia segura'\n };\n erros.push(erro);\n } \n var hasElementEC = false;\n var hasElementEA = false;\n var somaDasPercentagens = 0;\n episodio.intervenientes.forEach(function(interveniente) {\n var funcao = interveniente.funcao;\n if(funcao.equipa == 'EC'){\n hasElementEC = true;\n }\n if(funcao.equipa == 'EA'){\n hasElementEA = true;\n }\n somaDasPercentagens += Number(funcao.perc);\n });\n if(!hasElementEC){\n var erro = {\n episodio: episodio,\n tipo: 'error',\n erro: 'não tem elementos na equipa cirurgica'\n };\n erros.push(erro);\n }\n if(!hasElementEA){\n var erro = {\n episodio: episodio,\n tipo: 'error',\n erro: 'não tem elementos na equipa de apoio'\n };\n erros.push(erro);\n }\n if(somaDasPercentagens != 100){\n var erro = {\n episodio: episodio,\n tipo: 'error',\n erro: 'a soma das percentagens dos intervenientes dá '+somaDasPercentagens+'%' \n };\n erros.push(erro);\n }\n var servico;\n for (let i = 0; i < servicos.length; i++) {\n const servicoI = servicos[i];\n if(episodio.servico == servicoI.id){\n servico = servicoI;\n break;\n }\n } \n var horaInicioServico = moment(servico.horario_ini, 'HH:mm:ss');\n var horaEntradaBloco = moment(episodio.horas_oper_ini, 'HH:mm:ss');\n var isHoraEntradaBlocoEarlier = horaInicioServico.isBefore(horaEntradaBloco) \n if(!isHoraEntradaBlocoEarlier){\n var erro = {\n episodio: episodio,\n tipo: 'warning',\n erro: 'a hora registada como entrada no bloco operatório ('+horaEntradaBloco.format('HH:mm:ss')+') é anterior ao horário de funcionamento do serviço \"'+servico['servico']+'\" ('+horaInicioServico.format('HH:mm:ss')+')', \n };\n erros.push(erro);\n }\n listaToAdd.push(episodio);\n }\n });\n\n if(listaToAdd.length == 0 && erros.length == 0){\n toastr(\"Selecione pelo menos um episódio para validar\", \"error\");\n return;\n }\n var errosValidacaoSecretariadoModal=\"<div class='overlay'>\"+\n \"<div id='erros_validacao_pendente_secretariado' class='modal bigModal'>\"+\n \"<h4 class='modal_title font-black'>Erro(s) ao validar episódio(s) <i onclick='closeModal();' class='fas fa-times-circle close_modal'></i></h4>\"+\n \"<p id='episodios_com_erros_pendente_secretariado_label'>Os seguintes episódios <span style='color:red'>não serão válidados</span> devido à existência de erros:</p>\"+\n \"<div id='episodios_com_erros_pendente_secretariado' class='errors_modal_container'>\"+\n \"</div>\"+\n \"<p id='episodios_com_inconformidades_pendente_secretariado_label' style='border-top: 1px solid lightgray; padding-top: 15px; margin-top: 15px;'>Os seguintes episódios <span style='color:orange'>poderão ser válidados</span> mas apresentam inconformidades:</p>\"+\n \"<div id='episodios_com_inconformidades_pendente_secretariado' class='errors_modal_container'>\"+\n \"<label class='container costumHeight' style='width:1.75vw; float: left; margin-right: 1vw;'>\"+\n \"<input type='checkbox' id='episodio_desconforme_all' onclick='selecAlltDesconformes()'>\"+\n \"<span class='checkmark costumCheck_inner'></span>\"+\n \"</label>\"+ \n \"<b>Selecionar todos os desconformes</b>\"+\n \"</div>\"+\n \"<p id='episodios_sem_erros_pendente_secretariado_label' style='border-top: 1px solid lightgray; padding-top: 15px; margin-top: 15px;'>Assim sendo, apenas os seguintes episódios serão validados:</p>\"+\n \"<div id='episodios_sem_erros_pendente_secretariado' class='errors_modal_container'>\"+\n \"</div>\"+\n \"<div style='margin-top:1vw'>\"+\n \"<button id='validarEpisodiosComErros_pendente_secretariado' class='confirm-btn'>Validar Conformes e Desconformes Selecionados (<span id='nrOfSelected'>0</span>)</button>\"+\n \"<button id='validarEpisodiosSemErros_pendente_secretariado' class='confirm-btn'>Validar Apenas Conformes</button>\"+\n \"<button onclick='closeModal();' class='confirm-btn'>Cancelar</button>\"+\n \"</div>\"+\n \"</div>\"+ \n \"</div>\";\n if(erros.length > 0){\n var contaImpeditivos = 0;\n var contaInconformes = 0;\n var contaConformes = 0;\n $(\"body\").append(errosValidacaoSecretariadoModal);\n for (let index = 0; index < listaToAdd.length; index++) {\n const episodio = listaToAdd[index];\n var errosEpisodio = [];\n erros.forEach(function (error) {\n if(error.episodio == episodio){\n errosEpisodio.push(error);\n }\n });\n if(errosEpisodio.length == 0){\n contaConformes++;\n listaToAdd[index]['errosImpeditivos'] = [];\n listaToAdd[index]['errosNaoImpeditivos'] = [];\n $(\"#episodios_sem_erros_pendente_secretariado\").append(\"<p><b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome']+\" <i style='color:green; margin-left:5px;' class='fas fa-check-circle'></i></p>\");\n } else {\n var errosImpeditivos = [];\n var errosNaoImpeditivos = [];\n errosEpisodio.forEach(function (error) {\n if(error.tipo == 'error'){\n errosImpeditivos.push(error);\n }else {\n errosNaoImpeditivos.push(error);\n }\n });\n listaToAdd[index]['errosImpeditivos'] = errosImpeditivos;\n listaToAdd[index]['errosNaoImpeditivos'] = errosNaoImpeditivos;\n if(errosImpeditivos.length > 0){\n var string = \"<p>O episódio <b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome'];\n errosImpeditivos.forEach( function (erro) {\n contaImpeditivos++;\n string += \" \" + erro.erro + \",\";\n });\n string = string.substring(0, string.length-1);\n string+=\" <i style='color:red; margin-left:5px;' class='fas fa-times-circle'></i></p>\";\n $(\"#episodios_com_erros_pendente_secretariado\").append(string);\n } else {\n if(errosNaoImpeditivos.length > 0){\n var string = \"\";\n string += \"<p>\"+\n \"<label class='container costumHeight' style='width:1.75vw; float: left; margin-right: 1vw;'>\"+\n \"<input type='checkbox' id='episodio_desconforme_\"+episodio['id']+\"' class='episodio_desconforme'>\"+\n \"<span class='checkmark costumCheck_inner' onclick='selectDesconforme(\"+episodio['id']+\")'></span>\"+\n \"</label>\"+ \n \"O episódio <b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome'];\n errosNaoImpeditivos.forEach( function (erro) {\n contaInconformes++;\n string += \" \" + erro.erro + \",\";\n });\n string = string.substring(0, string.length-1);\n string+=\" <i style='color:orange; margin-left:5px;' class='fas fa-exclamation-triangle'></i></p>\";\n $(\"#episodios_com_inconformidades_pendente_secretariado\").append(string);\n }\n }\n }\n }\n if(contaConformes == 0){\n $(\"#episodios_sem_erros_pendente_secretariado_label\").remove();\n $(\"#episodios_sem_erros_pendente_secretariado\").remove();\n }\n if(contaImpeditivos == 0){\n $(\"#episodios_com_erros_pendente_secretariado_label\").remove();\n $(\"#episodios_com_erros_pendente_secretariado\").remove();\n }\n if(contaInconformes == 0){\n $(\"#episodios_com_inconformidades_pendente_secretariado_label\").remove();\n $(\"#episodios_com_inconformidades_pendente_secretariado\").remove();\n $(\"#validarEpisodiosComErros_pendente_secretariado\").remove();\n }\n document.getElementById('validarEpisodiosSemErros_pendente_secretariado').addEventListener('click', function(){\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n if(episodioValidado.errosImpeditivos.length == 0 && episodioValidado.errosNaoImpeditivos.length == 0){\n listaToAddIds.push(episodioValidado['id']);\n }\n });\n if(listaToAddIds == 0){ \n toastr(\"Nenhum episódio está completamente válido\", \"error\");\n } else{\n realValidarPendenteSecretariado(listaToAddIds); \n closeModal();\n }\n return;\n });\n if(document.getElementById('validarEpisodiosComErros_pendente_secretariado') != null){\n document.getElementById('validarEpisodiosComErros_pendente_secretariado').addEventListener('click', function () {\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n if(episodioValidado.errosImpeditivos.length == 0 && episodioValidado.errosNaoImpeditivos.length != 0){\n if($(\"#episodio_desconforme_\"+episodioValidado['id']).is(':checked')){\n listaToAddIds.push(episodioValidado['id']);\n }\n } else if(episodioValidado.errosImpeditivos.length == 0 && episodioValidado.errosNaoImpeditivos.length == 0){\n listaToAddIds.push(episodioValidado['id']);\n }\n });\n if(listaToAddIds == 0){ \n toastr(\"Nenhum episódio está completamente válido\", \"error\");\n } else{\n realValidarPendenteSecretariado(listaToAddIds); \n closeModal();\n }\n return;\n });\n }\n return;\n }\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n listaToAddIds.push(episodioValidado['id']);\n });\n realValidarPendenteSecretariado(listaToAddIds); \n}", "async _checkErrors(operation, results)\n\t{\n\t\tconst res = results[operation+'Result'];\n\n\t\tif (operation === 'FECAESolicitar' && res.FeDetResp) {\n\t\t\tif (Array.isArray(res.FeDetResp.FECAEDetResponse)) {\n\t\t\t\tres.FeDetResp.FECAEDetResponse = res.FeDetResp.FECAEDetResponse[0];\n\t\t\t}\n\t\t\t\n\t\t\tif (res.FeDetResp.FECAEDetResponse.Observaciones && res.FeDetResp.FECAEDetResponse.Resultado !== 'A') {\n\t\t\t\tres.Errors = { Err : res.FeDetResp.FECAEDetResponse.Observaciones.Obs };\n\t\t\t}\n\t\t}\n\n\t\tif (res.Errors) {\n\t\t\tconst err = Array.isArray(res.Errors.Err) ? res.Errors.Err[0] : res.Errors.Err;\n\t\t\tthrow new Error(`(${err.Code}) ${err.Msg}`, err.Code);\n\t\t}\n\t}", "function ValidarRegistroNuevoLibro() {\n var titulo = $('#txt_titulo_libro').val();\n var autor = $('#slc_autor_libro').val();\n var tema = $('#slc_tema_libro').val();\n var existencia = $('#txt_existencia').val();\n var ubicacion = $('#txt_ubicacion').val();\n var fecha_ingreso = $('#txt_fecha_registro_libro').val();\n var mensaje = '';\n var error = false;\n if (titulo == '') {\n mensaje += 'Debe ingresar el titulo del libro\\n';\n error = true;\n }\n if (autor == '') {\n mensaje += 'Debe seleccionar el autor del libro\\n';\n error = true;\n }\n if (tema == '') {\n mensaje += 'Debe seleccionar el tema del libro\\n';\n error = true;\n }\n if (existencia == '') {\n mensaje += 'Debe la cantidad de libros existentes\\n';\n error = true;\n }\n if (ubicacion == '') {\n mensaje += 'Debe ingresar la ubicacion del libro\\n';\n error = true;\n }\n error ? alert(mensaje) : AgregarNuevoLibro(titulo, tema, autor, existencia, ubicacion, fecha_ingreso);\n}", "function AdministrarValidaciones() {\r\n var _a, _b, _c, _d;\r\n var Valido = true;\r\n var errorArray = [];\r\n if (!ValidarCamposVacios(\"numDni\") || !ValidarRangoNumerico(\"numDni\", 1000000, 55000000)) {\r\n console.log(\"Error en el DNI\");\r\n errorArray.push(\"DNI\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numDni\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numDni\", false);\r\n }\r\n if (!ValidarCamposVacios(\"txtApellido\")) {\r\n console.log(\"El apellido está vacío\");\r\n errorArray.push(\"Apellido\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"txtApellido\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"txtApellido\", false);\r\n }\r\n if (!ValidarCamposVacios(\"txtNombre\")) {\r\n console.log(\"El nombre está vacío\");\r\n errorArray.push(\"Nombre\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"txtNombre\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"txtNombre\", false);\r\n }\r\n if (!ValidarCombo(\"cboSexo\", \"--\")) {\r\n console.log(\"No se ha seleccionado sexo\");\r\n errorArray.push(\"Sexo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"cboSexo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"cboSexo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"numLegajo\") || !ValidarRangoNumerico(\"numLegajo\", 100, 550)) {\r\n console.log(\"Error en el legajo\");\r\n errorArray.push(\"Legajo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numLegajo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numLegajo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"numSueldo\") || !ValidarRangoNumerico(\"numSueldo\", 800, ObtenerSueldoMaximo(ObtenerRbSeleccionado(\"Turno\")))) {\r\n console.log(\"Error en el sueldo\");\r\n errorArray.push(\"Sueldo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numSueldo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numSueldo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"Foto\")) {\r\n console.log(\"Error en la foto\");\r\n errorArray.push(\"Foto\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"Foto\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"Foto\", false);\r\n }\r\n if (ObtenerRbSeleccionado(\"Turno\") == \"\") {\r\n console.log(\"Error en el turno\");\r\n errorArray.push(\"Turno\");\r\n Valido = false;\r\n if (((_a = document.getElementsByClassName(\"turnos\")[0]) === null || _a === void 0 ? void 0 : _a.previousSibling).tagName != 'SPAN') {\r\n var newNode = document.createElement(\"span\");\r\n newNode.style.color = \"brown\";\r\n newNode.appendChild(document.createTextNode(\"*\"));\r\n (_b = document.getElementsByClassName(\"turnos\")[0].parentElement) === null || _b === void 0 ? void 0 : _b.insertBefore(newNode, document.getElementsByClassName(\"turnos\")[0]);\r\n }\r\n }\r\n else {\r\n if (((_c = document.getElementsByClassName(\"turnos\")[0]) === null || _c === void 0 ? void 0 : _c.previousSibling).tagName == 'SPAN') {\r\n ((_d = document.getElementsByClassName(\"turnos\")[0]) === null || _d === void 0 ? void 0 : _d.previousSibling).remove();\r\n }\r\n }\r\n return Valido;\r\n // if(Valido)\r\n // {\r\n // let form = (<HTMLFormElement>document.getElementById(\"frmEmpleado\"));\r\n // if(form != null)\r\n // {\r\n // form.submit();\r\n // }\r\n // }\r\n // else\r\n // {\r\n // //COMENTADO POR LA PARTE 4 DEL TP\r\n // // let errorMessage = \"Los siguientes campos están vacíos o los valores ingresados no son válidos:\"\r\n // // errorArray.forEach(element => {\r\n // // errorMessage = errorMessage.concat('\\n', '- ', element);\r\n // // });\r\n // // alert(errorMessage);\r\n // }\r\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 }", "function validarErrSig(ecu){ // 2 + 2\nlet erss = [];\nlet ers = 0;\nlet signos = ['{','[', '(', ')', ']', '}','+', '-', '*', '/', ' ','=', '^','|','||','&','&&', '<', '>', '<>', '<=', '>=','1','2','3','4','5','6','7','8','9','0'];\n\nfor (let i = 0; i < ecu.length; i++) {\nif(signos.includes(ecu[i])){\n \n}else{\n erss.push(ecu[i]);\n ers++;\n}\n}\n\nif(ers > 0){\nreturn {consigers: true , erers: erss} \n}else{\nreturn {consigers: false , erers: 'Todo Correcto'} \n}\n\n}", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula.toUpperCase();\r\n this.putSound (paraula.so);\r\n this.ant = this.actual;\r\n this.actual = \"\";\r\n }\r\n else {\r\n this.putImg (\"imatges/error.gif\");\r\n this.putSound (\"so/error.wav\");\r\n this.actual = \"\";\r\n }\r\n}", "validateFields() {\n const { description, amount, date } = Form.getValues() //Desustrurando o objeto\n // console.log(description)\n\n if(description.trim() === \"\" || amount.trim() === \"\" || date.trim() === \"\") { // trim: limpeza da sua string\n throw new Error(\"Por favor, preencha todos os campos\")// Throw é jogar para fora (cuspir), criando um novo objeto de erro com uma mensagem adicionada\n } \n }", "function validarForm () {\n\n if (!formRegistro.checkValidity()) { \n const campos = [nombre, apellidos, tel, email, username, username, api_key, pass, pass2]\n //console.dir(campos)\n \n\n try {\n const error = new Error()\n\n // comprobamos los radio\n if (!genero[0].checkValidity()) {\n error.code = 'genero'\n throw error\n }\n if (!nacionalidad[0].checkValidity()) {\n error.code = 'nacionalidad'\n throw error\n }\n\n // comprobamos la provincia\n if ((nacionalidad.filter(item => item.checked)[0].value) == 'Española') {\n if (!provincias.checkValidity()){\n error.code = 'provincias'\n throw error\n }\n }\n \n // comprobamos los input texto\n campos.forEach((item) => { \n if(!item.value) {\n error.code = item.id\n throw error\n }\n }) \n\n //comprobamos que se han aceptado las condiciones\n if (!condiciones.checked) {\n error.code = 'condiciones'\n throw error\n }\n\n return true \n\n } catch (error) {\n let errorMsg\n \n switch (error.code) {\n case 'genero':\n errorMsg = 'Marca el género al que perteneces'\n break;\n case 'nombre':\n errorMsg = 'Introduce tu nombre'\n break;\n case 'apellidos':\n errorMsg = 'Introduce tus apellidos'\n break;\n case 'nacionalidad':\n errorMsg = 'Selecciona tu nacionalidad'\n break;\n case 'provincias':\n errorMsg = 'Selecciona tu provincia'\n break\n case 'mobile':\n errorMsg = 'Introduce tu número de teléfono'\n break;\n case 'email':\n errorMsg = 'Introduce tu dirección de correo'\n break\n case 'username':\n errorMsg = 'Introduce tu nombre de usuario'\n break\n case 'api_key':\n errorMsg = 'Introduce tu api_key'\n break\n case 'pass':\n errorMsg = 'Introduce tu contraseña'\n break\n case 'pass2':\n errorMsg = 'Repite tu contraseña'\n break\n case 'condiciones':\n errorMsg = 'Es necesario que aceptes las condiciones'\n break\n default:\n errorMsg = 'Se ha produido un error'\n break;\n } \n \n formRegistro.querySelector('p.error').innerHTML = errorMsg\n return false\n }\n \n }\n\n // comprobamos que las contraseñas coinciden\n if (pass.value !== pass2.value) {\n console.log('contraseñas distintas')\n formRegistro.querySelector('p.error').innerHTML = 'Es necesario que las contraseñas coincidan'\n return false\n }\n\n\n return true\n }", "function validar(u) {\n let erros = [];\n\n // EXEMPLOS DE ERROS:\n if (!u) return { pass: false, erros: [\"Usuário não informado\"] };\n checkField(u, \"nome\", erros);\n checkField(u, \"dataNascimento\", erros);\n checkField(u, \"email\", erros);\n\n if (u?.nome && u.nome.length < 2)\n erros.push(\"O nome deve ter pelo menos 2 caracteres\");\n if (u?.dataNascimento && u.dataNascimento < 18)\n erros.push(\"O usuario deve ter pelo menos 18 anos\");\n // etc...\n\n return erros.length > 0 ? { pass: false, erros } : { pass: true, erros: [] };\n}", "function destacaCamposComProblemaEmForms( erros ){\n\n tabela.find('.form-group').removeClass('has-error');\n\n $.each( erros, function( index, erro ){\n\n $(\"[name='\"+index+\"']\").parents(\".form-group\").addClass('has-error');\n\n });\n\n }", "function btnAceptar() {\r\n\r\n var entrar = false;\r\n let calleValidar = document.getElementById(\"invalid-calle\");\r\n let numeroValidar = document.getElementById(\"invalid-numero\");\r\n let esquinaValidar = document.getElementById(\"invalid-esquina\");\r\n let calleHTML = document.getElementById(\"validationCalle\");\r\n let esquinaHTML = document.getElementById(\"validationEsquina\");\r\n let numeroHTML = document.getElementById(\"validationNumero\");\r\n let tarjetaHTML = document.getElementById(\"idTarjeta\");\r\n let vencimientoHTML = document.getElementById(\"idVencimiento\");\r\n let codigoDeSegHTMML = document.getElementById(\"idCodSeg\");\r\n let errorModalHTML = document.getElementById(\"errorModal\");\r\n\r\n if (calleHTML.value == null || calleHTML.value == \"\") {\r\n calleValidar.innerHTML = 'Debe ingresar la calle';\r\n entrar = true;\r\n } else {\r\n document.getElementById(\"invalid-calle\").innerHTML = '';\r\n }\r\n if (numeroHTML.value == null || numeroHTML.value == '') {\r\n numeroValidar.innerHTML = 'Debe ingresar el numero';\r\n entrar = true;\r\n } else {\r\n document.getElementById(\"invalid-numero\").innerHTML = '';\r\n }\r\n if (esquinaHTML.value == null || esquinaHTML.value == \"\") {\r\n esquinaValidar.innerHTML = 'Debe ingresar la esquina';\r\n entrar = true;\r\n } else {\r\n document.getElementById(\"invalid-esquina\").innerHTML = '';\r\n\r\n }\r\n if (tarjetaHTML.value == null || tarjetaHTML.value == \"\") {\r\n entrar = true;\r\n tarjetaHTML.style.borderColor = \"red\";\r\n } else {\r\n\r\n tarjetaHTML.style.borderColor = \"green\";\r\n }\r\n if (vencimientoHTML.value == null || vencimientoHTML.value == \"\") {\r\n entrar = true;\r\n vencimientoHTML.style.borderColor = \"red\";\r\n } else {\r\n\r\n vencimientoHTML.style.borderColor = \"green\";\r\n }\r\n if (codigoDeSegHTMML.value == null || codigoDeSegHTMML.value == \"\") {\r\n entrar = true;\r\n codigoDeSegHTMML.style.borderColor = \"red\";\r\n } else {\r\n\r\n codigoDeSegHTMML.style.borderColor = \"green\";\r\n }\r\n if (entrar) {\r\n errorModalHTML.innerHTML = 'Faltan campos por rellenar '\r\n } else {\r\n errorModalHTML.innerHTML = '<span style=\"color:green\"> Datos Cargados exitosamente! </span> ';\r\n\r\n document.getElementById(\"alert\").innerHTML = '<div class=\"alert alert-success\" role=\"alert\"> <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" class=\"bi bi-cart4\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">' +\r\n ' <path fill-rule=\"evenodd\" d=\"M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 4H14.5a.5.5 0 0 1 .485.621l-1.5 6A.5.5 0 0 1 13 11H4a.5.5 0 0 1-.485-.379L1.61 3H.5a.5.5 0 0 1-.5-.5zM3.14 5l.5 2H5V5H3.14zM6 5v2h2V5H6zm3' +\r\n ' 0v2h2V5H9zm3 0v2h1.36l.5-2H12zm1.11 3H12v2h.61l.5-2zM11 8H9v2h2V8zM8 8H6v2h2V8zM5 8H3.89l.5 2H5V8zm0 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0zm9-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0z\"/>' +\r\n ' </svg> Compra exitosa! <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">' +\r\n ' <span aria-hidden=\"true\">&times;</span> </button></div>';\r\n }\r\n\r\n}", "function validarInputIntegrantes(integrantes) {\n //const integrantes = $form[\"cantidad-integrantes\"].value;\n\n const errorIntegrantes = validarIntegrantesFamiliares(integrantes);\n const $integrantes = $form[\"cantidad-integrantes\"].value;\n\n const errores = {\n \"cantidad-integrantes\": errorIntegrantes\n }\n\n const esExitoIntegrantes = manejarErrores(errores) === 0 ;\n\n if (esExitoIntegrantes){\n crearIntegrantes($integrantes);\n }\n\n return errores;\n}", "function validarPeticion(peticion=request,respuesta=response, next) {\n \n let errores = validationResult(peticion);\n if (!errores.isEmpty()) {\n \n return (respuesta.status(400).json(errores));\n\n }\n next();\n\n}", "function limpiarMensajesValidacion(){\n\t\tvar indexValidacion = 2; \n\t\t//tomamos la lista actual del rowset \n\t\tvar listaClientes = listado1.datos; \n\t\t//realizamos la tranformaion \n\t\tfor (var i=0; i < listaClientes.length; i++){\n\t\t\t//limpia el el mensage de validacion\n\t\t\tlistaClientes[i][indexValidacion] = \"\"; \n\t\t}\n\t\tlistado1.repinta();\n\t}", "function validaruc(){\r\n\t\tvar ruc = document.getElementById('ruc');\r\n\t\tlimpiarError(ruc);\r\n\t\tif(ruc.value ==''){\r\n\t\t\talert ('Completa el campo de ruc o rise');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(isNaN(ruc.value)){\r\n\t\t\talert('Formato del RUC o RISE debe ser numeros');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\telse if(ruc.value.length<13){\r\n\t\t\talert('Error: Solo se debe ingresar minimo 13 digitos');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(ruc.value.length>13){\r\n\t\t\talert('Error: solo se debe ingresar maximo 13 digitos');\r\n\t\t\terror(ruc);\r\n\t\t\treturn false;\r\n\t\t}return true;\r\n\t}", "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 tornarErrosInvisiveis(){\n $(errorName).addClass('deixarInvisivel');\n}", "function setValidacaoRemota(erro) {\n\n if (!erro) {\n $(\"#salvar-erros\").html(null);\n return;\n }\n\n $(\"#salvar-erros\").append(\"<p>\" + erro + \"</p>\")\n }", "function validateRockets() {\n //NO CONSIGO OPTIMIZAR EL CÓDIGO\n /*for (let i:number=1;i<3;i++){\n eval(\"rocket\"+i) = (<HTMLInputElement>document.getElementById(\"inputRocket\"+i+\"0Id\")).value;\n \"rocket\"+i = (<HTMLInputElement>document.getElementById(\"inputRocket+i+Id\")).value;\n rocket+i = (<HTMLInputElement>document.getElementById(\"inputRocket+i+Id\")).value;\n }*/\n //valor de los inputs \n var formInputsValue = {\n rocket0: document.getElementById(\"inputRocket0Id\").value,\n rocket1: document.getElementById(\"inputRocket1Id\").value,\n select0: parseInt(document.getElementById(\"selectRocket0\").value),\n select1: parseInt(document.getElementById(\"selectRocket1\").value),\n };\n var rocket0 = formInputsValue.rocket0, rocket1 = formInputsValue.rocket1, select0 = formInputsValue.select0, select1 = formInputsValue.select1;\n fInvalid(formElements);\n validator = true;\n for (var i_1 = 0; i_1 < 2; i_1++) {\n validator = comId(eval(\"rocket\" + i_1), eval(\"inputRocket\" + i_1 + \"Id\"), eval(\"invalidRocket\" + i_1 + \"Id\"), validator);\n validator = comNumProp(eval(\"select\" + i_1), eval(\"selectRocket\" + i_1), eval(\"inavalidRocket\" + i_1 + \"select\"), validator);\n }\n if (validator) {\n for (var i_2 = 0; i_2 < 2; i_2++) {\n createRocket(eval(\"rocket\" + i_2), eval(\"select\" + i_2));\n }\n roquetForm.classList.add('no-visible');\n //mostramos la info del cohete\n showInfo();\n }\n return validator;\n}", "function validate (e){\r\n var x = e.target.id.substr(5).split('_');\r\n var b = x[0];\r\n var trp = x[1];\r\n document.getElementById('ptETerr_'+ b).innerHTML = '';\r\n var x = parseIntZero (e.target.value);\r\n if (isNaN(x) || x<0 || x>150000){\r\n e.target.style.backgroundColor = 'red';\r\n document.getElementById('ptETerr_'+ b).innerHTML = 'Invalid Entry';\r\n return;\r\n } else {\r\n e.target.style.backgroundColor = '';\r\n e.target.value = x;\r\n t.troops['b'+ b][trp-1] = x;\r\n }\r\n var tot = 0;\r\n for (var td=0; td<troopDef.length; td++)\r\n tot += parseIntZero(document.getElementById('ptET_'+ b +'_'+ [troopDef[td][1]]).value);\r\n if (tot<1 && cList['lvl'+ b].length>0 )\r\n document.getElementById('ptETerr_'+ b).innerHTML = 'No troops defined';\r\n if (tot>150000)\r\n document.getElementById('ptETerr_'+ b).innerHTML = 'Too many troops';\r\n }", "validate() {\n this.errorMessage = \"Dit is geen nummer\";\n super.validate();\n }", "function mostrar_errores_registro(data){\n // Procesa respuesta\n var errores = JSON.parse(data);\n\n // Imprime descripcion errores\n $('#error-perfil').text(errores[0]);\n $('#error-nombre_completo').text(errores[1]);\n $('#error-email').text(errores[2]);\n $('#error-celular').text(errores[3]);\n $('#error-contrasena').text(errores[4]);\n\n // Aniade contornos de colores a campos\n if( ! errores[1])\n marcar_elemento_valido('#nombre_completo');\n else\n marcar_elemento_no_valido('#nombre_completo');\n\n if( ! errores[2])\n marcar_elemento_valido('#email');\n else\n marcar_elemento_no_valido('#email');\n\n if( ! errores[3])\n marcar_elemento_valido('#celular');\n else\n marcar_elemento_no_valido('#celular');\n\n if( ! errores[4]){\n marcar_elemento_valido('#contrasena');\n marcar_elemento_valido('#confirmacion_contrasena');\n }\n else{\n marcar_elemento_no_valido('#contrasena');\n marcar_elemento_no_valido('#confirmacion_contrasena');\n }\n}", "validarInfo() {\n if (this.erros.length > 0) {\n this.validador.style.display = \"table-row\";\n this.imprimirErros(this.erros);\n } else if ((this.validarRepetido(this.nome, this.peso, this.altura)) == false) {\n this.calculaIMC();\n this.adicionarElementos();\n this.validador.style.display = \"none\";\n this.form.reset();\n }\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 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}", "function verifyErrors() {\n\t\tlet foundError = false;\n\t\n \n for(let error in field.validity) {\n \t\t// se nao for customErorr\n \t\t//entao verifica se tem erro\n \t\tif( field.validity[error] && !field.validity.valid) {\n\n \t\t\tfoundError = error\n \t\t}\n }\n return foundError;\n\n }", "function validar_add_riesgo1(){\r\n\t\r\n\tif(document.getElementById('sel_alcance_add').value=='-1'){\r\n\t\tmostrarDiv('error_alcance');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_descripcion').value==''){\r\n\t\tmostrarDiv('error_descripcion');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_estrategia').value==''){\r\n\t\tmostrarDiv('error_estrategia');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('txt_fecha_deteccion_add').value==''){\r\n\t\tmostrarDiv('error_fecha_deteccion');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_impacto').value=='-1'){\r\n\t\tmostrarDiv('error_impacto');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_probabilidad').value=='-1'){\r\n\t\tmostrarDiv('error_probabilidad');\t\r\n\t\treturn false;\r\n\t}\r\n\tif(document.getElementById('sel_estado_add').value=='-1'){\r\n\t\tmostrarDiv('error_estado_add');\t\r\n\t\treturn false;\r\n\t}\t\r\n\tdocument.getElementById('frm_add_riesgo1').action='?mod=riesgos&niv=1&task=saveAdd';\r\n\tdocument.getElementById('frm_add_riesgo1').submit();\r\n}", "function controllaDati() {\r\n\t\tvar err=false;\r\n\t\tvar check=true;\r\n\t\tvar elem = document.getElementById(\"nomeRicetta\");\r\n\t\tif(elem.value.length == 0) {\r\n\t\t\t\tdocument.getElementById(\"nomeRicettaErr\").innerHTML= \"Inserisci il titolo\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"nomeRicettaErr\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"nomeAutore\");\r\n\t\tif( elem.value.length==0 ) {\r\n\t\t\t\tdocument.getElementById(\"nomeAutoreErr\").innerHTML= \"Inserisci il nome dell'autore\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"nomeAutoreErr\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"areaProcedimento\");\r\n\t\tif( elem.value.length==0 ) {\r\n\t\t\t\tdocument.getElementById(\"areaProcedimentoErr\").innerHTML= \"Inserisci il procedimento\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"areaProcedimentoErr\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"ingrediente0\");\r\n\t\tif( elem.value.length==0 ) {\r\n\t\t\t\tdocument.getElementById(\"ingrediente0Err\").innerHTML= \"<p>Inserisci almeno il primo ingrediente</p>\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"ingrediente0Err\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"quantita0\");\r\n\t\tif( isNaN(elem.value) || parseInt(elem.value)<0 || parseInt(elem.value) > 9999) {\r\n\t\t\t\tdocument.getElementById(\"quantitaN0Err\").innerHTML= \"La quantità deve essere numerica\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"quantitaN0Err\").innerHTML= \"\";\r\n\t\t}\r\n\t\tif (check==false) {\r\n\t\t\treturn !err;\r\n\t\t}\r\n\t\t\r\n}", "function validarvacios() {\n var bandera = true;\n /*Creamos un for que nos recorrera todos los elmentos de nuestra html */\n for (var i = 0; i < document.forms[0].elements.length; i++) {\n var elemento = document.forms[0].elements[i]\n /*seleccionamos todoslos elementos de tipo text y comparamos si estos estan vacios */\n if (elemento.value == '' && elemento.type == 'text') {\n /*Si los elementos se encuentran vacios mostrara un mensaje de error en nuestras etiquetas spam */\n if (elemento.id == 'nombre') {\n document.getElementById('errorNombre').style = 'display:block; color:white;'\n document.getElementById('errorNombre').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n\n }\n if (elemento.id == 'apellido') {\n document.getElementById('errorApellido').style = 'display:block; color:white;'\n document.getElementById('errorApellido').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'cedula') {\n document.getElementById('errorCedula').style = 'display:block; color:white;'\n document.getElementById('errorCedula').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'telefono') {\n document.getElementById('errorTelefono').style = 'display:block; color:white;'\n document.getElementById('errorTelefono').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'direccion') {\n document.getElementById('errorDireccion').style = 'display:block; color:white;'\n document.getElementById('errorDireccion').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'fecha') {\n document.getElementById('errorFecha').style = 'display:block; color:white;'\n document.getElementById('errorFecha').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'correo') {\n document.getElementById('errorCorreo').style = 'display:block; color:white;'\n document.getElementById('errorCorreo').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n if (elemento.id == 'contrasenia') {\n document.getElementById('errorContrasenia').style = 'display:block; color:white;'\n document.getElementById('errorContrasenia').innerHTML = 'Campo vacio'\n elemento.style.border = \"1px red solid\"\n }\n \n } else {\n\n /*se leeel dato de nuestra etiqueta cedula y posteriormente se la envia a nuestra funcion de validar cedula */\n\n\n if(elemento.id == 'cedula'){\n cedula = document.getElementById(\"cedula\").value;\n /*si nuestra cedula esigual a 10 procede a ingresar a nuestro metodo de validacion */\n if (validarnumero(cedula)==false) {\n document.getElementById('errorCedula').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorCedula').innerHTML = '<b>No se permite letras'\n }else{\n validaCedula();\n }\n\n }\n\n /* el siguiente if compara si los elementos ingresados son de tipo numerico */\n if (elemento.id == 'nombre') {\n document.getElementById('errorNombre').style = 'display:none;'\n nombre = document.getElementById(\"nombre\").value;\n if (validarNombre(nombre) == false) {\n document.getElementById('errorNombre').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorNombre').innerHTML = '<b>No se permite numeros</b>'\n }\n }\n /* el siguiente if compara si los elementos ingresados son de tipo numerico */\n if (elemento.id == 'apellido') {\n document.getElementById('errorApellido').style = 'display:none;'\n apellido = document.getElementById(\"apellido\").value;\n \n if (validarNombre(apellido) == false) {\n document.getElementById('errorApellido').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorApellido').innerHTML = '<b>No se permite numeros</b>'\n }\n\n }\n if (elemento.id == 'telefono') {\n document.getElementById('errorTelefono').style = 'display:none;'\n numero= document.getElementById(\"telefono\").value;\n /*compararemos si todos los datos son de tipo numericos */\n if (validarnumero(numero) == false) {\n document.getElementById('errorTelefono').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorTelefono').innerHTML = '<b>Revise nuevamente su numero telefonico</b>'\n }\n /*Nos aseguramos de que nuestro telefono tenga un maximo de 10 */\n if (numero.length < 10) {\n document.getElementById('errorTelefono').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorTelefono').innerHTML = '<b>Revise nuevamente su numero telefonico</b>'\n }\n\n }\n if (elemento.id == 'fecha') {\n document.getElementById('errorFecha').style = 'display:none;'\n fech = document.getElementById(\"fecha\").value;\n \n if (validarformato(fech) == false) {\n document.getElementById('errorFecha').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorFecha').innerHTML = '<b>Formato de fecha incorrecta</b>'\n }\n\n }\n if (elemento.id == 'correo') {\n document.getElementById('errorCorreo').style = 'display:none;'\n cor = document.getElementById(\"correo\").value;\n \n if (validarEmail(cor) == false) {\n document.getElementById('errorCorreo').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorCorreo').innerHTML = '<b>Extencion de correo incorrecta </b>'\n }\n\n }\n\n if (elemento.id == 'contrasenia') {\n document.getElementById('errorContrasenia').style = 'display:none;'\n contra = document.getElementById(\"contrasenia\").value;\n \n if (contra.length < 8) {\n document.getElementById('errorContrasenia').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorContrasenia').innerHTML = '<b>Ingrese nuevamente una nueva contraseña </b>'\n }\n \n if (validarPasswd (contra) == false) {\n document.getElementById('errorContrasenia').style = 'display:block; color:rgb(238, 16, 16); font-size:20px;'\n document.getElementById('errorContrasenia').innerHTML = '<b>Ingrese nuevamente una nueva contraseña </b>'\n }\n \n\n\n }\n\n \n }\n\n\n bandera = false\n }\n \n}", "function validarGDHsEpisodios (){\n var listaToAdd = [];\n var erros = [];\n episodios.forEach(function(episodio, it) {\n if($(\"#pendente_gdh_\"+it).is(':checked')){\n if(episodio['gdh1'] == null && episodio['gdh2'] == null){\n var erro = {\n episodio: episodio,\n erro: ' não tem nenhum GDH atribuído' \n };\n erros.push(erro);\n }\n \n if(episodio['gdh1'] != null && episodio['gdh2'] == null){\n var targetServico;\n for (let it3 = 0; it3 < servicos.length; it3++) {\n const service = servicos[it3];\n if(service['id'] == episodio['servico']){\n targetServico = service;\n break;\n }\n }\n var authGDHs = targetServico['listaGHDs'];\n var targetGDH;\n for (let it4 = 0; it4 < gdhList.length; it4++) {\n const gdh = gdhList[it4];\n if(gdh.id == episodio['gdh1']){\n targetGDH = gdh;\n break;\n }\n }\n if(authGDHs.indexOf(targetGDH['id']) == -1){\n var erro = {\n episodio: episodio,\n erro: ' o gdh definido '+targetGDH.gdh+' não está autorizado para o servico \"'+targetServico['servico']+'\"' \n };\n erros.push(erro);\n } \n }\n listaToAdd.push(episodio);\n }\n });\n \n\n \n if(listaToAdd.length == 0 && erros.length == 0){\n toastr(\"Selecione pelo menos um episódio para validar\", \"error\");\n return;\n }\n\n var errosValidacaoGDHModal=\"<div class='overlay'>\"+\n \"<div id='erros_validacao_pendente_gdh' class='modal bigModal'>\"+\n \"<h4 class='modal_title font-black'>Erro(s) ao validar episódio(s) <i onclick='closeModal();' class='fas fa-times-circle close_modal'></i></h4>\"+\n \"<span>Os seguintes episódios <span style='color:red'>não serão válidados</span> devido à existência de erros:</span>\"+\n \"<div id='episodios_com_erros_pendente_gdh' class='errors_modal_container'>\"+\n \"</div>\"+\n \"<div style='width:100%; height:1px; margin-top:15px; margin-bottom:15px; background: lightgrey;'></div>\"+\n \"<span>Assim sendo, apenas os seguintes episódios serão validados:</span>\"+\n \"<div id='episodios_sem_erros_pendente_gdh' class='errors_modal_container'>\"+\n \"</div>\"+\n \"<div style='margin-top:1vw'>\"+\n \"<button onclick='closeModal();' id='validarEpisodiosSemErros_pendente_gdh' class='confirm-btn'>Concluir</button>\"+\n \"</div>\"+\n \"</div>\"+ \n \"</div>\";\n if(erros.length > 0){\n $(\"body\").append(errosValidacaoGDHModal);\n var contaInconformes = 0;\n var contaConformes = 0;\n for (let it = 0; it < listaToAdd.length; it++) {\n const episodio = listaToAdd[it];\n var errosEpisodio = [];\n erros.forEach(function (error) {\n if(error.episodio == episodio){\n errosEpisodio.push(error);\n }\n });\n episodio['erros'] = errosEpisodio;\n \n if(episodio['erros'].length > 0){\n contaInconformes++;\n var errorString = \"<p>O episódio <b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome'];\n episodio['erros'].forEach(function(error) {\n errorString += \" \" + error.erro + \",\";\n });\n errorString = errorString.substring(0, errorString.length-1);\n errorString += \"<i style='color:red; margin-left:15px;' class='fas fa-times-circle'></i></p>\";\n $(\"#episodios_com_erros_pendente_gdh\").append(errorString);\n } else {\n contaConformes++;\n $(\"#episodios_sem_erros_pendente_gdh\").append(\"<p><b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome']+\" <i style='color:green; margin-left:15px;' class='fas fa-check-circle'></i></p>\");\n }\n }\n\n if(contaInconformes == 0){\n $(\"#episodios_com_erros_pendente_gdh\").append(\"<p><b>Nenhum episódio com erros</b></p>\");\n }\n if(contaConformes == 0){\n $(\"#episodios_sem_erros_pendente_gdh\").append(\"<p><b>Nenhum episódio será validado</b></p>\");\n }\n \n document.getElementById('validarEpisodiosSemErros_pendente_gdh').addEventListener('click', function(){\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n if(episodioValidado.erros.length == 0 ){\n listaToAddIds.push(episodioValidado['id']);\n }\n });\n realValidarPendenteGDH(listaToAddIds); \n });\n\n return;\n }\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n listaToAddIds.push(episodioValidado['id']);\n });\n realValidarPendenteGDH(listaToAddIds);\n}", "function handleStCCErr(err) {\n // Reset validation objects\n if (!$scope.validationErrors) {\n $scope.validationErrors = {\n source: {},\n billing: {\n address: {}\n }\n }\n }\n else if (!$scope.validationErrors.source) {\n $scope.validationErrors.source = {};\n }\n else if (!$scope.validationErrors.billing) {\n $scope.validationErrors.billing = {\n address: {}\n };\n }\n\n // Pick correct error code to switch on\n var errCode = err;\n if (err.data) {\n errCode = err.data;\n }\n\n $scope.chargeErr = errCode;\n\n switch (errCode) {\n case 'invalid_number':\n $scope.validationErrors.source.number = 'Please enter a valid number. You can use dashes or spaces to separate blocks of numbers if you choose';\n break;\n case 'incorrect_number':\n $scope.validationErrors.source.number = 'Please enter a correct number. You can use dashes or spaces to separate blocks of numbers if you choose';\n break;\n case 'card_declined':\n $scope.validationErrors.source.number = 'Your card has been declined.';\n break;\n case 'processing_error':\n $scope.validationErrors.source.number = 'There was an issue processing your payment. Please try again or contact our support team';\n break;\n case 'expired_card':\n $scope.validationErrors.source.number = 'This card has expired. Please use a different card';\n break;\n case 'invalid_expiry_month':\n $scope.validationErrors.source.exp_month = 'Please enter a valid expiry month';\n break;\n case 'invalid_expiry_year':\n $scope.validationErrors.source.exp_month = 'Please enter a valid expiry year';\n break;\n case 'invalid_cvc':\n $scope.validationErrors.source.cvc = 'Please enter a valid CVC';\n break;\n case 'incorrect_cvc':\n $scope.validationErrors.source.cvc = 'Please enter a correct CVC';\n break;\n case 'incorrect_zip':\n $scope.validationErrors.billing.address.postal_code = 'Please make sure postal code matches credit card billing address';\n $scope.validationErrors.source.number = 'Please make sure postal code matches credit card billing address';\n break;\n default:\n $scope.validationErrors.source.number = 'There was an issue processing your payment. Please try again or contact our support team';\n break;\n }\n }", "function validate(){\n let isErrors = false;\n let firstName = formReserve['firstName'];\n let lastName = formReserve['lastName'];\n let phone = formReserve['phone'];\n let email = formReserve['email'];\n let age = formReserve['birthdate'];\n let quantity = formReserve['quantity'];\n let location = formReserve['location'];\n let cgv = formReserve['cgv'];\n document.querySelectorAll('.error').forEach(error => error.remove());\n document.querySelectorAll('.error--bg').forEach(error => error.classList.remove('error--bg'));\n if(!nameCheked(firstName.value)){\n isErrors = true;\n firstName.classList.add('error--bg');\n firstName.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer 2 caractères ou plus pour le prénom.'));\n }\n if(!nameCheked(lastName.value)){\n isErrors = true;\n lastName.classList.add('error--bg');\n lastName.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer 2 caractères ou plus pour le nom.'));\n }\n if(!isPhone(phone.value)){\n isErrors = true;\n phone.classList.add('error--bg');\n phone.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer un numéro de téléphone valide.'));\n }\n if(!isEmail(email.value)){\n isErrors = true;\n email.classList.add('error--bg');\n email.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer une adresse mail valide.'));\n }\n if(!checkAge(age.value)){\n isErrors = true;\n age.classList.add('error--bg');\n age.insertAdjacentElement('afterend', createErrorSpan('Vous devez avoir au moins 18 ans.'));\n }\n if(!isNumeric(quantity.value)){\n isErrors = true;\n quantity.classList.add('error--bg');\n quantity.insertAdjacentElement('afterend', createErrorSpan('Veuillez entrer une valeur comprise entre 0 et 99.'));\n }\n if(!atLeastOneCheck(location)){\n isErrors = true;\n location[0].parentNode.classList.add('error--bg');\n document.getElementsByClassName(\"formData\")[6].insertAdjacentElement('afterend', createErrorSpan('Vous devez choisir au moins une ville.'));\n }\n if(!checkboxChecked(cgv)){\n isErrors = true;\n document.getElementsByClassName(\"checkbox2-label\")[0].children[0].classList.add('error--bg');\n document.getElementsByClassName(\"checkbox2-label\")[0].insertAdjacentElement('afterend', createErrorSpan('Vous devez accepter les termes et conditions.'));\n }\n if(isErrors == true){\n return false;\n } else {\n let participant = {\n firstname: firstName.value,\n lastname: lastName.value,\n phonenumber: phone.value,\n email: email.value,\n birthdate: age.value,\n previousparticipations : quantity.value,\n location: location.value\n };\n const bio = () => {\n this.firstName + this.lastname + 'né(e) le' + this.birthdate + 'tél : ' + this.phonenumber + this.email + 'A déjà participé : ' + this.previousparticipation + 'à' + this.location + '.';\n } \n formReserve.style.display = 'none';\n modalBody.classList.add('message-sended');\n valmessage.innerHTML='Merci, votre formulaire a bien été envoyé !';\n modalBody.append(valmessage);\n buttonClose.classList.add('button','button:hover','button-close');\n buttonClose.innerHTML = \"Fermer\";\n modalBody.appendChild(buttonClose);\n buttonClose.addEventListener (\"click\", closeModal);\n return false; \n }\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 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}", "validate() {\n this.errorMessage = \"Dit is geen text\";\n super.validate();\n }", "function Validacion_Create(e){\n //Esta linea detiene el envio al POST para validarlo\n e.preventDefault();\n try{\n console.log('Validando formulario Insumos!');\n if(this.querySelector('[name=Descripcion]').value == '') { \n console.log('La Descripcion esta vacía');\n ejecutaAlertaError(\"Descripcion\");\n // alert(\"Error! La Descripcion esta vacía, por favor complete el campo\")\n return;\n }\n if(this.querySelector('[name=DescripcionAbre]').value == '') { \n console.log('La DescripcionAbre esta vacía');\n ejecutaAlertaError(\"Descripcion Abreviada\");\n return;\n }\n\n this.submit();\n\n }\n catch{\n ejecutaAlertaError();\n }\n\n \n }", "function validateNuevoArticulo() {\n /*elements for focus*/\n var inTitulo = document.getElementById(\"article-title\");\n var txtContenido = document.getElementById(\"article-content\");\n var txtFuente = document.getElementById(\"article-source\");\n\n /*elements for test*/\n var tituloValue = inTitulo.value.trim();\n var contenidoValue = txtContenido.value.trim();\n var fuenteValue = txtFuente.value.trim();\n\n /*elements for errors*/\n var errorTitulo = document.getElementById(\"title-error\");\n var errorContenido = document.getElementById(\"content-error\");\n var errorFuente = document.getElementById(\"source-error\");\n var generalError = document.getElementsByClassName(\"general-errors\")[0];\n\n errorTitulo.innerHTML = '';\n errorContenido.innerHTML = '';\n errorFuente.innerHTML = '';\n generalError.innerHTML = '';\n\n var cont = 0, errors = [];\n errors[0] = '<span>El campo no debe quedar vacío.</span>';\n errors[1] = '<span>Ingresar un valor más específico.</span>';\n errors[2] = '<span>El contenido debe tener más texto.</span>';\n\n /*validate titulo*/\n if (tituloValue === '') {\n cont++;\n errorTitulo.innerHTML = errors[0];\n if (cont == 1) inTitulo.focus();\n } else if (tituloValue.length < 15) {\n cont++;\n errorTitulo.innerHTML = errors[1];\n if (cont == 1) inTitulo.focus();\n }\n\n /*validate contenido*/\n if (contenidoValue === '') {\n cont++;\n errorContenido.innerHTML = errors[0];\n if (cont == 1) txtContenido.focus();\n } else if (contenidoValue.length < 700) {\n cont++;\n errorContenido.innerHTML = errors[2];\n if (cont == 1) txtContenido.focus();\n }\n\n /*validate titulo*/\n if (fuenteValue === '') {\n cont++;\n errorFuente.innerHTML = errors[0];\n if (cont == 1) txtFuente.focus();\n } else if (fuenteValue.length < 15) {\n cont++;\n errorFuente.innerHTML = errors[1];\n if (cont == 1) txtFuente.focus();\n }\n\n /*results*/\n if (cont > 0) {\n generalError.innerHTML = '<span>Hay '+cont+' campo(s) por completar.</span>';\n return false;\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 validarFormulario(){\n var nombre = document.getElementById(\"nombre\");\n var apellidos = document.getElementById(\"apellido\");\n var telefono = document.getElementById(\"telefono\");\n //console.log(nombre.value);\n \n var etiqueta_error_nombre = document.getElementById(\"error-nombre\")\n if(nombre.value< String.length) {\n // alert(\"Requerido\");\n etiqueta_error_nombre.innerHTML = \"Requerido\";\n // Cambio de estilo a través de JS. Pongo borde rojo en esta condición.\n document.getElementById(\"nombre\").style.border = \"1px solid red\";\n } else {\n etiqueta_error_nombre.innerHTML = \"\";\n document.getElementById(\"nombre\").style.border = \"\";\n } \n \n var etiqueta_error_apellido = document.getElementById(\"error-apellido\");\n if(apellidos.value=='') {\n //alert(\"Requerido\");\n etiqueta_error_apellido.innerHTML = \"Requerido\";\n \n document.getElementById(\"apellido\").style.border = \"1px solid red\";\n } else {\n etiqueta_error_apellido.innerHTML =\"\";\n document.getElementById(\"apellido\").style.border = \"\";\n }\n \n var etiqueta_error_telefono = document.getElementById(\"error-telefono\"); \n if(telefono.value=='') {\n //alert(\"Requerido\");\n etiqueta_error_telefono.innerHTML = \"Requerido\";\n document.getElementById(\"telefono\").style.border = \"1px solid red\";\n } else {\n etiqueta_error_telefono.innerHTML = \"\";\n document.getElementById(\"telefono\").style.border = \"\";\n }\n \n// var errores = document.getElementsByClassName(\"error\");\n// \n// for(i=0;i<errores.length;i++){\n// console.log(errores[i]);\n// errores[i].innerHTML = \"Requerido\"\n// }\n// console.log(errores);\n \n// alert(\"Estamos validando el formulario\");\n \n \n return;\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 ManageErrors(commandcalledName, data) {\n selecteditem.error = Translate(\"Error\" + commandcalledName + data.error.errorCode);\n\n if (selecteditem.error.length === 0) {\n selecteditem.error = data.error.errorMessage; //to translate --> The Cannot prepare an ES ticket becouse scenario step id 2 is not valid.\n }\n }", "function validarGuardadoPrimeraSucursal(){\n\n\tvar sw = 0; // variable para determinar si existen campos sin diligenciar\n\n\t\n\tif( $(\"#sucursal_nombre\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_nombre\").addClass( \"active\" );\n\t\t$(\"#sucursal_nombre\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#sucursal_telefono1\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_telefono1\").addClass( \"active\" );\n\t\t$(\"#sucursal_telefono1\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\n\t\n\t\n\tif( $(\"#sucursal_celular\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_celular\").addClass( \"active\" );\n\t\t$(\"#sucursal_celular\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\n\t\n\t\n\tif( $(\"#sucursal_direccion\").val().trim().length == 0 ){\n\t\t\n\t\t$(\"#label_sucursal_direccion\").addClass( \"active\" );\n\t\t$(\"#sucursal_direccion\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idPais\").val() == '0' ){\n\t\t\n\t\t$(\"#label_sucursal_pais\").addClass( \"active\" );\n\t\t$(\"#pais\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idCiudad\").val() == '0' ){\n\t\t\n\t\t$(\"#label_sucursal_ciudad\").addClass( \"active\" );\n\t\t$(\"#ciudad\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif( $(\"#idBarrio\").val() == '0'){\n\t\t\n\t\t$(\"#label_sucursal_barrio\").addClass( \"active\" );\n\t\t$(\"#barrio\").addClass( \"invalid\" );\n\t\tsw = 1;\n\t}\t\n\t\n\n\tif(sw == 1){\n\t\treturn false;\n\t}else{\n\t\t$(\"#form_primeraSucursal\").submit();\n\t}\n \n}", "function ControlData(pu, qte){\n try {\n if(isNaN(pu)) throw \"Entrer un Prix Unitaire correct\";\n if(isNaN(qte)) throw \"Entrer une Quantité correct\";\n if(parseFloat(pu) == NaN) throw \"Le Prix Unitaire n'est pas correct\";\n if(parseFloat(qte) != parseInt(qte)) throw \"La Quantité doit être un nombre entier\";\n \n }\n catch(error){\n alert(error);\n return;\n }\n return true;\n}", "checkIsValid() {\n if (!this.isValid) {\n this.errors.push({\n field: this.fieldName,\n message: this.message,\n valueRecieved: this.fieldValue,\n });\n }\n }", "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 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 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 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 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 validarFormPerfil(){\n\tvar error = false;\n\tvar seccion = \"\";\n\t//SECCION DATOS PERSONALES\n\tif (error == false){\n\t\tif ($('#dat_Nombre').val().trim() == ''){\n\t\t\talerta('Ingrese su nombre', 'error');\n\t\t\tsetInputInvalid('#dat_Nombre');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_Apellido').val().trim() == ''){\n\t\t\talerta('Ingrese su apellido', 'error');\n\t\t\tsetInputInvalid('#dat_Apellido');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_CUIL').val().trim() == ''){\n\t\t\talerta('Ingrese su CUIL/CUIL', 'error');\n\t\t\tsetInputInvalid('#dat_CUIL');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_FechaNac').val().trim() == ''){\n\t\t\talerta('Ingrese su fecha de nacimiento', 'error');\n\t\t\tsetInputInvalid('#dat_FechaNac');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_Sexo').val().trim() == ''){\n\t\t\talerta('Seleccione su sexo', 'error');\n\t\t\tsetInputInvalid('#dat_Sexo');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_EstadoCivil').val().trim() == ''){\n\t\t\talerta('Seleccione su estado civil', 'error');\n\t\t\tsetInputInvalid('#dat_EstadoCivil');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_TipoDoc').val().trim() == ''){\n\t\t\talerta('Seleccione tipo de documento', 'error');\n\t\t\tsetInputInvalid('#dat_TipoDoc');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_Nacionalidad').val().trim() == ''){\n\t\t\talerta('Seleccione su nacionalidad', 'error');\n\t\t\tsetInputInvalid('#dat_Nacionalidad');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\t//VALIDAR EL DOMICILIO \n\tif (error == false){\n\t\tif ($(\"#postal_code\").val() == \"\"){\n\t\t\talerta(\"Debe completar el código postal\", 'error');\n\t\t\tsetInputInvalid('#postal_code');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($(\"#locality\").val() == \"\"){\n\t\t\talerta(\"Debe completar la localidad\", 'error');\n\t\t\tsetInputInvalid('#locality');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (($(\"#administrative_area_level_2\").val() == \"\") || ($(\"#administrative_area_level_1\").val() == \"\")){\n\t\t\talerta(\"Debe completar el partido y provincia\", 'error');\n\t\t\tsetInputInvalid('#administrative_area_level_2');\n\t\t\tsetInputInvalid('#administrative_area_level_1');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (($(\"#route\").val() == \"\") || ($(\"#street_number\").val() == \"\")){\n\t\t\talerta(\"Debe completar la calle y el número de su domicilio personal\", 'error');\n\t\t\tsetInputInvalid('#route');\n\t\t\tsetInputInvalid('#street_number');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\n\n\t//FIN VALIDAR DOMICILIO \n\t// VALIDAR CONTACTO \n\tif (error == false){\n\t\tif ($('#dat_Email').val().trim() == ''){\n\t\t\talerta('Ingrese su email', 'error');\n\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\tsetInputInvalid('#dat_Email');\t\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (!validarMail($('#dat_Email').val().trim())){\n\t\t\talerta('Formato de email invalido', 'error');\n\t\t\tvalidarTuMail('dat_Email');\n\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\tsetInputInvalid('#dat_Email');\t\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_TelCelular').val().trim() == ''){\n\t\t\talerta('Ingrese su número de celular', 'error');\n\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\tsetInputInvalid('#dat_TelCelular');\t\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tif(!validarTelefono($('#dat_TelCelular').val())){\n\t\t\t\talerta('Formato de teléfono no válido', 'error');\n\t\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\t\tsetInputInvalid('#dat_TelCelular');\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t// FIN VALIDACIÖN CONTACTO \n\n\t//VALIDAR LOS FAMILIARES \n\t//VALIDA LOS APELLIDOS DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_apellido]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Ingrese el apellido de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t);\n\t}\n\t//VALIDA LOS NOMBRES DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_nombre]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Ingrese el nombre de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t);\n\t}\n\t\n\t//VALIDA LOS TIPOS DE DOCUMENTOS DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"select[name^=field_tipo]\").each(\n\t\t\tfunction(){\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione el tipo de documento de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\t$(this).addClass('invalid');\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDA LOS DOCUMENTOS DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_documento]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && ((this.value.length > 8) || (this.value.length < 7))){\n\t\t\t\t\talerta(\"El documento del familiar es incorrecto\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\t\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\tif ((error == false) && ($.isNumeric(this.value) == false)){\n\t\t\t\t\talerta(\"El documento del familiar es incorrecto\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\tsetInputInvalid(\"#field_documento\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDA EL PARENTESCO CON LOS FAMILIARES\n\tif (error == false){\n\t\t\n\t\t$(\"select[name^=field_parentesco]\").each(\n\t\t\tfunction(){\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione el parentesco con su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDA EL SEXO DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"select[name^=field_sexo]\").each(\n\t\t\tfunction(){\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione sexo de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDAR LAS FECHAS DE NACIMIENTO DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_nacimiento]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && (this.value == \"\")){\n\t\t\t\t\talerta(\"Ingrese la fecha de nacimiento de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\t\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\n\t\t\t}\n\t\t);\n\t}\n\t//DISCAPACIDAD\n\tif (error == false){\n\t\t\n\t\t$(\"select[name^=field_discapacitado]\").each(\n\t\t\t\n\t\t\tfunction(){\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione si tiene discapacidad su familiar \", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t);\n\t}\n\t//FIN VALIDACIÖN FAMILIARES\n\n\t//VALIDAR RELACION LABORAL \n\n\tif (error == false){\n\t\t//VALIDA LA RELACIÓN LABORAL \n\t\tif (($(\"#lab_rel\").val() == \"\")){\n\t\t\talerta(\"Complete la relación laboral de su cargo actual\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#lab_rel');\t\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\t//validar que seleccione organismo y estructura\n\t\tif (($(\"#lab_organismo\").val() == \"\") || ($(\"#lab_estructura_id\").val() == \"\")){\n\t\t\t$(\"#lab_estructura\").focus();\n\t\t\talerta(\"Complete el organismo y estructura donde posee cargo de revista\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#lab_estructura');\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (($(\"#lab_organismo2\").val() == \"\") || ($(\"#lab_estructura2_id\").val() == \"\")){\n\t\t\t$(\"#lab_estructura2\").focus();\n\t\t\talerta(\"Complete el organismo y estructura donde presta servicio\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#lab_estructura2');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#postal_code2\").val() == \"\"){\n\t\t\talerta(\"Debe completar el código postal\", 'error');\n\t\t\tsetInputInvalid('#postal_code2');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#locality2\").val() == \"\"){\n\t\t\talerta(\"Debe completar la localidad\", 'error');\n\t\t\tsetInputInvalid('#locality2');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\terror = true;\n\t\t}\n\t}\n\n\t\n\tif (error == false){\n\t\tif (($(\"#route2\").val() == \"\") || ($(\"#street_number2\").val() == \"\")){\n\t\t\talerta(\"Debe completar la calle y el número de su domicilio laboral\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#route2');\n\t\t\tsetInputInvalid('#street_number2');\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\n\t\tif (($(\"#administrative_area_level_2\").val() == \"\") || ($(\"#administrative_area_level_1\").val() == \"\")){\n\t\t\talerta(\"Debe completar el partido y provincia\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#administrative_area_level_2');\n\t\t\tsetInputInvalid('#administrative_area_level_1');\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#pais_dom\").val() == 0){\n\t\t\talerta(\"El domicilio seleccionado no es de Argentina\", 'error');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#pais_dom2\").val() == 0){\n\t\t\talerta(\"El domicilio laboral seleccionado no es de Argentina\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif(error == false ){\n\t\t$('#dat_NroDocumento').attr('disabled', false);\n\t\t$('#route').attr('disabled', false);\n\t\t$('#street_number').attr('disabled', false);\n\t\t$('#locality').attr('disabled', false);\n\t\t$('#administrative_area_level_2').attr('disabled', false);\n\t\t$('#administrative_area_level_1').attr('disabled', false);\n\t\t$('#route2').attr('disabled', false);\n\t\t$('#street_number2').attr('disabled', false);\n\t\t$('#locality2').attr('disabled', false);\n\t\t$('#administrative_area_level_22').attr('disabled', false);\n\t\t$('#administrative_area_level_12').attr('disabled', false);\n\t\t$('#postal_code').attr('disabled', false);\n\t\t$('#postal_code2').attr('disabled', false);\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n\t\n\t\n\t\n\t\n}", "validateValues() {\n if (this.getBeer() == undefined) {\n return chalk.bgRed('Error reading beer details');\n } else if (this.getTemperature() == undefined) {\n return chalk.bgRed('Error reading container temperature');\n } else if (this.getBeer().getMinTemperature() == undefined && this.getBeer().getMaxTemperature() == undefined) {\n return chalk.bgRed('Error reading beer temperature');\n } else {\n return '';\n }\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}", "function validarFormulario(){\n // removemos el div con la clase alert\n $('.alert').remove();\n\n\n // declarion de variables\n var asunto=$('#asunto').val(),\n correo_D=$('#correo_D').val(),\n correo_E=$('#correo_E').val(),\n mensaje=$('#mensaje').val();\n\n // validamos el correo emisor\n if(correo_E==\"\" || correo_E==null){\n\n cambiarColor(\"correo_E\");\n // mostramos le mensaje de alerta\n mostraAlerta(\"Campo obligatorio\");\n return false;\n }else{\n var expresion= /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n if(!expresion.test(correo_E)){\n // muestra el mesaje que debe ingresar un nombre válido\n cambiarColor(\"correo_E\");\n mostraAlerta(\"Por favor ingrese un correo válido\");\n return false;\n }\n }\n \n\n // validamos el correo destino\n if(correo_D==\"\" || correo_D==null){\n\n cambiarColor(\"correo_D\");\n // mostramos le mensaje de alerta\n mostraAlerta(\"Campo obligatorio\");\n return false;\n }else{\n var expresion= /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/;\n if(!expresion.test(correo_D)){\n // muestra el mesaje que debe ingresar un correo válido\n cambiarColor(\"correo_D\");\n mostraAlerta(\"Por favor ingrese un correo válido\");\n return false;\n }\n }\n\n // valido el asunto\n if(asunto==\"\" || asunto==null){\n cambiarColor(\"asunto\");\n // mostramos le mensaje de alerta\n mostraAlerta(\"Campo obligatorio\");\n return false;\n }else{\n var expresion= /^[,\\\\.\\\\a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]*$/;\n if(!expresion.test(asunto)){\n // mostrara el mesaje que debe ingresar un texto válido en el asunto\n cambiarColor(\"asunto\");\n mostraAlerta(\"No se permiten caracteres especiales\");\n return false;\n }\n }\n\n return true;\n \n}", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\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 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 validateInputValue($obj){\n if($obj.val() == ''){\n $obj.css('background',\"#ffa8a8\");\n validationObjects[$obj[0].id][1] = false;\n // wysyłam error do wyswietlenia\n errorService(true, 'Pole ' + validationObjects[$obj[0].id][0] + ' nie może być puste', $obj[0].id + \"Error\");\n } \n\telse if($obj[0].id == 'phoneNumber'){\n // nie ma dokładnie 9 znaków:\n if($obj.val().length != 9){\n $obj.css('background',\"#ffa8a8\");\n validationObjects[$obj[0].id][1] = false;\n // wysyłam error do wyswietlenia\n errorService(true, 'Pole ' + validationObjects[$obj[0].id][0] + ' musi zawierać 9 cyfr', $obj[0].id + \"Error\");\n } \n // phoneNumber zawiera też litery lub znaki specjalne\n else if(isNaN($obj.val())){\n $obj.css('background',\"#ffa8a8\");\n validationObjects[$obj[0].id][1] = false;\n // wysyłam error do wyswietlenia\n errorService(true, 'Pole ' + validationObjects[$obj[0].id][0] + ' nie może zawierać liter lub znaków specjalnych', $obj[0].id + \"Error\");\n } \n // phoneNumber poprawne\n else {\n $obj.css('background',\"white\");\n validationObjects[$obj[0].id][1] = true;\n // wysyłam info żeby usunąć error jesli taki był\n errorService(false, \"\" , $obj[0].id + \"Error\");\n }\n }\n\telse{\n $obj.css('background',\"white\");\n validationObjects[$obj[0].id][1] = true;\n // wysyłam info żeby usunąć error jesli taki był\n errorService(false, \"\" , $obj[0].id + \"Error\");\n }\n disableOrEnableEditButton();\n}", "function validate_items() {\n\tvar selected = $(\".padding\"); // vsechny spravne polozky\t\n\tvar err = 0; // pocet chyb\n\t\n\tfor(let i = 0; i < selected.length; i++) { // neco co nemelo byt zaskrtnute zaskrtnul\n\t\tif($(selected[i]).hasClass(\"striked\")) {\n\t\t\t\terr++;\n\t\t\t}\n\t}\n\n\tvar striked = $(\".striked\");\n\tif(striked.length < 13)\n\t\terr += (13-striked.length);\t\n\t\n $(\"#errcount\").val(err); // zvaliduj kolik tam ma chyb\n $(\"#dialogform3\").submit(); // odesli formular a hod sem dalsi test\n\t\n}", "function validar_add_entregable(){\n\tif(document.getElementById('sel_etapa').value=='-1'){\n\t\tmostrarDiv('error_especie');\n\t\treturn false;\n\t}\n\tif(document.getElementById('txt_entregable').value==''){\n\t\tmostrarDiv('error_entregable');\t\n\t\treturn false;\n\t}\n\tdocument.getElementById('frm_add_entregable').action='?mod=entregables&task=saveAdd';\n\tdocument.getElementById('frm_add_entregable').submit();\n}", "function validarCampo() {\n // se valida la longitud del tecto y que este no este vacio\n validarLongitud(this);\n\n // validad unicamente el email\n if (this.type === \"email\") {\n validarEmail(this);\n }\n let errores = document.querySelectorAll(\".error\");\n if (email.value !== \"\" && asusto.value !== \"\" && mensaje.value !== \"\") {\n if (errores.length === 0) {\n btnEnviar.disabled = false;\n }\n }\n}", "function validate_input() {\n\tvar err = 0; // pocet chyb\n\tfor(let i = 0; i < 9; i++) {\n\t\tif(user_order[i] !== order[i])\n\t\t\terr++;\n\t}\n\t$('#errcount').val(err);// ukaz tlacitko odeslani a zvaliduj napred\n\t$('#dialogform1').toggleClass(\"disappear\"); // ukaz odesilaci formular\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", "function validarReglas(){\n try{\n pnlCgg_res_beneficiario.getEl().mask('Validando...', 'x-mask-loading');\n var flagResultado = 'true'; \n\n //El auspiciante ya esta establecido en la apertura del formulario. \n crperNumDocIdentific = txtCrben_num_doc_identific.getValue(); \n cggCrperFechaNacimiento = dtCrper_fecha_nacimiento.getValue().format('d/m/Y');\n //cggcrperCodigo = txtCrben_codigo.getValue();\n var jsonData = {\n 'CRPER_CODIGO':crperCodigo,\n 'CGGCRPER_CODIGO':cggcrperCodigo,\n 'CRPER_NUM_DOC_IDENTIFIC':crperNumDocIdentific,\n 'CRPER_FECHA_NACIMIENTO':cggCrperFechaNacimiento\n };\n var param = new SOAPClientParameters();\n var tmpEvaluacion = evaluarReglasValidacion();\n param.add('inJSON_reglas_validacion',tmpEvaluacion);\n param.add('jsonData',JSON.stringify(jsonData));\n var r = SOAPClient.invoke(URL_WS+'Cgg_regla_validacion' ,'ejecutarReglaTipoSolicitud',param, false, null);\n\n var validacion = Ext.util.JSON.decode(r);\n\n if(validacion.resultadoValidacion != undefined){\n if(validacion.resultadoValidacion == 'false'){\n var objCgg_regla_validacion = new FrmListadoCgg_regla_validacion_resultado(validacion);\n objCgg_regla_validacion.loadData();\n objCgg_regla_validacion.show();\n }\n flagResultado = validacion.resultadoValidacion;\n }\n pnlCgg_res_beneficiario.getEl().unmask();\n return flagResultado;\n }catch(inErr){\n Ext.MsgPopup.msg(tituloCgg_res_beneficiario, \"No se ha podido validar la informaci\\u00f3n a almacenar.<br>Error:\"+inErr);\n pnlCgg_res_beneficiario.getEl().unmask();\n return 'false';\n }\n }", "function accionCrear()\n\t{\n\n//\t\talert(\"accionCrear\");\n\t\tif(listado1.datos.length != 0)\n\t\t{\n\t\t\tvar orden = listado1.codSeleccionados();\n//\t\t\talert(\"Linea seleccionada \" + orden);\n\t\t\tset('frmPBuscarTiposError.hidOidCabeceraMatrizSel', orden);\n\t\t\tset('frmPBuscarTiposError.accion', 'crear');\n\t\t\tenviaSICC('frmPBuscarTiposError');\n\n\t\t}else\n\t\t{\n\t\t\talert(\"no hay seleccion: \" + listado1.datos.length);\n\t\t}\n\t}", "function validadarFormulario(){\r\n\r\n\tlet errorMsg=''; \r\n\tlet bError=false;\r\n\r\n\tif (inputIdentificacion.value=='') {\r\n\r\n\t\tinputIdentificacion.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{\r\n\r\n\t\tinputIdentificacion.classList.remove('bordeError');\r\n\t}\r\n\r\n\r\n\tif(inputNombre.value=='') {\r\n\r\n\t\tinputNombre.classList.add('bordeError');\r\n\t\terrorMsg='Debe escribir un nombre';\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputNombre.classList.remove('bordeError');\r\n\t}\r\n\r\n\r\n\tif(inputApellido.value=='') {\r\n\r\n\t\tinputApellido.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputApellido.classList.remove('bordeError');\r\n\t}\r\n\t\r\n\tif(inputSegundoApellido.value==''){\r\n\t\tinputSegundoApellido.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{\r\n\t\tinputSegundoApellido.classList.remove('bordeError');\r\n\t}\r\n\r\n\r\n\tif(inputTelPersonal.value==''){\r\n\r\n\t\tinputTelPersonal.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{\r\n\r\n\t\tinputTelPersonal.classList.remove('bordeError');\r\n\r\n\t}\r\n\r\n\r\n\tif(inputFechaNacimiento.value=='') {\r\n\r\n\t\tinputFechaNacimiento.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputFechaNacimiento.classList.remove('bordeError');\r\n}\r\n\r\n\r\n\tif(inputDireccion.value=='') {\r\n\r\n\t\tinputDireccion.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{ \r\n\t\tinputDireccion.classList.remove('bordeError');\r\n}\r\n\r\n\tif(inputTelCasa.value=='') {\r\n\r\n\t\tinputTelCasa.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputTelCasa.classList.remove('bordeError');\r\n}\r\n\r\n\r\n\tif(inputGrupoSanguineo.value=='') {\r\n\r\n\t\tinputGrupoSanguineo.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputGrupoSanguineo.classList.remove('bordeError');\r\n}\r\n\r\n\tif(inputDonador.value=='') {\r\n\r\n\t\tinputDonador.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{ \r\n\t\tinputDonador.classList.remove('bordeError');\r\n}\r\n\r\n\tif(inputFoto.value=='') {\r\n\r\n\t\tinputFoto.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t\r\n}\r\n//else{ \r\n\t//\tinputFoto.classList.remove('bordeError');\r\n//}\r\n\r\n\tif(inputBeca.value=='') {\r\n\r\n\t\tinputBeca.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{ \r\n\t\tinputBeca.classList.remove('bordeError');\r\n}\r\n\r\n\tif(inputNombreContacto1.value=='') {\r\n\r\n\t\tinputNombreContacto1.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{ \r\n\t\tinputNombreContacto1.classList.remove('bordeError');\r\n}\r\n\r\n\t\tif(inputParentesco1.value=='') {\r\n\r\n\t\tinputParentesco1.classList.add('bordeError');\r\n\t\t\tbError=true;\r\n\t}else{ \r\n\t\tinputParentesco1.classList.remove('bordeError');\r\n}\r\n\r\n\tif(inputTelContacto1.value=='') {\r\n\t\t\r\n\t\tinputTelContacto1.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputTelContacto1.classList.remove('bordeError');\r\n}\r\n\r\n\tif(inputCondicionMedica.value=='') {\r\n\t\r\n\t\tinputCondicionMedica.classList.add('bordeError');\r\n\t\tbError=true;\r\n\t}else{ \r\n\t\tinputCondicionMedica.classList.remove('bordeError');\r\n}\r\n\r\nif(inputComprobante.value==''){\r\n\tinputComprobante.classList.add('bordeError');\r\n\tbError=true;\r\n\t}else{\r\n\r\n\t\tinputComprobante.classList.remove('bError')\r\n\t}\r\n\r\n\r\n\r\n\tif(inputInstitucion.value=='') {\r\n\r\n\t\tinputInstitucion.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputInstitucion.classList.remove('bordeError');\r\n}\r\n\r\n\t\tif(inputNivel.value=='') {\r\n\t\tinputNivel.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\t}else{ \r\n\t\tinputNivel.classList.remove('bordeError');\r\n}\r\n\r\n\t\r\n\tif(inputSeccion.value=='') {\r\n\t\tinputSeccion.classList.add('bordeError');\r\n\t\tbError=true;\r\n\r\n\r\n\t}else{ \r\n\t\tinputSeccion.classList.remove('bordeError');\r\n}\r\n\r\n\treturn bError;\r\n\r\n}", "onInvalid(errors) {\n console.log(errors);\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 }", "imprimirErros(erros) {\n let imprimir = \"\";\n this.validador.style.display = \"block\";\n erros.forEach((valor) => {\n imprimir += `${valor} <br>`;\n this.validador.innerHTML = imprimir;\n })\n }", "function validateForm ()\n {\n\n //Variabele om errors bij te houden\n\n let numberOfErrors = 0;\n\n //Check voornaam\n\n let voornaam = document.getElementById(\"voornaam\");\n let voornaamSpan = document.querySelector(\"#voornaam + span\");\n\n if(voornaam.value.length > 30)\n {\n voornaam.style.borderColor = \"red\";\n voornaamSpan.innerText = \"max 30 karakters !\";\n voornaamSpan.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(voornaam, voornaamSpan, numberOfErrors);\n\n }\n\n //Check familienaam\n\n let familienaam = document.getElementById(\"familienaam\");\n let familienaamSpan = document.querySelector(\"#familienaam + span\");\n\n if(familienaam.value === '' || familienaam.value === ' ')\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Het veld is verplicht !\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else\n {\n if(familienaam.value.length > 50)\n {\n familienaam.style.borderColor = \"red\";\n familienaamSpan.innerText = \"Max 50 karakters\";\n familienaamSpan.style.color = \"red\";\n numberOfErrors += 1;\n }\n else //terugzetten van de kleur als er geen fout meer is.\n {\n resetStyle(familienaam, familienaamSpan, numberOfErrors);\n }\n }\n\n\n\n //Check geboortedatum\n\n let geboortedatum = document.getElementById(\"geboortedatum\");\n let geboortedatumSpan = document.querySelector(\"#geboortedatum + span\");\n\n\n //Gebruik regex expressie. Bemerk dat de expressie tussen twee slashes moet staan.\n\n let regex = /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/;\n\n //We gebruiken de test() method die we aanroepen over een regex expressie\n //Zie https://www.w3schools.com/js/js_regexp.asp\n //Check dat geboortedatum niet leeg is en dan niet aan het patroon voldoet\n\n if(geboortedatum.value !== '' && regex.test(geboortedatum.value) === false)\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Formaat is niet YYYY-MM-DD !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n //Check of geboortedatum leeg is\n\n if(geboortedatum.value === '')\n {\n numberOfErrors += 1;\n geboortedatum.style.borderColor = \"red\";\n geboortedatumSpan.innerText = \"Geboortedatum is een verplicht veld !\";\n geboortedatumSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(geboortedatum, geboortedatumSpan, numberOfErrors);\n }\n }\n\n //Check e-mail\n\n let email = document.getElementById(\"email\");\n let emailSpan = document.querySelector(\"#email + span\");\n\n //Regex voor mail geplukt van https://emailregex.com/\n\n regexMail =\n /^(([^<>()\\[\\]\\\\.,;:\\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 //Check email tegen regexMail\n\n if(regexMail.test(email.value) === false)\n {\n numberOfErrors += 1;\n email.style.borderColor = \"red\";\n emailSpan.innerText = \"Geen geldig email adres !\";\n emailSpan.style.color = \"red\";\n }\n\n else\n {\n //Check of email ingevuld is\n\n if(email.value === '' || email.value === ' ')\n {\n numberOfErrors += 1;\n emailSpan.innerText = \"Verplicht veld !\";\n emailSpan.style.color = \"red\";\n email.style.borderColor = \"red\";\n }\n else\n {\n resetStyle(email, emailSpan, numberOfErrors);\n }\n }\n\n //Check aantal kinderen\n\n let aantalKinderen = document.querySelector(\"#aantalKinderen\");\n let aantalKinderenSpan = document.querySelector(\"#aantalKinderen + span\");\n\n if(aantalKinderen.value < 0)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"is geen positief getal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n if(aantalKinderen.value > 99)\n {\n numberOfErrors += 1;\n aantalKinderen.style.borderColor = \"red\";\n aantalKinderenSpan.innerText = \"te hoog aantal\";\n aantalKinderenSpan.style.color = \"red\";\n }\n else\n {\n resetStyle(aantalKinderen, aantalKinderenSpan, numberOfErrors);\n }\n }\n\n //Geef alert als het formulier volledig correct is\n\n if(numberOfErrors === 0)\n {\n alert(\"formulier correct ingevuld !\")\n }\n }", "function validate_variables(){\n\ttry{\n\t\tif (!flagValidateVariablesOnOperationCompletion) return true;\n\t\t\n\t\t// проверим сначала заполнение полей из родительского лимита \n\t\tvalid = true;\n\t\ttry {\n\t\t\t// нужно ли проверять? на том ли этапе?\n\t\t\tif (document.getElementById(\"checkParentStage\").value == \"true\") {\n\t\t\t\tvalid = checkParentAllowedFilled();\n\t\t\t\tif (!valid) {\n\t\t\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n\t\t\t\t\tdocument.getElementById(\"errorMessage\").innerHTML='Параметры не соответствуют родительскому Лимиту. Необходимо либо привести параметры к значениям, указанным в Лимите (Сублимите), либо установить признак \"индивидуальные условия\"<br /><br />';\n\t\t\t\t\treturn valid; // false\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Err) {\t}\n\t\t\n\t\tdocument.getElementById(\"errorMessage\").innerHTML=''\n\t\tvalid = true;\n\t\tvalid = checkRequiredFields();\n\t\t\n\t\tvar ctarray = document.getElementsByName(\"ContractorTypeValidateDiv\");\n\t\tfor (var i=0;i<ctarray.length;i++){\n\t\t\tnobody_checked = true;\n\t\t\tobjDiv = ctarray[i].parentElement;\n\t\t\tvar input_array = objDiv.getElementsByTagName(\"input\");\n\t\t\tfor (var j=0;j<input_array.length;j++){\n\t\t\t\tif(input_array[j].checked==true){\n\t\t\t\t\tnobody_checked=false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(nobody_checked){\n\t\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n\t\t\t\tdocument.getElementById(\"errorMessage\").innerHTML=document.getElementById(\"errorMessage\").innerHTML+\n\t\t\t\t'Необходимо указать тип контрагента<br /><br />';\n\t\t\t\tvalid=false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n//\t\tvar ctarray = document.getElementsByName(\"Категория качества ссуды\");\n//\t\tfor (var i=0;i<ctarray.length;i++){\n//\t\t\tvar objSel = ctarray[i];\n//\t\t\tif (objSel.selectedIndex==0){\n//\t\t\t\tdocument.getElementById(\"errorMessage\").style.display = \"inline\";\n//\t\t\t\tdocument.getElementById(\"errorMessage\").innerHTML=document.getElementById(\"errorMessage\").innerHTML+\n//\t\t\t\t'Необходимо заполнить поле \"Категория качества ссуды: не ниже\"<br /><br />';\n//\t\t\t\tvalid=false;\n//\t\t\t}\n//\t\t\t\n//\t\t}\n\t\treturn valid;\n\t} catch(err){\n\t\treturn true;\n }\n}", "validate() {\n const errors = [];\n if (!this.gtin) {\n errors.push('gtin is required.');\n }\n if (!this.quantity) {\n errors.push('quantity is required.');\n } else if (this.quantity < 0) { // TODO accept zero quantity ?\n errors.push('quantity cannot be negative.');\n }\n if (!this.requesterId) {\n errors.push('requesterId is required.');\n }\n if (!this.senderId) {\n errors.push('senderId is required.');\n }\n\n return errors.length === 0 ? undefined : errors;\n }", "function Validar(){\r\n error.innerHTML=\"\";\r\n\r\n ValidarNombre();\r\n ValidarCategoria();\r\n ValidarPrecio();\r\n ValidarCantidad();\r\n}", "function validateFieldsIF(){\n \n console.log(\"ENTRA\");\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n\n $(\".requisito\").each(function(index,value){\n\n id = $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo = $(value).children(\".nombre_requisito\").text();\n estatusViejo = $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n {\n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "function ValidarRegistro()\n{\n\n var porId = document.getElementById(\"nombre\").value;\n var porId2 = document.getElementById(\"estatus\").value;\n \n $(\".requisito\").each(function(index,value){\n \n id= $(value).children(\".id_requisito\").text();\n nombre_requisitoViejo= $(value).children(\".nombre_requisito\").text();\n estatusViejo= $(value).children(\".estatus\").text();\n\n });\n var id_requisitotabla = $(\".id_requisito\").val();\n if((id_requisitotabla==porId )&&(estatusViejo==porId2))\n { \n MensajeModificarNone();\n return false;\n }else if($(\"#nombre\").val()=='')\n {\n MensajeDatosNone();\n $(\"#nombre\").focus();\n return false;\n }\n else if($(\"#nombre\").val().length<3)\n {\n MensajeminimoCaracter();\n $(\"#nombre\").focus();\n return false;\n }else if($(\"#estatus\").val()=='')\n {\n MensajeEstatusSelecct();\n $(\"#estatus\").focus();\n return false;\n }\n {\n return true;\n }\n\n}", "formValidHandler (nom, prenom, naissance, adresse, email, telephone, classe){\r\n let result = {\r\n status : true,\r\n message : null,\r\n }\r\n if(!(nom && prenom && naissance && adresse && email && telephone && classe)){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner tous les paramètres\";\r\n if(nom === false && prenom === true && adresse === true && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre NOM.\";\r\n }else if(nom === true && prenom === false && adresse === true && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre PRENOM.\";\r\n }else if(nom === true && prenom === true && adresse === false && email === true && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"Veuillez bien renseigner la valeur du paramètre ADRESSE.\";\r\n }else if(nom === true && prenom === true && adresse === true && email === false && telephone === true && classe === true){\r\n result.status = false;\r\n result.message = \"La valeur du paramètre EMAIL.\";\r\n }else if(nom === true && prenom === true && adresse === true && email === true && telephone === false && classe === true){\r\n result.status = false;\r\n result.message = \"La valeur du TELEPHONE. Il est \\n\"+\r\n \" doit contenir 9 chiffre \";\r\n }else if(nom === true && prenom === true && adresse === true && email === true && telephone === true && classe === false){\r\n result.status = false;\r\n result.message = \"Veuillez choisir la classe \";\r\n }\r\n return result;\r\n }\r\n return result;\r\n }", "function validarColor(ev) {\n if (intentos == 0) {\n if (contadorpositivos >= 6) {\n alert(\"¡Felicitaciones!Haz logrado organizar correctamente cada uno de los términos y así recordar la definición de la arquitectura multiprocesador.Sigue estudiando para ser cada vez mejor.\");\n } else {\n alert(\"Estudia una vez más la arquitectura procesador e inténtalo de nuevo.\");\n }\n }\n if (intentos > 0) {\n\n var divPalabras = document.getElementById(\"palabras\");\n for (let index = 1; index <= 6; index++) {\n let auxPalabra = \"palabra\" + index;\n let auxRecuadro = \"recuadro\" + index;\n checkElement(auxPalabra, auxRecuadro);\n if (document.getElementById(auxPalabra).parentNode.id == auxRecuadro) {\n contadorpositivos = contadorpositivos + 1;\n } else {\n var palabraMal = document.getElementById(auxPalabra);\n divPalabras.appendChild(palabraMal);\n this.inicio();\n }\n }\n if (intentos == 0) {\n if (contadorpositivos >= 6) {\n alert(\"¡Felicitaciones!Haz logrado organizar correctamente cada uno de los términos y así recordar la definición de la arquitectura multiprocesador.Sigue estudiando para ser cada vez mejor.\");\n } else {\n alert(\"Estudia una vez más la arquitectura procesador e inténtalo de nuevo.\");\n }\n }\n intentos = intentos - 1\n alert(\"Quedan \" + intentos + \" Intentos\");\n\n } else {\n document.getElementById(\"boton\").style.display = \"none\";\n document.getElementById(\"botonreiniciar\").style.display = \"unset\";\n }\n}", "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 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 ControleErreur(){\n//récupération des valeurs nécessaires à la validation d'un ajout ou d'une modification\n\tvar nom = document.getElementById(\"txtNom\").value;\n\tif(nom != \"\")\n\t{\n\t\t//Le boutton redevient clicable\n\t\tdocument.getElementById(\"cmdCreerProjet\").disabled = false;\n\t\tdocument.getElementById(\"cmdCreerProjet\").className = \"button\";\t\n\t}\n\telse {\n\t\t//Le boutton d'ajout devient inclicable\n\t\tdocument.getElementById(\"cmdCreerProjet\").disabled = true;\n\t\tdocument.getElementById(\"cmdCreerProjet\").className = \"\";\n\t}\n}", "function formatErrorIndications(elementERR) {\n /** first the format of inpunt elements, but not the div of checkbox, the effect is ugly.\n And no all checkbox are mandatory.\n With this, the user can locate easily the elements with errors **/\n if (elementERR !== activities) {\n elementERR.style.borderBottom = '3px solid red';\n }\n\n /** Second the format of the error meesages **/\n const errorMessages = document.getElementsByClassName('errorMessage');\n for (let i = 0; i < errorMessages.length; i+= 1) {\n errorMessages[i].style.background = 'lightblue';\n errorMessages[i].style.borderLeft = '6px solid red';\n errorMessages[i].style.marginBottom = '5px';\n errorMessages[i].style.paddingLeft = '5px';\n errorMessages[i].style.lineHeight = 1.5;\n errorMessages[i].style.color = 'black';\n errorMessages[i].style.fontSize = '14px';\n errorMessages[i].style.fontWeight = 500;\n }\n }", "function transformAndValidateEditedClienti(cei, name, value, listaClienti)\n{ \t\n\tcei.values[name] = value;\n //I messaggi vengono ricalcolati a ogni iterazione...\n cei.errorMessages = {};\n //Nessun controllo sui nomi duplicati per i clienti...\n /* if (name==='nome') \n errMgmt(cei, 'nome', 'nomeDuplicato','',false);\n\t\t\tfor (var propt in listaClienti)\n if (listaClienti[propt].nome === value) errMgmt(cei, 'nome','nomeDuplicato','Questo nome esiste già', true );\n \t*/\n //Se ho anche solo un errore... sono svalido.\n if (name==='email') errMgmt(cei, 'email','invalidEmail','email non valida', !isValidEmail(cei.values.email) && cei.values.email.length >0);\n \n \n cei.isValid = isValidEditedItem(cei);\n return cei;\n}", "function comprobarNecesarios(formulario){\n var noHayErrores = true;\n $(\".\"+formulario+\" .necesario\").each(function(index){\n if($(this).val()==\"\"){\n $(this).addClass(\"k-invalid\"); \n noHayErrores = false;\n }\n }); \n return noHayErrores; \n }", "isAllValid() {\n return this.state.movieTitle_error || this.state.diractor_error || this.state.year_error || this.state.runtime_error || this.state.genre_error;\n }", "function processErrors(data){\n \n}", "function validacionForm() {\r\n\tvar reason = \"\";\r\n\tvar nom = document.getElementById(\"name\");\r\n\tvar mot = document.getElementById(\"cita\");\r\n\tvar tel = document.getElementById(\"numer\");\r\n\treason += validateName(nom);\r\n\treason += validateCita(mot);\r\n\treason += validatePhone(tel);\r\n\tif (reason != \"\") {\r\n\t\twindow.alert(\"Algunos de los campos necesita correción\\n\" + reason);\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "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 validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function validarResaltarAlHacerClick(event) {\r\n}", "function validateCep(cep)\n{\n //valida se o cep foi preenchido\n if(cep == \"\" || cep.length < 8)\n {\n // adicionas os li a lista de erros\n $(\"#listaErrosLightBox\").append(\"<li> Erro de Preenchimento </li>\"); \n $(\"#listaErrosLightBox\").append(\"<li> &#201; necess&#225;rio o preenchimento do campo CEP </li>\");\n\n // chama a funcao que mostrar os erro no lightbox\n showErrorColorBox();\n \n return false;\n }\n \n // valida se o cep possui apenas numero \n validaCep = \"\" + cep.match(\"[0-9]+\");\n\n //valida se o cep foi preenchido\n if(validaCep.length < 8)\n {\n // adicionas os li a lista de erros\n $(\"#listaErrosLightBox\").append(\"<li> Erro de Preenchimento </li>\"); \n $(\"#listaErrosLightBox\").append(\"<li> Campo CEP preenchimento incorretamente </li>\");\n\n // chama a funcao que mostrar os erro no lightbox\n showErrorColorBox();\n\n return false;\n } \n return true;\n}", "function comprobarEstados(estados){\n var validado = true;\n var msg = '';\n\n for (var i in estados) {\n var est = estados[i];\n\n // Verificamos que el contenido de estados sean objetos\n if( typeof(est) == 'object' ) {\n var keys = Object.keys(est);\n var values = objectValues(est);\n\n if( keys[0] == 'nombre' ){\n validado = comprobarEstado(values[0]);\n\n if (!validado) {\n //alert('Estado '+i+' no tiene un nombre válido');\n $('.msgError').html('Estado '+i+' no tiene un nombre válido.');\n $('#modalError').modal();\n return false;\n }else {\n // Obtenemos el número del estado al quitarle q\n var num = values[0].slice(1,values[0].length);\n if( i != num) {\n msg = 'Error: Estados no ordenados en orden ascendente.';\n validado = false;\n }\n }\n\n // Comprueba que el segundo campo sea el de esFinal y tipo booleano\n if( keys[1] == 'esFinal') {\n if( !typeof(values[1]) == 'boolean' ) {\n msg = 'JSON contiene un estado que no ha guardado bien esFinal (boolean)';\n validado = false;\n }\n } else {\n msg = 'JSON contiene un objeto con un key no válido.';\n validado = false;\n }\n\n } else {\n msg = 'JSON contiene un objeto con un key no válido.';\n validado = false;\n }\n\n } else {\n msg = \"JSON contiene un elemento que no es un objeto\";\n validado = false;\n }\n if(!validado){\n $('.msgError').html(msg);\n $('#modalError').modal();\n return false;\n }\n }\n return validado;\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 validarCampo(){\r\n\tlet lleno=true;\r\n inputNombre = document.querySelector('#txtNombre');\r\n\t inputSegundoNombre= document.querySelector('#txtSegundoNombre');\r\n\t inputApellido = document.querySelector('#txtApellido');\r\n inputSegundoApellido= document.querySelector('#txtSegundoApellido');\r\n\t inputIdentificacion= document.querySelector('#txtIdentificacion');\r\n\t inputFechaNacimiento = document.querySelector('#txtFechaNacimiento');\r\n\t\t inputGenero = document.querySelector('input[name= genero]:checked'); \r\n\t\t inputTelefono = document.querySelector('#txtTelefono');\r\n\t inputCorreo = document.querySelector('#txtCorreo');\r\n\t inputGradoAcademico=document.querySelector('#txtGradoAcademico');\r\n\t inputInstitucion = document.querySelector('#txtInstitucion');\r\n\t inputNivel = document.querySelector('#txtNivel');\r\n\t inputSeccion = document.querySelector('#txtSeccion');\r\n\t\r\n\r\nlet formulario=[];\r\n\t formulario=[inputNombre,inputApellido,inputSegundoApellido,inputIdentificacion,inputFechaNacimiento,\r\n\t\tinputGenero,inputTelefono,inputCorreo,inputGradoAcademico,inputInstitucion,inputNivel,inputSeccion];\r\n\r\nfor ( vacio= 0; vacio <formulario.length; vacio++) {\r\n if (formulario[vacio].value==\"\"){\r\n\t\t\r\n\tformulario[vacio].classList.add('bordeError'); \r\n\t\t lleno=false;\r\n\t\t document.querySelector('#modal').classList.remove('ocultar');\r\n\t\t \r\n}else{\r\nformulario[vacio].classList.remove('bordeError');\r\nformulario.length==lleno;\r\n \r\n }\r\n\r\n }\r\n \r\n\r\n return lleno;\r\n}", "function validateFields() {\n\t// hide all previous warnings\n\thideAllWarnings();\n\tconsole.log(\"validando campos\");\n\t\t\n\tvar err = false;\n\t\t\n\t//--var textTypeFields = new Array( 'name', 'empresa', 'telefono', 'email', 'lugar' );\n\tvar textTypeFields = new Array( 'name', 'telefono', 'email', 'lugar' );\n\t\n\t// Check if text fields have content\n\tfor( var i = 0; i < textTypeFields.length; i++ ) {\n\t\tif( $( \"#\" + textTypeFields[i] ).val().length == 0 ) {\n\t\t\t$( \"#\" + textTypeFields[i] + \"_msg\" ).toggle();\n\t\t\t$( \"#\" + textTypeFields[i] ).select();\n\t\t\t$( \"#\" + textTypeFields[i] ).focus();\n\t\t\terr = true;\n\t\t\treturn err;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\n\t// Check if there is a valid email address\n\tif( !checkEmail( $(\"#email\").val() ) && !err ) {\n\t\t$(\"#email_msg_format\").toggle();\n\t\terr = true;\n\t}\n\tconsole.log(\"el valor de err \" + err);\n\tif(!err) {\n\t\t$(\"#contact_message\").html(\"Enviando pedido..., <br />por favor espere.\");\n\t\tinitializeDB();\n\t\tvar elementos = new Array();\n\t\tdb.transaction( function(tx) {\n\t\t\ttx.executeSql('SELECT * FROM orders', [], function(tx, results) {\n\t\t\t\tvar len = results.rows.length;\n\t\t\t\tfor (var i=0; i < len; i++){\n\t\t elementos[i] = results.rows.item(i).id_mod +\";\"+ results.rows.item(i).cost + \";\" + results.rows.item(i).cant;\n\t\t }\n\t\t\t\t\n\t\t\t\tvar name = $(\"#name\").val();\n\t\t\t\tvar company = $(\"#client\").val(); //---$(\"#empresa\").val();\n\t\t\t\tvar telephone = $(\"#telefono\").val();\n\t\t\t\tvar email = $(\"#email\").val();\n\t\t\t\tvar city = $(\"#lugar\").val();\n\t\t\t\tvar modules = '';\n\t\t\t\tvar pack = '';\n\t\t\t\tvar tiempo = '';\n\t\t\t\tvar costo = '';\n\t\t\t\tvar datos = elementos.join(\"-\");\n\t\t\t\t\n\t\t\t\tconsole.log(\"los datos a enviar \" + datos);\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\turl: \"http://www.enbolivia.com/class/sendcot3.php\",\n\t\t\t\t\tdata: ({\"frmnombre\": name,\"frmempresa\": company, \"frmtelefono\": telephone, \"frmmail\": email, \"frmlugar\": city, \"frmpaquetes\": datos, \"frmidpaquete\": pack, \"frmtiempo\": tiempo, \"frmcosto\": costo}),\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdataType: \"text\",\n\t\t\t\t\tsuccess: envioSatisfactorio,\n\t\t\t\t\terror: function() {navigator.notification.alert(\"Su cotizaci\\u00f3n no se pudo enviar.\", function() {}, \"Formulario de Contactos\", \"Aceptar\");}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}, errorCB);\n\t\t}, errorCB, successCB);\n\t}\n\t\n\treturn err;\n}", "function insertar_comprobantes()\r\n\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\tvar id_tipo_comprobantes=document.getElementById('id_tipo_comprobantes').value;\r\n\t\t\t\tvar fecha_ccomprobantes=document.getElementById('fecha_ccomprobantes').value;\r\n\t\t\t\tvar concepto_ccomprobantes=document.getElementById('concepto_ccomprobantes').value;\r\n\t\t\t\t\r\n\t\t\t\tvar error=\"TRUE\";\r\n\t\t\t\t\r\n\t\t\t\tif (id_tipo_comprobantes == 0)\r\n\t\t \t{\r\n\t\t\t \t\r\n\t\t \t\t$(\"#mensaje_id_tipo_comprobantes\").text(\"Seleccione Tipo\");\r\n\t\t \t\t$(\"#mensaje_id_tipo_comprobantes\").fadeIn(\"slow\"); //Muestra mensaje de error\r\n\t\t \r\n\t\t \t\terror =\"TRUE\";\r\n\t\t \t\treturn false;\r\n\t\t\t }\r\n\t\t \telse \r\n\t\t \t{\r\n\t\t \t\t$(\"#mensaje_id_tipo_comprobantes\").fadeOut(\"slow\"); //Oculta mensaje de error\r\n\t\t \t\terror =\"FALSE\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t}", "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 myadd() {\n\n //Validation Form\n if (document.getElementById(\"name\").value == \"\" || provider.value == \"\" || quantity.value == \"\" || store.value == \"\" || unit.value == \"Selecciona un Opcion\") {\n\n //Initialize tags\n tag[0].style.color = \"black\";\n tag[0].style.fontWeight = 'normal';\n tag[1].style.color = \"black\";\n tag[1].style.fontWeight = 'normal';\n tag[2].style.color = \"black\";\n tag[2].style.fontWeight = 'normal';\n tag[3].style.color = \"black\";\n tag[3].style.fontWeight = 'normal';\n tag[4].style.color = \"black\";\n tag[4].style.fontWeight = 'normal';\n tag[5].style.color = \"black\";\n tag[5].style.fontWeight = 'normal';\n\n //Complete form Message\n if (i == 0) {\n var label = document.createElement(\"label\");\n var h5 = document.getElementById(\"h5\");\n label.innerHTML = \"*Porfavor de completar los espacios marcados en rojo\"\n label.style.color = \"red\";\n h5.appendChild(label);\n i++;\n }\n\n //Change or complete the following input field\n if (document.getElementById(\"name\").value == \"\") {\n tag[0].style.color = \"red\";\n tag[0].style.fontWeight = 'bold';\n }\n\n if (provider.value == \"\") {\n tag[1].style.color = \"red\";\n tag[1].style.fontWeight = 'bold';\n }\n\n if (store.value == \"\") {\n tag[2].style.color = \"red\";\n tag[2].style.fontWeight = 'bold';\n }\n\n if (quantity.value == \"\") {\n tag[3].style.color = \"red\";\n tag[3].style.fontWeight = 'bold';\n }\n\n if (unit.value == \"\") {\n tag[4].style.color = \"red\";\n tag[4].style.fontWeight = 'bold';\n }\n\n }\n\n //When there is no error call this else\n else {\n\n //set all attributes\n var arr = {};\n\n // if (edit_button.value != \"\") {\n // arr.id_log = edit_button.value;\n // }\n // else {\n //uuid\n arr[\"id_log\"] = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (dt + Math.random() * 16) % 16 | 0;\n dt = Math.floor(dt / 16);\n return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);\n });\n // }\n\n arr.name = document.getElementById(\"name\").value;\n arr.provider = provider.value;\n arr.store = type.value;\n arr.quantity = quantity.value;\n arr.unit = unit.value;\n\n\n\n //Prepare var to REST call api\n var json = JSON.stringify(arr);\n console.log(json);\n //Make REST Api call\n var request = new XMLHttpRequest();\n request.open('POST', 'https://0whknuyu69.execute-api.us-east-1.amazonaws.com/dev_0/', true);\n request.send(json);\n\n //Reload Document\n document.location.reload();\n\n }\n}" ]
[ "0.64757085", "0.64431095", "0.6434141", "0.64282477", "0.6422546", "0.6394693", "0.635704", "0.63330203", "0.6239344", "0.6225913", "0.61776406", "0.61654526", "0.61515427", "0.6139425", "0.61233777", "0.61064094", "0.6090101", "0.60893613", "0.607488", "0.6062314", "0.60511154", "0.6046973", "0.6041116", "0.6034651", "0.60187364", "0.601783", "0.6002838", "0.5984682", "0.59732634", "0.5968612", "0.5967913", "0.59582394", "0.5954334", "0.5946848", "0.59444404", "0.5939802", "0.5938389", "0.59251183", "0.5924673", "0.5915862", "0.5899989", "0.58965766", "0.58814305", "0.5875295", "0.58697015", "0.5868775", "0.58635527", "0.58567053", "0.5842823", "0.5838637", "0.5831527", "0.5823417", "0.5814914", "0.5801841", "0.57949007", "0.5782451", "0.5765424", "0.5761664", "0.57600033", "0.57503426", "0.57487017", "0.574691", "0.5746624", "0.57457906", "0.57427865", "0.5740981", "0.57402337", "0.57386625", "0.5734555", "0.5733959", "0.57236326", "0.5720579", "0.57193154", "0.57192135", "0.5718828", "0.5717797", "0.57169837", "0.5714779", "0.571384", "0.5712194", "0.5709416", "0.569962", "0.5692601", "0.56892616", "0.5676655", "0.5676096", "0.5671684", "0.56694454", "0.5666011", "0.56652427", "0.5662013", "0.56593764", "0.5657993", "0.5656563", "0.5646982", "0.5641742", "0.5629364", "0.56240636", "0.56142354", "0.5614054" ]
0.69003063
0
exibe mensagems de erro
function exibeMensagensDeErro(erros) { var ul = document.querySelector("#mensagens-erro"); ul.innerHTML = ""; erros.forEach(function(erro) { var li = document.createElement("li"); li.textContent = erro; ul.appendChild(li); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error(msg) {\n alertify.alert('<img src=\"/images/cancel.png\" alt=\"Error\">Error!', msg);\n }", "function fallo() {\n return error(\"Reportar fallo\");\n}", "function error(){\n return \"Invaild e-mail or password!\";\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "function deuErro() {\n toastr.error(\"Algo deu errado. Tente novamente.\");\n }", "function errorGeneral(){\n M.toast({html: 'Ha ocurrido un error, intente de nuevo más tarde'});\n}", "function error(msg) {\n\t\t// Update the status DOM object with the error message\n\t\tstatus.innerHTML = typeof msg === 'string' ? msg : 'Failed!';\n\t\tstatus.className = 'alert alert-error';\n\t}", "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "function mostrarError(err){\n console.log('Error', err);\n }", "function handleError() {\n // TODO handle errors\n // var message = 'Something went wrong...';\n }", "function error(message) {\r\n\tnotify(\"Erreur\", message);\r\n}", "function erro(msg) {\n\t\n\n\t$.notify({\n \tmessage: msg\n\n },{\n type: 'danger',\n timer: 1000\n \n });\n}", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function error(err) {\n var problem;\n if (err.code == 1) {\n // user said no!\n problem = \"You won't share your location with us.\"\n }\n if (err.code == 2) {\n // location is unavailable - no satellites in range?\n problem = \"Your location is unavailable.\"\n }\n if (err.code == 3) {\n // request timed out\n problem = \"Something was too slow.\"\n }\n document.getElementById('location').innerHTML = \"Something went wrong! \"+problem;\n \n}", "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "function msgFalhaBaixarArquivo() {\n $scope.showErrorMessage(\"Falha ao fazer o download do arquivo.\");\n }", "function error(message) {\n jsav.umsg(message, {\"color\" : \"red\"});\n jsav.umsg(\"<br />\");\n }", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t\tbrief.save();\n\t\t\tnotif(\"warning\", \"Brief sauvegardé avec <strong>succès</strong> !\");\n\n\t\t}", "function erro(msg) {\n\t$.notify({\n \tmessage: msg\n\n },{\n type: 'danger',\n timer: 1000\n });\n}", "function error(msg) {\n response({ status: 'error', msg: msg });\n }", "function error(message) {\r\n command_1.issue('error', message);\r\n}", "function error(message) {\r\n command_1.issue('error', message);\r\n}", "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "function error(err) {\n myAlertOnValium.show({\n type: 'danger',\n title: 'Upload failed',\n content: err || ''\n });\n }", "function Msg_handleErr(msg, url, l, sMsg, bUsaPag) {\n var stxt = \"\";\n if (sMsg == '') {\n stxt += \"ERROR DEL SISTEMA.\\n\\n\";\n stxt += \"¡ADVERTENCIA!.\\n\";\n stxt += \"Notificar del error a sistemas.\\n\\n\";\n if (!bUsaPag)\n stxt += \"NO CONTINUE USANDO LA PÁGINA ACTUAL.\\n\\n\\n\";\n stxt += \"Se encontró un error en la página actual.\\n\\n\";\n stxt += \"Error: \" + msg + \"\\n\";\n stxt += \"URL: \" + url + \"\\n\";\n stxt += \"Línea: \" + l + \"\\n\\n\";\n stxt += \"Hacer click en OK para continuar.\\n\\n\";\n } else\n stxt = sMsg;\n alert(stxt);\n}", "function error(err) {\n myAlert({\n type: 'danger',\n title: 'Upload failed',\n content: err || ''\n });\n }", "function muestraError(cadena) {\n self.ErrorEnviar = cadena;\n self.showErrorForm = true;\n cfpLoadingBar.complete();\n }", "function errMsg(e) {\r\n\tconsole.log(e);\r\n\tbot.speak('Something went wrong. Tell master to check the fail logs.')\r\n}", "function errorHandler(err) {\n //alert(\"An error occured\\n\" + err.message + \"\\n\" + err.details.join(\"\\n\"));\n }", "function showError() {}", "function error(err) {\n const errorembed = new Discord.MessageEmbed()\n .setColor(color)\n .setTitle('New Error Caught!')\n .setTimestamp()\n .setDescription(`\\`\\`\\`xl\\n${err.stack}\\`\\`\\``);\n client.channels.get('385485532458778626').send({\n embed: errorembed\n });\n }", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function mostrarError(mensaje) {\n setError(mensaje);\n }", "function error() {\r\n\t\t\t\talert(\"error\");\r\n\t\t\t}", "function error(msg) {\n inputEl.classList.add('invalid');\n M.toast({\n html: msg,\n displayLength: 4000\n })\n }", "function showErrorMessage(msg) { }", "function errback(err) {\n //alert(err.toString());\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function showError(error) {\r\n switch(error.code) {\r\n case error.PERMISSION_DENIED:\r\n smthgwrong.textContent = \"Pro zobrazení počasí v aktuální oblasti prosím povolte přítup k poloze.\"\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n smthgwrong.textContent = \"Nebylo možné identifikovat polohu.\"\r\n break;\r\n case error.TIMEOUT:\r\n smthgwrong.textContent = \"Příkaz pro získaní polohy vypršel, zkuste to prosím znova.\"\r\n break;\r\n case error.UNKNOWN_ERROR:\r\n smthgwrong.textContent = \"Během procesu došlo k neznámé chybě.\"\r\n break;\r\n }\r\n}", "function error(err){\n alert('Error: ' + err + ' :('); // alert the error message\n}", "function getErrorMsg() {\n if (UserFactory.locale == 'en') {\n return \"Could not perform this operation. Please try again later\";\n } else if (UserFactory.locale == 'es') {\n return 'No se pudo realizar esta operación. Por favor, inténtelo de nuevo más tarde';\n } else {\n return 'Não foi possível executar esta operação. Por favor, tente novamente mais tarde';\n }\n }", "function onFail(message) {\n console.log('Failed because: ' + message);\n }", "function handleError(errStat){\n alert(\"this isnt working\" + errStat);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function defaultError(error)\n{\n msg(\"error \" + error.responseText);\n}", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function submitErrorHandler (errMessage){\n alertDialog(errMessage);\n }", "function mensajeError(mensaje){ \n \tSwal.fire({\n \t\ttitle: 'Error',\n \t\ttext: mensaje,\n \t\ticon: 'error',\n \t\tshowCloseButton: true,\n \t\tconfirmButtonText:'Aceptar'\n \t}); \n }", "function onFail(message) {\n }", "function error(msg) {\n throw \"Error: \" + msg;\n }", "error(message) {\n return this.sendMessage(MessageType.Error, message);\n }", "function erorrMessage(errors) {\n\n var txt =\"\";\n $.each(errors, function( index, value ) {\n txt += ErrorMsg('warning',value);\n \n });\n return txt;\n}", "function erorrMessage(errors) {\n\n var txt =\"\";\n $.each(errors, function( index, value ) {\n txt += ErrorMsg('warning',value);\n \n });\n return txt;\n}", "function send_err(msg, input) {\n\t\t\tsendMsg({ msg: 'tx_error', e: msg, input: input });\n\t\t\tsendMsg({ msg: 'tx_step', state: 'committing_failed' });\n\t\t}", "function send_err(msg, input) {\n\t\t\tsendMsg({ msg: 'tx_error', e: msg, input: input });\n\t\t\tsendMsg({ msg: 'tx_step', state: 'committing_failed' });\n\t\t}", "function errorHandler(error) {\n var message = '';\n switch (error.code) {\n case FileError.SECURITY_ERR:\n message = 'Security Error';\n break;\n case FileError.NOT_FOUND_ERR:\n message = 'Not Found Error';\n break;\n case FileError.QUOTA_EXCEEDED_ERR:\n message = 'Quota Exceeded Error';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n message = 'Invalid Modification Error';\n break;\n case FileError.INVALID_STATE_ERR:\n message = 'Invalid State Error';\n break;\n default:\n message = 'Unknown Error UAY';\n break;\n }\n alert(message);\n }", "function onFail(msg){ \n console.log(msg); alert(msg); \n }", "function onFail(mesage) {\n alert('Failed because: ' + message);\n}", "function errorMsg(eMsg) {\n swal(\"Error\", eMsg, \"error\");\n }", "function showError() {\n showStatus('error');\n}", "function mensagemErro(email, passi) {\r\n let mensagem = \"\"\r\n\r\n if (email) { //Ou seja o email não existe\r\n mensagem = \"O mail que introduziu não existe\"\r\n }\r\n else if (passi) { //Se o mail existe mas a pass é true, então é porque o mail e a pass não correspondem\r\n mensagem = \"A password está errada\"\r\n }\r\n\r\n return mensagem\r\n}", "function errorDialog(status){\n window.alert(\"Chyba pri načítaní údajov zo servera.\\nError reading data from the server.\\nStatus= \"+status);\n}", "function error(n, m) {\n CB.status(false, n, m);\n console.error('SimpleCTI.error() - We got an error number: ' + n + ' Text: ' + m);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onError(err) {\n if (err === null) return;\n try {\n console.trace();\n } catch (e) {}\n console.log(err);\n $(\"#errModal\").find('[thdc-err]').text(err.message);\n $(\"#errModal\").vModal('show');\n throw \"general error\";\n}", "function onFail(message) {\n alert('Se ha producido un error: ' + message);\n}", "showError(error){\n\t\talert(error||'unknown error has occurred.');\n\t}", "function errback(err) {\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function errorDialog(status){\n window.alert(\"Chyba pri naÄŤĂ­tanĂ­ Ăşdajov zo servera.\\nStatus= \"+status);\n}", "function error(message, data, title) {\n $mdToast.simple().content(message);\n }", "function error(msg) {\n\t\t$(\"<div class=\\\"alert alert-danger alert-dismissible\\\" role=\\\"alert\\\">\" +\n\t\t\t\"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"Close\\\">\" +\n\t\t\t\"<span aria-hidden=\\\"true\\\">&times;</span></button>\" +\n\t\t\t\"<strong>Error!</strong> \" + msg + \"</div>\"\n\t\t).prependTo(\"#alerts\").hide().slideDown().delay(ERROR_TIMEOUT).slideUp(function () {$(this).remove();});\n\t}", "productError() {\n\t\tthis.DOM.innerHTML = \"Oups, le produit demandé n'existe pas !\"\n\t}", "_error(err) {\n this._loading(false);\n if (! err.message) return;\n this.refs['popup'].getWrappedInstance().show(err.message);\n }", "function error() {\n self.addThreepio(\"I think we've broken \" + friend.name + \" with your question.\");\n setTimeout(function () {\n var result = self.yesNo(RandomUtil.coinFlip());\n self.addThreepio(\"I suppose I can go ahead and answer your question for you: \" + result);\n self.hideFriend();\n setTimeout(self.addInput, self.timeBetweenBubbles);\n }, self.timeBetweenBubbles);\n }", "function showError(type, text) {}", "function cargarError(){\n\talert(\"Error requesting information from the server\");\n}", "function cargarError(){\n\talert(\"Error requesting information from the server\");\n}", "function clearErrorMsg() {\n AlmCommon.clearMsgs();\n }", "function failHandler(msg){\n Dialogs.failMessage(msg);\n}", "function fail(msg) { throw new Error(msg); }", "function errorHandler(err) {\n alert(\"发生错误\\n\" + err.message + \"\\n\" + err.details.join(\"\\n\"));\n}", "showErrorMessage() {}", "showErrorBox(title, content, detail) {\r\n return this.showMessageBox({\r\n buttons: ['OK'],\r\n message: content,\r\n title,\r\n detail,\r\n type: 'error',\r\n }).then((answer) => {\r\n return;\r\n });\r\n }", "function error(message) {\n\t\tconsole.log(\"There is an error: \" + message);\n\t}", "function errorMsg(msg, error) {\n // errorElement.innerHTML += '<p>' + msg + '</p>';\n console.log(msg);\n if (typeof error !== 'undefined') {\n console.error(error);\n }\n }", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function caml_failwith (msg) {\n caml_raise_with_string(caml_global_data[3], msg);\n}", "function msjError(error) {\r\n\tswitch (error) {\r\n\t\tcase 1000: alert (\"¡SELECCIONE UN REGISTRO!\"); break;\r\n\t\tcase 1010: alert (\"¡LOS CAMPOS MARCADOS CON (*) SON OBLIGATORIOS!\"); break;\r\n\t\tcase 1020: alert (\"¡REGISTRO EXISTENTE!\"); break;\r\n\t\tcase 1030: alert (\"¡PERIODO CONTABLE INCORRECTO!\"); break;\r\n\t\tcase 1040: alert (\"¡FECHA FUNDACION INCORRECTA!\"); break;\r\n\t\tcase 1050: alert (\"¡DEBE LLENAR EL CAMPO RIESGO!\"); break;\r\n\t\tcase 1060: alert (\"¡MONTO INCORRECTO!\"); break;\r\n\t\tcase 1070: alert (\"¡NUMERO INCORRECTO!\"); break;\r\n\t\tcase 1080: alert (\"¡FECHA DE NACIMIENTO INCORRECTA!\"); break;\r\n\t\tcase 1090: alert (\"¡FECHA DE ESTADO CIVIL INCORRECTA!\"); break;\r\n\t\tcase 1100: alert (\"¡FECHA DE EXPIRACION DE LICENCIA INCORRECTA!\"); break;\r\n\t\tcase 1110: alert (\"¡FECHA DE INGRESO INCORRECTA!\"); break;\r\n\t\tcase 1120: alert (\"¡FECHA DE CESE INCORRECTA!\"); break;\r\n\t\tcase 1130: alert (\"¡DEBE SELECCIONAR UN VALOR EN EL FILTRO BUSCAR!\"); break;\r\n\t\tcase 1140: alert (\"¡FECHA DE VIGENCIA DE CONTRATO INCORRECTA!\"); break;\r\n\t\tcase 1150: alert (\"¡FECHA DE FIRMA INCORRECTA!\"); break;\r\n\t\tcase 1160: alert (\"¡FECHA DE BAJA INCORRECTA!\"); break;\r\n\t\tcase 1170: alert (\"¡DEBE SELECCIONAR UN CARGO!\"); break;\r\n\t\tcase 1180: alert (\"¡DEBE LLENAR TODOS LOS CAMPOS!\"); break;\r\n\t\tcase 1190: alert (\"¡SUELDO INCORRECTO!\"); break;\r\n\t\tcase 1200: alert (\"FECHA DE ENTREGA INCORRECTA!\"); break;\r\n\t\tcase 1210: alert (\"¡DEBE SELECCIONAR LA PERSONA RELACIONADA!\"); break;\r\n\t\tcase 1220: alert (\"¡SELECCIONE UN DOCUMENTO!\"); break;\r\n\t\tcase 1230: alert (\"¡FECHA DE ESTADO INCORRECTA!\"); break;\r\n\t\tcase 1240: alert (\"¡FECHA DE VENCIMIENTO INCORRECTA!\"); break;\r\n\t\tcase 1250: alert (\"¡LA FECHA DE ESTADO NO PUEDE SER MENOR QUE LA FECHA DE ENTREGA!\"); break;\r\n\t\tcase 1260: alert (\"¡FECHA INCORECTA!\"); break;\r\n\t\tcase 1270: alert (\"¡MONTO DE HORAS INCORRECTO!\"); break;\r\n\t\tcase 1280: alert (\"¡MONTO DE AÑOS INCORRECTO!\"); break;\r\n\t\tcase 1290: alert (\"¡FECHA DE DOCUMENTO INCORECTA!\"); break;\r\n\t\tcase 1300: alert (\"¡PERIODO DE SUSPENSION INCORECTA!\"); break;\r\n\t\tcase 1310: alert (\"¡INTERVALOS DE FECHAS Y HORAS INCORRECTA!\"); break;\r\n\t\tcase 1320: alert (\"¡VALOR INCORRECTO!\"); break;\r\n\t\tcase 1330: alert (\"¡VALOR NOMINAL INCORRECTO!\"); break;\r\n\t\tcase 1340: alert (\"¡CANTIDAD INCORRECTA!\"); break;\r\n\t\tcase 1350: alert (\"¡AÑO DEL VEHICULO INCORRECTO!\"); break;\r\n\t\tcase 1360: alert (\"¡VALOR DE COMPRA INCORRECTO!\"); break;\r\n\t\tcase 1370: alert (\"¡FECHA DE VIGENCIA DEL REQUERIMIENTO INCORRECTA!\"); break;\r\n\t\tcase 1380: alert (\"¡FECHA DE SOLICITUD INCORRECTA!\"); break;\r\n\t\tcase 1390: alert (\"¡FECHA DE CAPACITACION INCORRECTA!\"); break;\r\n\t\tcase 1400: alert (\"¡MONTO DE COSTO INCORRECTO!\"); break;\r\n\t\tcase 1410: alert (\"¡MONTO ASUMIDO INCORRECTO!\"); break;\r\n\t\tcase 1420: alert (\"¡MONTO DE COSTO INCORRECTO!\"); break;\r\n\t\tcase 1430: alert (\"¡NUMERO DE VACANTES INCORRECTO!\"); break;\r\n\t\tcase 1440: alert (\"¡FECHA DE VIGENCIA INCORRECTA!\"); break;\r\n\t\tcase 1450: alert (\"¡DEBE INGRESAR LA HORA DE INICIO Y FIN DEL DIA SELECCIONADO!\"); break;\r\n\t\tcase 1460: alert (\"¡DEBE INGRESAR EL HORARIO DE LA CAPACITACION!\"); break;\r\n\t\tcase 1470: alert (\"¡MONTO INCORRECTO!\"); break;\r\n\t}\r\n}", "function error(err) {\r\n notificationElement.style.display = \"block\"\r\n notificationElement.innerHTML = `<p>${err.message}</p>`\r\n}" ]
[ "0.72028387", "0.71101004", "0.70031583", "0.6936272", "0.6936272", "0.6926672", "0.69160444", "0.6880918", "0.68707734", "0.68667746", "0.68470687", "0.68379694", "0.68287385", "0.6815974", "0.6811743", "0.67968345", "0.67850876", "0.6782818", "0.67740446", "0.67697686", "0.67286605", "0.671246", "0.671246", "0.6689651", "0.66764235", "0.6676031", "0.66641796", "0.665901", "0.66551113", "0.66522026", "0.66462725", "0.6638206", "0.6626111", "0.660244", "0.660244", "0.660244", "0.660244", "0.660244", "0.65961045", "0.6573525", "0.6555404", "0.65532964", "0.65478885", "0.6537488", "0.6530263", "0.65286905", "0.6522232", "0.6521025", "0.6518003", "0.651787", "0.65067714", "0.6491027", "0.6491027", "0.6491027", "0.6491027", "0.6491027", "0.6491027", "0.6491027", "0.64879876", "0.64847815", "0.6479175", "0.6477558", "0.6476822", "0.64742863", "0.64742863", "0.64736575", "0.64736575", "0.6465288", "0.6465286", "0.64600223", "0.6450572", "0.644727", "0.6439174", "0.64376634", "0.64358115", "0.64351654", "0.6428641", "0.6423123", "0.6420845", "0.6413712", "0.6406496", "0.6394643", "0.63909715", "0.6389773", "0.6386296", "0.637936", "0.63734436", "0.6371709", "0.6371709", "0.6368647", "0.63671565", "0.6363567", "0.63531995", "0.63528687", "0.6349409", "0.63452315", "0.6343765", "0.6343066", "0.6340444", "0.6336557", "0.6334855" ]
0.0
-1
Create a function 'addNumbers' that takes a number as an argument. 'addNumbers' should add up all the numbers from 1 to the number you passed to the function. For example, if the input is 4 then your function should return 10 because 1 + 2 + 3 + 4 = 10. create a function with input number set a condtional if num is less than or equal to 1 return num recursive call return
function addNumbers(num) { if(num <= 1) { return num } return num + addNumbers(num - 1) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberSum(num) {\n if(num == 1) {\n return 1;\n }\n else {\n return num + numberSum(num - 1);\n }\n}", "function numberSum(num) {\n if(num == 1) {\n return 1;\n }\n else {\n return num + numberSum(num - 1);\n }\n}", "function addNumbers(num){\n let result;\n while (num > 0) {\n num += (number-1);\n num--;\n }\n}", "function addRange(number) {\n console.log(number);\n return number === 1 ? 1 : number + addRange(number - 1);\n}", "function SimpleAdding(num) {\n if(num==1){\n return 1;\n } else {\n return num + SimpleAdding(num -1);\n }\n \n}", "function recursion(number){\n number+=number;\n console.log(number)\n if(number<300) {\n recursion(number)\n }else{\n return number;\n }\n }", "function summation(num){\n if(num === 1) return 1;\n return num + summation(num - 1);\n}", "function sum(number) {\n if (number > 0){\n return number + sum(number - 1);\n } else if (number == 0) {\n return 0;\n }\n}", "function summation(number) {\n if (number <= 1) {\n return 1\n } else {\n return number + summation(number - 1)\n }\n}", "function sumTo(num) {\n if (num < 1)\n return 0;\n else\n return num + sumTo(num - 1);\n}", "function SimpleAdding(num){\n var result = 0;\n var add = function(){\n for(var i = 1; i <= num; i++){\n result += i;\n }\n }; \n add(num);\n return result;\n}", "function addNumbers(arr) {\n if (arr.length === 0) return 0;\n\n return (arr[0] + addNumbers(arr.slice(1)));\n}", "function addNumbers(num) {\n let acc = 0;\n for (let i = 0; i <= num; i++) {\n acc += i;\n }\n return acc;\n}", "function fn(num){\n if(num>10){\n return 20;\n }\n if(num%3===0){\n return num + fn(num+1);\n }\n return fn(num+1);\n}", "function recursion2(number){\n number+=number;\n console.log(number)\n if(number<= 0) {\n return number;\n }else if(number<300){\n recursion2(number)\n }else{\n return number;\n }\n }", "function recur(sum, num, ...nums){\n sum += num;\n if (nums.length == 0) return sum;\n return recur(sum, ...nums); //sum is returned back in\n }", "function sumRecursion(numbers) {\n if (!Array.isArray(numbers)) {\n return -1\n } else if (numbers.length === 1) {\n // Non-Recursive or Base case;\n\n return numbers[0];\n } else {\n // Recursive Case\n return numbers[0] + sumRecursion(numbers.slice(1));\n }\n}", "function sumNumbers(num) {\n let arr = `${num}`.split(\"\");\n let sum = arr.reduce((a, b) => +a + +b);\n if (sum < 10) {\n return sum;\n } else {\n return sumNumbers(sum);\n }\n}", "function addNumbers(firstNumber, secondNumber) {\n // return firstNumber + secondNumber;\n return firstNumber + secondNumber;\n}", "function sumRange(num) {\n // Base case; return 1 when num is equal to 1\n if (num === 1) return 1;\n\n // Recursive code block; adding num to the difference of num - 1\n // The key here is the different input being passed in to the recursive method\n return num + sumRange(num - 1);\n}", "function loopThroughnNumRecurse(num) {\n if (num <= 0) {\n console.log(num); \n return 0;\n } else {\n console.log(num);\n loopThroughnNumRecurse(num - 1);\n }\n}", "function addNumber(num){\n var answer = 0;\n //changs number to string type\n var convert = num.toString();\n //converts string type to array\n convert.split(\"\")\n \n for(var i = 0; i < convert.length; i++){\n answer += parseInt(convert[i])\n }\n if( answer >= 9) {\n addNumber(answer)\n }else{\n console.log(answer)\n }\n \n }", "function addNumbers(num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1, num2) { //create the function with 2 num arguments\n return num1 + num2 //add the two numbers and return the result\n}", "function SimpleAdding(num, sum) {\n // If no argument is passed for sum (Coderbyte will always only pass 1 argument into our function), we set it to 0\n sum = sum | 0;\n\n // Next, we set our base case to stop the function from recursing when our input number equals 0...\n if (num === 0) {\n // ...and return our answer\n return sum;\n }\n\n // Each time we recurse through our function, we add the number to our sum variable (sum += num)...\n sum += num;\n // ...and decrease num by 1 using the decrement operator\n num--;\n\n // We return the function again and continue to add num to curSum and decrement num by 1 until num reaches 0.\n return SimpleAdding(num, sum);\n}", "function addNumbers(num1, num2) {\n return num1 + num2;\n}", "function recursiveRange(num) {\n if (num === 1) return num;\n return num + recursiveRange(num - 1)\n}", "function addNumbers (num1, num2) {\n return num1 + num2;\n}", "function addNumbers(num1=0,num2=0){\n return num1 + num2;\n}", "function fibonacciRecursive(num){\n // stopping condition\n if (num == 0) {\n return [1];\n }\n if (num == 1) {\n return [1, 1]\n }\n // recursive call\n var fibo = fibonacciRecursive(num - 1);\n var nextFibo = fibo[num-1] + fibo [num - 2]; \n fibo.push(nextFibo);\n return fibo;\n}", "function addNumbers(number1, number2) {\n return number1 + number2\n}", "function getSumUpTo(number)\n{\n if(number == 1)\n return 1;\n else\n {\n return number + getSumUpTo(number-1);\n }\n}", "function addNumbers(numOne, numTwo) {\n return numOne + numTwo;\n}", "function addNums(firstNum, secondNum) {\n return firstNum + secondNum;\n}", "function rSums(num)\n{\n if (num ==1){\n return 1;\n } else {\n return num + rSums(num-1);\n }\n}", "function sum(num) {\n return num === 0 ? num : (num + sum(num - 1));\n}", "function recursiveRange(num) {\n if (num === 1) return 1;\n return num + recursiveRange(num - 1);\n}", "function sumRange(num){\n if (num === 1) return 1;\n return num + sumRange(num -1)\n}", "function sumRecursive(){\n var num1 = numberCreationRecursive(list1);\n var num2 = numberCreationRecursive(list2);\n\n console.log(num1+num2);\n}", "function recursiveRange(num) {\n if (num === 1) return 1;\n\n return num + recursiveRange(num - 1);\n}", "function numAdd (num, number) {\nreturn num + number;\n}", "function addTogether() {\n // Takes array and checks each element - if typeof does not return \"number\" return undefined, else return true\n function checkArguments(array){\n for (var element of array) {\n if (typeof element !== \"number\") return undefined;\n }\n return true;\n }\n // Function to apply in reduce() - takes currentValue and adds to an accumulator\n function reducer(accumulator, currentValue){\n return accumulator + currentValue;\n }\n // Creating args array from arguments \n var args = [...arguments];\n \n // If checkArguments returns true (all elements are numbers)\n if (checkArguments(args)){\n if (args.length == 2){\n // If there is two elements in args - reduce to one value by adding them\n sum = args.reduce(reducer);\n // Return reduced value\n return sum;\n } else {\n /* In case args.length == 1 - assign parameter to oldNum - \n return function that calls addTogether with oldNum and num (next number in original function call or otherwise)*/\n var oldNum = args[0];\n return function sumOldNumAnd(num){\n return addTogether(oldNum , num);\n };\n }\n } else {return undefined};\n //return undefined if checkArguments returned undefined. \n \n }", "function recursiveRange(num) {\n if (num === 0) return num;\n return num + recursiveRange(num - 1);\n}", "function addNumbers(number1, number2) {\r\n return number1 + number2;\r\n}", "function recursiveRange(num) {\n if (num === 0) return num;\n\n return num + recursiveRange(num - 1);\n}", "function addNumbers(number1, number2){\r\n return number1 + number2;\r\n}", "function addNumbers(a, b) {\n return a + b;\n}", "function addNumbers(a, b) {\n return a + b;\n}", "function addNumbers(num1, num2, num3){\n return num1 + num2 + num3;\n }", "function recursiveRange(num){\n if (num < 0) return 0;\n return num + recursiveRange(num - 1)\n}", "function recursiveRange(num) {\n if(num === 0) {\n return 0;\n }\n\n return num + recursiveRange(num - 1);\n}", "function addNum() {\n var sum = 0;\n for (let i = 0; i < arguments.length; i++) {\n var num = arguments[i];\n sum = sum + num;\n }\n return sum;\n}", "function recursiveRange(num) {\n if (num === 0) return 0;\n return num + recursiveRange(num-1);\n}", "function addNumbers( firstNumber, secondNumber ) {\n // return firstNumber + secondNumber;\nlet solution = firstNumber + secondNumber;\nreturn solution;\n}", "function addNumbers(numberOne, numberTwo) {\n return numberOne + numberTwo;\n}", "function factorial(number) { // Recibe un valor entero positivo\n if (number < 0) // Si es valor es un numero negativo entonces devuelve un -1 para hacer saber al usuario que se ingreso un valor invalido\n return -1; // retorno de valor invalido \n else if (number == 0) // Si el valor es 0, por definicion se devuelve un 1 por que 0! es 1, pero tambien sirve para la recursividad dentro de factorial\n return 1; // Devuelve el valor de 1 si es que el numero original es de 0 o si es la ultima iteracion de la funcion recursiva \n else { // Si el numero es un valor mayor a 1 se entra en la recursividad de la funcion \n return (number * factorial(number - 1)); // La recursividad funciona diciendo que el numero se multiplicara por la funcion - 1, y hasta que el numero dentro de la funcion no se vuelva 0 entonces se restara uno del valor del numero y se volver a multiplicar\n // Si el valor fuese 5, seria 5 * 5 - 1 * 5 - 1 - 1,5-1-1-1 * 5-1-1-1-1 * 0, claro que si se multiplica por 0 entonces el valor final seria 0, pero dentro del if si el valor es 0 hay un return de 1. \n // Pero el valor no sera de 1, dado que este return esta dentro de la primera iteracion de la recursividad, entonces el valor seria 5*4*3*2*1*1 = 120\n }\n}", "function fibonacci(number) // 0,1,1,2,3,5,8,13,21...\n{\n if (number <= 1) return number;\n\n return fibonacci(number - 2) + fibonacci(number - 1);\n}", "function factorial(num){\n //base case\n if (num === 0) return 1\n \n //recursive call\n return num * factorial(num - 1);\n}", "function multi_sum(num){\r\n return num==1 ? 0 : (num % 3 == 0) || (num % 5 == 0)? num + multi_sum(num-1): 0 + multi_sum(num-1) ; \r\n}", "function factorial(num) {\n //base case\n if(num === 1) {\n return 1 \n } \n\n //recursive call\n return num * factorial(num - 1)\n}", "function fibonacci(num) {\n if (num <= 1) return 1;\n return fibonacci(num - 1) + fibonacci(num - 2);\n}", "function fibonacci(num) {\n if (num <= 1) {\n return 1;\n }\n return fibonacci(num - 1) + fibonacci(num - 2);\n}", "function recursiveFibonnacci(num) {\n if (num <= 1) return num;\n return fibonacci(num - 2) + fibonacci(num - 1);\n}", "function recursiveFibonacci(number){\n\n if(isNaN(number)) return;\n if(number===0) return 0;\n if(number===1) return 1;\n\n return recursiveFibonacci(number-2)+ recursiveFibonacci(number-1);\n}", "function fibonacci(num){\n if(num === 0){\n return 0;\n }else if(num === 1){\n return 1;\n }else{\n return fibonacci(num - 2) + fibonacci(num - 1);\n }\n}", "function fibonacciRec(number)\n {\n if (number <= 1) return number;\n return fibonacciRec(number - 2) + fibonacciRec(number - 1);\n }", "function addNumbers(x, y) {\n return x+y;\n}", "function addRecurse(...nums) {\n if (nums.length < 1) {\n return 0;\n }\n if (nums.length === 1) {\n return nums[0];\n }\n return nums[0] + addRecurse(...nums.slice(1));\n}", "function fibonacciRec(num) {\n if (num <= 1) return 1;\n\n return fibonacciRec(num - 1) + fibonacciRec(num - 2);\n}", "function fibonnacci(number) {\r\n if (number === 0) {\r\n return 0;\r\n } else if (number === 1 || number === 2) {\r\n return 1;\r\n } else {\r\n return fibonnacci(number - 1) + fibonnacci(number - 2);\r\n }\r\n}", "function recursiveMaths(firstNumber, secondNumber) {\n // We will only run this function 50 times for now, so if it exceeds 50 we stop the code\n if (loopCount > 50) return;\n\n // We add up both the first and second number to create a new variable named newNumber\n let newNumber = firstNumber + secondNumber;\n\n // We no longer need the first number, so we replace it with the second number\n firstNumber = secondNumber;\n\n // By using ++ we add 1 to the counter\n loopCount++;\n\n // We want to see what number is being generated, so we log it in the console\n console.log(newNumber);\n\n recursiveMaths(secondNumber, newNumber);\n}", "function addNumbers(num1, num2){\n console.log(num1 + num2);\n}", "function addNumbers() {\n for (var _len = arguments.length, numbers = Array(_len), _key = 0; _key < _len; _key++) {\n numbers[_key] = arguments[_key];\n }\n\n return numbers.reduce(function (accum, curr) {\n return accum + curr;\n });\n}", "function addNums(num1, num2) {\n return num1 + num2\n}", "function addNumbers(num1, num2){\n var result = num1 + num2;\n // returns the value to the function call\n return result;\n}", "function addNums(num1, num2) {\n return num1 + num2;\n}", "function addNums(num1, num2) {\n return num1 + num2;\n}", "function fibonacci(num1, num2, numbers, limit) {\n const next = num1 + num2;\n if (next > limit) {\n return numbers;\n }\n if (next % 2 === 0) {\n numbers.push(next);\n }\n return fibonacci(num2, next, numbers, limit);\n}", "function sumofNnumbers(number){\n let sum = 0;\n for(let count = 1; count <= number; count++){\n sum = sum + count;\n }\n return sum;\n }", "function fibonacci(num) {\n console.log(num)\n if (num <= 1) {\n // todo investigate the time complexity of .push()\n //array.push(num)\n return 1\n }\n \n return fibonacci(num - 1) + fibonacci(num - 2)\n}", "function recursiveFactorial(number) {\n if (number === 0 {\n return 0;\n }\n if (number === 1) {\n return 1;\n } else if (number > 0) {\n return number * recursiveFactorial(number - 1);\n }\n }", "function summation(num) {}", "function simpleAdding(num) {\n\n // code goes here\n let result = 0;\n for(let i = 1; i <= num; i++) {\n result += i;\n }\n return result;\n\n}", "function SimpleAdding(num) {\n // Declare a variable to hold our answer\n var sum = 0;\n\n // Loop through all numbers between num and 1 inclusive...\n for (var i = num; i > 0; i--) {\n // ...adding i to our answer each time.\n sum += i;\n }\n\n // Return our answer.\n return sum;\n}", "function addTogether(num1,num2) {\nif (typeof(num1)=='number'){\n if (typeof(num2) == 'number'){\n return num1+num2\n }\n else if(!num2 ){\n return function(newnum){return newnum+num1}}\n else{return undefined}\n}\nelse {return undefined}\n\n}", "function Factorial(num, sum = 1){\n if(num == 1){\n return sum;\n }\n sum = sum * num;\n return Factorial(--num, sum);\n}", "function fibonacci(number){\n\tif(number <=1){\t\t// this number <= 1 must exist, \n\t\treturn number;\n\t}\n\treturn fibonacci(number - 2) + fibonacci(number - 1);\n}", "function sum(n){\n if(n == 1){\n return 1 ;\n }else{\n return sum(n-1)+n ;\n }\n}", "function factorial(num) {\n\t// always add a base case to terminate recursion\n\tif(num===1){\n\t\treturn 1; // 1! = 1;\n\t}\n\treturn num * factorial(num-1);\t\n}", "function fib(num){\n if(num === 0 || num === 1){\n return 1; \n }\n else{\n return fib(num - 1) + fib(num - 2);\n }\n}", "function sumOfNumbers(num) {\n let sum = 0;\n for (let i = 0; i <= num; i++) {\n sum += i;\n }\n return sum;\n}", "function addNums(num1 = 1, num2 = 1) {\r\n return num1 + num2;\r\n}", "function triangularNumber(num) {\n // Base Case\n if (num === 0) {\n return num;\n }\n\n //Recursive Case\n return num + triangularNumber(num - 1);\n}", "function sumNumbers(num1,num2){\n return num1 + num2\n\n}", "function factorial(num){\n if(num === 1) return 1; \n return num * sumRange(num-1);\n }", "function sumNumbers(num1, num2) {\n var result = num1 + num2;\n return 10;\n}", "function addNumbers(a, b) {\n\t/* Within the addNumbers() function, we will create a variable that will add the two above arguments together. */\n\tvar sum = a + b;\n\n\t/* Use a function \"return\" to send the \"sum\" variable outside of the function for other elements to use. */\n\treturn sum;\n}", "function fibonacci(number, list = []) {\r\n if (number <= 1) {\r\n return 1;\r\n }\r\n if (number <= 0) {\r\n return \"please use a positive number\";\r\n }\r\n\r\n const sum = fibonacci(number - 1) + fibonacci(number - 2);\r\n list.push(sum);\r\n return sum;\r\n}", "function add(number) {\n\t\treturn number + number;\n\t}", "function add(num1, num2) {\n if (num1 === undefined) {\n return add;\n }\n\n if (num2 === undefined) {\n return function innerAdd(num3) {\n if (num3 === undefined) {\n return innerAdd;\n }\n\n return num1 + num3;\n };\n }\n\n return num1 + num2;\n}" ]
[ "0.7538226", "0.7538226", "0.72371554", "0.72154796", "0.70560026", "0.69642884", "0.68568873", "0.6837586", "0.6828734", "0.6780858", "0.6773384", "0.6769926", "0.6680691", "0.6637689", "0.66249305", "0.6622949", "0.6601578", "0.65892774", "0.6589263", "0.65838516", "0.6575172", "0.65642226", "0.65577435", "0.6549436", "0.65401524", "0.65392065", "0.65354663", "0.6512454", "0.6510235", "0.6508067", "0.6504238", "0.64934766", "0.64880705", "0.6487426", "0.6483611", "0.6482942", "0.6469037", "0.6444729", "0.6442496", "0.6442033", "0.6438657", "0.6435612", "0.64290154", "0.64185566", "0.6403346", "0.64009464", "0.6391027", "0.6391027", "0.6381892", "0.6378366", "0.63764197", "0.63520896", "0.6346945", "0.6343296", "0.63411427", "0.63364476", "0.632124", "0.6313864", "0.62961006", "0.62854016", "0.6274852", "0.6270243", "0.6264522", "0.6256773", "0.62530744", "0.6247804", "0.6220485", "0.62176406", "0.62128985", "0.62080747", "0.6194693", "0.6184354", "0.61839443", "0.6179063", "0.61755544", "0.61743104", "0.61743104", "0.6165227", "0.61550325", "0.6146616", "0.61416125", "0.6125098", "0.6121246", "0.61144036", "0.611277", "0.6112704", "0.60990816", "0.6089221", "0.6086364", "0.60836047", "0.6072218", "0.6063703", "0.6060894", "0.6038313", "0.603657", "0.6032157", "0.6032056", "0.60312814", "0.60303515", "0.6018889" ]
0.8433195
0
console.log(addNumbers(5)) / Create a function "between50And500" that takes a number as an argument. "between50And500" should return a true if the number passed to it is between 50 and 500 exclusive. For example, if the input is 45 then your function should return false and if the input is 472 it should return true. create a function with input number initialize for loop with index starting at 1, and go up until num set condition if it's true return true if false return false output should be boolean true or false
function between50and500(num) { for(let i = 1; i <= num; i++) { if(num > 50 && num < 500) { return true } else { return false } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function between50and500(num){\n // console.log(num > 50 && num < 500)\n return (num > 50 && num < 500)\n}", "function fiveAndGreaterOnly(numbers) {\n // your code here\n}", "function checkNumber(numbersArray) { return numbersArray >= 5; }", "function fiveEx(p, o) {\n let insideNumber;\n let inbetweenNumber;\n\n if (p < 60 && p > 40) {\n if (o < 60 && o > 40) {\n insideNumber = true;\n // console.log(`${p} and ${o} are between 40 - 60`);\n } else {\n insideNumber = false;\n // console.log(`${p} and ${o} are NOT between 40 - 60`);\n }\n // console.log(insideNumber);\n }\n\n if (p <= 100 && p >= 70) {\n if (o <= 100 && o >= 70) {\n inbetweenNumber = true;\n // console.log(`${p} and ${o} are equal or between 70 - 100`);\n } else {\n inbetweenNumber = false;\n // console.log(`${p} and ${o} are NOT equal or between 70 - 100`);\n }\n // console.log(inbetweenNumber);\n }\n\n if (insideNumber == true || inbetweenNumber == true) {\n console.log(\"The parameters were met because one was true\");\n } else {\n console.log(\"The paramenters weren't met because one was false\");\n }\n}", "function sum(num1, num2){\n var num1 = 10;\n var num2 = 22;\n var result = num1 + num2;\n if (result <= 25){\n console.log(true);\n }\n else{\n console.log(false);\n } \n}", "function testNumbers(nr1, nr2) {\n const i = 30;\n let sum = nr1 + nr2;\n if (nr1 === i && nr2 === i || sum === 30) {\n return true;\n } else {\n return false;\n }\n}", "function sumOfNumbers(number) {\n let sum = 0\n for (let i = 0; i <=number; i++) {\n sum += i;\n }\n console.log(`Sum Of All Numbers: ${sum}`);\n }", "function isBetween(num) {\n return num >= 50 && num <= 100; // returning a boolean\n}", "function greaterThanFive(number){\n if(number > 5){\n console.log(\"true\")\n }\n else{console.log(\"false\")}\n \n }", "function sumOfNumbers(number) {\r\n var sum = 0;\r\n\r\n for (var i = 1; i <= number; i++) {\r\n if (i % 5 === 0 || i % 3 === 0) {\r\n sum += i;\r\n }\r\n }\r\n\r\n return sum;\r\n }", "function isInRange(num) {\n if (num>20 && num<50) {return true;}\n else {return false;}\n}", "function numbersBetweenFifty(x, y) {\n if ((x === 50 && y ===0) \n || x + y === 50)\n {\n return true;\n } \n else \n {\n return false;\n }\n }", "function over50(num){\n return num > 50;\n}", "function isMultipleOfFive(number){\n if(number%5 === 0){\n return true;\n } return false;\n}", "function multiplesOf3and5(number) {\r\n let sum_total = 0;\r\n for (var i = 0; i < number; i++) {\r\n if (i % 3 == 0 || i % 5 == 0) {\r\n sum_total = sum_total + i;\r\n }\r\n }\r\n return console.log(sum_total);\r\n}", "function addRange(number) {\n console.log(number);\n return number === 1 ? 1 : number + addRange(number - 1);\n}", "function over50(num){\n return num > 50;\n}", "function acceptsNumber(number) {\n if (number > 1) {\n for (var i = 1; i <= number; i++) {\n //must check of 1 because number / 0 = ...\n if (number % i === 0) {\n return false;\n }\n return true;\n }\n } else {\n return \"Number is not valid for check!!!\";\n }\n}", "function addNumbers(num){\n let result;\n while (num > 0) {\n num += (number-1);\n num--;\n }\n}", "function canSum(targetSum, numbers) {\n const table = new Array(targetSum + 1).fill(false);\n table[0] = true; \n\n for (let i = 0; i <= targetSum; i++) {\n if (table[i] === true) {\n for (let num of numbers) {\n table[i + num] = true;\n // console.log('i', i, table)\n }\n }\n }\n return table[targetSum];\n}", "function sumOfNumbers(number) {\n let sum = 0;\n for (let i = 0; i <= number; i++) {\n sum += i;\n }\n console.log(`The sum of all numbers from 0 to ${number} is ${sum}`);\n}", "function greaterThanFive(number) {\n if (number > 5) {\n return true;\n } else {\n return false;\n }\n}", "function checkExceptions(currentNumber){\n if (currentNumber % 2 === 0){\n return true;\n } else if (currentNumber % 5 === 0) {\n return true;\n } else {\n return false;\n }\n}", "function simpleAdding(num) {\n\n // code goes here\n let result = 0;\n for(let i = 1; i <= num; i++) {\n result += i;\n }\n return result;\n\n}", "function numbersFrom50To99(x, y) \n {\n if ((x >= 50 && x <= 99) || (y >= 50 && y <= 99))\n {\n return true;\n } \n else \n {\n return false;\n }\n}", "function in_range(num1, num2) {\n if ((50 <= num1 && num1 <= 99) && (50 <= num2 && num2 <= 99)) return true;\n return false;\n\n}", "function divisibleFive(num) {\n if(num % 5 === 0) {\n return true; \n } else {\n return false;\n }\n}", "function multiplesOf3and5(number) {\n // Good luck!\n let result= 0;\n for (let i =0; i < number ; i++){\n let test = i % 3 === 0 || i % 5 === 0;\n if(test) result += i;\n }\n return result;\n}", "function generateNumbers(start_val, end_val){\n //add 1 to start value (new value) and append to array\n // add 1 to new value and append to array\n // continue to add one to new value until new value equals end value\n //stop when new value > end value\n let numbers = []; // it's a list - zero based index - \n\n for(let i = start_val; i <= end_val; i++){\n //this will execute in a loop until i equals end val\n numbers.push(i)\n }\n return numbers\n}", "function under50(num){\n return num<50;\n}", "function sumofNnumbers(number){\n let sum = 0;\n for(let count = 1; count <= number; count++){\n sum = sum + count;\n }\n return sum;\n }", "function addUp(number) {\n result = 0;\n if (isNaN(number) || typeof number == \"string\") {\n alert(\"enter a number\");\n } else {\n for (i = 1; i <= number; i++) {\n result += i;\n }\n console.log(result);\n }\n}", "function under50(num){\n return num < 50;\n}", "function threesFives(num){\n var addednum = 0;\n\n for (var i= 1; i < num; i++){\n if(i % 3 !== 0 && i % 5 !==0 ){\n addednum += i;\n }\n console.log(addednum)\n }\n return addednum\n}", "function addNumbers(num) {\n let acc = 0;\n for (let i = 0; i <= num; i++) {\n acc += i;\n }\n return acc;\n}", "function isMultipleOfFive(input) {\n return input % 5 == 0; \n }", "function under50(num){\n return num < 50;\n}", "function SimpleAdding(num){\n var result = 0;\n var add = function(){\n for(var i = 1; i <= num; i++){\n result += i;\n }\n }; \n add(num);\n return result;\n}", "function solution(number){\n let sum = 0;\n \n for ( i = 1; i < 10; i ++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n };\n };\n return sum;\n }", "function addNumbers(firstNumber, secondNumber) {\n // return firstNumber + secondNumber;\n return firstNumber + secondNumber;\n}", "function summation(n) {\n\n let sum = 0;\n //start the count at 1, and if the \"i\" is less than or equal to the number, add 1 to the number\n //in this case if \"i\" is less than 4, add 1 and loop again\n for (let i = 1; i <= n; i++) {\n //add the value to the variable until it reaches the condition\n sum += i;\n }\n //return the vale\n return sum;\n}", "function summation(number) {\r\n \r\n var sum, i;\r\nsum = 0;\r\n for(var i = 0; i <= number; i++){\r\n sum = sum + i\r\n }\r\nreturn sum;\r\n}", "function lessThan100(num1,num2) {\r\n let sum=num1+num2;\r\n if(sum<100)\r\n {\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "function myNumb(numbers){\n if (numbers.indexOf(1) != -1 || numbers.indexOf(3) != -1) \n{\n return true;\n}\nelse{\n return false;\n}\n }", "function under50(num) {\n return num < 50;\n}", "function checks(a){\n if(a>99 && a<1000){\n return \"yes\"\n }else{\n return \"no\"\n }\n}", "function addNumbers(num) {\n if(num <= 1) {\n return num\n }\n return num + addNumbers(num - 1)\n}", "function solution(number){\n\n\tvar multiplesArray = [];\n\n\n\t//make an array of every multiple of 3 or 5\n\tfunction makeArray(){\n\t\tfor(i=number-1; i>0; i--){\n\t\t\tif(i % 3 === 0 || i % 5 === 0){\n\t\t \tmultiplesArray.push(i);\n\t\t \t};\n\t\t};\n\n\t};\n\t makeArray(number);\n\n\t //add them all together and return the value\n\t return multiplesArray.reduce((a, b) => a + b, 0);\n\t\n}", "function multiplesOf3and5(number) {\n let sum = 0;\n for(let i = 3; i < number; i++) {\n if(!(i % 3) || !(i % 5)) {\n sum+=i\n }\n }\n return sum;\n}", "function positive_increment() {\n for (var i = 5; i < 10; i++) {\n if (i < 0) return false;\n if (i > 20) return false;\n if (i === 7) return true;\n }\n return false;\n}", "function solution(number){\n var sum = 0;\n for(i = 0; i < number; i++){\n if(i % 3 === 0 || i % 5 === 0){\n sum = sum + i;\n }\n }\n return sum\n}", "function checkNumber(a, b) {\n if (a == 8 || b == 8) {\n console.log(true);\n } else if (a + b == 8) {\n console.log(true);\n } else if (a - b == 8 || b - a == 8) {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "function addUp(arr, num){\n for(let i = 0; i < arr.length; i++){\n for(let j = 0; j < arr.length; j++){\n if(arr[i] + arr[j] === num){\n return true;\n }\n }\n }\n return false;\n}", "function check50() {\n var number1 = parseFloat(document.getElementById(\"check1\").value),\n number2 = parseFloat(document.getElementById(\"check2\").value);\n if ((number1 == 50 || number2 == 50 || number1+number2 == 50) && !isNaN(number1) && !isNaN(number2)){\n document.getElementById(\"check-h3\").innerText = \"True\";\n }else if((number1 != 50 || number2 != 50 || number1+number2 != 50) && !isNaN(number1) && !isNaN(number2)) {\n document.getElementById(\"check-h3\").innerText = \"False\";\n }else {\n document.getElementById(\"check-h3\").innerText = \"Please Insert Valid Numbers\";\n }\n clear();\n}", "function divisibleByFive(num1) {\n return num1%5===0?true:false\n}", "function fizzbuzz(num1, num2) {\n // for min and max ranges num1 and num2\n for (let i = num1; i <= num2; i++) {\n // multiple of 3 and 5\n if (i %3 == 0 && i %5 == 0) {\n console.log(\"FizzBuzz\")\n } \n // multiple of 3\n else if (i %3 == 0) {\n console.log(\"Fizz\");\n }\n // multiple of 5\n else if (i %5 == 0) {\n console.log(\"Buzz\");\n }\n // print the num if none of the statements are true\n else {\n console.log(i);\n } \n}\n\n}", "function divisibleByFive(n) {\n if(n % 5 == 0){\n return true\n }else\n return false\n\n }", "function addRepeat(num1, num2) {\n let isTrue = false\n let sum = 0\n\n for (let i = 0; i < (num2 / num1); i++) {\n sum += num1\n if (sum === num2) {\n isTrue = !isTrue\n }\n }\n return isTrue\n\n}", "function summation(numbers) {\n let total = 0;\n for (let i = 1; i <= numbers; i++) {\n total += i;\n }\n return total;\n}", "function checkIfEntered (numberUser){\n var check = false;\n for(var i=0; i<= numbers.length; i++){\n if (numberUser == numbers[i]) {\n check = true;\n console.log(\"SI\");\n }\n }\n return check;\n}", "function positiveNums(value) {\n return value > 0; \n}", "function getValues(){\n //get values from the page \n //define block scoped variable\n let first_number = document.getElementById(\"start_value\").value;\n let last_number = document.getElementById(\"end_value\").value;\n\n //parse into integers\n first_number = parseInt(first_number);\n last_number = parseInt(last_number);\n //alert(\"The start value: \" + first_number);\n\n //Validate input with a Boolean check\n //call generateNumbers\n\n if(Number.isInteger(first_number) && Number.isInteger(last_number)){\n let numbers = generateNumbers(first_number, last_number);\n //call displayNumbers\n displayNumbers(numbers);\n\n } else {\n alert(\"You must enter integers\");\n }\n\n}", "function multiplesOf3and5(number) {\n let sum = 0;\n for (let i = 0; i < number; i++) {\n sum += i % 3 && i % 5 ? 0 : i;\n }\n return sum;\n}", "function sumNumbersTo (toNumber){\n let finalSum = 0;\n for (let i=0 ; i<=toNumber; i++){\n finalSum += i;\n }\n return finalSum;\n }", "function isMultipleOfFive(input) {\n return input % 5 === 0;\n}", "function abc(number){\n var sum = 0;\n for(var i =0; i<=number; i++){\n sum = sum + i;\n }\n console.log(sum);\n return sum+10;\n}", "function FindSumB(numbers, answer) {\n let found = false;\n let checkValue = 0;\n //sort the array\n numbers.sort(function (a, b) {\n return a - b\n });\n let startIndex = 0;\n let endIndex = numbers.length - 1;\n //\"do Loop\" Do this while condition is met\n do {\n //INDEX: 0 1 2 3\n //ARRAY:[3, 7, 10, 15]\n checkValue = numbers[startIndex] + numbers[endIndex]\n if(answer == checkValue){\n found = true;\n break; //when answer is found it will break from loop\n }else if (answer > checkValue){\n startIndex ++; //if true 0 -> 1 \n \n }else if (answer < checkValue){\n endIndex --; //if true 3 -> 2\n \n }\n } while( found == false && startIndex < endIndex);\n \n return found;\n}", "function addmultiple(){\r\n var sum=0;\r\n var a;\r\n a=Number(document.getElementById(\"second\").value);\r\n \r\n for (let i = 1; i <= a; i++) {\r\n if(i%3==0 || i%5==0)\r\n sum += i;\r\n \r\n }\r\n document.getElementById(\"answer2\").value=sum;\r\n}", "function multipleOfFive(number) {\n if (verbose) {\n console.log('mulitpleOfFive() -> number', number);\n }\n return number % 5 === 0;\n}", "function divisibleByFive(num1) {\r\n\treturn (num1%5 === 0);\r\n}", "function SimpleAdding(num) {\n // Declare a variable to hold our answer\n var sum = 0;\n\n // Loop through all numbers between num and 1 inclusive...\n for (var i = num; i > 0; i--) {\n // ...adding i to our answer each time.\n sum += i;\n }\n\n // Return our answer.\n return sum;\n}", "function highFive(num){ //print numbers less than 6 and if equals to 5 then print High Five!\n for(var i=0; i<num; i++){\n if(i == 5){// if num equals to 5, log below\n console.log(\"High Five!\");\n }\n else{//print i\n console.log(i);\n }\n }\n}", "function perfectNumber(upTo) {\n for (let i = 6; i < upTo; i++) {\n checkIfPerfectNumber(i); // Sets iteration of i as parameter to be passed through checkPerfectNumbers function\n }\n return perfectNumForFunction; // Returns perfect numbers after function check\n}", "function sumOdd5000(){\n var output = 0;\n for(var i = 1; i <= 5000; i=i+2){\n output += i;\n }\n return output;\n}", "function solution(number){\n let sum = 0;\n if (number < 0) {\n return 0;\n }\n for (i = 0; i < number; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i \n }\n }\n return sum;\n}", "function rand(min,max,isInt) {\n var min = min || 0,\n max = max || 1,\n isInt = isInt || false,\n num = Math.random()*(max - min) + min;\n if (isInt === true) {\n num = Math.round(num)\n if (contains.call(numArray, num)) {\n rand(min, max, isInt)\n }\n else {\n numArray.push(num)\n console.log(num)\n return num\n }\n\n }\n else {\n return num\n }\n\n}", "function printUpTo(x) { //x=-10\n // your code here\n if (x < 0) {\n console.log(false)\n return false;\n }\n for (var i = 1; i <= 1000; i++) { //i=1>2>3>4...999>1000>1001\n console.log(i); //1,2,3...999,1000\n }\n\n}", "function addNumbers(a, b) {\n return a + b;\n}", "function addNumbers(a, b) {\n return a + b;\n}", "function addNumbers( firstNumber, secondNumber ) {\n // return firstNumber + secondNumber;\nlet solution = firstNumber + secondNumber;\nreturn solution;\n}", "function inRange(num1,num2){\n // If these two numbers aren't greater than 50 - 99\n // dont proceed\n if(num1 >= 50 && num1 <= 99 ){\n // output something saying it is \n console.log(num1 + \" is in Range\")\n if(num2 >= 50 && num2 <= 99){\n // output something saying it is\n console.log(num2 + \" is in Range\")\n }\n }\n}", "function sumOfLowNumbers (a, b, c, d, e) {\n if (a > 6) {a=0} \n if (b > 6) {b=0} \n if (c > 6) {c=0} \n if (d > 6) {d=0} \n if (e > 6) {e=0}\n console.log(a + b + c + d + e)\n}", "function numberLogger(){\n for(let i = 1; i < 101; ++i){\n const three = i % 3;\n const five = i % 5;\n if(!three && !five){\n console.log(\"Jackpot!\");\n } else if(!three) {\n console.log(\"This is a multiple of 3\");\n } else if(!five){\n console.log(\"This is a multiple of 5\");\n } else {\n console.log(i);\n }\n }\n}", "function check(a, b) {\n if (a == 50 || b == 50 || (a + b) == 50) {\n console.log(true)\n } else {\n console.log(false)\n }\n}", "function printOddNumbersLessThan( number ) {\n for( let x = 1; x < number; x++ ) {\n //Here we perform another action so we need a second function\n if ( !checkForOddNumber( x ) ) {\n continue;\n }\n \n console.log( x );\n }\n}", "function filteritout(num)\r\n{\r\n if(num<=0)\r\n {\r\n return true;\r\n }\r\n return false\r\n}", "function highFive(num){\n     for(var i=0; i<num; i++){\n         if(i == 5){\n             console.log(\"High Five!\");\n         }\n         else{\n             console.log(i);\n         }\n     }\n }", "function highFive(num){\n     for(var i=0; i<num; i++){\n         if(i == 5){\n             console.log(\"High Five!\");\n         }\n         else{\n             console.log(i);\n         }\n     }\n }", "function multi_sum(num){\r\n return num==1 ? 0 : (num % 3 == 0) || (num % 5 == 0)? num + multi_sum(num-1): 0 + multi_sum(num-1) ; \r\n}", "function solution1(num) {\n\n\t// req 3\n\tif (num <= 0) {\n\t\treturn 0;\n\t}\n\n\tlet arr = [];\n\n\tfor (let i = 1; i < num; i++) {\n\n\t\tarr.push(i);\n\t}\n\n\t// req 1 & 4\n\tlet multiples = arr.filter(x => x % 3 === 0 || x % 5 === 0);\n\n\tlet sum = 0;\n\tfor (let i = 0; i < multiples.length; i++) {\n\n\t\tsum += multiples[i];\n\t}\n\n\treturn sum;\n}", "function tester(a){\n\t\n\tif(a > 1 && a < 10){\n\t\treturn true;\n\t} \n\telse{\n\t\treturn false;\n\t}\n\t\n}", "function solution(number) {\n var sum = 0;\n for (var i = 1; i < number; i++) {\n if (!(i % 3) || !(i % 5)) {\n sum += i;\n }\n }\n return sum;\n}", "function sumOfNumbers(num) {\n let sum = 0;\n for (let i = 0; i <= num; i++) {\n sum += i;\n }\n return sum;\n}", "function printUpTo(x){\n if(x<0){\n console.log(\"Number is negitive\")\n return false;\n }\n for(var i =0; i <= x; i++){\n console.log(i);\n }\n}", "function numbersLessThanFive(inputArray) {\n var outputArray = [];\n for (var i = 0; i < inputArray.length; i++) {\n if (inputArray[i] < 5) {\n outputArray.push(inputArray[i]);\n }\n }\n return outputArray;\n}", "function filteritout(num)\n{\n if(num<=0)\n {\n return true;\n }\n return false\n}", "function addNumbers(number1, number2) {\n return number1 + number2\n}", "function addTwoNumbers(a , b){\r\n const total = a + b;\r\n const answer = false;\r\n return answer;\r\n}", "function checkRangeNumber(min, max, number) {\r\n var resultRange = false;\r\n if(number >= min && number <= max) {\r\n resultRange = true;\r\n }\r\n return resultRange;\r\n}", "function find50(x, y) \n{\n var sum = x + y;\n return ((x == 50 || y == 50) ||sum == 50)? alert(\"One of numbers or their sum is = 50\"):\n alert(\"Neither number nor their sum is = 50\");\n}" ]
[ "0.7260147", "0.70935845", "0.6982522", "0.6714427", "0.6622951", "0.6556341", "0.65446925", "0.6505263", "0.65042156", "0.64400035", "0.6432569", "0.6421076", "0.63858145", "0.63853514", "0.6360893", "0.6353601", "0.6346918", "0.63247067", "0.63121563", "0.63110125", "0.6284078", "0.62587047", "0.6250019", "0.62465566", "0.62464434", "0.6233508", "0.62307817", "0.62262285", "0.62246335", "0.62201136", "0.62187743", "0.62144107", "0.6194866", "0.6190506", "0.61744237", "0.61722606", "0.6166946", "0.61653644", "0.6164662", "0.61575294", "0.61329055", "0.6130714", "0.6112293", "0.6100138", "0.6084201", "0.606942", "0.6064727", "0.60635275", "0.6061245", "0.60564727", "0.60536295", "0.60515344", "0.60474503", "0.604584", "0.6044531", "0.60383713", "0.60334337", "0.60246325", "0.602389", "0.6013385", "0.6012833", "0.60095483", "0.6003476", "0.5998936", "0.5992831", "0.59926593", "0.5990918", "0.59833753", "0.59711385", "0.59708744", "0.5966498", "0.59585005", "0.59570014", "0.5955955", "0.59553", "0.5954043", "0.59526354", "0.5945471", "0.5945471", "0.5941349", "0.59411365", "0.5932766", "0.5929867", "0.59292334", "0.5926681", "0.59250045", "0.5923696", "0.5923696", "0.5923454", "0.59170103", "0.590681", "0.59061706", "0.5900567", "0.5898588", "0.589625", "0.58953255", "0.5893629", "0.58917016", "0.5881619", "0.5871787" ]
0.778311
0
console.log(between50and500(61), 'this is for 50and500') console.log(between50and500(31), 'should return false') / Create a function "divBy100" that takes a number as an argument. "divBy100" should return a true if the number passed to it is divisible by 100. For example, if the input is 120 then your function should return false and if the input is 600 it should return true. create a function with input num set modular 100; if equals 0; return true else return false
function divBy100(num) { if(num % 100 === 0) { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function between50and500(num){\n // console.log(num > 50 && num < 500)\n return (num > 50 && num < 500)\n}", "function between50and500(num) {\n for(let i = 1; i <= num; i++) {\n if(num > 50 && num < 500) {\n return true\n } else {\n return false\n }\n }\n}", "function isBetween(num) {\n return num >= 50 && num <= 100; // returning a boolean\n}", "function divisible(num) {\nif(num % 100 == 0){\n return true;\n}else\nreturn false;\n\n}", "function in_range(num1, num2) {\n if ((50 <= num1 && num1 <= 99) && (50 <= num2 && num2 <= 99)) return true;\n return false;\n\n}", "function numbersFrom50To99(x, y) \n {\n if ((x >= 50 && x <= 99) || (y >= 50 && y <= 99))\n {\n return true;\n } \n else \n {\n return false;\n }\n}", "function lessThan100(num1,num2) {\r\n let sum=num1+num2;\r\n if(sum<100)\r\n {\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "function between(a){\n return (typeof(a)===\"number\" && a>=100 && a<=200)\n}", "function between50And99(a, b) {\n return (a >= 50 && a <= 99) || (b >= 50 && b <= 99);\n}", "function divisible(num) {\n return num % 100 === 0;\n }", "function between (a) {\n \tif (100<a && 200>a) {\n \t\treturn true;\n \t}\n \telse \n \t\treturn false;\n }", "function range(a, b) {\n if ((a >= 40 && a <= 60) && (b >= 40 && b <= 60)) {\n console.log('given numbers are in range of 40 and 60')\n } else if ((a >= 70 && a <= 100) && (b >= 70 && b <= 100)) {\n console.log('given numbers are in range of 70 and 100')\n } else {\n console.log('one or both the numbers are not in range')\n }\n}", "function lessThan100(num1,num2) {\r\n\treturn (num1+num2)<100\r\n}", "function inRange(num1,num2){\n // If these two numbers aren't greater than 50 - 99\n // dont proceed\n if(num1 >= 50 && num1 <= 99 ){\n // output something saying it is \n console.log(num1 + \" is in Range\")\n if(num2 >= 50 && num2 <= 99){\n // output something saying it is\n console.log(num2 + \" is in Range\")\n }\n }\n}", "function divBy100(num) {\n return (num % 100 === 0)\n}", "function divisible(num) {\n if (num % 100 === 0) {\n return true;\n }\n return false;\n}", "function under50(num){\n return num<50;\n}", "function isInRange(num) {\n if (num>20 && num<50) {return true;}\n else {return false;}\n}", "function in3050(a, b) {\n if (a >= 30 && a <= 40 && b >= 30 && b <= 40) {\n return true;\n } else if (a >= 40 && a <= 50 && b >= 40 && b <= 50) {\n return true;\n } else {\n return false;\n }\n}", "function over50(num){\n return num > 50;\n}", "function under50(num){\n return num < 50;\n}", "function check(num)\r\n{\r\n return num % 100==0;\r\n}", "function over50(num){\n return num > 50;\n}", "function lessThan100(num1,num2) {\n return num1+num2<100?true:false\n}", "function under50(num){\n return num < 50;\n}", "function checkDivision(beginRange, endRange) {\n if ((endRange > beginRange) && (endRange > 0 && endRange <= 100) && (Number.isInteger(beginRange)) && (Number.isInteger(endRange))) {\n for (let i = beginRange; endRange >= beginRange; beginRange++)\n if (!(beginRange % 2) && (beginRange % 10 !== 0)) {\n console.log(`${beginRange} is even`)\n } else if (beginRange % 3 === 0 ) {\n console.log(`${beginRange} apply to 3`)\n } else if (beginRange % 10 === 0) {\n console.log(`${beginRange} is divisible by 10`)\n }\n } else {\n return 'wrong input'\n }\n}", "function nearHundred(n){\n if (Math.abs(100-n) <= 10) {\n return true;\n } else if (Math.abs(200-n) <= 10) {\n return true;\n } else {\n return false;\n }\n}", "function under50(num) {\n return num < 50;\n}", "function lessThan100(a, b) {\n if (a + b < 100) {\n return true;\n }\n return false;\n}", "function test (beforePercentage, perc) {\n if (beforePercentage < 25 && perc >= 25 && perc < 50) {\n console.log(`${beforePercentage} ${perc} it is 25%`)\n } else if (beforePercentage < 50 && perc >= 50 && perc <= 75) {\n console.log(`${beforePercentage} ${perc} it is 50%`)\n } else if (beforePercentage < 75 && perc >= 75 && perc <= 75) {\n console.log(`${beforePercentage} ${perc} it is 75%`)\n } else if (beforePercentage < 100 && perc >= 100) {\n console.log(`${beforePercentage} ${perc} it is 100%`)\n }\n}", "function testStuff (a, b) { \n\t\tif(a > 25 && b < 100){ \n\t \t\tconsole.log(a + \" is greater than 25 and \" + b + \"is less than 100\"); \n\t\t} else { \n\t\t console.log(a + \" is NOT greater than 25 or \" + b + \"is NOT less than 100\"); \n\t}; \n\t}", "function fiveEx(p, o) {\n let insideNumber;\n let inbetweenNumber;\n\n if (p < 60 && p > 40) {\n if (o < 60 && o > 40) {\n insideNumber = true;\n // console.log(`${p} and ${o} are between 40 - 60`);\n } else {\n insideNumber = false;\n // console.log(`${p} and ${o} are NOT between 40 - 60`);\n }\n // console.log(insideNumber);\n }\n\n if (p <= 100 && p >= 70) {\n if (o <= 100 && o >= 70) {\n inbetweenNumber = true;\n // console.log(`${p} and ${o} are equal or between 70 - 100`);\n } else {\n inbetweenNumber = false;\n // console.log(`${p} and ${o} are NOT equal or between 70 - 100`);\n }\n // console.log(inbetweenNumber);\n }\n\n if (insideNumber == true || inbetweenNumber == true) {\n console.log(\"The parameters were met because one was true\");\n } else {\n console.log(\"The paramenters weren't met because one was false\");\n }\n}", "function areYouWithinTwentyDigitsOf(integer) {\n if ((100 - integer) <= 20 || (120 - integer) <= 20) {\n console.log(true)\n } else if ((400 - integer) <= 20 || (420 - integer) <= 20) {\n console.log(true)\n } else {\n console.log(false);\n }\n\n}", "function divisible(num) {\n\treturn !(num % 100);\n\t// return num % 100 == 0;\n}", "function anyNumber(firstNum, secondNum){\n // if(firstNum % secondNum === 0){\n // console.log(true);\n // } else {\n // console.log(false);\n // }\n console.log(firstNum % secondNum == 0); // can also write it like this \n}", "between(num, lower, upper) {\n return num > lower && num <= upper;\n }", "function isDivisible(divisee, divisor) {\n // your code here\n if (divisee % divisor === 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkNumRange(n1, n2) {\n if (\n (n1 >= 40 && n1 <= 60 && n2 >= 40 && n2 <= 60) ||\n (n1 >= 70 && n1 <= 100 && n2 >= 70 && n2 <= 100)\n ) {\n return true;\n } else {\n return false;\n }\n}", "function checks(a){\n if(a>99 && a<1000){\n return \"yes\"\n }else{\n return \"no\"\n }\n}", "function check(a, b) {\n\t//je check si la somme est inférieure à 100 pour retourner true, sinon je retourne false\n\tif(a+b < 100){\n\t return true;\n\t} else {return false;}\n}", "function testLogicalAnd(val) {\n if (val <= 50 && val >= 25) {\n return \"yes\";\n }\n\n return \"No\";\n}", "function numbersBetweenFifty(x, y) {\n if ((x === 50 && y ===0) \n || x + y === 50)\n {\n return true;\n } \n else \n {\n return false;\n }\n }", "function testLogicalAND(val){\n if (val <= 50 && val >= 25){\n return \"Yes\";\n }\n return \"No\";\n}", "function testLogicalAnd(val) {\n\n if (val >=25 && val <= 50) {\n return \"Yes\";\n }\n return \"No\";\n}", "function testLogicalAnd(val) {\r\n if (val <= 50 && val>=25) {\r\n document.write (\"Yes <br><br>\") ;\r\n }\r\n else{\r\n document.write (\"No <br><br>\") ;\r\n }\r\n }", "function billetes100(monto){\n if( monto%100 == 0){ \n return true;\n } else {\n alert(\"El cajero solo entrega billetes de 100\");\n return false;\n }\n }", "function numbers_ranges(x, y) {\n if ((x >= 40 && x <= 60 && y >= 40 && y <= 60) \n || \n (x >= 70 && x <= 100 && y >= 70 && y <= 100))\n {\n return true;\n } \n else \n {\n return false;\n }\n }", "function isBetween(num, low, high){\n return (num >= low) && (num <= high);\n}", "function under50(a) {\n return a < 50;\n}", "function between(min, max, num) {\n return (num >= min && num <= max);\n}", "function numberIn20(x) {\n return ((Math.abs(100 - x) <= 20) ||\n (Math.abs(400 - x) <= 20));\n}", "function dividedNumber (number){\n if (dividedBy3() && dividedBy5()){\n return 'BOTH';\n } else if (dividedBy5()){\n return 'FIVE';\n } else if (dividedBy3()){\n return 'THREE';\n } else return number; \n \n \n function dividedBy3 (){\n return (number % 3 === 0) ;\n }\n function dividedBy5 (){\n return (number % 5 === 0);\n }\n \n}", "function between50And99_3Numbers(a, b, c) {\n return (a >= 50 && a <= 99) || (b >= 50 && b <= 99) || (c >= 50 && c <= 99);\n}", "function div(a,b) {\n if (a % b == 0) {\n return true;\n }\n return false;\n}", "function testLogicalAnd(val) {\n\tif (val <= 50 && val >= 25) {\n\t\treturn \"Yes\";\n\t}\n\treturn \"No\";\n}", "function testLogicalAnd(val) {\n\tif(val <= 50 && val >= 25) {\n\t\treturn \"Yes\";\n\t}\n\treturn \"No\";\n}", "function threeNumbersFrom50To99(x, y, z) \n{\n return (x >= 50 && x <= 99) || (y >= 50 && y <= 99) || (z >= 50 && z <= 99);\n}", "function divisible(num1, num2){\n if (num1 % num2 === 0) {\n console.log('true');\n } else {\n console.log('false')\n }\n}", "function sum(num1, num2){\n var num1 = 10;\n var num2 = 22;\n var result = num1 + num2;\n if (result <= 25){\n console.log(true);\n }\n else{\n console.log(false);\n } \n}", "function isDivisible(dividend, divisor) {\n if(dividend%divisor === 0) {\n return true;\n } else {return false;}\n}", "function divisibleByFive(n) {\n if(n % 5 == 0){\n return true\n }else\n return false\n\n }", "function check(a, b) {\n if (a == 50 || b == 50 || (a + b) == 50) {\n console.log(true)\n } else {\n console.log(false)\n }\n}", "function checkRangeNumber(min, max, number) {\r\n var resultRange = false;\r\n if(number >= min && number <= max) {\r\n resultRange = true;\r\n }\r\n return resultRange;\r\n}", "function o(t){if(t%100===11){return true}else if(t%10===1){return false}return true}", "inRange (number, start, end){\r\n // if end is undefined, start = 0 and end = start, then check if in range\r\n if (typeof end === 'undefined'){\r\n end = start;\r\n start = 0;\r\n } else if ( start > end ){\r\n // swap the two values around\r\n let temp = start;\r\n start = end;\r\n end = temp;\r\n }\r\n if ((number > start) && (number < end)){\r\n return true;\r\n }\r\n else\r\n return false;\r\n }", "function good(n) { return n==304 || n >= 100 || n < 300; }", "function halfCalc(num){\n if(num < 19){\n return 1;\n }else{\n return 2;\n }\n}", "function divisibleFive(num) {\n if(num % 5 === 0) {\n return true; \n } else {\n return false;\n }\n}", "function isApproximately(a, b, withinPercent) {\n let percent = a / b * 100;\n Phoenix.log(percent);\n return percent > 100 - withinPercent && percent < 100 + withinPercent \n}", "function divisible(num1, num2) {\r\n num1 = 16\r\n num2 = 2\r\n if(num1%num2 === 0) {\r\n console.log(\"true\")\r\n }\r\n else { console.log(\"false\") }\r\n }", "function divisibleByFive(num1) {\n return num1%5===0?true:false\n}", "function e(A){return A%100===11||A%10!==1}", "function funcFive(num1, num2, num3, num4) {\n let multiplyNum = num1 * num2;\n if(multiplyNum > 100) {\n console.log(num3 + num4)\n } elseif(multiplyNum < 100) {\n console.log(num3 - num4)\n } elseif(multiplyNum === 100) {\n let multiplyNumTwo = num1 * num2 * num3;\n alert(multiplyNumTwo % num4)\n }\n}", "function isDivideBy(number, a, b) {\n return number % a === 0 && number % b === 0\n}", "function between(x, min, max) {\n return (x >= min && x <= max)\n}", "function valCax(n) {\n if(Number(n)>= 1 && Number(n)<=100){\n return false\n }else{\n return true\n }\n}", "function isDivisible(num1, num2) {\n if (num1 % num2 === 0) {\n console.log(true)\n } else if (num1 % num2 != 0) {\n console.log(false)\n }\n}", "function funcAndOperator(val){\r\n if(val <= 10 && val>0){\r\n return \"Its satisfied\";\r\n }\r\n return \"No its not satisfying our condition\";\r\n}", "function validate(num) {\r\n // return Number.isInteger(num);\r\n\r\n //return num !== isNaN && num >= 0 && num <= 100;\r\n return typeof num === \"number\" && num >= 0 && num <= 100;\r\n\r\n\r\n\r\n}", "function isMult(x){\n for (let i = 20 ; i > 10 ; i--){\n if (x%i!=0){return false;} \n }\n return true;\n}", "function eprimo(valor){\n for (var numero = 2; numero < valor ; numero++){\n if(valor % numero == 0){\n return false\n }\n return true\n }\n \n}", "function isDivisible(n) {\n // je utiliser la module pour avoire une resultat de la rest de division de n par 5\n //je compare cette resulta avec 0 pour etre sure que n est divisible par 5\n // je return le assignment pour tester \n //comme l'excercise 4 mais cette fois avec un operateur equal value \n\t// si la condition true la function return true si no false\n\t\n\treturn ( n % 5 == 0);\n}", "function find50(x, y) \n{\n var sum = x + y;\n return ((x == 50 || y == 50) ||sum == 50)? alert(\"One of numbers or their sum is = 50\"):\n alert(\"Neither number nor their sum is = 50\");\n}", "function a(e){if(e%100===11){return true}else if(e%10===1){return false}return true}", "function a(e){if(e%100===11){return true}else if(e%10===1){return false}return true}", "function schrikkeljaar(jaar){\n if(jaar % 4 === 0){\n if(jaar % 100 === 0){\n if(jaar % 400 === 0){\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return true;\n }\n }\n return false;\n\n}", "function in1020(a, b) {\n return (a >= 10 && a <= 20) || (b >= 10 && b <= 20);\n}", "function divides(x){\n \n return numbers => numbers % x === 0;\n}", "function IsDivisibleBy(a, b) {\n if (a % b === 0 || b % a === 0) {\n console.log(1);\n } else {\n console.log(0);\n }\n }", "function testLogicalAnd(val) {\n // Only change code below this line\n if (val > 24 && val < 51) {\n return \"Yes\";\n }\n // Only change code above this line\n return \"No\";\n}", "function dividedBy3Or7(x) \n{\n if (x % 3 == 0 || x % 7 == 0) \n {\n alert(\"Number divides by 3 or 7\");\n } \n else {\n alert(\"Number does not divide by 3 or 7\");\n }\n}", "function divisibleBy(lowerBound, upperBound) {\n for (var i = lowerBound; i <= upperBound; i++) {\n if (i % 5 == 0 && i % 3 == 0) console.log(i);\n }\n }", "function check(num1,num2,num3){\n return (num1 >= 20 && (num1 < num2 || num1 < num3)) ||\n (num2 >= 20 && (num2 < num1 || num2 < num3)) ||\n (num3 >= 20 && (num3 < num2 || num3 < num1)) ? true : false;\n}", "function divisibleByFive(n) {\n if (n % 5 === 0) {\n return true;\n }\n return false;\n}", "function isPercentage(range, value) {\n return ((value * (range[1] - range[0])) / 100) + range[0];\n }", "function canDivide(number, div1, div2) {\n return number % div1 === 0 && number % div2 === 0;\n}", "function testLessOrEqual(val) {\r\n if (val <= 22) { \r\n document.write (\"Smaller Than or Equal to 12 <br><br>\") ;\r\n }\r\n \r\n if (val <= 24) { \r\n document.write (\"Smaller Than or Equal to 24 <br><br>\") ;\r\n }\r\n \r\n else{\r\n document.write (\"More Than 24 <br><br>\") ;\r\n } }", "function numeroEhValido(numero) {\n if (numero < 0 || numero > 100) {\n return false\n } else {\n return true\n }\n}", "function isDivisible(n, x, y) {\n return n % x === 0 && n % y === 0 ? true : false\n}", "function isLeaper(y){\n if (y%4==0){\n if(y%100==0){\n\n if (y%400 ==0)\n return true;//\n else\n return false;\n }\n else\n return true;//\n }\n else\n return false;\n}" ]
[ "0.79628634", "0.77896285", "0.7614185", "0.75966084", "0.75555646", "0.7546572", "0.75312537", "0.74327064", "0.7430446", "0.7216211", "0.7165842", "0.71589977", "0.71533215", "0.71323603", "0.7126646", "0.71148235", "0.70952827", "0.7075341", "0.7072521", "0.7064518", "0.7056513", "0.70504296", "0.7039174", "0.70372885", "0.7034797", "0.7034225", "0.6930059", "0.69006234", "0.68759865", "0.6863541", "0.6850815", "0.68313193", "0.68053895", "0.6771586", "0.67583257", "0.67335284", "0.6706342", "0.6687562", "0.66601837", "0.6644851", "0.6639691", "0.6619394", "0.66081023", "0.6587487", "0.6581375", "0.65729535", "0.6555595", "0.65495497", "0.6530304", "0.65221524", "0.6519287", "0.65089095", "0.6493967", "0.64678085", "0.6383347", "0.6361084", "0.63530594", "0.63429165", "0.63270205", "0.631025", "0.6309325", "0.63067126", "0.63021785", "0.62981427", "0.6296912", "0.62928784", "0.6286492", "0.6284921", "0.6263864", "0.6261023", "0.6256766", "0.6249196", "0.62422925", "0.6234966", "0.6228873", "0.6224063", "0.6216155", "0.62144107", "0.620166", "0.6199825", "0.61980844", "0.6192481", "0.61919147", "0.61819303", "0.61819303", "0.61814934", "0.6180611", "0.6177198", "0.6170938", "0.61677366", "0.61622924", "0.6154699", "0.6154047", "0.6151719", "0.6151067", "0.61486566", "0.6142294", "0.6141669", "0.61341006", "0.6130617" ]
0.75709194
4
console.log(divBy100(710)) console.log(divBy100(700)) / Create a function "negativeOrEven" that takes a number as an argument. "negativeOrEven" should return a true if the number passed to it is a negative number OR it is an even number. For example, if the input is 7 then your function should return false and if the input is 3 it should return true. create a function with input number set two conditions; check if the number is less than zero, or if the number mod 2 equals 0 output will be a boolean
function negativeOrEven(num) { if(num < 0 || num % 2 === 0) { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function divisible(num) {\nif(num % 100 == 0){\n return true;\n}else\nreturn false;\n\n}", "function divBy100(num) {\n if(num % 100 === 0) {\n return true\n } else {\n return false\n }\n}", "function divBy100(num) {\n return (num % 100 === 0)\n}", "function divisible(num) {\n return num % 100 === 0;\n }", "function positiveEven(number){\n if((number > 0) && (number%2===0)){\n return true;\n }\n else{\n return false;\n }\n}", "function isEven(number) {\n if (number %2) {\n console.log(\"This number is Odd\");\n }\n else {\n console.log(\"This number is Even\");\n }\n\n}", "function isEven(num) {\n if(num%2 === 0){ //if remainder of num is 0 after modulo operator, return true.\n return true;\n }\n else return false;\n}", "function divisibleByTwo(num) {\n return num % 2 === 0;\n}", "function even_or_odd (num){\n\tvar tester = num % 2;\n\tif(tester === 0){\n\t\tconsole.log(\"the value passed is even\");\n\t}\n\telse if (tester === 1){\n\t\tconsole.log(\"the value passed is odd\");\n\t}\n\telse{\n\t\tconsole.log(\"enter a number\");\n\t}\n}", "isEven($number) {\n return $number % 2 === 0;\n }", "function isOdd (number) {\nif (number % 2 > 0){\n return true;\n}\nelse {\n return false;\n}\n}", "function even(num)//function with variable even\n{\nif((num%2)===0) return true;//if num is even true\nelse return false // if num is odd then false\n}", "function isEven(number) {\n\nif (number < 0) {\n return false;\n} else if (number === 0) {\n return true;\n} else if (number === 1) {\n return false;\n}\n\nreturn isEven(number -= 2);\n\n\n\n}", "function isEven(num){\n if(num % 2 === 0){\n return true;\n }else {\n return false;\n }\n}", "function isEven(number) {\n if(number%2 ===0) {\n return true \n } else {\n return false;\n }\n}", "function isEven(number) {\n return number % 2 == 0 \n}", "function isEven(n) {\n// return true if number is even\n// else return false\n return n%2 === 0;\n}", "function divisible(num) {\n if (num % 100 === 0) {\n return true;\n }\n return false;\n}", "function isEven(x) {\nif (x % 2 == 0) {\n return true;\n}else (x % 2 != 0)\n return false;\n}", "function isEven(num) {\n if (num % 2 === 0) {\n return true}\n else\n {return false;}\n \n}", "function isEven(num) {\n if(num % 2 === 0){\n return true;\n }\n else{\n return false;\n }\n}", "function EvenlyDivisible(int1, int2) {\r\n return ((int1 % int2) == 0);\r\n}", "function isDivisible(divisee, divisor) {\n // your code here\n if (divisee % divisor === 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function isEven(num){\n if(num % 2 === 0){\n return true;\n }\n else{\n return false;\n }\n}", "function isOddWithoutModulo(num) {\n // your code here\n let answer = num / 2;\n return !Number.isInteger(answer); //returns true or false\n }", "function isNegativeEven(x){\n if((x%2 === 0) && (x < 0)){\n return true;\n } return false;\n}", "function isEven(number) {\n if (number % 2 == 0) {\n return true;\n\n }\n return false;\n \n}", "function checkEvenNumber(num) {\n return num % 2 === 0;\n}", "function checkEven (number){\n if (number %2 == 0){\n return true;\n } else {\n return false;\n }\n}", "function check_Even_or_Odd(n){\n\nif (n%2==0)\n{\nreturn false\n}\nelse \nsum_even_numbers(n)\nreturn \n}", "function isPositiveEven(num){\n if((num%2 === 0) && (num > 0)){\n return true;\n } return false;\n}", "function isEven(num) {\n if (num % 2 === 0){\n return true;\n } else {\n return false;\n }\n}", "function isEven(number)\n{\n return 0 == (number % 2);\n}", "function divisible(num) {\n\treturn !(num % 100);\n\t// return num % 100 == 0;\n}", "function div(a,b) {\n if (a % b == 0) {\n return true;\n }\n return false;\n}", "function IsDivisibleBy(a, b) {\n if (a % b === 0 || b % a === 0) {\n console.log(1);\n } else {\n console.log(0);\n }\n }", "function even(number) {\n if (number % 2 == 0) {\n return console.log(\"this number is even\");\n } else {\n return console.log(\"this number is not even\");\n }\n}", "function isOddWithoutModulo(num) {\n // your code here\n return num % 2 !== 0;\n }", "function isEven(a,b){\n\tvar c = a+b;\n\tif (c%2==0) \n\t{\n\t\tconsole.log(\"True\")\n\t} else\n\t{\n\t\tconsole.log(\"False\")\n\t}\n\n}", "function isEven(num) {\n if (num % 2 === 0){\n return true;\n } else {\n return false;\n }\n}", "function isEven(num){\n console.log(\"num =\" + num);\n return num%2 ==0;\n }", "function isEven(number) {\n let new_number = number >= 0 ? number: -number;\n if (new_number === 0) {\n return true;\n } else if (new_number === 1){\n return false;\n } else { \n return isEven(new_number - 2);\n }\n}", "function evenNumber(){\n for(i=0;i<=100;i++){\n if(i%2==0){\n console.log(i);\n }\n }\n}", "function isEven(value)\n{\n if (value % 2 === 0)\n {\n console.log(\"The number is even!\");\n }\n else\n {\n console.log(\"The number is odd!\");\n }\n}", "function isEven(value){\n if (value % 2 === 0){\n return true;\n }\n else\n return false;\n}", "function isEven(number) {\n if (number % 2 === 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function isEven(number) {\n if (number % 2 == 0) {\n console.log(\"EVEN\")\n }\n else {\n console.log(\"ODD\")\n }\n}", "function anyNumber(firstNum, secondNum){\n // if(firstNum % secondNum === 0){\n // console.log(true);\n // } else {\n // console.log(false);\n // }\n console.log(firstNum % secondNum == 0); // can also write it like this \n}", "function isEven(x){\n return x % 2 === 0;\n}", "function determineEvenDivisibility( num1, num2 ){\n\tif (num1 % num2 === 0 ){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function isEven(num) {\n return num % 2 === 0\n}", "function isEven(number) {\n\n}", "function isNumberOdd(number) {\r\n return number % 2 !== 0\r\n\r\n}", "function isOdd(num){\r\n return num %2;\r\n}", "function negativeOrEven(num) {\n return (num % 2 === 0 || num < 0)\n}", "function isEven(num) {\n return num % 2 === 0\n}", "function isEven(number) {\n var isEven;\n if(number%2 === 0){\n isEven = true;\n }\n else{\n isEven = false;\n }\n return isEven;\n}", "function isEven(value) {\n if (value % 2 === 0) {\n return true;\n }\n else {\n return false;\n }\n }", "function OddEven(a) {\n if(a >= 0) {\n if( (a % 2) == 0) {\n console.log(\"even\");\n }\n else {\n console.log(\"odd\");\n }\n }\n else\n console.log(\"invalid:negative no.\");\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function divisible(num1, num2){\n if (num1 % num2 === 0) {\n console.log('true');\n } else {\n console.log('false')\n }\n}", "function isEven(x) {\n \tif ((x % 2) === 0) {\n\n \t\tconsole.log(\"true\");\n \t\treturn true;\n \t}\n\n \telse {\n\n \t\tconsole.log(\"false\");\n \t\treturn false;\n \t}\n }", "function isEven(y){\n if(y%2 === 0){\n return true;\n } else {\n return false;\n }\n}", "function isEven(number) {\n if (number % 2 == 0) {\n return true;\n } else {\n return false;\n }\n}", "function isEven(number) {\n if (number % 2 == 0) {\n return true;\n } else {\n return false;\n }\n}", "function isEven(number) {\n if (number < 0) {\n return isEven (number * -1); // HANDLE NEGATIVE INPUT\n }\n else if (number === 0) {\n return true;\n }\n else if (number === 1) {\n return false;\n }\n else {\n return isEven(number-2);\n }\n}", "function isOddWithoutModulo(num) {\n // your code here\n if(num > 0) {\n for(let i = num; i > 1; i-=2) {\n num -= 2;\n }\n } else {\n for(var i = num; i < 1; i+=2) {\n num += 2;\n }\n }\n // console.log(num) // returns 1\n\n let thisIsOdd = false;\n if(num === 0 || num === 2) {\n thisIsOdd = false;\n } else {\n thisIsOdd = true;\n }\n return thisIsOdd;\n\n }", "function isEvenOrOdd(number) {\n/* the modulus or percentage sign % is used to figure out what the remainder is if you divide the number on the LEFT by the number on the RIGHT of the modulus. I see it used a lot to figure out if something is an even or odd row in a table of elements */\n\n// regular style\n\n if (number % 2 > 0) {\n return 'this is an odd number'\n }\n else {\n return 'this is an even number'\n }\n\n// try using ternary operator\n/*\nvar statement = number % 2 > 0 ? 'this is an odd number' : 'this is an even number'\nreturn statement\n*/\n}", "function sumEven(){\n let sum=0;\n for(let i=0;i<=100;i++){\n if(i%2===0){\nsum+=i;\n }\n} \nconsole.log(\" sum of even numbers from 1-100 = \"+sum);\n\n}", "function isEven(num) {\n return num % 2 == 0\n}", "function isOdd(num){\n if(num%2>0){\n return true;\n }else{\n return false;\n }\n}", "function find(even){\n if(even %2==0){\n console.log(`${even} is an even nmber`)\n }else{\n console.log(`${even} is an odd number`)\n }\n}", "function checkEven(number) {\n return +number % 2 === 0;\n }", "function isEven(num) {\n return num % 2 === 0;\n}", "function isEven(num) {\n return num % 2 === 0;\n}", "function remainderOfTwoNum(x,y) {\n return x % y;\n}", "function isEven(number) {\n if (number % 2 === 0) { // 1\n return true // 1\n } else { // 1\n return false // 1\n }\n}", "function isOddWithoutModulo(num) {\n // your code here\n if(num === 0) {\n return false;\n }\n // gets rid of negative signs\n num = Math.abs(num);\n\n while(num >= 2) {\n num -= 2;\n }\n if(num === 1) {\n return true;\n } else {\n return false;\n }\n }", "function isEven(num) {\n return num % 2 === 0;\n}", "function isEven(num) {\n return num % 2 === 0;\n}", "function isEven(num) {\n return num % 2 === 0;\n}", "function isEven(num) {\n return num % 2 === 0;\n}", "function isEven(n) {\n return n % 2 === 0;\n }", "function isEven(num) {\n\n}", "function isEven(number) {\n return number % 2 === 0;\n }", "function isXEvenlyDivisibleByY( x, y ) {\n if(x%y===0) {\n \tconsole.log(true);\n } else {\n \tconsole.log(false); \n }\n}", "function isEven(number) {\n if (number % 2 == 0) {\n console.log('the number is even!');\n }\n else {\n console.log('the number is odd!')\n }\n}", "function isEven(n) {\n return n %2 === 0\n}", "function isEven(num) {\n return num % 2 == 0;\n}", "function oddorEven(num1) {\n return num1 % 2;\n}", "function isEven( number ) {\n if( number % 2 === 0 ) {\n return true;\n } else {\n return false;\n }\n}", "function even(num){\n return (num % 2 == 0);\n}", "function isOdd(x) {\nif (x % 2 == 0) {\n return false;\n}else (x % 2 != 0)\n return true;\n}", "function isEven(num) {\n return num % 2 == 0;\n}", "function isEvenAndGreaterThanTen(num) {\n \n if( num %2===0 && num >10 ){\n return true;\n } else {\n return false;\n } \n}", "function IsEven(num) {\n if (num % 2 === 0) {\n return true;\n } else {\n return false;\n }\n}", "function isEven(num){\n\treturn num % 2===0; // is true or false statement\n}", "function myFunction( num1){\n if (num1 % 2 != 0 ){\n console.log(\" yes! its an odd\")\n }\n else {\n console.log(\"oh no its an even\")\n }\n }", "function isOdd(x){\n if(x%2 === 0){\n return false;\n } else {\n return true;\n }\n}" ]
[ "0.76788616", "0.7634025", "0.74168044", "0.74019736", "0.7308278", "0.72731155", "0.72004133", "0.7180394", "0.71737236", "0.7168937", "0.7160632", "0.7156411", "0.7149154", "0.71377355", "0.71330357", "0.71046287", "0.7091212", "0.70893675", "0.7072615", "0.70600915", "0.705361", "0.70531684", "0.70414037", "0.7041285", "0.7036439", "0.7028044", "0.7027411", "0.7026516", "0.7020954", "0.70117664", "0.7009679", "0.7004988", "0.6998833", "0.6995372", "0.69904345", "0.6985542", "0.69747764", "0.69721967", "0.6971725", "0.69636005", "0.6959481", "0.69488794", "0.694861", "0.694765", "0.69319373", "0.69243515", "0.692413", "0.6924016", "0.6918846", "0.6910329", "0.6909149", "0.6906323", "0.6905205", "0.6900578", "0.6900235", "0.6899088", "0.6898476", "0.6896059", "0.6889433", "0.68875754", "0.68875754", "0.68847084", "0.68813217", "0.6878146", "0.68729", "0.68729", "0.68656266", "0.68647563", "0.68623203", "0.68615466", "0.68601114", "0.6857397", "0.68570936", "0.6853609", "0.68501425", "0.68501425", "0.68459606", "0.68441224", "0.6841091", "0.6840661", "0.6840661", "0.6840661", "0.6840661", "0.6839255", "0.683691", "0.68357146", "0.6831823", "0.68203413", "0.6813933", "0.68129724", "0.6810994", "0.68070585", "0.6805631", "0.68039834", "0.68009555", "0.6800129", "0.6799394", "0.6791123", "0.6788446", "0.6785968" ]
0.6933389
44
console.log(negativeOrEven(20)) console.log(negativeOrEven(87)) / Create a function "passAllTests" that takes an array of functions and another value as arguments. Each function in your array will return a boolean value. "passAllTests" should pass your value argument to each function. If all functions in your array return true then "passAllTests" will return true. Otherwise "passAllTests" should return false create a function with input array and value initialize a variable to true loop through the array, set conditional pass each index to the value if true; variable stays true if false; reassign the variable to be false return variable
function passAllTests(arrFuncs, valueArg) { let isTrue = true for(let i = 0; i < arrFuncs.length; i++) { if(arrFuncs[i](valueArg) === true) { isTrue = true } else { return false; } } return isTrue }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passAllTests(arrOfFuncs, value) {\n for (let i = 0; i < arrOfFuncs.length; i++) {\n if (!arrOfFuncs[i](value)) {\n return false;\n }\n }\n return true;\n}", "function every(arrayArg,test){\n//loop through the array \n for(var i=0; i<arrayArg.length; i++){\n//the array is accepted as an argument to the function argument (test)\n//if the function evaluates to false within the loop then return false\n if(!test(arrayArg[i]))\n return false;\n \t\t}\n//if the array is looped through and never false, then return true \n return true;\n }", "function some(arrayArg,test){\n//loop through the array \n for(var i=0; i<arrayArg.length; i++){\n//if the function ever evaluates to true within the loop then return true\n if(test(arrayArg[i]))\n return true;\n \t\t}\n //if the function never evaluates as true, then return false\n return false;\n }", "function passAllTests(arr,num) {\n\t var passTest = true\n \tarr.forEach( function(test) {\n if (test(num) === false) {\n passTest = false\n }\n })\n // console.log(passTest)\n \treturn passTest\n}", "function every(array, test) {\n // Your code here.\n return !(array.some(item => !test(item)));\n}", "function customEvery(array){\n var answer = true\n array.forEach(function(i){\n if(i % 2 != 0){\n answer = false\n console.log(answer)\n return answer\n }\n })\n return answer\n}", "function every1(array, test){\n return !array.some(element => !test(element));\n}", "function example(arr) {\n const isUneven = (num) => num % 2 == 0;\n\n console.log(arr.every(isUneven));\n}", "function isFilter(arr){\n for(let i=0;i<arr.length;i++)\n {\n let val = isEven(arr[i]);\n console.log(val);\n }\n \n}", "function everySome(array, test) {\n return !array.some(n => !test(n));\n}", "function every(array, test) {\n // Interesting this did not work below because the return does not break out of the entire function when returning false, therfore will always return true if done this way.\n // array.forEach(function(element) {\n // if (test(element) != true) {\n // return false;\n // }\n // })\n for (var i=0;i<array.length;i++){\n if (test(array[i]) != true) {\n return false;\n }\n }\n return true;\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //inputs an array of strings, and a function that tests string values, returing a boolean\n //outputs a boolean of true if all values in strings passed, or false if any failed\n //a for loop incrementing over strings\n \n // a variable to be set to false if any fail\n let weGood = true;\n for (let i = 0; i<strings.length; i++){\n //pass string at this value to test function. if false, return false\n if (test(strings[i])===false){\n weGood = false;\n }\n \n }\n return weGood;\n \n \n // YOUR CODE ABOVE HERE //\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n // determine if all strings in the strings array pass the test\n // first we need to loop through the strings array and pass it through the test function\n // outside the loop the code block apply the conditional statement on whether are strings pass\n var tester = [];\n for(var i = 0; i < strings.length; i++){\n if(!test(strings[i])){\n return false;\n }\n \n }\n return true;\n // tester should contain an array of boolean values either true or false\n // have to say if just one tester element is false\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function every (array, f){\n for (var i =0; i<array.length; i++){ \n if (!f(array[i]))\n return false;\n }\n return true;\n}", "function some(array, f){\n\t// var status = false;\n\tfor (var i = 0; i < array.length; i++){\n\t\tif (f(array[i])) return true;\n\t}\n\treturn false;\n}", "function onlyNegativeEvens(numbs){\n //returns an array containing all the positive evens from the sequence\n var NegativeEvenOnly = [];// empty array to store requested values in\n for (let i = 0; i < numbs.length; i++) {\n if (isNegative(numbs[i]) && isEven(numbs[i])){//CALLING OLDER FUNCTIONS\n NegativeEvenOnly.push(numbs[i]);// if check is good, pass into empty array\n }\n }\n return NegativeEvenOnly;// show us empty array\n}", "function postive(arr){\n\nresult = arr.every((elem)=>{\n return elem % 2 === 0 && elem > 0 && elem % 10 !== 0\n})\nreturn result}", "function makeFuncTester(arrOfTests) {\n return function(cb){\n let result = true\n arrOfTests.forEach(arr => result = result && (arr[1] === cb(arr[0])))\n return result\n }\n}", "function all(func, array){\n for (var i=0; i<array.length; i++){\n\t if (!func(array[i])) return false;\n }\n return true;\n }", "function every(array, test) {\n var it = true;\n array.forEach(function(value){\n if(test(value) === false){\n it = false;\n }\n });\n return it;\n}", "function exercise4(num) {\n var allEven = true;\n\n num.forEach(function(value) {\n if (value % 2 === 1)\n allEven = false;\n });\n\n return allEven;\n }", "function every(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (!test(array[i])) {\n return false;\n }\n }\n return true;\n}", "function isEven(number) {\n\nif (number < 0) {\n return false;\n} else if (number === 0) {\n return true;\n} else if (number === 1) {\n return false;\n}\n\nreturn isEven(number -= 2);\n\n\n\n}", "function filter(arr, testFunction) {\n var result = [];\n for (var i = 0; i < arr.length; ++i)\n var currentValue = arr[i];\n if (passesTest(currentValue)) {\n result.push(currentValue);\n }\n }", "function onlyNegativeOdds(numbs){\n //returns an array containing all the positive evens from the sequence\n var NegativeOddOnly = [];// empty array to store requested values in\n for (let i = 0; i < numbs.length; i++) {\n if (isNegative(numbs[i]) && isOdd(numbs[i])){//CALLING OLDER FUNCTIONS\n NegativeOddOnly.push(numbs[i]);// if check is good, pass into empty array\n }\n }\n return NegativeOddOnly;// show us empty array\n}", "function isEven(num){\n //input opposite to get false\n return !isOdd(num);\n}", "function isEven(someNum) {\r\n if (someNum == 0)\r\n return true;\r\n else if (someNum == 1)\r\n return false;\r\n else if (someNum < 0)\r\n return isEven(-someNum);\r\n else\r\n return isEven(someNum - 2);\r\n\r\n}", "function some(array, f) {\n var acc = false;\n\n for (var i = 0; i < array.length; i++) {\n acc = f(array[i], i, array);\n\n if (acc) {\n return acc;\n }\n }\n\n return acc;\n }", "function every(array, test) {\n\treturn !(array.some(element => !test(element)))\n}", "function every(array, test) {\n // Your code here.\n }", "function every(arr, func)\n{\n\tvar result = true;\n\tif (arr.length == 0) return result;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (!func(arr[i], i, arr))\n\t\t{\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n // We need to loop over the array\n for(var i = 0; i <= strings.length - 1; i++){\n // we need to pass each index to the test\n // What we are doing here is testing every string in our array aginast test and if they all resolve to pass the test \n // then it will return true, even if one string does not pass it will return false.\n if(strings.every(test)){\n return true;\n } else {\n return false;\n }\n \n \n \n // YOUR CODE ABOVE HERE //\n}\n \n}", "function passTesting(arr, func) {\n // let new_array = [];\n\n // Let's try this with a simple for() loop // *** THIS WORKS BUT LETS IMPROVE IT ***\n // for(let i = 0; i < arr.length; i++) {\n // let result = func(arr[i]);\n // if(result == true) {\n // new_array.push(arr[i]);\n // }\n // }\n // return the NEW_ARRAY\n\n // ** This is how we can use higher order functions and improve the above code\n let new_array = arr.filter( elem => func(elem));\n \n console.log(new_array);\n return new_array;\n}", "function isEven(number) {\n\n}", "function exercise3(num) {\n var hasEven = false;\n\n num.forEach(function(value) {\n if (value % 2 === 0) {\n hasEven = true;\n }\n });\n return hasEven;\n }", "function isEven(value){\n if (value % 2 === 0){\n return true;\n }\n else\n return false;\n}", "function filter(array, test) { // filters through an array\n var passed = []; // holds the passed elements of the test\n for (var i = 0; i < array.length; i++) { // goes through the length of the array\n if (test(array[i])) { // if the element passes the test\n passed.push(array[i]); // put it in the new array\n }// end of if \n }// end of for loop\n return passed; // return the array with the passes elements\n}// end of function", "function isEven(n){\n\n // code goes here\n\n}", "function isEven(value) {\n if (value % 2 === 0) {\n return true;\n }\n else {\n return false;\n }\n }", "function onlyPositiveOdds(numbs){\n //returns an array containing all the positive evens from the sequence\n var PositiveOddOnly = [];// empty array to store requested values in\n for (let i = 0; i < numbs.length; i++) {\n if (isPositive(numbs[i]) && isOdd(numbs[i])){//CALLING OLDER FUNCTIONS\n PositiveOddOnly.push(numbs[i]);// if check is good, pass into empty array\n }\n }\n return PositiveOddOnly;// show us empty array\n}", "function any(func, array){\n for (var i=0; i<array.length; i++){\n\t if (func(array[i])) return true;\n }\n return false;\n }", "function filter(array, fn) {\n // Your code here\n\n // I create an empty array result that will contain my answer\n let result=[];\n\n // I check that functions inputs were Ok\n if(array.length !==0 && fn===pickEvenNumbers){\n // If OK, I filter the array\n result=array.filter(fn);\n //If not, I manage the case\n }else{\n return(\"tableau vide\",array);\n }\n //I return the filtered array\n return result;\n}", "function checkPositive(arr) {\n // return arr.every(val => val > 0);\n return arr.every(function(currentVal) {\n return currentVal > 0;\n })\n}", "function isEven(num) {\n\n}", "function checkPositive(arr) {\n // Add your code below this line\n return arr.every(function(currentValue){\n return currentValue > 0;\n });\n // Add your code above this line\n}", "function guesswho(ops) { // array of 'operations'\n// 1. Create an array of numbers to keep.\n// 2. Start looping over numbers 1 - 100.\n// 3. pass each number into each function in 'ops'\n// 4. if all trues, push to array, if not, move on.\nlet keepers = [];\n\n for (let num = 1; num <= 100; num++) {\n let valid = true; // if this stays true, we push to keepers array\n\n for (let i = 0; i < ops.length; i++) {\n let success = ops[i](num);\n\n if(!success) {\n valid = false;\n }\n }\n if (valid) {\n keepers.push(num);\n }\n }\n\n\n\nreturn keepers;\n\n}", "function isEven(value) {\n if (value % 2 == 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function isEven(value) {\n if (value % 2 == 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function check_Even_or_Odd(n){\n\nif (n%2==0)\n{\nreturn false\n}\nelse \nsum_even_numbers(n)\nreturn \n}", "function even(value) {\n if(value % 2 == 0) {\n return true\n } else {\n return false\n }\n}", "function testAny(arr, fn) {\n for(var i=0;i<arr.length;i++) {\n if(fn(arr[i])) {\n return true;\n }\n }\n return false;\n }", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //create an empty array to contain modified string results\n var testedStringsResults = [];\n // Use a for loop to iterate through the array (strings) and push the result of the modified string into a new array\n for(var i = 0; i <= strings.length - 1; i++){\n testedStringsResults.push(test(strings[i]));\n }\n // Use a for loop to interate through the tested strings array and return false if the string didn't pass the test\n for(i = 0; i <= testedStringsResults.length - 1; i++) {\n if (testedStringsResults[i] === false) {\n return false;\n } \n } \n return true;\n \n // YOUR CODE ABOVE HERE //\n}", "function isEven(value){\n if (value % 2 == 0) {\n return true;\n } else {\n return false;\n };\n }", "function isEven(value) {\n if (value % 2 === 0) {\n return true;\n }\n else {\n return false;\n }\n}", "function demoFun(num,even){\n if(num % 2 == 0){\n even()\n }\n}", "function isEven(v,i, ary){\n return (v%2 == 0) ? true : false;\n}", "function isEven(x){\n return x % 2 === 0;\n}", "function page1ex7() {\n // 1. Write a function allPassed(students) that gets an array of students\n // (name, grade) and returns true if they all passed (grade >= 70)\n\n var gStudents = [\n { name: 'miku', grade: 70 },\n { name: 'muki', grade: 80 },\n { name: 'cc', grade: 70 },\n { name: 'dd', grade: 100 }\n ];\n\n console.log('Did all the students passed?', allPassed(gStudents));\n\n function allPassed(students) {\n return students.every(function(student) {\n return student.grade >= 70;\n });\n }\n}", "function lovefunc(flower1, flower2) {\n if ((flower1 + flower2) % 2 != 0) {\n return true;\n } else return false;\n}", "function checkPositive(arr) {\n\n let b = arr.every((args) => args > 0)\n if (b == true) {\n return 'yes';\n }\n return 'no';\n}", "function some(array, test) {\n for (let element of array) {\n if (test(element)) {\n return true;\n }\n }\n\n return false;\n}", "function every(arr, evaluation) {\n\tvar flag = true;\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (!evaluation(arr[i])) {\n\t\t\tflag = false;\n\t\t\tbreak;\n\t\t};\n\t}\n\treturn flag;\n}", "function exercise4(numList) {\n return _.every(numList, function (val) {\n return val % 2 === 0;\n });\n}", "isEven($number) {\n return $number % 2 === 0;\n }", "function isEven(value) {\n if (value % 2 === 0) {\n return true;\n } else {\n return false;\n }\n}", "function isEven(value) {\n if(value % 2 === 0) {\n return true;\n }\n else return false;\n}", "function testBooleanLogic (arr){\n for (var i = 0; i < arr.length; i++) {\n if(arr[i] === true){\n return true;\n }\n }\n return false;\n}", "function isEven(value) {\n if (value % 2 == 0) {\n \treturn true;\n } else {\n return false;\n\t};\n}", "function isEven(number) {\n let new_number = number >= 0 ? number: -number;\n if (new_number === 0) {\n return true;\n } else if (new_number === 1){\n return false;\n } else { \n return isEven(new_number - 2);\n }\n}", "function even(num)//function with variable even\n{\nif((num%2)===0) return true;//if num is even true\nelse return false // if num is odd then false\n}", "function pickEvenNumbers(value) {\n return (value%2 === 0);\n}", "function isEven(x) {\n \tif ((x % 2) === 0) {\n\n \t\tconsole.log(\"true\");\n \t\treturn true;\n \t}\n\n \telse {\n\n \t\tconsole.log(\"false\");\n \t\treturn false;\n \t}\n }", "function checkPositive(arr) {\n // Add your code below this line\n return arr.every(val => val >= 0)\n\n // Add your code above this line\n}", "function isEven(x) {\nif (x % 2 == 0) {\n return true;\n}else (x % 2 != 0)\n return false;\n}", "function callbackForEvery(elem, index, array) {\n return elem%2!==0;\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //I-array and test function\n //O-boolean based on test results\n //C-\n //E-\n //I'll make a temporary placeholder for the string I'm testing\n let testString\n \n //run it through a loop, if it fails the test at any point return false, otherwise exit loop and return true at that point\n for(let i = 0; i < strings.length; i++) {\n testString = strings[i]\n if (test(testString) == false) {\n return false}\n }\n return true\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function isEven(val){\n return val % 2 === 0;\n }", "function filter(array, test) {\n//filter function passing it test and array\n var passed = [];\n//creating variable passes and new array\n for (var i = 0; i < array.length; i++) \n//for i is = to 0 and i is less than array length increment i\n {\n if (test(array[i]))\n//testting i in array\n passed.push(array[i]);\n//pushing onto the array\n }\n return passed;\n}", "function isEven(a,b){\n\tvar c = a+b;\n\tif (c%2==0) \n\t{\n\t\tconsole.log(\"True\")\n\t} else\n\t{\n\t\tconsole.log(\"False\")\n\t}\n\n}", "function zero_negativity(arr){\n if(Array.isArray(arr)){\n for(let i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n console.log(\"Your input is an array, but there is a negative with index \" + i + \", and it has a value of \" + arr[i] + \".\");\n return false;\n }\n }\n console.log(\"Your input is an array and no negatives were found.\");\n return true;\n }\n else{\n console.log(\"Your arguement is not an array. Please only use an array.\");\n };\n return false;\n}", "function positiveEven(number){\n if((number > 0) && (number%2===0)){\n return true;\n }\n else{\n return false;\n }\n}", "function isEven(number) {\n return number % 2 == 0 \n}", "function allEven (input) {\n return input.every(function (num) {\n return (num % 2 === 0);\n });\n}", "function checkEven (number){\n if (number %2 == 0){\n return true;\n } else {\n return false;\n }\n}", "function find(arr, func) {\n \n //arr = [1, 2, 3, 4]\n // func = function(num){ return num % 2 === 0; }\n \n var num = 0;\n for(i=0; i<arr.length; i++) {\n num = arr[i];\n if(func(num) === true){\n console.log(num);\n return num;\n }\n \n }\n \n \n// return num; \n}", "function checkPositive(arr) {\n // Add your code below this line\n return arr.every(function(num) {\n return num > 0;\n }); \n //if every element passes the test --> true if all passes, false if not\n // Add your code above this line\n}", "function isEven(x) {\r\n return x % 2 === 0;\r\n}", "function checkForEven(checkThis) {\n \tfunction isEven(num){\n \tif (num < 0) {\n \treturn isEven(-num)\n } else if (num == 0) {\n \treturn true;\n } else if (num == 1) {\n \treturn false;\n } else {\n \treturn isEven(num-2)\n }\n }\n\treturn isEven(checkThis);\n}", "function some(arr, func)\n{\n\tvar result = false;\n\tif (arr.length == 0) return result;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (func(arr[i], i, arr))\n\t\t{\n\t\t\tresult = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "function isEven(number) {\n if (number < 0) {\n return isEven (number * -1); // HANDLE NEGATIVE INPUT\n }\n else if (number === 0) {\n return true;\n }\n else if (number === 1) {\n return false;\n }\n else {\n return isEven(number-2);\n }\n}", "function isEven(y){\n if(y%2 === 0){\n return true;\n } else {\n return false;\n }\n}", "function isEven(x){\n\tif ( x === 0 ) return true;\n\telse if ( x === 1 ) return false;\n\telse {\n\t\t\tif( x < 0 ) return isEven( x + 2 );\n\t\t\treturn isEven( x - 2 );\n\t}\n}", "function isEven(x) {\n return x % 2 === 0;\n}", "function some(arr, callback){\n\n //It iterates through every value in the array\n\tfor(var i = 0; i < arr.length; i++){\n //It runs the callback on every value in the array and if atleast one value returns true, it returns stops the function and returns true\n\t\tif(callback(arr[i], i, arr)) return true;\n } \n //If no value returns true in the loop, it returns false.\n return false;\n}", "function specialArray(array){\n for (var i = 0; i <array.length; i++){\n if (i % 2 === 1) {\n if (array[i] % 2 ===0){\n return false\n }\n }\n if (i % 2 === 0){\n if (array[i] % 2 ===1){\n return false\n }\n }\n }\n return true\n}", "function isEven(number)\n{\n return 0 == (number % 2);\n}", "function isNegativeEven(x){\n if((x%2 === 0) && (x < 0)){\n return true;\n } return false;\n}", "function isEven(num) {\n if (num % 2 === 0) {\n return true}\n else\n {return false;}\n \n}", "function every(values, predicate){\n\tfor(i = 0; i<values.length; i++){\n\t\tif(!predicate(values[i])){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function even(a) {\r\n if (a % 2 == 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}" ]
[ "0.73820233", "0.72553957", "0.72227246", "0.7046869", "0.6879429", "0.68482465", "0.6690346", "0.663028", "0.6598253", "0.6592069", "0.65910125", "0.6527881", "0.6521416", "0.65211225", "0.6484792", "0.6474867", "0.645466", "0.64283454", "0.64189285", "0.640167", "0.6388606", "0.6369812", "0.63624513", "0.6354948", "0.63364065", "0.63184226", "0.6256056", "0.62546057", "0.62519246", "0.62280524", "0.6226871", "0.6171355", "0.61678743", "0.61490333", "0.614048", "0.6140094", "0.6128806", "0.61281824", "0.61267257", "0.61233747", "0.6115821", "0.60901", "0.60789645", "0.6077184", "0.60744584", "0.6074133", "0.607156", "0.607156", "0.606933", "0.60479295", "0.6042056", "0.6034905", "0.60201544", "0.60158974", "0.6005965", "0.6002825", "0.5999226", "0.5991298", "0.5990927", "0.59849733", "0.59824586", "0.5978242", "0.5970107", "0.59700763", "0.59678626", "0.596307", "0.5952857", "0.5924955", "0.59225595", "0.59212834", "0.59107864", "0.59088886", "0.5898935", "0.5883223", "0.5882417", "0.58816487", "0.5881583", "0.58810616", "0.58801955", "0.5868557", "0.586725", "0.58632106", "0.58614165", "0.58583224", "0.5843939", "0.5842665", "0.58404094", "0.58368534", "0.58354586", "0.58333427", "0.58326256", "0.58307314", "0.5828523", "0.5822134", "0.5800523", "0.580041", "0.5786714", "0.5784778", "0.57787055", "0.5774641" ]
0.749197
0
console.log(passAllTests(functionsArr, 250)) console.log(passAllTests(functionsArr, 300)) / Define a function "isPalindrome" that takes a string, and returns a boolean value indicating whether the string is a palindrome (a palindrome is any string that has the same value when reversed for example, "LEVEL" or "RACECAR") create function that reverses, splits, joins input string set new string varialbe to an empty string split, reverse, then join return the newstring create palindrome function with input string set condtional with string and see if it equals invoking reverse funtion with string passed in
function reverse(string) { let split = "" split = string.split('').reverse().join('') return split }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPal(string){\n var newSplitString = string.split('');\n console.log(`Split String : ${newSplitString}`);\n var newReverseString = newSplitString.reverse();\n console.log(`Reverse string : ${newReverseString}`);\n var newJoinString = newReverseString.join(\"\");\n console.log(`Join string : ${newJoinString}`);\n\n \n if(string === newJoinString) {\n console.log(\"Palindrome!\");\n } else {\n console.log(\"Nope\");\n }\n}", "function PalindromeTest() {\n if (Array.isArray(arguments[0])) {\n this.argumentsArray = arguments[0];\n } else {\n this.argumentsArray = Array.from(arguments);\n }\n\n this.UniquePhrasesObject = phrasesOnly(this.argumentsArray);\n\n this.phrasesArray = Array.from(this.UniquePhrasesObject.values());\n\n this.UniqueWordsObject = wordsOnly(this.argumentsArray);\n\n this.wordsArray = Array.from(this.UniqueWordsObject.values());\n\n // Defines a phrasesPalindromeObject (For Individual PalindromeTest treatment of string, Single or Multiple Arguments)\n this.phrasesPalindromeObject = palindrome(Array.from(this.UniquePhrasesObject.keys()));\n\n // Defines a wordsPalindromeObject (For Word by word PalindromeTest treament of string, Single or Multiple Arguments)\n this.wordsPalindromeObject = palindrome(Array.from(this.UniqueWordsObject.keys()));\n\n // Defines a palindromesOnlyObject (Shows only phrases and words that have been tested to be palindromes)\n this.palindromesOnlyObject = palindromesOnly(new Map([...this.phrasesPalindromeObject, ...this.wordsPalindromeObject]));\n\n // Returns array of all phrases or single string inputs that are Palindromes\n // TODO: Add tests for this functionality\n this.passedPhrasesPalindrome =\n passedPalindromeIndexes(this.phrasesPalindromeObject).map(passedIndex => this.phrasesArray[passedIndex]);\n\n // Returns array of all words that are Palindromes\n // TODO: Add tests for this functionality\n this.passedWordsPalindrome =\n passedPalindromeIndexes(this.wordsPalindromeObject).map(passedIndex =>\n this.wordsArray[passedIndex]);\n\n // Defines array of the processed form of input strings/phrases, from which they passed as palindromes\n this.formOfPassedPhrasesPalindrome =\n passedPalindromeIndexes(this.phrasesPalindromeObject).map(passedIndex => Array.from(this.UniquePhrasesObject.keys())[passedIndex]);\n // passedPalindromeIndexes(this.phrasesPalindromeObject).map(passedIndex => Array.from(this.phrasesPalindromeObject.keys())[passedIndex]);\n\n // Defines array of the processed form of input words, from which they passed as palindromes\n this.formOfPassedWordsPalindrome =\n passedPalindromeIndexes(this.wordsPalindromeObject).map(passedIndex => Array.from(this.UniqueWordsObject.keys())[passedIndex]);\n // passedPalindromeIndexes(this.wordsPalindromeObject).map(passedIndex => Array.from(this.wordsPalindromeObject.keys())[passedIndex]);\n}", "function isPalindrome(str) {\n\n/////////////////////////////////////////////////////////\n // const strArr = str.split('');\n\n // strArr.reverse();\n \n // const reverseWord = strArr.join('');\n\n // if(str === reverseWord) {\n // console.log(\"It's a Palindrome.\");\n // }else{\n // console.log(\"It's not a Plaindrom.\");\n // }\n\n///////////////////////////////////////////////////////////\n // let revString = '';\n\n // for(let i = str.length - 1 ; i >= 0 ; i--){\n // revString += str[i] ;\n // }\n\n // if(str.lower === revString.lower) {\n // console.log(\"It's a Palindrome.\");\n // }else{\n // console.log(\"It's not a Plaindrom.\");\n // }\n \n//////////////////////////////////////////////////////////\n \n let revString = '';\n\n for(let i = 0 ; i <=str.length - 1 ; i++) {\n revString = str[i] + revString;\n }\n console.log(revString);\n if(str === revString) {\n console.log(\"It's a Palindrome.\");\n }else{\n console.log(\"It's not a Plaindrome.\");\n }\n \n///////////////////////////////////////////////////////////\n\n \n}", "function demoFun(num,palindrome){\nvar arr=num.split('').reverse().join('')\nif(arr == num){\npalindrome()\n}\n}", "function palindrome(string,callback)\n{ \nresult=string.split(\"\").reverse().join(\"\");\n if(result==string)\n result=\"palindrome\";\n else\n result=\"not a palindrome\";\n callback(); \n }", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //create an empty array to contain modified string results\n var testedStringsResults = [];\n // Use a for loop to iterate through the array (strings) and push the result of the modified string into a new array\n for(var i = 0; i <= strings.length - 1; i++){\n testedStringsResults.push(test(strings[i]));\n }\n // Use a for loop to interate through the tested strings array and return false if the string didn't pass the test\n for(i = 0; i <= testedStringsResults.length - 1; i++) {\n if (testedStringsResults[i] === false) {\n return false;\n } \n } \n return true;\n \n // YOUR CODE ABOVE HERE //\n}", "function palindrome(s){\n\n //Reverse the String \n //Push to array , reverse and parse to string\n //Return true if revString and str is equals\n\n const revString = str.split('').reverse().join('');\n\n return revString === str;\n\n}", "function isPalindrome(str) {\n let result = [];\n function helper(helperStr) {\n let leng = helperStr.length;\n let first = helperStr[0];\n let last = helperStr[leng - 1];\n\n if (leng === 0) return; // base case\n // console.log(first, last, result);\n first === last ? result.push(true) : result.push(false);\n helper(helperStr.slice(1, leng - 1)); // recur\n }\n helper(str);\n return result.every((el) => el); // when every elements is true, return true\n}", "function palindrome(str) \n{\n\n str = str.toLowerCase();\n\nlet strlength = str.length; \n \nfor (let i = 0; i < strlength/2; i++) \n{\nif (str[i] !== str[strlength - 1 - i]) \n{ \n return `${str} is not a palindrome`;\n}\n\n}\nreturn `${str} is a palindrome`;\n}", "function isPalindrome(str) {\n //remove spaces, turn same case\n let newStr = str.toString().toLowerCase().replace(/\\s+/g, '');\n console.log(newStr);\n //reverse strings\n let revers = newStr.split(\"\").reverse().join('');\n console.log(revers);\n console.log(newStr + \"=\" + revers + \"?\");\n if (newStr === revers) {\n return `'${[str]}' is a palindrome :)`;\n }\n return `'${[str]}' is not a palindrome!`;\n\n}", "function palindrome(str) {\n \n /* Robert Solution \n const reversed = '';\n for (i of str){\n reversed = i + reversed;\n }\n\n if (reversed === str){\n return true;\n } else {\n return false;\n }\n */\n \n\n /* SOLUTION #1 \n const reversed = str.split('').reverse().join('');\n return str === reversed; */\n\n /* SOLUTION #2 \n\n\n */\n \n /* Robert Solution EVERY Method\n \n arr = str.split('');\n rev = str.split('').reverse()\n\n //console.log(arr)\n //console.log(rev)\n\n let n = 0;\n return rev.every((val)=>{\n n += 1 \n //console.log(n)\n //console.log(val, arr[n-1])\n return val === arr[n-1]\n })\n\n */\n\n return str.split('').every((char,i) => {\n \n return char === str[str.length - i - 1];\n })\n\n\n}", "function palindrome(str)\n{\n// split string into array\n var arr = str.split(\"\");\n// reverse array\n arr = arr.reverse();\n//\n var str2 = arr.join(\"\");\n\n\n// if second string equals the first string return true\n if(str2 == str){\n return true;\n }\n // if they are not equal return false\n return false;\n\n}", "function findPalindromes() {\n var testText = 'Each exe opens a different game,with a different level of WOW or LOL difficulty .',\n testerForCommas = 0,\n arrTest,\n loopZter = 0,\n loopZter2 = 0,\n arrayOfPolies = [],\n forwardWord = [],\n backwardWord = [],\n checkerLoop = 0,\n isTheSame = true; \n\n while (testerForCommas != -1) {\n testerForCommas = testText.indexOf(',');\n\n if (testerForCommas == (-1)) {\n break;\n }\n else {\n testText = testText.replace(',', ' ');\n }\n }\n arrTest = testText.split(' '); \n var thisTextLen = arrTest.length;\n for (loopZter = 0; loopZter < thisTextLen; loopZter += 1) {\n for (loopZter2 = 0; loopZter2 < arrTest[loopZter].length; loopZter2 += 1) {\n forwardWord.push(arrTest[loopZter][loopZter2]);\n backwardWord.unshift(arrTest[loopZter][loopZter2]);\n }\n for (checkerLoop = 0; checkerLoop < forwardWord.length; checkerLoop += 1) {\n if (forwardWord[checkerLoop] != backwardWord[checkerLoop]) {\n isTheSame = false;\n break;\n }\n }\n if (isTheSame && forwardWord.length > 1) { //making sure not to take in account the 1 letter words/symbols\n arrayOfPolies.push(arrTest[loopZter]);\n }\n else {\n isTheSame = true;\n }\n forwardWord.length = 0;\n backwardWord.length = 0;\n }\n console.log(arrayOfPolies);\n}", "function palindrome(string) {\n let splitString = string.split('');\n let reverseArray = splitString.reverse();\n let joinArray = reverseArray.join('');\n\n if (string == joinArray) {\n console.log(true);\n } else {\n console.log(false);\n }\n}", "function isPalindrome(str){\n var newStr = [];\n newStr = str.split('').reverse().join('');\n if (newStr == str){\n console.log(\"Is Palindrome\") \n } else if(newStr !== str) {\n console.log(\"Not a Palindrome\")\n }\n }", "function isPalindrome(someStr) {\r\n \r\n thePalin = someStr.split('').reverse().join('');\r\n if (thePalin == someStr)\r\n return true;\r\n else\r\n return false;\r\n \r\n}", "function palindrome() {\n // to lowercase\n var lowerTestString = testString.toLowerCase();\n var lowerJoinArray = joinArray.toLowerCase();\n if (lowerTestString === lowerJoinArray) {\n palinYesOrNo = \"That is a palindrome!\";\n } else {\n palinYesOrNo = \"Not a palindrome.\";\n }\n writeToHTML();\n}", "function isPalindrome(string) {\n\n function reverse() {\n return string.split('').reverse().join('')\n }\n\n return string === reverse();\n}", "function palindrome(str) {\n var result = str.split('').reverse().join('');\n console.log(result)\n var checker = str;\nif(str == result){\n return true;\n}\nelse {\n return false;\n}\n}", "function palindrome(str) {\n\n let splitStr = str.split(\"\");\n let reverseStr = splitStr.reverse();\n let joinStr = reverseStr.join(\"\");\n let drome = str.split(\"\").reverse().join(\"\");\n console.log(drome,output);\n if (drome === input.value) {\n document.getElementById(\"output3\").innerHTML = \"Your string is a palidrome\";\n } else {\n document.getElementById(\"output3\").innerHTML = \"No\";\n }}", "function isPalindrome(string) {\n // Write your code here.\n // reverse string and compare string\n // string.reverse()\n // string === new string\n // O(n) O(1) ST\n\n let pointerEndIndex = string.length - 1;\n // only needs to travse to half the string\n for ( let i = 0; i < string.length / 2; i++) {\n // check first value with last value\n if ( string[i] === string[pointerEndIndex]) { \n pointerEndIndex--;\n continue;\n } else { \n return false;\n }\n } \n return true;\n }", "function isPalindrome_V2(str){\n if(str.split('').reverse().join('')==str){\n return true;\n }\n return false;\n \n}", "function palChecker(pallendromeCandidate) {\n//split the string into an array, reverse the array, and then merge the elements back into one. The quote marks in join keeps from separating the array with commas\n var pallendromeCandidateOpposite = pallendromeCandidate.split().reverse().join(\"\");\n console.log(pallendromeCandidateOpposite);\n\n//looking at the word forwards and backwards, and with teh same case, determine if both are the same\n if(pallendromeCandidate.toUpperCase() === pallendromeCandidateOpposite.toUpperCase()){\n \treturn true;\n } else {\n \treturn false;\n }\n}", "function isPalindrome(str) {\n\n}", "function palindrome(a,call)\n{\nvar res=0;\nvar s='';\nvar n=[];\nif(call(a)==a)\n{\nreturn \"palindrome\"\n}\nelse\n{\nreturn \"not a palindorme\"\n}\n}", "function palindrome(string) {\n\n}", "function palindromeChecker(palindrome) {\n var array = [];\n array = palindrome.split(\"\");\n // console.log(array);\n var reversedPal = array.reverse();\n // console.log(reversedPal);\n if (array.equals(reversedPal)) {\n return console.log(palindrome +\" is a Palindrome!\")\n } else {\n return console.log(palindrome + \"is not a palindrome.\")\n }\n}", "function palindrome(str) {\n let val = 'abcdefghijklmnopqrstuvwxyz0123456789'.toLowerCase().split('')\n console.log(val)\n let strArr = str.toLowerCase().split('')\n let finalStr = []\n for(let i = 0; i < strArr.length;i++){\n for(let j = 0; j < val.length; j++){\n if(val[j] === strArr[i]){\n finalStr.push(val[j])\n }\n console.log(finalStr)\n }\n }\n \n \n /////fix down////\n \n let reversed = []\n for(let i = finalStr.length-1; i >= 0;i--){\n reversed.push(finalStr[i])\n }\n console.log(reversed, 'THIS IS REV')\n \n \n return finalStr.join('') === reversed.join('')\n }", "function palindrome_check__arrayReverse(string) {\n // Reverse String // O(n)\n let reversed = string.split('').reverse().join('') // split = O(n) --- reverse = O(n) --- join = O(n)\n\n // Conditional & Return\n return string === reversed // O(1)\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //I-array and test function\n //O-boolean based on test results\n //C-\n //E-\n //I'll make a temporary placeholder for the string I'm testing\n let testString\n \n //run it through a loop, if it fails the test at any point return false, otherwise exit loop and return true at that point\n for(let i = 0; i < strings.length; i++) {\n testString = strings[i]\n if (test(testString) == false) {\n return false}\n }\n return true\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function palindrome(str) {\n\n //convert to array\n const strArr = str.split('')\n\n //reverse array in new var\n const reverseArr= strArr.reverse()\n\n //convert back to string. arr1 !== arr2\n const reverseStr=reverseArr.join('')\n\n // match to initial str\n if (str === reverseStr) {\n return true\n } else {\n return false\n }\n\n}", "function isPalindrome(baseStr){\r\n let reverseStr = reverseString(baseStr)\r\n \r\n for (let i = 0; i <= baseStr.length - 1; i++){\r\n if(baseStr[i] !== reverseStr[i]){\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function palindromeSolution2(str){\n\treturn str.split('').every((current, index, arr)=>{\n\t\treturn (current === arr[arr.length - index - 1]);\n\t});\n}", "function palindrome(str) {\n\t// Array.prototype.every -- is used to do a boolean check on every element within an array\n\t// arr.every((val) => val > 5);\n\t// If any function returns false, then the overall expression returns false as well\n\treturn str.split('').every((char,i) => {\n\t\treturn char === str[str.length -i -1]; // mirrored element\n\t});\n}", "isPalindrome(str){ //// fix it. not correct\r\n var letters = []; // This is our stack\r\n var reverseWord = \"\"; // Variable to store the reversed word\r\n for(let i=0; i<str.length; i++) { // Iterate through string and push into our stack\r\n letters.push(str[i]);\r\n }\r\n for(let i=0; i<str.length; i++) { // Iterate through string again and concat the popped element from letters to reverseWord variable\r\n reverseWord+=letters.pop();\r\n }\r\n if (reverseWord === str) {\r\n console.log(str + ' is a palindrome');\r\n } else {\r\n console.log(str + ' is not a palindrome');\r\n }\r\n }", "function isPalindrome(str){\n var str2 = str.toLowerCase().split(\"\").join(\"\").replace(/ /g, '');\n var str3 = str.toLowerCase().split(\"\").reverse().join(\"\").replace(/ /g, '');\n if (str3 === str2) {\n console.log(\"Yay, it's a Palindrome!\")\n }else {\n console.log(\"Sorry, it's not a Palindrome...\")\n }\n}", "function isPalindrome(string) {\n // Write your code here.\n\tconst reversedChars = [];\n\tfor (let i = string.length - 1; i >= 0; i--) {\n\t\treversedChars.push(string[i])\n\t}\n\treturn string === reversedChars.join('')\n}", "function isPalindrome(string){\n return string === string.split('').reverse().join(''); //I DID IT BY MYSELF!!\n}", "function testSuite () {\n console.log(\"Expected output of maxOfThree(5,4,44) is 44 \" + myFunctionTest(44, maxOfThree(5, 4, 44)));\n console.log(\"Expected output of maxOfThree(55,4,44) is 55 \" + myFunctionTest(55, maxOfThree(55, 4, 44)));\n console.log(\"Expected output of maxOfThree(55,4,44) is 55 \" + myFunctionTest(4, maxOfThree(55, 4, 44)));\n /* Test Function 4 */\n console.log(\"Expected output of isVowel(true,'a') is true \" + myFunctionTest(true, isVowel('a')));\n console.log(\"Expected output of isVowel(true,'A') is true \" + myFunctionTest(true, isVowel('A')));\n console.log(\"Expected output of isVowel(false,'b') is false \" + myFunctionTest(false, isVowel('b')))\n /* Test Function 5a*/\n console.log(\"Expected output of sum([1, 2, 3, 4]) is 10 \" + myFunctionTest(10, sum([1, 2, 3, 4])));\n /* Test Function 5a*/\n console.log(\"Expected output of multiply([1, 2, 3, 4]) is 24 \" + myFunctionTest(24, multiply([1, 2, 3, 4])));\n\n //reverse\n console.log(\"Expected output of reverse(abc) is cba \" + myFunctionTest(\"cba\", reverse(\"abc\")))\n\n// testing for find longest word\n console.log(\"Expected output of findLongestWord([lam,hot,soa,siagian]) is 7 \" +\n myFunctionTest(7, function () {\n return findLongestWord([\"lam\", \"hot\", \"soa\", \"siagian\"]);\n })\n );\n\n console.log(findLongestWord([\"lam\", \"hot\", \"soa\", \"siagian\"]));\n//filterLongWords function test\n console.log(\"Expected output of filterLongWords([\\\"jambu\\\", \\\"buku\\\", \\\"bola\\\", \" +\n \"\\\"durian\\\", \\\"sirsak\\\", \\\"hitam\\\"], 6) is [durian, sirsak, hitamm] \" +\n myFunctionTest(\"durian\", \"sirsak\", \"hitamm\", filterLongWords([\"jambu\", \"buku\", \"bola\", \"durian\", \"sirsak\", \"hitamm\"], 5).toString()));\n\n console.log(function() {return filterLongWords([\"jambu\", \"buku\", \"bola\", \"durian\", \"sirsak\", \"hitamm\"])});\n slideJS()\n}", "function isPalindrome(string){\n string = string.toLowerCase()\n const charactersArr = string.split('')\n const validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('')\n\n let lettersArr = charactersArr.filter(char => validCharacters.includes(char))\n \n return lettersArr.join('') === lettersArr.reverse().join('')\n //if (lettersArr.join('') === lettersArr.reverse().join('')) return true; else return false\n}", "function palindrome(string){\n var newWord='';\n for (var i=string.length-1; i>=0; i--){\n newWord+=string[i];\n \n }\n if (newWord===string){\n return string +' is a palindrome'\n \n } else{\n return string +' is not a palindrome'\n }\n \n }", "function palindrome(string) {\n\t//exclude from the string all characters different than letters and numbers\n\tvar excludeChar = /[^A-Za-z0-9]/g;\n\n\t//convert the string elements toLowerCase and take out all the \n\t//unwanted characters, if there are any\n\tvar initialString = string.toLowerCase().replace(excludeChar, '');\n\n\t//create a var which stores the number of string characters\n\tvar ln = string.length;\n\n\t//with FOR, loop through the first half of the string and compare it\n\t//with the second half\n\tfor(i = 0; i < ln/2; i++) {\n\t\tif(initialString[i] !== initialString[ln-1-i]) {\n\t\t\treturn console.log(\"This is not a palindrome\");\n\t\t}\n\t}\n\treturn console.log(\"This is a palindrome\");\n\n}", "function isPalindrome(str){\n // if(str.length <2) return false;\n for(var i = 0; i<str.length/2; i++){\n // console.log(str[i])\n // console.log(str[str.length-i-1])\n if(str[i]!=str[str.length-i-1])\n return false;\n\n }\n return true;\n return str === str.split(\"\").reverse().join(\"\"); \n}", "function isPalindrome(string) {\n // Write your code here.\n\tlet leftIdx = 0\n\tlet rightIdx = string.length - 1\n\twhile (leftIdx < rightIdx) {\n\t\tif (string[leftIdx] !== string[rightIdx]) return false\n\t\tleftIdx++\n\t\trightIdx--\n\t}\n\treturn true\n}", "function checkPalindrome(str){ \n // convert string to array\n var reg = /[^A-Za-z0-9]/g;\n str = str.toLowerCase().replace(reg , '');\n var stringArray = str.split('');\n var l =stringArray.length;\n let i=0;\n while(i<l){\n if(stringArray[i] === stringArray[l-1-i]){\n return 'Palindrome';\n } else {\n return 'Not Palindrome';\n }\n i++;\n }\n}", "function palindrome (str) {\n let arrayContent = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n str = str.toLowerCase()\n let cleanStr = ''\n\n for (let i = 0; i < str.length; i++) {\n if (arrayContent.includes(str[i])) {\n cleanStr = cleanStr + str[i]\n }\n }\n\n if (cleanStr.length % 2 === 0) {\n return cleanStr.slice(0, (cleanStr.length / 2)) === reverseStringV1(cleanStr.slice((cleanStr.length / 2)))\n } else {\n return cleanStr.slice(0, Math.floor(cleanStr.length / 2)) === reverseStringV1(cleanStr.slice(Math.floor(cleanStr.length / 2) + 1))\n }\n}", "function isPalindrome(teststr) {\n let left = 0;\n let right = teststr.length-1;\n while (left <= right) {\n if(teststr[left] != teststr[right]){\n return false;\n }\n left += 1;\n right -= 1;\n }\n return true;\n}", "function palindrome(string){\n let len = string.length;\n for(let i = 0; i < string.length; i++){\n if(string[i] != string[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function isPalindrome(str){\n var reversedArr = [];\n var words = str.split('');\n for(var i = words.length -1; i>=0 ;i-- ){\n // console.log(reversedArr); \n reversedArr.push(words[i]);\n }\n\n if(str == reversedArr.join('')){\n return 'palindrome';\n } else {\n return 'not';\n }\n}", "function isPalindrome(str, low, high, length) {\n let arr = str.split('').filter((e) => e != ' ')\n if (length <= 1) {\n return true;\n }\n if (arr[low] != arr[high]) {\n return false;\n } else {\n return isPalindrome(str, low + 1, high - 1, length - 2)\n }\n}", "function isPalindrome(string){\n string = string.toLowerCase();\n var charactersArr = string.split(\"\"); //1st array has all characters including punctuation & spaces\n //ignore any character not a letter\n var validCharacters = \"abcdefghijklmnopqrstuvwxyz\".split(\"\"); //2nd array is only the alphabet\n\n//BLOCK CODE BELOW SAYS: CHECK THE FIRST LETTER (index 0) and if it's part of our valid characters, push it into\n//the lettersArry.\n//If it's not one of our valid characters, return a -1 = invalid\n\n//i. Create letters array in which to place only the characters from our CharacterArr\nvar lettersArr = [];\n//ii. remove any character not a letter e.g., numbers USE A FOR-EACH LOOP\n charactersArr.forEach(char => {\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char);\n });\nif (lettersArr.join(\"\") === lettersArr.reverse().join(\"\")) return true;\nelse return false;\n}", "function palindrome (string) {\r\n var regExp = /[\\W_]/g; //This is a regular expression. The expreesion in the var regExp is symbol for non alphanumerics and hyphen.\r\n var newString = string.toLowerCase().replace(regExp, ''); //The input parameter is set to lower case and all non alphanumerics are replaced with an empty string\r\n var reversedString = newString.split('').reverse().join(''); // The new string is split into an array, reversed and joined back into a string\r\n if (reversedString === newString) { //if the reversed and new string are equal, the code below runs accordingly\r\n return true;\r\n } \r\n else {\r\n return false \r\n } \r\n}", "function isPalindrome(str) {\n // const revString = str\n // .split(\"\") // turn a string into an array\n // .reverse() // reverse, duh\n // .join(\"\"); // method returns the array as a string.\n // return revString === str;\n}", "function checkPal(){\n // plan\n // determine how to find the palindromes\n // brute:\n // go from the bottom up until your at or past number\n \n // non brute: \n // find a way to get it from above down\n // use a math equsation to find this\n \n\n}", "function palindromeCheck(str) {\n if (str.length === 1) { // if the length of a word is only 1 character, \n return false; // take it out because a palindrome cannot be created. \n }\n\n str = str.toLowerCase(); // make lower case to make sure algo accounts for all characters in string\n\n let reverseStr = ''; // instantiate blank palindrome holder; \n\n for (let i = str.length - 1; i >= 0; i--) { // loop through string backwards and see what comes out as a palindrome. \n reverseStr += str[i]; // count the number of times a palindrome was able to be found and with what words in string. \n }\n\n return reverseStr === str; // return all palindromes that are the same as the existing words in the string.\n}", "function palinChecker(string){\n\tvar backword = string.split('').reverse().join('');\n\tconsole.log(backword);\n\tif (backword == string){\n\t\tconsole.log(\"You have a palindrome.\");\n\t\treturn true;\n\t}\n\telse{\n\t\tconsole.log(\"Not a palindrome.\");\n\t\treturn false;\n\t}\n}", "function isPalindrome1(string) {\n const compareString = \n string.split('')\n .reverse()\n .join('')\n if(string === compareString) return true;\n else return false\n}", "function is_palindrome(s) {\n s = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, '');\n\n const regularString = new Stack();\n for (let i = 0; i < s.length; i++) {\n regularString.push(s[i]);\n }\n\n // racecar front to back, racecar back to front\n const reverseString = new Stack();\n for (let i = s.length - 1; i >= 0; i--) {\n reverseString.push(s[i]);\n }\n\n while (regularString.top !== null) {\n if (regularString.top.data !== reverseString.top.data) {\n return false;\n }\n regularString.top = regularString.top.next;\n reverseString.top = reverseString.top.next;\n }\n\n return true;\n}", "function isPalindrome(string) {\n string = string.replace(/\\s/g, '');\n string = string.toLowerCase().trim();\n const strStack = new Stack();\n let reversedStr = '';\n // Put each character in the stack one at a time\n for (let i=0; i<string.length; i++) {\n strStack.push(string[i]);\n }\n // pop off each character and save in a new string\n while (strStack.top !== null) {\n let val = strStack.pop()\n reversedStr = reversedStr.concat(val);\n }\n // compare original str to new str\n console.log(string);\n console.log(reversedStr);\n return string === reversedStr;\n}", "function otherPalindrome(str) {\n\n let reverseArr = [];\n\n for(var i = str.length-1; i >= 0; i--) {\n reverseArr.push(str[i]);\n }\n // console.log(reverseArr);\n rvsWord = reverseArr.join(\"\");\n // console.log(rvsWord);\n\n if(str == rvsWord) {\n return true;\n } else {\n return false;\n }\n\n}", "function isPalindrome(string) {\n let reverseString = string.split(\"\").reverse().join(\"\");\n return reverseString === string;\n}", "function palindrome(string){\n return string === string.split(\"\").reverse().join(\"\");\n}", "function palindromeSolution1(str){\n\tconst reversed = str.split('').reduce((accum, letter)=> letter + accum, '');\n\treturn reversed === str;\n}", "function Palindrome(str) { \n str = str.replace(/\\s+/g, '');\t\t\t\t//Removes all spaces within the inputted string so that spaces are not important\n var reverseStr = [];\t\t\t\t\t\t//Array declared for the reverse string\n\n for (i=str.length-1, j=0; i==0, j < str.length; i--, j++) {\t//Double for loop, going down from the last letter of str to the first (i)\n\t\t\t\t\t\t\t\t//And going up from 0 to the last element of the string for the reverse string (j)\n reverseStr[j] = str[i];\t\t\t\t\t//Creates a reverse string\n }\n\n if (reverseStr.join('') == str) {\t\t\t\t//Joins together the reverse string and if it matches the original string then true\n return true;\n }\n else {\n return false;\t\t\t\t\t\t//Otherwise false\n }\n}", "function isPalidrome(str){\n let reverseStrArray = str.split('').reverse();\n let reverseStr = reverseStrArray.join(''); \n \n if (str === reverseStr){\n return true;\n }\n \n return false;\n }", "function Palindrome(str) {\n\n\tvar myArray = str.split('');\n\n\tvar revArray = myArray.reverse(); // how do I use .reverse only once?\n\n\tvar myArray = str.split(''); \n\t\n\tfor (i in myArray) {\n\n\t\tif (myArray[i] == revArray[i]) {\n\n\t\t} else {\n\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function isPalindrome(str) {\n let result = \"\";\n\n function helper(helperStr) {\n console.log(helperStr)\n if (helperStr.length === 1) {\n result += helperStr.charAt(0);\n return\n }\n result += helperStr.charAt(helperStr.length - 1);\n helper(helperStr.slice(0, helperStr.length - 1));\n }\n\n helper(str);\n\n return str === result ? true : false;\n}", "function palindrome(str) {\n if (str === str.split(\"\").reverse().join(\"\")) {\n return true;\n } else {\n return false;\n }\n}", "function palindrome(str) {\n if (!str[1]) {\n console.log(\"This is a palindrome\");\n }\n else if (str[0] === str[str.length-1]) {\n str = str.slice(1, str.length-1);\n return palindrome(str);\n }\n else {\n console.log(\"this is def not a palindrome\");\n }\n}", "function checkIsPalindrome(inputString) {\n\n if (typeof inputString !== \"string\") {\n return \"no\";\n }\n\n // checking palindromes is kind of weird.\n // take the length of the string.\n // grab string [0] and string [n]; compare for sameness\n // iterate until floor(n/2), I guess\n // as long as the bit is true, it's a palindrome?\n\n let wordArr = inputString.split('');\n for (let i = 0; i < wordArr.length / 2; i++) {\n if (wordArr[i] !== wordArr[wordArr.length - i - 1]) {\n return \"no\";\n }\n }\n return \"yes\";\n\n}", "function isPalindrome(str){\n const revString = str.split('').reverse().join(''); \n return revString === str; // will give true or false\n \n}", "function Palindrome(str) \r\n {\r\n var cstr = str.toLowerCase().replace(/[^a-zA-Z0-9]+/g,)\r\n var count = 0\r\n if ((str.length) / 2 ===0 )\r\n {\r\n\r\n }\r\n else \r\n {\r\n if(str.length ===1)\r\n {\r\n document.write(\"Entry is palindrome\")\r\n }\r\n else\r\n {\r\n count = (str.length -1 ) /2 \r\n }\r\n }\r\n for (var i = 0; i <count.length; i++) \r\n {\r\n if (str[i] != srt.slice(-1-x)[0])\r\n {\r\n document.write(\"The entry is not palindrome\")\r\n }\r\n }\r\n document.write(\"The entry is palindrome\" + \"<br>\")\r\n }", "function isPalindrome(checkingStr) {\n let flag = true;\n for (let i = 0; i < checkingStr.length / 2; i++) {\n\n if (checkingStr[i] !== checkingStr[checkingStr.length - 1 - i]) {\n flag = false;\n break\n }\n\n }\n return flag ? checkingStr : flag;\n}", "function checkPalindrome() {\n // take input\n var string = prompt('Enter a string:', \"\");\n let isPalindrome = true;\n\n // find the length of a string\n const len = string.length;\n\n // loop through half of the string\n for (let i = 0; i < len / 2; i++) {\n\n // check if first and last string are same\n if (string[i] !== string[len - 1 - i]) {\n isPalindrome = false;\n }\n }\n if (isPalindrome) {\n document.getElementById(\"output\").textContent = \"Palindrome\";\n } else {\n document.getElementById(\"output\").textContent = \"Not Palindrome\";\n }\n}", "function isPalindromic(a) {\n let rev = a.toString().split('').reverse('').join('');\n console.log(rev)\n return a === rev ? true : false;\n}", "function ablePalindrome(s){\n let indexS = 0;\n let indexE = s.length - 1;\n for (; indexS < indexE; indexS++, indexE--) {\n if (s[indexE] !== s[indexS]) return isPalindrome1(s,indexS+1,indexE)||isPalindrome1(s,indexS,indexE-1);\n }\n return true;\n\n function isPalindrome1(s,indexS,indexE) {\n for (; indexS < indexE; indexS++, indexE--) {\n if (s[indexE] !== s[indexS]) return false;\n }\n return true;\n }\n}", "function palindrome(str) {\n \n // pre-process\n str = str.toLowerCase();\n \n // find unwanted characters and replace\n const re = /[^a-z\\d]+/g;\n\tstr = str.replace(re, '');\n\t\n // for reversing a string\n function reverseString(txt) {\n return txt.split('').reverse().join('');\n\t}\n\n\t// A question of symmetry:\n // find length & middle, split and reverse one piece\n // then check for equality\n \n\t// even if odd length string, this will give us enough to\n\t// check two halves are palindromic\n\tconst half = Math.floor(str.length / 2);\n\t\n\tconst flipped = reverseString(str.substring(str.length - half));\n\t\n\treturn str.substring(0, half) === flipped;\n \n}", "function is_palindrome(s) {\n s = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, \"\");\n if (s.length < 3) {\n return false;\n }\n // Your code goes here\n const stringStack = new Stack();\n for (let i = 0; i < s.length; i++) {\n stringStack.push(s[i]);\n }\n let reverseString = \"\";\n // add up all the pop values - notice that the pop() returns node.value\n while (!stringStack.isEmpty()) {\n reverseString += stringStack.pop();\n }\n // check if accumulated pop = string\n if (s === reverseString) {\n return true;\n } else {\n return false;\n }\n}", "function palindrome(str) {\n debugger;\n return str.split(``).every((value, index) => {\n return value == str[str.length - index -1];\n });\n}", "function isPalindrome(arg) {\n\tvar argumentAsList;\n\t// prepare argument into array if it is a string.\n\tif(typeof arg === 'string') {\n\t\targumentAsList = arg.split('');\n\t} else {\n\t\targumentAsList = arg;\n\t}\n\tfunction compareOpposites(list) {\n\t\tfor (var i = 0; i < (list.length / 2); i++) {\n\t\t\tvar oppositeIndex = list[list.length - (i + 1)];\n\t\t\tif(list[i] !== oppositeIndex) {\n\t\t\t\treturn console.log('EX 3:The argument is NOT a Palindrome');\n\t\t\t}\n\t\t}\n\t\treturn console.log('EX 3:The argument is a Palindrome') \n\t} \n\t// if the length of the argumentList is even \n\tif(argumentAsList.length % 2 === 0 ) {\n\t\tcompareOpposites(argumentAsList);\n\t}\n\t// if the length of the argumentList is odd \n\tif(argumentAsList.length % 2 === 1 ) {\n\t\tvar indexOfCenterElement = (argumentAsList.length - 1) /2;\n\t\targumentAsList.splice(indexOfCenterElement, 1)\n\t\tcompareOpposites(argumentAsList);\n\t}\n}", "function palindrome(str) {\n return true;\n}", "function isPalendromeTest() {\n return this.isPalendrome(959);\n}", "function palindrome(str) {\n //Check if input is a palindrome\n if (isPalindrome(str)) return true;\n let strCopy = str.slice(0).split(''); // [r,a,c,e,c,r,a] --> [a,r,c,e,c,r,a]\n\n for (let i = 0; i < str.length - 1; i++) {\n let j = i + 1;\n swap(strCopy, i, j);\n if (isPalindrome(strCopy)) {\n return true;\n } else {\n strCopy = str.slice(0).split('');\n continue;\n }\n }\n return false;\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n // determine if all strings in the strings array pass the test\n // first we need to loop through the strings array and pass it through the test function\n // outside the loop the code block apply the conditional statement on whether are strings pass\n var tester = [];\n for(var i = 0; i < strings.length; i++){\n if(!test(strings[i])){\n return false;\n }\n \n }\n return true;\n // tester should contain an array of boolean values either true or false\n // have to say if just one tester element is false\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function isPalindrome(str) {\r\n\r\n //Compare if the str getting passed is equal to the reversed of the string\r\n //If it matches then return true\r\n //else false\r\n if(str === reverseString(str)){\r\n console.log(\"True\");\r\n return true;\r\n }\r\n else{\r\n console.log(\"false\");\r\n return false;\r\n }\r\n}", "function isAlsoPalindrome(str){\n for (i = 0; i < str.length; i++){\n if(str[i] != str[str.length -1 -i]){\n console.log(false);\n }\n console.log(true);\n }\n}", "function allStringsPass(strings, test) {\n // YOUR CODE BELOW HERE //\n //inputs an array of strings, and a function that tests string values, returing a boolean\n //outputs a boolean of true if all values in strings passed, or false if any failed\n //a for loop incrementing over strings\n \n // a variable to be set to false if any fail\n let weGood = true;\n for (let i = 0; i<strings.length; i++){\n //pass string at this value to test function. if false, return false\n if (test(strings[i])===false){\n weGood = false;\n }\n \n }\n return weGood;\n \n \n // YOUR CODE ABOVE HERE //\n}", "function isPalindrome(str){\n return (str === str.split('').reverse().join('')); \n}", "function palindrome(pal){\n\tlet palLength = pal.length;\n\tlet palArr = pal.split('');\n\tfor(let i = 0; i < palArr.length; i++){\n\t\tif(palArr[i] === palArr[(palArr.length -1) - i]){\n\t\t} else {\n\t\t console.log('nope!');\n\t\t return 'sorry, this is not a palindrome!';\n\t\t}\n\t};\n return pal + ' is a palindrome!';\n}", "function check_Palindrome(str_entry){\n// Change the string into lower case and remove all non-alphanumeric characters\n var cstr = str_entry.toLowerCase().replace(/[^a-zA-Z0-9]+/g,'');\n\tvar ccount = 0;\n// Check whether the string is empty or not\n\tif(cstr===\"\") {\n\t\talert(\"Nothing found!\");\n\t\treturn false;\n\t}\n// Check if the length of the string is even or odd\n\tif ((cstr.length) % 2 === 0) {\n\t\tccount = (cstr.length) / 2;\n\t} else {\n// If the length of the string is 1 then it becomes a palindrome\n\t\tif (cstr.length === 1) {\n\t\t\talert(\"Entry is a palindrome.\");\n\t\t\treturn true;\n\t\t} else {\n// If the length of the string is odd ignore middle character\n\t\t\tccount = (cstr.length - 1) / 2;\n\t\t}\n\t}\n// Loop through to check the first character to the last character and then move next\n\tfor (var x = 0; x < ccount; x++) {\n// Compare characters and drop them if they do not match\n\t\tif (cstr[x] != cstr.slice(-1-x)[0]) {\n\t\t\talert(\"Entry is not a palindrome.\");\n\t\t\treturn false;\n\t\t}\n\t}\n\talert(\"The entry is a palindrome.\");\n\treturn true;\n}", "function palindrome(string){\n let len = string.length;\n let str = string.toLowerCase();\n for(let i = 0; i < str.length/2; i ++){\n if(str[i] != str[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function isPalindrome(string){\n for (var i = 0; i < string.length / 2; i++){\n if (string[i] !== string[string.length - 1 -i]) {\n return false\n }\n }\n return true\n }", "function palindrome() {\n str = prompt(\"Enter the String to check for Palindrome\");\n \n\n var re = /[\\W_]/g;\n var lowRegStr = str.toLowerCase().replace(re, '');\n var reverseStr = lowRegStr.split('').reverse().join('');\n //return reverseStr === lowRegStr;\n\n\n if (reverseStr === lowRegStr) {\n document.writeln(\"true\")\n }\n else {\n document.writeln(\"false\")\n }\n}", "function isPalindrome(str) {\r\n return str === str.split('').reverse().join('');\r\n}", "function checkPalidrom(str){\n\n return str == str.split('').reverse().join('');\n \n}", "function checkIsPalindrome(inputString) {\n // Your code here\n let reverseWord = inputString.toString().split('').reverse().join('');\n if (inputString === reverseWord) {\n return 'Yes';\n } \n return 'No'\n}", "function palindrome(str) {\n //assign a front and a back pointer\n let front = 0\n let back = str.length - 1\n \n //back and front pointers won't always meet in the middle, so use (back > front)\n while (back > front) {\n //increments front pointer if current character doesn't meet criteria\n if ( str[front].match(/[\\W_]/) ) {\n front++\n continue\n }\n //decrements back pointer if current character doesn't meet criteria\n if ( str[back].match(/[\\W_]/) ) {\n back--\n continue\n }\n //finally does the comparison on the current character\n if ( str[front].toLowerCase() !== str[back].toLowerCase() ) return false\n front++\n back--\n }\n \n //if the whole string has been compared without returning false, it's a palindrome!\n return true\n \n }", "function isPalindrom(n){\n // let reverseN = n.split('').reverse().join('');\n // if(n === reverseN) return true;\n // return false;\n let arrN = n.split('');\n let len = arrN.length;\n for (let i = 0; i < len/2; i++){\n if(arrN[i] !== arrN[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function palindrome(string) {\n let lower = string.toLowerCase();\n return lower === reverse(lower);\n}", "function Palindrome(str) {\n return str.split(' ').join('') === str.split('').reverse().join('').replace(/ /g,''); \n}", "function isPalindrome(str) {\nlet end = str.length - 1;\nfor (let idx = 0; idx < str.length / 2; idx += 1) {\n if (str[idx] !== str[end]) {\n return false;\n }\n end -= 1;\n}\nreturn true;\n}" ]
[ "0.7133543", "0.70340705", "0.70277864", "0.69195074", "0.6897911", "0.6885694", "0.68594754", "0.68586373", "0.6825957", "0.6812347", "0.68109417", "0.67944103", "0.67717206", "0.6755872", "0.67464024", "0.6735601", "0.67330545", "0.6683324", "0.66658145", "0.66404724", "0.6639984", "0.66384876", "0.6636575", "0.6629804", "0.6618206", "0.661383", "0.6566967", "0.6564754", "0.65383565", "0.65341175", "0.65256846", "0.6521771", "0.65192735", "0.6518178", "0.6517492", "0.6515426", "0.6500877", "0.6499062", "0.64755064", "0.6461598", "0.6456621", "0.6455231", "0.6455189", "0.64528674", "0.6445401", "0.6431553", "0.6431365", "0.64298844", "0.6427533", "0.6427012", "0.6423837", "0.6416169", "0.64148897", "0.64033955", "0.6398416", "0.6398095", "0.6391672", "0.6355887", "0.6353046", "0.6351085", "0.63491464", "0.63469946", "0.6344229", "0.63230115", "0.63215923", "0.6315783", "0.63074255", "0.6306682", "0.6305263", "0.6300942", "0.6294171", "0.62933785", "0.6281239", "0.62810683", "0.627812", "0.62775713", "0.6263277", "0.62622344", "0.6260812", "0.6260801", "0.62600374", "0.62550396", "0.62539333", "0.6252116", "0.6251064", "0.6251003", "0.62506074", "0.6247135", "0.62467676", "0.6244574", "0.6237978", "0.6237646", "0.6237256", "0.6231371", "0.62247026", "0.62201786", "0.6217445", "0.62159425", "0.6215661", "0.6213291", "0.62107974" ]
0.0
-1
console.log(isPalindrome("LEVEL")) console.log(isPalindrome("hello")) / Create a function "add" that takes an argument (a number) and returns a function. The returned function should also take one argument (a number) and return the sum of its argument and the argument that was originally past to "add" Example: const addBy10 = add(10) addBy10(20) > 30 create a function with input number output should return a function which takes one argument (number) returns sum of it's argument and the argument in the previous function
function addTen(num) { return function addNum(n) { return num + n; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addingMath(num, addingFunction){\r\n return num + addingFunction();//we have to \r\n}", "function palindrome(a,call)\n{\nvar res=0;\nvar s='';\nvar n=[];\nif(call(a)==a)\n{\nreturn \"palindrome\"\n}\nelse\n{\nreturn \"not a palindorme\"\n}\n}", "function add(){\n let sumFunc = sumOfThirty(30, 2, 20)\n let divFunc = divideProductFunc(sumFunc, 10, 2)\n return divFunc \n }", "function addition_Function(a, b) { //Function returns a added to b\n return a + b;\n}", "function calculateSum(a,b) //here are two argument/parameters given to calculateSum function\n{\n //sum of two numbers\n /* lekin sum karne ke kiye humko 2 no dene hoge jo ki hum waha dege */\n let sum = a + b;\n return sum; //return function value ko return kar deta hai jo usko call karega\n}", "function add(num1) {\n return function secondAdd(num2) {\n return (num1 + num2)\n }\n}", "function add(x) {\n \nreturn function(y) {\n return function(z) {\n return x + y + z\n }\n}\n\n \n}", "function add(a,b){return a+b;}", "function addBy(firstNumber) {\n return function (secondNumber) {\n return firstNumber + secondNumber;\n }\n}", "function addTogether(num1,num2) {\nif (typeof(num1)=='number'){\n if (typeof(num2) == 'number'){\n return num1+num2\n }\n else if(!num2 ){\n return function(newnum){return newnum+num1}}\n else{return undefined}\n}\nelse {return undefined}\n\n}", "function demoFun(num,palindrome){\nvar arr=num.split('').reverse().join('')\nif(arr == num){\npalindrome()\n}\n}", "function addFunc(first, second){\r\n return first + second;\r\n}", "function add(number){\n return function(a){\n return a + number;\n }\n}", "function add(a,b){\n return a+b;\n}", "function add(a,b){\n return a+b;\n}", "function add(a, b){\n return a+b;\n}", "function add(x) {\n // Add your code below this line\n return function(y){\n return function(z){\n return x + y + z;\n }\n }\n // Add your code above this line\n}", "function makeAdd(num1) {\n return function (num2) {\n return num1 + num2;\n }\n}", "function add(x) {\n // Add your code below this line\n return function(y){\n return function(z){\n return x + y + z;\n }\n }\n\n // Add your code above this line\n}", "function add() {\n\tvar arg1 = arguments[0];\n\tvar arg2 = arguments[1];\n\tif (arg1 && arg2) {\n\t\tif (typeof arg1 == 'number' && typeof arg2 == 'number') {\n\t\t\treturn arg1 + arg2;\n\t\t}\n\t} else if (typeof arg1 == 'number') {\n\t\treturn function (x) {\n\t\t\treturn add(x, arg1);\n\t\t};\n\t} else {\n\t\treturn undefined;\n\t}\n}", "function add(x) {\n // Add your code below this line - done\n return function(y) {\n return function(z) {\n return x+y+z;\n }\n }\n // Add your code above this line\n}", "function addTogether() {\n //create a function to check if the argument is a number\n //if not, return undefined\n let checkNum = (num) => {\n if(typeof num !== 'number') {\n return undefined;\n } else {\n return num;\n }\n };\n\n //Check if we have two argument paramaters,\n if(arguments.length > 1) {\n let a = checkNum(arguments[0]);\n let b = checkNum(arguments[1]);\n //If the arguments passed return as undefined, return undefined.\n //Otherwise, add them and return the sum.\n if(a === undefined || b === undefined) {\n return undefined;\n } else {\n return a + b;\n }\n } else {\n //If only one argument paramater is passed, return a new function that expects two paramaters\n let c = arguments[0];\n\n if(checkNum(c)) {\n return (arg2) => {\n //Check for non-numbers again\n if(c === undefined || checkNum(arg2) === undefined) {\n return undefined;\n } else {\n // If numbers add them and return sum\n return c + arg2;\n }\n };\n }\n }\n}", "function addTogether() {\n let args = arguments\n\n for(let i = 0; i < args.length; i++){\n if (typeof(args[i]) !== 'number'){\n return undefined\n }\n }\n \n if(args.length == 2){\n return args[0] + args[1]\n } else if (args.length == 1 && typeof(args[0]) === 'number'){\n return function(num){\n if(typeof(num)==='number'){\n return args[0] + num\n }\n } \n }\n\n return false;\n}", "function addNumbers(num1, num2) { //create the function with 2 num arguments\n return num1 + num2 //add the two numbers and return the result\n}", "function add() {\n //Lexical to add\n function sub() {\n return \"30\";\n }\n return \"Prince\";\n}", "function add(a,b){\n return a + b\n}", "function addFunction(a,b,c){\n return a + b + c;\n}", "function add(number1, number2){\n return number1 + number2;\n}", "function addAgain(parameter1, parameter2) {\n parameter1 + parameter2; \n}", "function add(a, b) {\n return a + b; \n}", "function add1Functional(number) {\n return number + 1;\n}", "function checkPal(){\n // plan\n // determine how to find the palindromes\n // brute:\n // go from the bottom up until your at or past number\n \n // non brute: \n // find a way to get it from above down\n // use a math equsation to find this\n \n\n}", "function add(number1, number2) {\n return number1 + number2\n}", "function createAddByFunction(firstNumber) {\n const someThing = 'something';\n return function(secondNumber) {\n console.log(someThing);\n return firstNumber + secondNumber;\n }\n}", "function add(a,b){\n return a + b;\n}", "function MyNewFunction(number1, number2) {\r\n let result = number1 + number2;\r\n return result;\r\n }", "function add(a, b){\n return a + b;\n}", "function SimpleAdding(num) {\n if(num==1){\n return 1;\n } else {\n return num + SimpleAdding(num -1);\n }\n \n}", "function SimpleAdding(num) {\n\n // code goes here\n return num;\n\n}", "function add(number1, number2) {\n return number1 + number2;\n}", "function scatterPalindrome(strToEvaluate) {\n // Write your code here\n}", "function add(a, b) {return a+b;}", "function add(a, b){\n return a + b;\n}", "function add(a, b){\n return a + b;\n}", "function add (a,b)\n{\n return a + b \n\n}", "function addTogether() {\n let checkNumber = function (num){\n if(typeof(num) !== \"number\"){\n return undefined;\n }else{\n return num;\n }\n }\n \n if (arguments.length > 1){\n let a = checkNumber(arguments[0]);\n let b = checkNumber(arguments[1]);\n if (a === undefined || b === undefined){\n return undefined\n }else{\n return a + b;\n }\n \n \n } else {\n var c = arguments[0];\n if (checkNumber(c)) {\n return function(arg2) {\n if (c === undefined || checkNumber(arg2) === undefined) {\n return undefined;\n } else {\n return c + arg2;\n }\n };\n }\n }\n }", "function add(a,b) {\n return a + b;\n}", "function add(a,b){\r\n return a + b;\r\n}", "function add(num1,num2){\n return num1 + num2;\n}", "function add(n){\n var addAgain = function(x){\n return add(n+x);\n };\n addAgain.valueOf = function(){\n return n;\n };\n return addAgain;\n}", "function addition(number1, number2) {\n return number1 + number2;\n}", "function addieren(a,b) {\n return a + b; \n}", "function add(a){\n return function(b){\n return a+b;\n }\n}", "function add(a){\n return function(b){\n return a+b;\n }\n}", "function add(sum1, sum2){\n return sum1 + sum2;\n }", "function add(num1, num2){\n console.log(num1 + num2);\n return\n}", "function addition(a, b) {\n return a+b;\n}", "function add(num1, num2) {\n return num1 + num2;\n\n}", "function add(num1, num2) {\n return num1 + num2;\n\n}", "function add(a, b) {\n return a + b\n}", "function add(a, b) {\n return a + b\n}", "function add(a, b) {\n return a + b\n}", "function addition(x){\n return function(y){\n return x+y\n }\n}", "function add(a, b) {\n return a + b\n}", "function addTogether(arg1) {\n let sum = 0\n if (isNaN(arg1)) {\n return undefined\n }\n\n if (arguments.length == 2) {\n if (typeof arguments[1] !== \"number\") {\n return undefined\n }\n sum = arg1 + arguments[1]\n return sum\n } else if (arguments.length ==1) {\n return function(arg2) {\n if (typeof arg2 !== \"number\") {\n return undefined\n } else {\n return arg1 + arg2\n }\n }\n }\n}", "function adder(x, y){ //here I built an add function so that's why I named it add\n//this function takes in two parameters(which will represent the two numbers we want to pass in when we call the function)\n return x + y;\n}", "function add(num1,num2)\n{\n return num1+num2;\n}", "function add (num1, num2){\n return (num1 + num2);\n}", "function add(a,b){\n\treturn a+b;\n}", "function add (firstNum, secondNum) {\n\n return firstNum + secondNum;\n\n}", "function add(num1,num2)\n{\n return num1 + num2;\n}", "function add(x){\n return function(y){\n return x + y\n }\n}", "function addNumbers( firstNumber, secondNumber ) {\n // return firstNumber + secondNumber;\nlet solution = firstNumber + secondNumber;\nreturn solution;\n}", "function add(n) {\n function addRandom(y) {\n function addAnother(x) {\n return (n + y + x)\n }\n return addAnother\n }\n return addRandom;\n}", "function add(num1, num2){\n let result = num1 + num2;\n return result;\n}", "function add() {\n var args = Array.prototype.slice.call(arguments);\n if (args.length !== 2) {\n if (typeof args[0] !== 'number') {\n return undefined;\n }\n return function(a) {\n if (typeof a !== 'number') {\n return undefined;\n }\n return (a + args[0]);\n };\n } else {\n if (typeof args[1] !== \"number\") {\n return undefined;\n }\n return args[0] + args[1];\n }\n}", "function palindrome(word){\n \n}", "function add(num1, num2){\n return num1 + num2;\n}", "function add() {\n return a +90; // the callable object returns an expression (a) which is \n // defined outside of the callable object \n }", "function addition() {\n calculateResult(\"ADD\");\n}", "function add (a , b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function addition(a, b) {\r\n return a + b;\r\n}", "function add (num1,num2){\n return num1+num2;\n}", "function add(a,b) {\n console.log(a+b)\n}", "function Addition(x){\r\n // it is return some reference no name of function just a refernce\r\n return function (y){\r\n return x+y;\r\n };\r\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}" ]
[ "0.6575899", "0.6277251", "0.62276244", "0.6214441", "0.6105831", "0.6091405", "0.6056858", "0.60514385", "0.6028215", "0.60084933", "0.5997353", "0.5993668", "0.599056", "0.59902596", "0.59902596", "0.59881383", "0.59853625", "0.59779406", "0.59684795", "0.59634864", "0.595215", "0.5946903", "0.59446687", "0.5941912", "0.59393865", "0.5931836", "0.5931693", "0.5927024", "0.5921499", "0.59164333", "0.5911232", "0.5905535", "0.59040993", "0.5901491", "0.59000796", "0.5890792", "0.5885324", "0.5883484", "0.58751917", "0.58707684", "0.5869209", "0.58655035", "0.5865028", "0.5865028", "0.58589447", "0.58521324", "0.58518255", "0.5850563", "0.5849781", "0.58383316", "0.5831195", "0.58298874", "0.5827254", "0.5827254", "0.582675", "0.58218837", "0.5821363", "0.5816663", "0.5816663", "0.58090764", "0.58090764", "0.58090764", "0.58074313", "0.5806498", "0.57940274", "0.57934266", "0.5789806", "0.578606", "0.5784529", "0.57832086", "0.5780059", "0.57794523", "0.5779078", "0.577861", "0.5777169", "0.5774798", "0.5774612", "0.5767612", "0.5767335", "0.576295", "0.5759791", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.5758094", "0.57572013", "0.5755134", "0.5752375", "0.57506746", "0.5746951", "0.5746951" ]
0.57789606
73
console.log(added10(5)) Write a function "getLength" that returns the length of a string. Accomplish this without using any loops, native JS methods, or the length property. create a function with input string set base case through string length counting down by 1 until string length is = 1 output string length
function getLength(string, index = 0) { if(string[index] === undefined) { return index; } return getLength(string, index + 1) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RunLength(str) {\n\n // code goes here\n return str\n\n}", "function stringLength(string,count=0){\n if ( string.slice(0) === \"\" ) return count; //console.log(count);\n return stringLength(string.slice(1),count+1);\n}", "function stringLength(str){\nvar result =0;\nwhile(str != \"\"){\n\n \tresult+=1;\n str= str.slice(1);\n}\n \n return result;\n \n }", "function length(string) {\n // YOUR CODE BELOW HERE //\n \n // The .length property accesses the number of characters in a given string.\n // This is how we decipher the length of a string.\n return string.length; // When the length function is called the given argument's length will be returned.\n\n // YOUR CODE ABOVE HERE //\n}", "function runLength( str ) {\n\tvar counter = 1,\n\t\tnewStr = \"\";\n\n\tfor ( var i = 0; i < str.length; i++ ) {\n\t\tif ( str[i] === str[i + 1] ) {\n\t\t\tcounter++;\n\t\t} else {\n\t\t\tnewStr += ( counter + str[i] );\n\t\t\tcounter = 1;\n\t\t}\n\t}\n\treturn newStr;\n}", "function stringlencheck(as_string, ai_maxlen) {\n var li_stringlen = 0;\n var li_temp = 0;\n alert(as_string.length);\n for (i = 0; as_string.charAt(i) != 0; i++) {\n //li_stringlen++;\n //*\n alert(as_string.charAt(i));\n if (as_string.charAt(i) < 0) {\n li_temp = li_temp + 1;\n li_stringlen = li_stringlen + 2;\n } else {\n li_stringlen = li_stringlen + 1;\n }\n if (li_temp == 2) {\n\n li_temp = 0;\n }\n //*/\n }\n\n if (li_stringlen > ai_maxlen) {\n alert(li_stringlen + \"longer\");\n }\n}", "function stringlencheck(as_string,ai_maxlen){\r\n var li_stringlen = 0;\r\n var li_temp = 0;\r\n alert(as_string.length);\r\n for(i = 0;as_string.charAt(i) != 0;i++){\r\n //li_stringlen++;\r\n //*\r\n alert(as_string.charAt(i));\r\n if(as_string.charAt(i) < 0){\r\n li_temp = li_temp + 1;\r\n li_stringlen = li_stringlen + 2;\r\n }else{\r\n li_stringlen = li_stringlen + 1;\r\n }\r\n if(li_temp == 2){\r\n\r\n li_temp = 0;\r\n }\r\n //*/\r\n }\r\n\r\n if(li_stringlen > ai_maxlen){\r\n alert(li_stringlen + \"longer\");\r\n }\r\n}", "function getLength(string){\n return string.length;\n}", "function length (string){\n\treturn string.length;\n}", "function strLen(str) {\n // hello\n // debugger;\n // isejimo salyga\n if (str === \"\") return 0;\n\n // console.log(\"str:\", str);\n\n //veiksmas ir rekursija\n let total = 1 + strLen(str.slice(1));\n return total;\n}", "function RunLength(str) {\n var letter = str.charAt(0);\n var count = 0;\n var result = '';\n str.split('').forEach(function(c) {\n if (c == letter)\n count++;\n else {\n result += count + letter;\n letter = c;\n count = 1;\n }\n });\n result += count + letter;\n return result;\n}", "function runLength(string) {\n var output = [];\n var counter = 1;\n if (string === '' || string === null) {\n return string;\n }\n for (var i = 0; i < string.length; i++){\n if(string[i] === string[i+1]){\n counter++;\n }\n output.push(counter + string[i]);\n }\n counter = 1;\n }", "function getLength(string) {\n return string.length\n}", "function len(str)\r\n{\r\n if (str) {\r\n return len(str.substring(1))+1;\r\n }\r\n else\r\n return 0;\r\n}", "function getLength(string) {\n return string.length;\n}", "function getLength(string) {\n return string.length;\n}", "function getLength(string) {\n return string.length;\n}", "function getLength(string1){\n return string1.getLength;\n}", "function stringLength(string){\n let length = string.length;\n console.log(`The length of \"${string}\" is:`, length);\n return length;\n}", "function runLengthEncoding(string) {\n // create list 'chars' to store result; no concatenating with a string as it isn't as efficient\n let chars = []\n // create variable 'length' to keep track of runs starting at 1\n let length = 1\n // loop through string starting at second character\n for (let i = 1; i < string.length; i++) {\n // if character is not the same as previous OR length is equal to 9\n if (string[i] !== string[i - 1] || length === 9) {\n // add 'length' to 'chars' + previous 'char'\n chars.push(length, string[i - 1])\n // reset length to 0 as next line will increment it by one regardless, \n // handling both cases of inside this conditional and outside \n // of the conditional for characters that are the same\n length = 0\n }\n // increment 'length', as character is the same as previous \n length++\n }\n // handle last element by adding 'length' + 'char' to 'chars'\n chars.push(length, string[string.length - 1])\n // join 'chars' into string and return\n return chars.join('')\n}", "function length(str) {\n return str.length;\n}", "function getStr(str) {\n console.log(str.length);\n}", "function addLength(str) {\n//start-here\nreturn str.split(\" \").map(x => `${x} ${x.length}`)\n }", "function sc_stringLength(s) { return s.length; }", "function unusualFive() {\n let str = 'tests';\n return str.length;\n}", "function subLength(str,char)\n{\n let charcount=0;\n let len=-1;\n for(let i=0;i<=str.length;i++)\n {\n if( str[i]===char)\n {\n charcount++;\n \n } \n \n }\n \n return charcount;\n \n}", "function getLength(str) {\n return str.length;\n}", "function getLength(str) {\n return str.length;\n}", "function getLength(str) {\n return str.length;\n}", "function getLength (str) {\n return str.length;\n}", "function totalLetters (string) {\n var length=0;\n for (var i=0; i < string.length; i++){\n length = length + string[i].length;\n }\n console.log(length);\n}", "function length(str) {\n\t// debugger;\n\tif (str == '') {\n\t\treturn 0;\n\t}\n\telse {\n\t\treturn length( str.substring(1) ) + 1;\n\t}\n}", "function findStringLength(str) {\n let counter = 0;\n while(str[counter] !== undefined) {\n counter++;\n }\n console.log('String Length', counter);\n}", "function Get_Length() { \n var Sentance = \"Click here to find the length of this specific string.\" //declare the string\n var S_Length = Sentance.length; //declare and set the variable to the string length\n document.getElementById(\"strLength\").innerHTML = S_Length; //display the string length\n}", "function getLength(input){\n return input.length;\n}", "function inverte(str){\n var result = '',\n length = str.length;\n \n while (length--) { result += str[length]; }\n \n console.log(result);\n}", "function length(str) {\n\treturn str.length;\n}", "function num_repeats(string) {\n\n}", "function repeatedString(s, n) {\n /*while the string length is less than n, we want to concatenate the string on itself\n then we want to slice it at n\n then we make a new array and slice on each letter\n then we have an aCount and a for loop that says if array[i] === 'a' then aCount incerments\n then we return aCount\n */\n\n /*second way...\n do the loop first, see what a count is\n divide n by sting.length\n multiply by aCount?\n */\n let aCount = 0\n for (let i = 0; i < s.length; i++) {\n if (s[i] === 'a')\n aCount++\n }\n return Math.round(aCount * (n / s.length))\n //something here... possibly with modulo remainder, to add... 16/23 passed\n\n\n}", "function repeatedString(s, n) {\n // Write your code here\n let fix = Math.floor(n / s.length);\n let count = countA(s) * fix;\n \n let leftOut = n % s.length;\n count = count + countA(s.substring(0,leftOut));\n return count;\n \n}", "function addLength(str) {\n //start-here\n const wordArray = str.split(\" \");\n let wordSize = wordArray.map(function (elem) {\n return elem + \" \" + elem.length;\n });\n return(wordSize)\n}", "function recurse(string, length) {\n // base case -- if length is less than or equal to 1 return true\n if (length <= 1) {\n return true;\n }\n // subtract one from length\n length--;\n // compare first and last element\n if (string[0] !== string[length]) {\n return false;\n }\n // slice first and last letters and store new str\n let newStr = string.slice(1, length);\n // subtract one from length\n length--;\n // call recurse on new substring and new length\n return recurse(newStr, length);\n }", "function MainFunction()\n{\n 'use strict';\n\n console.log('GetLengthShortestWord first result is:');\n console.log('aba boo dodod llll a666 nn' + ' --> ' + GetLengthShortestWord('aba boo dodod llll a666 nn'));\n console.log('');\n\n console.log('GetLengthShortestWord second result is:');\n console.log('122 b11oo 13333' + ' --> ' + GetLengthShortestWord('122 b11oo 13333'));\n console.log('');\n\n}", "function runLength(str){\n let resultObj = {};\n str.split(\"\").forEach(function(val,ind,arr){\n resultObj.hasOwnProperty(val)? resultObj[val]+=1: resultObj[val]=1;\n });//end of forEach\n let resultStr = \"\";\n for(let key in resultObj){\n resultStr += resultObj[key] + key;\n }\n return resultStr;\n}//end", "function rltlength () {\n}", "function longestRun (string) {\n\n\n\n\n\n}", "function length(str) {\n return str.length;\n }", "function getlength(word) {\r\n return word.length;\r\n\r\n}", "function getlength(word) {return word.length }", "function numberofCharacters(input) {\n const num = input.length\n console.log( input + \" \" + \"has\" + \" \" + num + \" \" + \"characters\");\n}", "function count(str) {\n return str.length;\n}", "function numChars(str1){\n return str1.length\n}", "pad1(str, length) {\n if (length <= str.length) return str;\n\n const startingPad = Math.floor((length - str.length) / 2);\n const endingPad = length - str.length - startingPad;\n const prefix = str.padStart(startingPad + str.length);\n const paddedResult = prefix.padEnd(startingPad + str.length + endingPad);\n // const paddedResult = prefix.padEnd(length); // also works\n\n return paddedResult;\n }", "function lengthInput()\r\n{\r\n return inputLength;\r\n}", "function unusualFive(){\n return 'joker'.length;\n}", "function StringReduction(str) { \nvar res = str.length + 1;\n while(res>str.length){\n res = str.length;\n str = str.replace(/ab|ba/, 'c');\n str = str.replace(/ca|ac/, 'b');\n str = str.replace(/bc|cb/, 'a');\n } ;\n \n // code goes here \n return str.length; \n \n}", "function repeatedString(s, n) {\n let numA = s.split('').filter(x => x === 'a').length;\n if (Number.isInteger(n / s.length)) {\n return n / s.length * numA;\n } else {\n let extra = n - (Math.floor(n / s.length) * s.length);\n let plus = 0;\n s.split('').forEach((ele, i, a) => { \n if (i < extra && ele === 'a') {\n plus++;\n console.log(plus);\n } \n })\n return Math.floor(n / s.length) * numA + plus;\n }\n}", "function runLengthEncoding(str) {\n\tvar count = 1;\n\tvar strArr = [];\n\tfor (var i = 0; i < str.length; i++) {\n\t\tif (str[i] === str[i+1]) {\n\t\t\tcount++;\n\t\t} else {\n\t\t\tstrArr.push(count + str[i]);\n\t\t\tcount = 1;\n\t\t}\n\t}\n\treturn strArr.join(\"\");\n}", "function getLength(word) {\n console.log(word.length);\n}", "function stringLength() {\n var a = \"Super Nova Girl\";\n var n = a.length; //assigns the number of characters of variable 'a' to variable 'n'\n document.getElementById(\"length\").innerHTML = n;\n}", "function Len() {\r\n}", "function countChars(){\n\n}", "function findLongestSubstring(str) {\n let start = 0;\n let end = 0;\n let counter = {};\n let maxLength = 0;\n\n while (start < str.length && end < str.length) {\n counter[str[end]] = (counter[str[end]] || 0) + 1;\n if (counter[str[end]] > 1) {\n maxLength = Math.max(maxLength, (end - start));\n start++;\n end = start;\n counter = {};\n } else {\n end++;\n }\n if (end === str.length) {\n maxLength = Math.max(maxLength, (end - start));\n console.log(maxLength);\n return maxLength;\n }\n }\n\n console.log(maxLength)\n return maxLength;\n}", "function longestPalindrome(phrase){\r\n}", "function s(s) {\n // const map = \"$abcdefghijklmnopqrstuvwxyz\"\n // .split(\"\")\n // .reduce((acc, char, idx) => ({ ...acc, [char]: idx }), {});\n\n return helper(0);\n\n function helper(i) {\n if (i >= s.length) {\n return 1;\n }\n if (s[i] === \"0\") {\n return 0;\n }\n\n let ways = helper(s, i + 1);\n if (i + 2 <= s.length && Number(s.substring(i, i + 2)) <= 26) {\n ways += helper(i + 2);\n }\n return ways;\n }\n}", "function len() {\n var H = \"The length of the string in this varible will display on screen\";\n var L = H.length\n document.getElementById(\"len\").innerHTML = L;\n}", "function longWordCount(string){\n var count = 0;\n var newString = string.split(' ');\n // console.log(newString)\n var stringChar = 7;\n\n for(var i = 0; i < newString.length; i++){\n // console.log(newString[i]);\n//if length of the element in array(string) is larger\n//than stringChar, then increment count by 1.\n if(stringChar < newString[i].length){\n count++;\n }\n }\n return count;\n}", "function lengthen(str1,str2){\nlet min='';\nlet max='';\nlet count = 2;\nlet result='';\nif(str1.length < str2.length){\n min = str1, max= str2;\n} else if(str1 > str2){\n min=str2, max=str1;\n}\nwhile(result.length <= max.length){\n result = min.repeat(count);\n count= count+ 1;\n}\n return result.slice(0,max.length);\n}", "function getLength() {\n //prompt for the input\n var userLength = prompt('Please enter a number between 8 and 128!');\n \n //parse the string and turn it to an integer\n var parsedNum = parseInt(userLength);\n \n //if NaN or Num lower than 8 or Num greater than 128, return function\n if (!parsedNum || parsedNum < 8 || parsedNum > 128){\n return getLength();\n \n //else return the parsednum and store it into variable\n } else {\n return parsedNum;\n }\n}", "function palindromicSubstring(str){\n let count = str.length;\n\n for(let i=0; i<str.length; i++){\n count += countPalindrome(str, i, i + 1) + countPalindrome(str, i, i + 2) ;\n }\n\n return count;\n}", "function getLength(awesome) { //stringLength == true or false\n return awesome.length //stringLength === true or false\n\n}", "function stringChange1 ( mainString ) { \n \n const len=mainString.length;\n let subStr,newStr;\n\n if ( len >= 3){\n\n subStr=mainString.substring(0,3);\n newStr= mainString.concat(subStr);\n \n return subStr.concat(newStr);\n \n \n }\n else \n return (\"Enter the string with length must be 3 or more.\")\n\n}", "function count(input) {\n var numberChar = input.length;\n return numberChar;\n}", "function string(text) {\nvar stringLength = text.length;\n// console.log(stringLength);\n if (stringLength % 2 == 0) \n {\n return(\"true\");\n } \n {\n return (\"false\");\n }\n}", "function longestSubstring(str) {\n // -------------------- Your Code Here --------------------\n\n\n\n\n\n\n\n // --------------------- End Code Area --------------------\n}", "function fixed_len(str, count) {\n var l = str.length;\n\n if (!count)\n count = 10;\n\n if (l > count)\n return str.substr(0, count);\n else\n return str + new Array(count + 1 - l).join(\" \");\n }", "function ToLength(argument) { // eslint-disable-line no-unused-vars\n\t// 1. Let len be ? ToInteger(argument).\n\tvar len = ToInteger(argument);\n\t// 2. If len ≤ +0, return +0.\n\tif (len <= 0) {\n\t\treturn 0;\n\t}\n\t// 3. Return min(len, 253-1).\n\treturn Math.min(len, Math.pow(2, 53) -1);\n}", "function repeatedString(s,n) {\n //Check if there are any a's in the input string\n if (!s.includes('a')) {\n return 0;\n }\n //Find number of matches in original string\n const matches = s.match(/a/g).length;\n //Find number of full repeats needed\n const repeats = Math.floor(n / s.length);\n //Calculate initial result\n let initialResult = matches * repeats;\n //Find how many extra characters are needed\n const remainder = n % s.length;\n //If there is a remainder, add the number of 'a's from it\n if (remainder !== 0) {\n const extras = s.slice(0,remainder).match(/a/g);\n if (extras !== null) {\n return initialResult + extras.length;\n }\n } \n return initialResult;\n}", "function runLengthEncoding(string) {\n let encodedArr = [];\n let count = 1;\n\n for (let i = 1; i < string.length + 1; i++) {\n let currentChar = string[i];\n let prevChar = string[i - 1];\n\n if (count === 9 || currentChar !== prevChar) {\n encodedArr.push(count, prevChar);\n count = 0;\n }\n count++;\n }\n\n return encodedArr.join('');\n}", "function lengthOfTheLongestSubstringThatContainsAtMost(s, k) {\n // Your code here\n}", "countBigWords(input) {\n // code goes here\n //break string into separate words\n let words = input.split(\" \");\n //create a count\n let counter = 0;\n //iterate through each word in the string\n for (let i = 0; i < words.length; i++) {\n //check if each word's length is greater that 6\n //if it is increase the counter by 1\n if (words[i].length > 6) {\n counter++;\n }\n }\n\n //return the counter\n\n return counter;\n }", "function stringLength(a, b, c) {\n console.log(a.length + b.length + c.length);\n console.log(Math.floor((a.length + b.length + c.length)/3));\n}", "function Len(s) {\n if (!s || s == undefined) {\n return 0;\n }\n else {\n return s.length;\n }\n }", "function repeatedString(s, n) {\n const length = s.length\n const times = Math.floor(n/length)\n const remain = n - times * length\n\n let as = 0\n for (let j = 0; j < s.length; j++) {\n if (s[j] === \"a\") {\n as++\n }\n }\n\n as *= times\n\n for (let i = 0; i < remain; i++) {\n if (s[i] === \"a\") {\n as++\n }\n }\n\n return as\n\n\n\n}", "function aux(str, last, count) {\n if (str.length === 0) {\n return last + count;\n } else {\n var head = str.charAt(0);\n var tail = str.substring(1);\n\n if (head === last) {\n if (count === 9) {\n return head + \"9\" + aux(tail, head, 1);\n } else {\n return aux(tail, head, count + 1);\n }\n } else {\n return last + count + aux(tail, head, 1);\n }\n }\n }", "function stringLength(str) {\n let strLength = str.length;\n\n return strLength;\n}", "function lastIndex(length) {\n var mod = length % 10;\n if (mod === 0) {\n return 10;\n }\n else {\n return mod;\n }\n }", "function lengthOfLongestSubstring(s){\n let longest = 0;\n if(s.length <=1){\n return s.length;\n }\n for(let left = 0; left < s.length; left++){\n let seenChars = {}, currentLength = 0;\n for (let right = left; right < s.length; right++) {\n const currentChar = s[right];\n if(!seenChars[currentChar]){\n currentLength++;\n seenChars[currentChar] = true;\n longest = Math.max(longest, currentLength)\n } else {\n break;\n }\n }\n }\n console.log(longest);\n}", "function longestPalindrome(str) {\n\n let arr = [...Array(128)].map(x => 0);\n\n for (const s of str.split(\"\")) {\n arr[s.charCodeAt(0)]++;\n }\n let length = 0;\n\n for (const chr of arr) {\n length += chr % 2 == 0 ? chr : chr - 1;\n }\n\n if (length < str.length) length++;\n \n return length;\n }", "function repeatedString(s, n) {\n\n let string = '';\n let total = 0;\n\n while(string.length < n){\n string += s;\n }\n\n\n for(let char = 0; char < n; char++){\n if(string.charAt(char) === \"a\"){\n total ++\n }\n }\n return total;\n}", "function getLength(word) {\n return word.length;\n}", "function charFreq(string) {\n //...\n}", "function charFreq(string) {\n //...\n}", "function repeatedString(s, n) {\n var count = 0;\n var sum = 0;\n var aTail = 0;\n var array = s.split('');\n var sumEnter = (n - n % array.length) / array.length;\n var tail = n - (sumEnter * array.length);\n console.log('sumEnter ' + sumEnter);\n console.log('tail ' + tail);\n\n for (var i = 0; i < array.length; i++) {\n if ('a' == array[i]) {\n count++;\n }\n }\n\n if (n % array.length == 0) {\n sum = count * (n / array.length);\n } else {\n tail = s.substring(0, tail).split('');\n console.log('qwerty' + tail);\n tail.forEach(element => {\n if (element === 'a') {\n aTail++;\n }\n });\n sum = count * sumEnter + aTail;\n }\n console.log('sum ' + sum);\n return sum;\n}", "function calculate_step(input_length) {\n var zero_count = ( input_length.toString().length - 1 );\n var str_step = \"1\";\n\n for (i = 0; i < zero_count; i++) {\n str_step += \"0\";\n }\n\n return parseInt(str_step);\n}", "function repeatedString(s, n){\r\n var countA=s=>s.split('a').length-1;\r\n \r\n let len= s.length \r\n let fl=Math.floor(n/len);\r\n let remainder=s.slice(0,n%len);\r\n \r\n return fl*countA(s)+countA(remainder);\r\n }", "function ToLength(argument) { // eslint-disable-line no-unused-vars\n\t\t// 1. Let len be ? ToInteger(argument).\n\t\tvar len = ToInteger(argument);\n\t\t// 2. If len ≤ +0, return +0.\n\t\tif (len <= 0) {\n\t\t\treturn 0;\n\t\t}\n\t\t// 3. Return min(len, 253-1).\n\t\treturn Math.min(len, Math.pow(2, 53) - 1);\n\t}", "function findLength(sample){\n return sample.length;\n}", "function repeatedString(s, n) {\n let counter = 0;\n for (let i = 0; i < s.length; i++) {\n if (s[i] === \"a\") {\n counter += 1;\n }\n }\n if (n % s.length === 0) {\n let multiplier = n / s.length;\n return counter * multiplier;\n } else {\n let remainder = n % s.length;\n let multiplier = Math.floor(n / s.length);\n let extra = 0;\n for (let j = 0; j < remainder; j++) {\n if (s[j] === \"a\") {\n extra += 1;\n }\n }\n return counter * multiplier + extra;\n }\n}", "function getLength(something) {\n return something.length;\n}" ]
[ "0.783266", "0.76564664", "0.745688", "0.7421909", "0.7202736", "0.71726745", "0.7168809", "0.7145943", "0.7049176", "0.70311135", "0.703008", "0.7013376", "0.7009365", "0.69934535", "0.694041", "0.694041", "0.694041", "0.69090796", "0.68500656", "0.6821083", "0.68207264", "0.6783412", "0.6779385", "0.67707384", "0.676471", "0.67263335", "0.67058754", "0.67058754", "0.67058754", "0.66841954", "0.66802406", "0.66461843", "0.6643339", "0.6629768", "0.66105527", "0.6553992", "0.6544661", "0.6507004", "0.6506766", "0.64580166", "0.645798", "0.64519304", "0.6419931", "0.64165986", "0.63846624", "0.6380475", "0.6365808", "0.6365513", "0.6353757", "0.63380694", "0.63379276", "0.63309646", "0.63253415", "0.6322675", "0.63155955", "0.63119847", "0.62970155", "0.6291437", "0.62907654", "0.6281323", "0.62631774", "0.62406707", "0.62329364", "0.6224125", "0.61923915", "0.61772573", "0.6175975", "0.6159087", "0.6158701", "0.61528236", "0.61452913", "0.6133133", "0.61300087", "0.61297435", "0.6104189", "0.6091205", "0.608975", "0.60788286", "0.6070618", "0.60631484", "0.6061916", "0.6059239", "0.6049444", "0.60477644", "0.6045641", "0.6037408", "0.6037055", "0.60363156", "0.60339856", "0.603365", "0.6033132", "0.60323334", "0.60323334", "0.60273623", "0.6024755", "0.6014265", "0.60135466", "0.6007882", "0.60015047", "0.6000285" ]
0.6717058
26
set the path to use in the fetch request
setPath (callback) { // provide random parameter "thisparam", which will be rejected this.path = `/posts?teamId=${this.team.id}&streamId=${this.teamStream.id}&thisparam=1`; callback(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchPath( newpath: string ) {\n fetch( '/files', {\n method: 'post',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n path: this.getCWD() ? path.resolve( this.getCWD(), newpath ) : './'\n })\n })\n .then( res => res.json() )\n .then( data => {\n dispatcher.dispatch({\n type: ACTIONS.FILES,\n payload: data\n })\n })\n }", "set path(value) {}", "get path() {}", "function _initPath(){ \n\tthis._setPath = function(){ \n\treturn (\"/*your path here*/\"); }; }", "async function sendPath(){\n const url = `/api/uploadPath?location=${path}`\n const response = await fetch(url)\n getAllFiles()\n}", "loadPath() {\n if (!this.target.objectId) return;\n\n this.datasource\n .fetchObject(this.target.objectId, ['path'])\n .then(result => {\n this.objectPath = result.path;\n })\n .catch(err => {\n // Ignore 404 \"Not Found\" error as user can input anything as Object ID.\n if (err.status != 404) throw err;\n });\n }", "setPath(path) {\nthis._path = path;\n}", "constructor(base = public_path || location.origin, path = apiPath) {\n this.base = base;\n this.apiPath = path;\n this.isFetching = false;\n }", "urlForPath(path = '/') {\n if (!path.startsWith('/')) {\n throw new Error(`Path must begin with \"/\": ${path}`);\n }\n return `https://${this.restApi.restApiId}.execute-api.${core_1.Stack.of(this).region}.${core_1.Stack.of(this).urlSuffix}/${this.stageName}${path}`;\n }", "set path(path) {\n this._path = path;\n this.setAttribute('path', path);\n }", "get __generateRequestURL() {\n const {\n folderName,\n name\n } = this.fsProcessor.file;\n\n return String(`${this.resource}/_api/web/GetFolderByServerRelativeUrl('${folderName}')/Files('${name}')/$value`);\n }", "get() { // get() es como voy a formatear el valor\n return `http://localhost:8001/files/${this.path}`;\n }", "get() {\n return `${process.env.APP_URL}/files/${this.path}`;\n }", "constructor(baseUrl, path) {\r\n super();\r\n this._forceCaching = false;\r\n if (typeof baseUrl === \"string\") {\r\n // we need to do some extra parsing to get the parent url correct if we are\r\n // being created from just a string.\r\n if (isUrlAbsolute(baseUrl) || baseUrl.lastIndexOf(\"/\") < 0) {\r\n this._parentUrl = baseUrl;\r\n this._url = combine(baseUrl, path);\r\n }\r\n else if (baseUrl.lastIndexOf(\"/\") > baseUrl.lastIndexOf(\"(\")) {\r\n // .../items(19)/fields\r\n const index = baseUrl.lastIndexOf(\"/\");\r\n this._parentUrl = baseUrl.slice(0, index);\r\n path = combine(baseUrl.slice(index), path);\r\n this._url = combine(this._parentUrl, path);\r\n }\r\n else {\r\n // .../items(19)\r\n const index = baseUrl.lastIndexOf(\"(\");\r\n this._parentUrl = baseUrl.slice(0, index);\r\n this._url = combine(baseUrl, path);\r\n }\r\n }\r\n else {\r\n this.extend(baseUrl, path);\r\n const target = baseUrl.query.get(\"@target\");\r\n if (target !== undefined) {\r\n this.query.set(\"@target\", target);\r\n }\r\n }\r\n }", "setPath (callback) {\n\t\t// pick a few file streams in the repo to fetch by ID \n\t\tconst codemarkPosts = this.postData.filter(postData => postData.post.codemarkId);\n\t\tlet fileStreams = codemarkPosts.map(postData => postData.streams[0]);\n\t\tfileStreams = fileStreams.filter(stream => stream.repoId === this.repo.id);\n\t\tconst teamId = this.team.id;\n\t\tconst repoId = this.repo.id;\n\t\tthis.expectedStreams = [\n\t\t\tfileStreams[2],\n\t\t\tthis.repoStreams[0],\n\t\t\tfileStreams[1]\n\t\t];\n\t\tconst ids = this.expectedStreams.map(stream => stream.id);\n\t\tthis.path = `/streams?teamId=${teamId}&repoId=${repoId}&ids=${ids}`;\n\t\tcallback();\n\t}", "get path() {\n return this._path;\n }", "get path() {\n return this._path;\n }", "get path () {\n\t\treturn this._path;\n\t}", "function modifyTourUri(){\n\t\tserverUri = Parameters.getTourServerUri() + \"/path\";\n\t}", "function fetchPath(path){\r\n var url = '/' + path.replace(/[^a-z0-9\\-_]/gi, '_') + '.html';\r\n return fetch(url).then(response => response.text());\r\n}", "setPath (callback) {\n\t\tsuper.setPath(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.path = `/reviews/checkpoint-diffs/${this.review.id}?_testLegacyResponse=1`;\n\t\t\tcallback();\n\t\t});\n\t}", "function setPaths(req, res, next) {\n\t\tres.locals.paths = req.app.locals.paths;\n\t\tres.locals.paths.site = req.protocol + '://' + req.get('host');\n\t\tnext();\n\t}", "function getServerPath(){\n return SERVER_PATH;\n }", "receiveContentProps({ path }) {\n this.rootUrl = `/${path}`;\n }", "function decidePath(pathName,res){\n\tswitch(pathName){\n\tcase '/': initializeTransaction(res);\n\tbreak;\n\tdefault:res.end(JSON.stringify({\"error\":\"PATH NOT SUPPORTED\"}));\n\tbreak;\n\n\n\n\t}\n\n}", "get fullpath()\t{ return \"\" + this.prefix + this.path }", "appendPath(path) {\n if (path) {\n let currentPath = this.getPath();\n if (currentPath) {\n if (!currentPath.endsWith(\"/\")) {\n currentPath += \"/\";\n }\n if (path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n path = currentPath + path;\n }\n this.set(path, \"PATH\");\n }\n }", "appendPath(path) {\n if (path) {\n let currentPath = this.getPath();\n if (currentPath) {\n if (!currentPath.endsWith(\"/\")) {\n currentPath += \"/\";\n }\n if (path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n path = currentPath + path;\n }\n this.set(path, \"PATH\");\n }\n }", "buildPath(path = '') {\n if (path.indexOf('http') === 0) {\n return path;\n }\n\n return this.baseUrl + path;\n }", "get path() {\n\t\treturn this.__path;\n\t}", "path(name) {\n this.url += ('/' + name);\n return this;\n }", "function mountRequestPath ( value ) {\n var out = '';\n var rawCep = mountRawSequence( value );\n\n if ( rawCep ) {\n out = [\n request.data.url,\n rawCep,\n '.', request.data.format\n ].join(''); \n }\n\n return out;\n}", "function setPath(path) {\n console.log(path);\n $location.path(path);\n }", "_getUri(path) {\n Logger.log('debug', `API._getUri(${path})`);\n return this.base_url + path + (path.includes('?') ? '&' : '?') + 'app_key=' + this.app_key;\n }", "set assetPath(value) {}", "set assetPath(value) {}", "function setOriginalUrl (req, res, next) {\n res.locals.path = req.originalUrl\n next()\n}", "static getFullPath() {\n return this.baseUrl() + this.apiRoute() + '/' + this.route() + '/'\n }", "localPath( path, )\n\t{\n\t\treturn `${this.#webRoot}${path}`;\n\t}", "setPath(path) {\n if (!path) {\n this._path = undefined;\n }\n else {\n const schemeIndex = path.indexOf(\"://\");\n if (schemeIndex !== -1) {\n const schemeStart = path.lastIndexOf(\"/\", schemeIndex);\n // Make sure to only grab the URL part of the path before setting the state back to SCHEME\n // this will handle cases such as \"/a/b/c/https://microsoft.com\" => \"https://microsoft.com\"\n this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), \"SCHEME\");\n }\n else {\n this.set(path, \"PATH\");\n }\n }\n }", "setPath(path) {\n if (!path) {\n this._path = undefined;\n }\n else {\n const schemeIndex = path.indexOf(\"://\");\n if (schemeIndex !== -1) {\n const schemeStart = path.lastIndexOf(\"/\", schemeIndex);\n // Make sure to only grab the URL part of the path before setting the state back to SCHEME\n // this will handle cases such as \"/a/b/c/https://microsoft.com\" => \"https://microsoft.com\"\n this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), \"SCHEME\");\n }\n else {\n this.set(path, \"PATH\");\n }\n }\n }", "setPath (callback) {\n\t\t// we'll fetch all the file streams from the repo\n\t\tconst teamId = this.team.id;\n\t\tconst repoId = this.repo.id;\n\t\tconst codemarkPosts = this.postData.filter(postData => postData.post.codemarkId);\n\t\tthis.expectedStreams = codemarkPosts.map(postData => postData.streams[0]);\n\t\tthis.expectedStreams = this.expectedStreams.filter(stream => stream.repoId === repoId);\n\t\tthis.expectedStreams.push(this.repoStreams[0]);\n\t\tthis.path = `/streams?type=file&repoId=${repoId}&teamId=${teamId}`;\n\t\tcallback();\n\t}", "async fetch(path) {\n this._raise('fetch', {});\n try {\n const { href } = new URL(ABSOLUTE_URL_REGEX.test(path) ? path : `${this.baseUri}${path}`);\n const { entity, response } = await store.get({ href, token: this._token });\n if (entity) {\n this.entity = entity;\n await this.renderEntity();\n } else if (response) {\n await this.renderResponse(response);\n this._raise('update', { message: 'Displaying raw response', href: response.url });\n } else {\n throw new Error('invalid response');\n }\n this._raise('success', { message: 'Request success', href });\n } catch (err) {\n console.warn(err); // eslint-disable-line no-console\n this._raise('error', { message: err.message, error: err });\n }\n this._raise('complete', { message: 'Fetch complete.' });\n }", "set dirname(dirname) {\n assertPath(this.basename, 'dirname');\n this.path = path__default[\"default\"].join(dirname || '', this.basename);\n }", "setPath (callback) {\n\t\tif (!this.foreignTeam) { return callback(); }\n\t\t// we'll attempt to fetch some users from \"our\" team, and users from the \"foreign\" team, by ID\n\t\t// but since we're not allowed to see users on the foreign team, we should only see users on our team\n\t\tconst teamId = this.team.id;\n\t\tthis.myUsers = [1,3,4].map(index => this.users[index].user);\n\t\tconst foreignUsers = [2, 4].map(index => this.foreignUsers[index].user);\n\t\tconst allUsers = [...this.myUsers, ...foreignUsers];\n\t\tconst ids = allUsers.map(user => user.id);\n\t\tthis.path = `/users?teamId=${teamId}&ids=${ids}`;\n\t\tcallback();\n\t}", "get url() {\n return `/api/projects/file/${this.projectId}${this.filePath}`\n }", "function setPathPrefix(prefix) {\n pathPrefix = prefix;\n}", "function setPathPrefix(prefix) {\n pathPrefix = prefix;\n}", "function setPathPrefix(prefix) {\n pathPrefix = prefix;\n}", "function setPathPrefix(prefix) {\n pathPrefix = prefix;\n}", "function setPathMemory(url, type){\n var deferred = Q.defer();\n var setname = type === \"public\" ? \"public-path\" : \"private-path\";\n client.sadd([setname, url], function(err, reply){\n if (!err){ \n deferred.resolve(reply);\n } else {\n deferred.reject(err);\n }\n });\n return deferred.promise.nodeify();\n}", "get path() {\n return this.constructor.buildPath(\n this._org,\n this._type,\n this._name,\n this._version,\n this._extra,\n );\n }", "function sendPath(event){\n\n fetch('http://localhost:3000/homeDir')\n .then(function(res){\n return res.text(); /*promise 정리!!*/\n })\n .then(function(text){\n console.log(text + \" \" + typeof(text));\n input.value = text;\n let body = { path: input.value };\n console.log(input.value);\n\n return fetch('http://localhost:3000/dirpath',{\n method: 'POST',\n headers: header,\n body: JSON.stringify(body)\n });\n })\n .then(function(res){\n return res.json();\n })\n .then(function(text){\n addDirs(fileList, text);\n });\n}", "updatePath(newPath) {\n return this.props.convertPathToUrl(newPath)\n .then(\n url => this.setState({path: url})\n )\n .catch(\n e => this.setState({path: null})\n )\n ;\n }", "function _setPath (path) {\n path = path.replace('\\\\/', '/');\n path = path.replace(':', '');\n path = path.replace('\\\\', '/');\n return path;\n }", "get url() {return '/';}", "function path( urn ){\n\t\treturn json.urn( urn )\n\t\t.then( function( data ){\n\t\t\tvar path = data.src[0];\n\t\t\treturn src( path, urn )\n\t\t});\n\t}", "setPath (callback) {\n\t\t// set for fetching streams with \"unread\" messages\n\t\tthis.path = `/streams?teamId=${this.team.id}&unread`;\n\t\tcallback();\n\t}", "setPath (callback) {\n\t\tthis.post = this.postData[0].post;\n\t\tthis.path = '/posts/' + this.post.id;\n\t\tcallback();\n\t}", "function setPath(obj, value, path) {\n var keys = path.split('.');\n var ret = obj;\n var lastKey = keys[keys.length - 1];\n var target = ret;\n var parentPathKeys = keys.slice(0, keys.length - 1);\n parentPathKeys.forEach(function (key) {\n if (!target.hasOwnProperty(key)) {\n target[key] = {};\n }\n target = target[key];\n });\n target[lastKey] = value;\n return ret;\n }", "function setPath(obj, value, path) {\n var keys = path.split('.');\n var ret = obj;\n var lastKey = keys[keys.length - 1];\n var target = ret;\n var parentPathKeys = keys.slice(0, keys.length - 1);\n parentPathKeys.forEach(function (key) {\n if (!target.hasOwnProperty(key)) {\n target[key] = {};\n }\n target = target[key];\n });\n target[lastKey] = value;\n return ret;\n }", "toUrlPath() {\r\n return this.urlPath + this._stringifyAux() +\r\n (isPresent(this.child) ? this.child._toNonRootUrl() : '');\r\n }", "setPath (callback) {\n\t\tthis.path = '/teams?mine';\n\t\tcallback();\n\t}", "function setPath(obj, value, path) {\n var keys = path.split('.');\n var ret = obj;\n var lastKey = keys[keys.length -1];\n var target = ret;\n\n var parentPathKeys = keys.slice(0, keys.length -1);\n parentPathKeys.forEach(function(key) {\n if (!target.hasOwnProperty(key)) {\n target[key] = {};\n }\n target = target[key];\n });\n\n target[lastKey] = value;\n return ret;\n }", "get path() {\n return this.constructor.buildPath(\n this._org,\n this._type,\n this._name,\n this._alias,\n );\n }", "function u(path) {\n return BASE_URL + path;\n }", "function setData(data, path) {\n resetTable();\n fetch(URL + path, {\n method: \"POST\",\n redirect: \"follow\",\n body: data,\n headers: {\n 'Content-Type': 'application/json'\n }\n }).catch(err => {\n if (err.httpError) {\n err.fullError.then(eJson => console.log(\"Error: \" + eJson.detail))\n } else {\n console.log(\"Netværks fejl\")\n }\n })\n }", "componentDidMount() {\n // call page config to generate HTML\n const path = this.props.config || 'page0'\n let url = getRoot(`config/${path}.json`)\n\n // if (window.location.hostname !== 'localhost') {\n // // url = `${URL}${url}`\n // url = getRoot(url)\n // }\n fetch(url, { method: 'get' })\n .then(response => response.json())\n .then(data => this.buildHtml(data))\n .catch(err => console.log(err));\n }", "function setUrl(src, str) {\n\t\t\t\tvar a = src.split(\"/\");\n\t\t\t\ta[a.length - 2] = str;\n\t\t\t\treturn a.join('/');\n\t\t\t}", "set RenderPaths(value) {}", "fetchHome() {\n fetch( '/files', {\n method: 'post',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify({\n path: './'\n })\n })\n .then( res => res.json() )\n .then( data => {\n dispatcher.dispatch({\n type: ACTIONS.FILES,\n payload: data\n })\n })\n }", "function PathContestProvider() {\n\n}", "function setFolder(url){\n\tfolder = url;\n}", "_update() {\n window.location.pathname = this._current().url;\n }", "get path() {\n return parse(this).pathname\n }", "get path () {\n return __dirname\n }", "get pathname()\t{ return \"\" + this.path + this.file}", "constructor( aPath ) {\n this.fullpath = aPath;\n }", "updateDir() {\n let url = decodeURIComponent(this.$location.url());\n console.debug(\"url: \" + url);\n let dir = url.slice(BASE_URL.length, url.length);\n if (dir === '/') {\n dir = '';\n }\n if (dir !== this.dir) {\n this.dir = dir;\n this.updateCrumbs();\n }\n }", "function getResourceUrl() { return \"http://\"+location.href.split(\"//\")[1].split(\"/\").splice(0,3).join(\"/\")+'.json?api_key='+MoviePilot.apikey;}", "function setupEndpoint() {\n if (host.val().indexOf('/') != -1) {\n var hostArr = host.val().split('/');\n\n path = \"http://\" + hostArr[0] + \":\" + port.val();\n hostArr.shift(); // remove host\n\n if (hostArr.length > 0) { // anything left?\n path += \"/\" + hostArr.join('/');\n }\n } else {\n path = \"http://\" + host.val() + \":\" + port.val();\n }\n endpoint = path;\n }", "build_paths() {\n return {\n items: {\n list: { // Returns a list of items\n method: \"GET\",\n path: \"[path]\", \n }, \n item: { // Returns a single item with ID %%\n method: \"GET\",\n path: \"[path]/%%\"\n }, \n item_metadata: { // Returns metadata for item %%\n method: \"GET\",\n path: \"[path]/%%/[key]\", \n }, \n find_by_metadata: { // Returns items based on specified metadata value\n method: \"POST\",\n path: \"[path]\"\n } \n },\n query: { \n filtered_items: { // Returns items based on chosen filters\n method: \"GET\",\n path: \"[path]\", \n }, \n filtered_collections: { // Returns collections based on chosen filters\n method: \"GET\",\n path: \"[path]\",\n }, \n collection: { // Returns collection with ID %%\n method: \"GET\",\n path: \"[path]/%%\",\n } \n }\n };\n }", "constructor(baseUrl, path) {\r\n super();\r\n if (typeof baseUrl === \"string\") {\r\n const urlStr = baseUrl;\r\n this._parentUrl = urlStr;\r\n this._url = combine(urlStr, path);\r\n }\r\n else {\r\n this.extend(baseUrl, path);\r\n }\r\n }", "function hardcodedPath() {\n if ((0, _isUndefined3.default)(pageData.path)) return void 0;\n\n var pagePath = pageData.path;\n\n // Enforce a starting slash on all paths\n var pathStartsWithSlash = (0, _startsWith3.default)(pagePath, '/');\n if (!pathStartsWithSlash) {\n pagePath = '/' + pagePath;\n }\n\n // Enforce a trailing slash on all paths\n var pathHasExtension = _path.posix.extname(pagePath) !== '';\n var pathEndsWithSlash = (0, _endsWith3.default)(pagePath, '/');\n if (!pathEndsWithSlash && !pathHasExtension) {\n pagePath = pagePath + '/';\n }\n\n return pagePath;\n }", "ensurePath(path, last = {}) {\n var object = this.getSearch().request;\n path.split('.')\n .forEach((part, index, arr) => {\n if( !object[part] ) {\n if( arr.length-1 === index ) object[part] = last;\n else object[part] = {};\n }\n object = object[part];\n });\n \n\n }", "get path() {\n return this._model ? this._model.path : '';\n }", "uploadFileURL() {\n return `${this.baseUrl}/renku/cache.files_upload?override_existing=true`;\n }", "toPath(url) {\n let query = {};\n /**\n * Extract query string from the current URL\n */\n if (this.forwardQueryString) {\n query = qs_1.default.parse(url_1.parse(this.request.url).query || '');\n }\n /**\n * Assign custom query string\n */\n Object.assign(query, this.queryString);\n /**\n * Redirect\n */\n this.sendResponse(url, query);\n }", "setPath (callback) {\n\t\t// replace the token with a token that has no email in it\n\t\tsuper.setPath(() => {\n\t\t\tconst tokenHandler = new TokenHandler(this.apiConfig.sharedSecrets.auth);\n\t\t\tconst payload = tokenHandler.decode(this.path.split('=')[1]);\n\t\t\tdelete payload[this.parameter];\n\t\t\tconst token = tokenHandler.generate(payload, 'email');\n\t\t\tthis.path = `/web/confirm-email?t=${token}`;\n\t\t\tcallback();\n\t\t});\n\t}", "resourcesUrl (baseUrl,username){\n browser.get(baseUrl + username + \"/_resources\");\n }", "push(path) {\n let p = new Path(path)\n if(p.is_absolute())\n this.path = path\n else\n this.path += '/' + path\n }", "get uri() {\n if(this._filter.key === 'user' && this._filter.value && this.light) {\n return `user/${this._filter.value}/project/light.json`;\n }\n else {\n return super.uri;\n }\n }", "function PathMapper() {\n\t}", "function PathMapper() {\n\t}", "getApiResult(path) {\n return fetch(`${this.url}${path}`, this.options)\n .then((result) => result.json());\n }", "function getPathParam(url){\n var pathParm = undefined;\n if(!url) {\n return pathParm\n }\n if (url.indexOf('/person/') > -1 || url.indexOf('/detail') > -1) { // request is sent from a person page ==> backend URL uses 'person/...' pattern\n return 'person';\n }\n return 'organisation'\n}", "function getPath(req, res, next) {\n\tvar client = new Client();\t \n\tclient.get(\"http://DoSComputev2.mybluemix.net/api/dummy\", function (data, response) {\n\t console.log(response);\n\t\tres.render('process', data);\n\t});\n}", "get path(){ \r\n\t\treturn (this.__order \r\n\t\t\t\t|| this.resolveStarPath(this.location))[this.at()] }", "function hardcodedPath() {\n if (pageData.path) {\n var pathInvariantMessage = '\\n Hardcoded paths are relative to the website root so must be prepended with a\\n forward slash. You set the path to \"' + pageData.path + '\" in \"' + parsedPath.path + '\"\\n but it should be \"/' + pageData.path + '\"\\n\\n See http://bit.ly/1qeNpdy for more.\\n ';\n (0, _invariant2.default)(pageData.path.charAt(0) === '/', pathInvariantMessage);\n }\n\n return pageData.path;\n }", "function fetchDebug(path) {\n var formData = new FormData();\n formData.append('path', path);\n return fetch('server/navigation.php', {\n method: 'POST',\n body: formData\n }).then(res => res.text()).then(text => text);\n}" ]
[ "0.7036319", "0.6580499", "0.6518277", "0.6421893", "0.62237376", "0.6179531", "0.61403465", "0.60616136", "0.6027527", "0.5963468", "0.5950418", "0.5926494", "0.5795893", "0.5795686", "0.5791057", "0.57902193", "0.57832074", "0.5776752", "0.577005", "0.5751301", "0.5745839", "0.5688195", "0.56796765", "0.5650961", "0.56352705", "0.56242776", "0.562188", "0.562188", "0.5605593", "0.55858666", "0.5582738", "0.55625415", "0.5554396", "0.55159205", "0.55112076", "0.55112076", "0.55092067", "0.5495692", "0.54905576", "0.548761", "0.548761", "0.5484873", "0.5454293", "0.54450285", "0.5435513", "0.5434422", "0.5429983", "0.5429983", "0.5429983", "0.5429983", "0.54120815", "0.54031956", "0.5395604", "0.5394411", "0.5374268", "0.5361261", "0.535834", "0.535676", "0.5356166", "0.53545856", "0.53545856", "0.5319822", "0.5318383", "0.53146964", "0.5307467", "0.5294331", "0.52869684", "0.52698565", "0.5263163", "0.5245148", "0.52429545", "0.52387756", "0.52382886", "0.523303", "0.5229877", "0.52275693", "0.5219941", "0.5214096", "0.5211181", "0.5196956", "0.51815027", "0.517845", "0.5163603", "0.5162404", "0.51561046", "0.5147406", "0.51329017", "0.5130511", "0.5125399", "0.512187", "0.5102359", "0.5095697", "0.50951815", "0.50951815", "0.50933063", "0.50880265", "0.5087121", "0.5086482", "0.5086332", "0.5085309" ]
0.55161095
33
Override to use PatternVisitor we overrode.
visitPattern(node, options, callback) { if (!node) { return; } if (typeof options === 'function') { callback = options; options = { processRightHandNodes: false }; } const visitor = new PatternVisitor(this.options, node, callback); visitor.visit(node); if (options.processRightHandNodes) { visitor.rightHandNodes.forEach(this.visit, this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pattern() {\n }", "constructor(pattern){\n //\n //Construct the parent.\n super(pattern);\n }", "constructor(pattern){\n //\n //Consturct the super constructor.\n super(pattern,'g');\n }", "function STIXPatternListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "get pattern() { return this._pattern; }", "get pattern() {\n return new RegExp(_classPrivateFieldGet(this, _pattern));\n }", "pattern() {\n return this.defs().pattern(...arguments);\n }", "get pattern() {\r\n return this._pattern;\r\n }", "constructor(type,pattern){\n //\n //Construct the parent.\n super(pattern);\n //\n //Set the type.\n this.type = type;\n }", "function Visitor() {}", "function Visitor() {}", "function Visitor() {}", "visitNode(node) { }", "get pattern() {\n return this._pattern;\n }", "visit(){\n\t\tif(!this.parent || this.parent.content)\n\t\t\treturn this.convert(...arguments)\n\t}", "function PatternMatch(patt) {\n\tthis.patt = patt;\n\t//Switching on object mode so when stream reads sensordata it emits single pattern match.\n\tTransform.call( this, { objectMode: true } );\n}", "function Pattern() {\n var _this = \n // Init\n _super.call(this) || this;\n /**\n * List of elements the pattern consists of.\n */\n _this._elements = new _utils_List__WEBPACK_IMPORTED_MODULE_3__[\"List\"]();\n /**\n * A storage for Filter property/value pairs.\n *\n * @ignore Exclude from docs\n * @see {@link PatternProperties}\n */\n _this.properties = {};\n _this.className = \"Pattern\";\n // Set defaults\n _this.width = 10;\n _this.height = 10;\n _this.x = 0;\n _this.y = 0;\n _this.patternUnits = \"userSpaceOnUse\";\n var interfaceColors = new _utils_InterfaceColorSet__WEBPACK_IMPORTED_MODULE_6__[\"InterfaceColorSet\"]();\n _this.backgroundFill = interfaceColors.getFor(\"background\");\n _this.backgroundOpacity = 0;\n _this.fillOpacity = 1;\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\n _this.stroke = interfaceColors.getFor(\"alternativeBackground\");\n _this.strokeOpacity = 1;\n _this.strokeWidth = 1;\n _this.shapeRendering = \"crispEdges\";\n _this.rotation = 0;\n // Create main group to store pattern elements inelements\n _this.element = _this.paper.addGroup(\"pattern\");\n _this.id = \"pattern-\" + _Registry__WEBPACK_IMPORTED_MODULE_5__[\"registry\"].getUniqueId();\n _this.element.attr({ \"id\": _this.id });\n _this._disposers.push(_this.element);\n // Make elements disposable\n _this._disposers.push(new _utils_List__WEBPACK_IMPORTED_MODULE_3__[\"ListDisposer\"](_this._elements));\n // Request again to trigger getter/setter code\n _this.patternUnits = _this.patternUnits;\n _this.width = _this.width;\n _this.height = _this.height;\n // Apply theme\n _this.applyTheme();\n return _this;\n }", "function PatternView() {\n\t\n\t//Current means which thing is selected\n\tthis.octave = 3;\n\tthis.channels = 4;\n\tthis.step = 1;\n\tthis.rows = 64;\n\tthis.maxChannel = this.channels - 1;\n\tthis.maxRow = this.rows - 1;\n\tthis.currentRow = 0;\n\tthis.currentChannel = 0;\n\tthis.currentGroup = 0;\t\t\t//which of the 5 groups is selected\n\t\t\t\t\t\t\t\t\t//\t\tnote, isntrument, volume, effect, parameter\n\tthis.currentCol = 0;\t\t\t//Which of the columns is selected\n\t\t\t\t\t\t\t\t\t//0: note, 1-2: instrument, 3-4: vol 5: effect 6-7: param\n\tthis.selected = \"note\";\t\t\t//What kind of thing is highlighted. Mostly for CSS purposes\n\tthis.selectedEl = null;\t\t\t//an element reference for easy manipulation\n\tthis.mode = \"view\";\t\t\t\t//\"view\" or \"edit\"\n\n}", "function Visitor() {\r\n}", "function MaskMarkerVisitor() {\n}", "function Pattern( example ){\n\n\tthis.examples = [];\n\tthis.counts = {};\n\n\tif( example ){\n\t\tthis.push( example );\n\t}\n\t\n}", "regexSelector(pattern) {\n this.registerRegexInput(pattern);\n }", "function RegExpPattern(){\n\t//\n}", "function ReorderingGraphPatternIterator(parent, pattern, options) {\n // Empty patterns have no effect\n if (!pattern || !pattern.length)\n return new TransformIterator(parent, options);\n // A one-element pattern can be solved by a triple pattern iterator\n if (pattern.length === 1)\n return new TriplePatternIterator(parent, pattern[0], options);\n // For length two or more, construct a ReorderingGraphPatternIterator\n if (!(this instanceof ReorderingGraphPatternIterator))\n return new ReorderingGraphPatternIterator(parent, pattern, options);\n MultiTransformIterator.call(this, parent, options);\n\n this._pattern = pattern;\n this._options = options || (options = {});\n this._client = options.fragmentsClient;\n}", "pattern() {\n return this.#patternList[this.#index];\n }", "visit(visitor){\n if (visitor.before) {\n visitor.before.call(visitor, this);\n }\n if (visitor.after) {\n visitor.after.call(visitor, this);\n }\n }", "function patFind() {\n this.factorLimit = 10;\n this.patternLimit = 5;\n this.target = document.querySelector(\"#pat-find\");\n if (this.target != null) {\n this.textarea = this.target.querySelector(\"textarea\");\n this.button = this.target.querySelector(\"button\");\n this.resultarea = this.target.querySelector(\".results\");\n this.button.addEventListener(\"click\", this.analyse.bind(this), false);\n }\n }", "function patternAsNode(pattern, doc) {\n if (!pattern) throw Error(\"null argument passed to patternAsNode\");\n if (instanceOf(pattern, DocumentFragment)) {\n return pattern;\n } else if (instanceOf(pattern, Node)) {\n return pattern;\n } else if (instanceOf(pattern, Link) || instanceOf(pattern, Button)) {\n throw new Error(\"pattern as LinkOrButton is not supported yet\");\n } else if (instanceOf(pattern, Range)) {\n throw new Error(\"pattern as Range not supported yet\"); \n } else if (instanceOf(pattern, Match)) {\n // TODO handle case where Match.range is null\n return pattern.element;\n } else {\n var match = Pattern.find(doc, pattern);\n return match.element;\n }\n}", "function rcVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function PythonLikeVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "visit(){\n this.visited = true ;\n }", "function gSregExp(text,ppattern) {\n\n var patt;\n if (ppattern instanceof RegExp) {\n patt = new RegExp(ppattern.source,'g');\n } else {\n //g for search all occurences\n patt = new RegExp(ppattern,'g');\n }\n\n var object;\n\n //var object;\n var data = patt.exec(text);//text.match(patt);\n //console.log('data->'+data);\n if (data==null || data==undefined) {\n return null;\n } else {\n var list = [];\n var i = 0;\n\n while (data!=null && data!=undefined) {\n //console.log('adding data->'+data);\n if (data instanceof Array && data.length>1) {\n list[i] = gSlist(data);\n } else {\n list[i] = data;\n }\n i = i + 1;\n data = patt.exec(text);\n }\n object = inherit(gSlist(list),'RegExp');\n }\n\n gScreateClassNames(object,['java.util.regex.Matcher']);\n\n object.pattern = patt;\n object.text = text;\n\n object.replaceFirst = function(data) {\n return this.text.replaceFirst(this[0],data);\n }\n\n object.replaceAll = function(data) {\n return this.text.replaceAll(this.pattern,data);\n }\n\n object.reset = function() {\n return this;\n }\n\n return object;\n}", "static data_to_pattern(data) {\n\t\tthrow Error('static data_to_pattern() not implemented');\n\t}", "function updatePattern(pat){ // call the pattern currently being created\n switch(pat) {\n case 0:\n rainbow();\n break;\n case 1:\n rainbowCycle();\n break;\n case 2:\n theaterChaseRainbow();\n break;\n case 3:\n colorWipe(strip.Color(255, 0, 0)); // red\n break; \n } \n}", "toString(){\n this.pattern.fromPixels(this.pixels);\n return this.pattern.toString();\n }", "function Pattern(name, listed, describe, rules) {\n this.name = name;\n this.listed = listed;\n this.describe = describe;\n this.rules = rules;\n }", "function Pattern(name, listed, describe, rules) {\r\n this.name = name;\r\n this.listed = listed;\r\n this.describe = describe;\r\n this.rules = rules;\r\n }", "listen(pattern) {\n this._state.matchWith({\n Pending: _ => this._listeners.push(pattern),\n Cancelled: _ => pattern.onCancelled(), \n Resolved: ({ value }) => pattern.onResolved(value),\n Rejected: ({ reason }) => pattern.onRejected(reason)\n });\n return this;\n }", "toJSON(){\n return this.pattern.toJSON();\n }", "toString () {\n return this.regex.toString()\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "function PlaygroundVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "on(pattern) {\n const briskRoute = new BriskRoute_1.BriskRoute(pattern, this.matchers);\n const openedGroup = this.getRecentGroup();\n if (openedGroup) {\n openedGroup.routes.push(briskRoute);\n }\n else {\n this.routes.push(briskRoute);\n }\n return briskRoute;\n }", "addPatternToMatch(i, p, keyInput) {\n\n\t\tif (!this.matchList.hasOwnProperty(keyInput)) {\n\t\t\tthis.matchList[keyInput] = {\n\t\t\t\tinput: i,\n\t\t\t\tpatterns: []\n\t\t\t};\n\t\t}\t\t\n\t\tthis.matchList[keyInput].patterns.push(p);\n\t}", "_escapeRegexMatches(content, pattern) {\n return content.replace(pattern, (_, keep) => {\n const replaceBy = `__ph-${this.index}__`;\n this.placeholders.push(keep);\n this.index++;\n return replaceBy;\n });\n }", "_escapeRegexMatches(content, pattern) {\n return content.replace(pattern, (_, keep) => {\n const replaceBy = `__ph-${this.index}__`;\n this.placeholders.push(keep);\n this.index++;\n return replaceBy;\n });\n }", "match(pattern) {\n if (this.probe(pattern)) {\n return this.consume();\n }\n\n return null;\n }", "function RandomVisitor() {\n antlr4.tree.ParseTreeVisitor.call(this);\n return this;\n}", "static pattern(param, pattern) {\n\n if (_.isString(pattern)) {\n pattern = new RegExp(pattern);\n }\n\n this.patterns[param] = pattern;\n }", "function Visitor(name, destination){\n this.name = name;\n this.destination = destination;\n }", "function statVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "processCreatePattern(context, result, inputParams, index) {\n var _a;\n result.element = (_a = result.element) !== null && _a !== void 0 ? _a : [];\n const element = inputParams.element;\n result.element.push(element);\n }", "function CompositePattern()\r\n{\r\n\t//WARNING! do not add anything here, it will never be called\r\n}", "function CompositePattern()\r\n{\r\n\t//WARNING! do not add anything here, it will never be called\r\n}", "prepare() {\n\t\tthis.regex = new RegExp(this.panelEl.querySelector('input').value, 'i');\n\t}", "function registerEvents( patternlab ) {\n\n //register our handler at the appropriate time of execution\n patternlab.events.on('patternlab-pattern-write-end', onPatternIterate);\n\n}", "function RomeVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "function Pattern( options ){\n\tif(!options) options ={};\n\t\n\t//TODO\n\tthis.offset = options.offset ? new Haze.meta.M.Vec(options.offset.x, options.offset.y) : new Haze.meta.M.Vec(0,0);\n\t//TODO this.clipSpace?\n\tthis.rotation = options.rotation || Math.PI / 180 * 45;\n\t\n\t//image might not be loaded\n\tthis.isReady = false;\n\tthis.loadError = false;\n\t\n\t//not sure if this should be wrapped but right now I'll take a standard image object\n\tthis.image = new Image();\n\t\n\tvar that = this;\n\tthis.image.onload = function(){that.isReady = true};\n\tthis.image.onerror = function(){that.loadError = true;};\n\t\n\tthis.image.src = options.source;\n\t\n\t\n\t\n\tthis.repeat = options.repeat || this.Types.repeat;\n\t\n\t\n\t\n\t\n\t\n}", "function NodeVisitor() {\n _classCallCheck(this, NodeVisitor);\n\n this[path] = [];\n }", "init() {\n var i = 0,\n child = null,\n docElement = document.createElementNS(this.xmlns, 'pattern');\n docElement.setAttribute('id', this.id);\n if (this.x) {\n docElement.setAttribute('x', this.x);\n }\n if (this.y) {\n docElement.setAttribute('y', this.y);\n }\n if (this.transform) {\n docElement.setAttribute('patternTransform', this.transform);\n }\n if (this.units) {\n docElement.setAttribute('patternUnits', this.units);\n }\n if (this.contentUnits) {\n docElement.setAttribute('patternContentUnits', this.contentUnits);\n }\n if (this.link) {\n docElement.setAttributeNS(Util.xmlNamespaces().xmlnsXLink, 'href', this.link);\n }\n if (this.width) {\n docElement.setAttribute('width', this.width);\n }\n if (this.height) {\n docElement.setAttribute('height', this.height);\n }\n if (this.preserveAspectRatio) {\n docElement.setAttribute('preserveAspectRatio', this.preserveAspectRatio);\n }\n this._docElementNS = docElement;\n if (this.children.length > 0) {\n for (; i < this.children.length; i++) {\n child = this.children[i];\n if (child.docElementNS) {\n this.docElementNS.appendChild(child.docElementNS);\n }\n }\n }\n if (this.autoBind) {\n this.bind();\n }\n }", "function decide() {\n\t\t\t\tvar recognise = false;\n\t\t\t\tif(fromAbove && fromBelow) {\n\t\t\t\t\tif(fromAbove == fromBelow) {\n\t\t\t\t\t\talert(\"Pattern recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.childAddress[i].x][self.childAddress[i].y][self.childAddress[i].z](fromBelow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Pattern not recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.parentAddress.x][self.parentAddress.y][self.parentAddress.z](fromBelow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function patternFactory() {\n var len,\n j,\n newPattern,\n funcs = arguments; // each argument is a pattern being combined\n\n len = funcs.length;\n\n for (j = 0; j < len; j += 1) {\n if (typeof funcs[j] !== \"function\") {\n funcs[j] = createSequenceFunc(funcs[j]);\n }\n }\n\n newPattern = concatenatePatternFuncs(funcs);\n\n return function (args) {\n if (typeof args === \"number\") {\n newPattern(args);\n } else {\n executeSequence(args, newPattern, emptyFunc);\n }\n };\n }", "function Visitor(doc) {\n\tthis.stack = [];\n\tthis.parent = doc; //always a list item\n\tthis.node = doc.head();\n\tthis.index = 0;\n\tthis.point = 1;\n\tthis.retained = 0;\n\tthis.ops = []; //to get to the doc\n}", "function matchDownstream(n) {\n n.passFilter = true;\n\n if (n.children && n.children.length) {\n n.children.forEach(matchDownstream);\n }\n }", "visit(arg_element, ...args) {\n MxI.$raiseNotImplementedError(IVisitor, this);\n }", "function DigraphWalker(digraph) {\n _super.call(this);\n this.digraph = digraph;\n }", "function _cloneRegExp(pattern) {\n return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));\n }", "isRegExp() {\n return this.#patternList[this.#index] instanceof RegExp;\n }", "function patternMatcher(pattern, string) {\n // Write your code here.\n}", "function AssignmentPattern(node, print) {\n\t print.plain(node.left);\n\t this.push(\" = \");\n\t print.plain(node.right);\n\t}", "function AssignmentPattern(node, print) {\n\t print.plain(node.left);\n\t this.push(\" = \");\n\t print.plain(node.right);\n\t}", "getPattern() {\n return /^.* (.*):/;\n }", "route(pattern, methods, handler) {\n const route = new Route_1.Route(pattern, methods, handler, this.matchers);\n const openedGroup = this.getRecentGroup();\n if (openedGroup) {\n openedGroup.routes.push(route);\n }\n else {\n this.routes.push(route);\n }\n return route;\n }", "function CodiVisitor() {\r\n\tantlr4.tree.ParseTreeVisitor.call(this);\r\n\treturn this;\r\n}", "addHighlightMatch(pat) {\n this._highlights.push(pat);\n }", "function playerPattern(color, pattern) {\n const draw = {\n beehive: drawBeehive,\n toad: drawToad,\n lwss: drawLwss,\n glider: drawGlider,\n }\n if (draw[pattern]) {\n draw[pattern](color)\n primus.forEach(spark => spark.emit(GAME_EVENT.STATE, game.colors))\n }\n }", "function onClick() {\n\tdocument.getElementById('text-area').value = '';\n\tconst stoppingPoint = document.getElementById('pattern-input').value;\n\tthis.patternProducer(stoppingPoint);\n}", "next() {\n for (let off = this.matchPos - this.curLineStart;;) {\n this.re.lastIndex = off;\n let match = this.matchPos <= this.to && this.re.exec(this.curLine);\n if (match) {\n let from = this.curLineStart + match.index, to = from + match[0].length;\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n if (from == this.curLineStart + this.curLine.length)\n this.nextLine();\n if ((from < to || from > this.value.to) && (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n return this;\n }\n off = this.matchPos - this.curLineStart;\n }\n else if (this.curLineStart + this.curLine.length < this.to) {\n this.nextLine();\n off = 0;\n }\n else {\n this.done = true;\n return this;\n }\n }\n }", "function testModifierG(){\n var str = \"Visit Visit Visit !\";\n var pattern = /visit/ig;\n var res = str.match(pattern);\n console.log(res);\n \n}", "clear(){\n\t\tconst patterns = instancePatterns.get(this);\n\t\tpatterns.clear();\n\t\tsuper.clear();\n\t}", "clear(){\n\t\tconst patterns = instancePatterns.get(this);\n\t\tpatterns.clear();\n\t\tsuper.clear();\n\t}", "function GoobScraperVisitor() {\n\tantlr4.tree.ParseTreeVisitor.call(this);\n\treturn this;\n}", "copy(re)\n {\n //You are already yourself, don't copy nothing.\n if (re === this) return;\n\n //Make room for the copy...\n this.clear();\n\n this._expression = re._expression;\n\n //Copy terminals\n for (const terminal of re._terminals)\n {\n this._terminals.add(terminal);\n }\n\n //Copy errors\n for (const error of re._errors)\n {\n //WARNING: if the error's store state objects, they need to be redirected to the copies\n this._errors.push(error);\n }\n }", "*match(root) {\n const context = { scope: root };\n yield* this.matchInternal(root, 0, context);\n }", "function visit() {\n if (this.isBlacklisted()) return false;\n if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false;\n\n this.call(\"enter\");\n\n if (this.shouldSkip) {\n return this.shouldStop;\n }\n\n var node = this.node;\n var opts = this.opts;\n\n if (node) {\n if (Array.isArray(node)) {\n // traverse over these replacement nodes we purposely don't call exitNode\n // as the original node has been destroyed\n for (var i = 0; i < node.length; i++) {\n _index2[\"default\"].node(node[i], opts, this.scope, this.state, this, this.skipKeys);\n }\n } else {\n _index2[\"default\"].node(node, opts, this.scope, this.state, this, this.skipKeys);\n this.call(\"exit\");\n }\n }\n\n return this.shouldStop;\n}", "get patternRuleIndex() {\r\n return this._patternRuleIndex;\r\n }", "visitChildren(ctx) {\n if (!ctx) {\n return;\n }\n if (ctx.children) {\n return ctx.children.map((child) => {\n if (child.children && child.children.length !== 0) {\n return child.accept(this);\n }\n return child.getText();\n });\n }\n }", "setFilter(pattern) {\n this.dispatcher.setFilter(pattern);\n }", "function patInputChange() {\n let input = this.getAttribute('name');\n\n let currRules = rules.filter(function(el) {\n return el.pattern &&\n el.on === input\n });\n\n currRules.forEach(rule => {\n let regex = new RegExp(rule.pattern);\n if (regex.test(this.value) === false) {\n window.showError(this.parentNode, 'pattern');\n } else {\n window.hideError(this.parentNode, 'pattern');\n }\n });\n}", "function TemplatablePattern(input_scanner, parent) {\n Pattern.call(this, input_scanner, parent);\n this.__template_pattern = null;\n this._disabled = Object.assign({}, template_names);\n this._excluded = Object.assign({}, template_names);\n\n if (parent) {\n this.__template_pattern = this._input.get_regexp(parent.__template_pattern);\n this._excluded = Object.assign(this._excluded, parent._excluded);\n this._disabled = Object.assign(this._disabled, parent._disabled);\n }\n\n var pattern = new Pattern(input_scanner);\n this.__patterns = {\n handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),\n handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),\n handlebars: pattern.starting_with(/{{/).until_after(/}}/),\n php: pattern.starting_with(/<\\?(?:[=]|php)/).until_after(/\\?>/),\n erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),\n // django coflicts with handlebars a bit.\n django: pattern.starting_with(/{%/).until_after(/%}/),\n django_value: pattern.starting_with(/{{/).until_after(/}}/),\n django_comment: pattern.starting_with(/{#/).until_after(/#}/),\n smarty: pattern.starting_with(/{(?=[^}{\\s\\n])/).until_after(/[^\\s\\n]}/),\n smarty_comment: pattern.starting_with(/{\\*/).until_after(/\\*}/),\n smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\\/literal}/)\n };\n}", "visit() {\n if(this.state) this.state = Node.VISITED;\n }", "rest() {\n if (this.#rest !== undefined)\n return this.#rest;\n if (!this.hasMore())\n return (this.#rest = null);\n this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);\n this.#rest.#isAbsolute = this.#isAbsolute;\n this.#rest.#isUNC = this.#isUNC;\n this.#rest.#isDrive = this.#isDrive;\n return this.#rest;\n }", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}", "function patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}" ]
[ "0.67489964", "0.65757245", "0.64462817", "0.60840034", "0.6071314", "0.59319896", "0.5829151", "0.5826701", "0.5817403", "0.57974076", "0.57974076", "0.57974076", "0.5744598", "0.56779313", "0.5649064", "0.5591914", "0.5550594", "0.5535888", "0.55266243", "0.5436963", "0.5429004", "0.5426619", "0.5336143", "0.52973604", "0.52876955", "0.5279139", "0.5265675", "0.5257004", "0.5144514", "0.5143678", "0.513851", "0.5112549", "0.5110006", "0.5090022", "0.50896806", "0.5087532", "0.50717014", "0.50500214", "0.50379926", "0.5032326", "0.50102174", "0.50102174", "0.50058407", "0.50012225", "0.49502227", "0.49399486", "0.49399486", "0.4910804", "0.49065095", "0.48866308", "0.48505214", "0.48468405", "0.4821839", "0.4818922", "0.4818922", "0.47850823", "0.478239", "0.4781477", "0.47795364", "0.47747868", "0.47739598", "0.47708583", "0.47435194", "0.47383288", "0.47341204", "0.47288108", "0.47124413", "0.47086933", "0.46995717", "0.4694457", "0.46910855", "0.46910855", "0.4666886", "0.46553406", "0.46496758", "0.46424735", "0.46389467", "0.46386725", "0.463652", "0.46229932", "0.46156415", "0.46156415", "0.4597258", "0.45929697", "0.45875606", "0.45855775", "0.45849395", "0.4581297", "0.4578736", "0.45746195", "0.45626286", "0.45597437", "0.45495203", "0.45489916", "0.45489916", "0.45489916", "0.45489916", "0.45489916", "0.45489916", "0.45489916" ]
0.6803011
0
Override. Visit `node.typeParameters` and `node.returnType` additionally to find `typeof` expressions.
visitFunction(node) { const { type, id, typeParameters, params, returnType, body } = node; const scopeManager = this.scopeManager; const upperScope = this.currentScope(); // Process the name. if (type === types_1.AST_NODE_TYPES.FunctionDeclaration && id) { upperScope.__define(id, new experimental_utils_1.TSESLintScope.Definition('FunctionName', id, node, null, null, null)); // Remove overload definition to avoid confusion of no-redeclare rule. const { defs, identifiers } = upperScope.set.get(id.name); for (let i = 0; i < defs.length; ++i) { const def = defs[i]; if (def.type === 'FunctionName' && def.node.type === types_1.AST_NODE_TYPES.TSDeclareFunction) { defs.splice(i, 1); identifiers.splice(i, 1); break; } } } else if (type === types_1.AST_NODE_TYPES.FunctionExpression && id) { scopeManager.__nestFunctionExpressionNameScope(node); } // Open the function scope. scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition); const innerScope = this.currentScope(); // Process the type parameters this.visit(typeParameters); // Process parameter declarations. for (let i = 0; i < params.length; ++i) { this.visitPattern(params[i], { processRightHandNodes: true }, (pattern, info) => { if (pattern.type !== types_1.AST_NODE_TYPES.Identifier || pattern.name !== 'this') { innerScope.__define(pattern, new experimental_utils_1.TSESLintScope.ParameterDefinition(pattern, node, i, info.rest)); this.referencingDefaultValue(pattern, info.assignments, null, true); } }); } // Process the return type. this.visit(returnType); // Process the body. if (body && body.type === types_1.AST_NODE_TYPES.BlockStatement) { this.visitChildren(body); } else { this.visit(body); } // Close the function scope. this.close(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "function staticallyVerifyType(node, types) {\n if (isNodeNully(node)) {\n return types.indexOf(\"null\") > -1 || types.indexOf(\"undefined\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"Literal\") {\n if (node.regex) {\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(\"RegExp\")) ? TYPE_VALID : TYPE_INVALID;\n } else {\n return types.indexOf(typeof node.value) > -1 ? TYPE_VALID : TYPE_INVALID;\n }\n } else if (node.type === \"ObjectExpression\") {\n return types.indexOf(\"object\") > -1 || types.indexOf(\"shape\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"ArrayExpression\") {\n return types.indexOf(\"array\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (t.isFunction(node)) {\n return types.indexOf(\"function\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'NewExpression' && node.callee.type === 'Identifier') {\n // this is of the form `return new SomeClass()`\n // @fixme it should be possible to do this with non computed member expressions too\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(node.callee.name)) ? TYPE_VALID : TYPE_UNKNOWN;\n } else if (isBooleanExpression(node)) {\n return types.indexOf('boolean') > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'Identifier') {\n // check the scope to see if this is a `const` value\n return node;\n } else {\n return TYPE_UNKNOWN; // will produce a runtime type check\n }\n }", "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "getTypeNode() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.type);\r\n }", "function getNodeType(node) {\n switch (node.type) {\n case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:\n case utils_1.AST_NODE_TYPES.MethodDefinition:\n return node.kind;\n case utils_1.AST_NODE_TYPES.TSMethodSignature:\n return 'method';\n case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration:\n return 'call-signature';\n case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration:\n return 'constructor';\n case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:\n return node.readonly ? 'readonly-field' : 'field';\n case utils_1.AST_NODE_TYPES.PropertyDefinition:\n return node.value && functionExpressions.includes(node.value.type)\n ? 'method'\n : node.readonly\n ? 'readonly-field'\n : 'field';\n case utils_1.AST_NODE_TYPES.TSPropertySignature:\n return node.readonly ? 'readonly-field' : 'field';\n case utils_1.AST_NODE_TYPES.TSIndexSignature:\n return node.readonly ? 'readonly-signature' : 'signature';\n case utils_1.AST_NODE_TYPES.StaticBlock:\n return 'static-initialization';\n default:\n return null;\n }\n}", "function tokenTypes(n) {\r\n\tif (n.parent) {\r\n\t\tvar tt = [n.type];\r\n\t\treturn tt.concat(tokenTypes(n.parent));\r\n } else {\r\n \treturn n.type;\r\n\t}\r\n}", "function extractReturnTypes(node) {\n if (node.returnType) {\n var types = extractAnnotationTypes(node.returnType);\n if (types.indexOf('any') === -1 && types.indexOf('mixed') === -1) {\n return types;\n }\n }\n return [];\n }", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function TypeRecursion() {}", "function staticallyVerifyReturnType(node, types) {\n return staticallyVerifyType(node.argument, types);\n }", "function __processNode() {\n try {\n switch (type) {\n case TYPE.boolean:\n case TYPE.number:\n case TYPE.string:\n return node;\n case TYPE.Date:\n var date = node;\n var dateDetails = {\n \"[*TYPE*]\": typeName,\n //epochMs: date.getTime(),\n value: date.toISOString()\n };\n if (hideType) {\n delete dateDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return dateDetails.value; // delete dateDetails.epochMs;\n }\n return dateDetails;\n case TYPE.function:\n try {\n verboseObjectsOut.push(node);\n var full;\n if (node.toString == null) {\n full = \"ERROR_node_no_toString_method\";\n }\n else {\n full = node.toString();\n }\n var fcnName = full.substring(full.indexOf(\" \"), full.indexOf(\"(\"));\n var fcnParams = full.substring(full.indexOf(\"(\"), full.indexOf(\"{\") - 1);\n var fcnDetails = { \"[*TYPE*]\": typeName, signature: fcnName + fcnParams, full: full };\n if (hideType) {\n delete fcnDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n delete fcnDetails.full;\n }\n return fcnDetails;\n }\n catch (ex) {\n return { \"[*TYPE*]\": typeName, value: \"function-unknown\" };\n }\n case TYPE.Error:\n verboseObjectsOut.push(node);\n var errDetails = { \"[*TYPE*]\": typeName, name: node.name, message: node.message, stack: node.stack == null ? null : node.stack.split(\"\\n\") };\n if (hideType) {\n delete errDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n delete errDetails.stack;\n }\n return errDetails;\n case TYPE.null:\n return null; // \"[*NULL*]\";\n case TYPE.undefined:\n return \"[*UNDEFINED*]\";\n case TYPE.RegExp:\n //var regexp = (node as RegExp);\n //var regexpDetails = { \"[*TYPE*]\": typeName, source: regexp.source, details: regexp.g };\n //if (hideType) {\n // delete regexpDetails[\"[*TYPE*]\"];\n //}\n //if (!showVerboseDetails) {\n // delete regexpDetails.source;\n //}\n //return regexpDetails;\n case TYPE.Array:\n case TYPE.object:\n switch (typeName) {\n case \"Promise\":\n var promise = node;\n if (promise[\"toJSON\"] != null) {\n var promiseDetails = promise.toJSON();\n promiseDetails[\"[*TYPE*]\"] = typeName;\n return promiseDetails;\n }\n if (promise.toString == null) {\n return { \"[*TYPE*]\": typeName, value: \"ERROR_promise_no_toString_method\" };\n }\n else {\n return { \"[*TYPE*]\": typeName, value: promise.toString() };\n }\n case \"Buffer\":\n try {\n var buffer = node;\n var strOutput = void 0;\n if (buffer.toString == null) {\n strOutput = \"ERROR_buffer2_no_toString_method\";\n }\n else {\n strOutput = buffer.toString();\n }\n var bufferDetails = { \"[*TYPE*]\": typeName, value: stringHelper.summarize(strOutput, 200), length: buffer.length };\n if (hideType) {\n delete bufferDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n //return bufferDetails.value;\n }\n return bufferDetails;\n }\n catch (ex) {\n return { \"[*TYPE*]\": typeName, value: \"buffer-unknown\" };\n }\n case \"Stream\":\n case \"ReadableStream\":\n case \"WriteableStream\":\n var streamDetails = { \"[*TYPE*]\": typeName, value: \"[*STREAM*]\" };\n if (hideType) {\n delete streamDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return streamDetails.value;\n }\n return streamDetails;\n case \"Moment\":\n var momentValue = node;\n var momentDetails = { \"[*TYPE*]\": typeName, value: momentValue.toJSON() };\n if (hideType) {\n delete momentDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return momentValue.toISOString();\n }\n return momentDetails;\n case \"IncommingMessage\":\n try {\n var req = node;\n var msgDetails = { \"[*TYPE*]\": typeName, value: { headers: req.headers, method: req.method, statusCode: req.statusCode, httpVersion: req.httpVersion, statusMessage: req.statusMessage, url: req.url } };\n if (hideType) {\n delete msgDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return msgDetails.value;\n }\n return msgDetails;\n }\n catch (ex) {\n //failure parsing as node http.IncommingMessage. try as normal instead.\n break;\n }\n default:\n //try to see if a .toJSON() method exists\n if (typeof (node[\"toJSON\"]) !== \"undefined\") {\n var toJsonDetails = node.toJSON();\n toJsonDetails[\"[*TYPE*]\"] = typeName;\n return toJsonDetails;\n }\n break;\n }\n try {\n if (!nodeDepthSearchDisabled) {\n //check to see if we can stringify (no circular dependencies)\n exports.JSONX.stringifyX(node, replacer);\n }\n //able to stringify (no exception thrown), so lets ignore depth searching for our children (avoid stringifying to gain perf)\n return _nodePropertyRecurser(node, depth, typeName, true);\n }\n catch (ex) {\n //couldn't stringify\n if (depth >= maxSearchDepth) {\n return \"[*MAX_SEARCH_DEPTH*]\";\n }\n //can't stringify it, so...\n if (ex.message.toLowerCase().indexOf(\"circular\") < 0 && ex.message.toLowerCase().indexOf(\"typeerror\") < 0) {\n //exception isn't due to circular or typeErrors, so let's just stop\n if (ex.toString == null) {\n return \"[*ERROR_ex_no_toString=\" + ex + \"*]\";\n }\n return \"[*ERROR_\" + ex.toString() + \"*]\";\n }\n if (!disableCircularDetection) {\n //circular, lets try to recursively work through this\n if (node[_superStringifyTokenId] !== undefined) {\n //circular found, so stop\n return \"[*CIRCULAR_REFERENCE*]\";\n }\n //mark this as processed\n node[_superStringifyTokenId] = null;\n _processedNodes.push(node);\n }\n return _nodePropertyRecurser(node, depth, typeName);\n }\n default:\n var unknownDetails;\n if (node.toString == null) {\n unknownDetails = { \"[*TYPE*]\": typeName, status: \"inspectJSONify does not know how to parse this\", value: \"some-node_no_toString\" };\n }\n else {\n unknownDetails = { \"[*TYPE*]\": typeName, status: \"inspectJSONify does not know how to parse this\", value: node.toString() };\n }\n if (hideType) {\n delete unknownDetails[\"[*TYPE*]\"];\n }\n if (!showVerboseDetails) {\n return \"[*???*] \" + unknownDetails.value;\n }\n return unknownDetails;\n }\n }\n catch (ex) {\n //logger.assert(ex);\n return \"error: {0}\" + String(ex);\n }\n }", "function get_all_nodes_by_type(ast, typename) {\n\tvar nodes = [];\n\ttraverse(ast, function (node) {\n\t\tif (node.type == typename) {\n\t\t\tnodes.push(node);\n\t\t}\n\t});\n\treturn nodes;\n}", "function checkParameterTypeAnnotationsAsExpressions(node) {\n // ensure all type annotations with a value declaration are checked as an expression\n for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) {\n var parameter = _a[_i];\n checkTypeAnnotationAsExpression(parameter);\n }\n }", "function checkTypeAnnotationAsExpression(node) {\n checkTypeNodeAsExpression(node.type);\n }", "function createTypeExpression(node) {\n if (node.type == 'Identifier') {\n return node;\n } else if (node.type == 'QualifiedTypeIdentifier') {\n return t.memberExpression(createTypeExpression(node.qualification), createTypeExpression(node.id));\n }\n\n throw this.errorWithNode('Unsupported type: ' + node.type);\n }", "function checkTypeNodeAsExpression(node) {\n // When we are emitting type metadata for decorators, we need to try to check the type\n // as if it were an expression so that we can emit the type in a value position when we\n // serialize the type metadata.\n if (node && node.kind === 155 /* TypeReference */) {\n var root = getFirstIdentifier(node.typeName);\n var meaning = root.parent.kind === 155 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */;\n // Resolve type so we know which symbol is referenced\n var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);\n // Resolved symbol is alias\n if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */) {\n var aliasTarget = resolveAlias(rootSymbol);\n // If alias has value symbol - mark alias as referenced\n if (aliasTarget.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {\n markAliasSymbolAsReferenced(rootSymbol);\n }\n }\n }\n }", "function isType(node) {\n return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n}", "function _typeof2(e){return _typeof2=\"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},_typeof2(e)}", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function FunctionTypeAnnotation(node, print, parent) {\n print.plain(node.typeParameters);\n this.push(\"(\");\n print.list(node.params);\n\n if (node.rest) {\n if (node.params.length) {\n this.push(\",\");\n this.space();\n }\n this.push(\"...\");\n print.plain(node.rest);\n }\n\n this.push(\")\");\n\n // this node type is overloaded, not sure why but it makes it EXTREMELY annoying\n if (parent.type === \"ObjectTypeProperty\" || parent.type === \"ObjectTypeCallProperty\" || parent.type === \"DeclareFunction\") {\n this.push(\":\");\n } else {\n this.space();\n this.push(\"=>\");\n }\n\n this.space();\n print.plain(node.returnType);\n}", "function FunctionTypeAnnotation(node, print, parent) {\n\t print.plain(node.typeParameters);\n\t this.push(\"(\");\n\t print.list(node.params);\n\n\t if (node.rest) {\n\t if (node.params.length) {\n\t this.push(\",\");\n\t this.space();\n\t }\n\t this.push(\"...\");\n\t print.plain(node.rest);\n\t }\n\n\t this.push(\")\");\n\n\t // this node type is overloaded, not sure why but it makes it EXTREMELY annoying\n\t if (parent.type === \"ObjectTypeProperty\" || parent.type === \"ObjectTypeCallProperty\" || parent.type === \"DeclareFunction\") {\n\t this.push(\":\");\n\t } else {\n\t this.space();\n\t this.push(\"=>\");\n\t }\n\n\t this.space();\n\t print.plain(node.returnType);\n\t}", "function FunctionTypeAnnotation(node, print, parent) {\n\t print.plain(node.typeParameters);\n\t this.push(\"(\");\n\t print.list(node.params);\n\n\t if (node.rest) {\n\t if (node.params.length) {\n\t this.push(\",\");\n\t this.space();\n\t }\n\t this.push(\"...\");\n\t print.plain(node.rest);\n\t }\n\n\t this.push(\")\");\n\n\t // this node type is overloaded, not sure why but it makes it EXTREMELY annoying\n\t if (parent.type === \"ObjectTypeProperty\" || parent.type === \"ObjectTypeCallProperty\" || parent.type === \"DeclareFunction\") {\n\t this.push(\":\");\n\t } else {\n\t this.space();\n\t this.push(\"=>\");\n\t }\n\n\t this.space();\n\t print.plain(node.returnType);\n\t}", "function evaluateTypeOfExpression({ node, environment, evaluate, statementTraversalStack }) {\n return typeof evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function match(node, ...types) {\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n if (node.type === type) {\n return true;\n }\n }\n return false;\n}", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function _typeof(e) {\n return (_typeof = \"function\" == typeof Symbol && \"symbol\" == _typeof2(Symbol.iterator) ? function(e) {\n return _typeof2(e)\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : _typeof2(e)\n })(e)\n }", "function parsePrimaryType(){var params=null,returnType=null,marker=markerCreate(),rest=null,tmp,typeParameters,token,type,isGroupedType=false;switch(lookahead.type){case Token.Identifier:switch(lookahead.value){case 'any':lex();return markerApply(marker,delegate.createAnyTypeAnnotation());case 'bool': // fallthrough\ncase 'boolean':lex();return markerApply(marker,delegate.createBooleanTypeAnnotation());case 'number':lex();return markerApply(marker,delegate.createNumberTypeAnnotation());case 'string':lex();return markerApply(marker,delegate.createStringTypeAnnotation());}return markerApply(marker,parseGenericType());case Token.Punctuator:switch(lookahead.value){case '{':return markerApply(marker,parseObjectType());case '[':return parseTupleType();case '<':typeParameters = parseTypeParameterDeclaration();expect('(');tmp = parseFunctionTypeParams();params = tmp.params;rest = tmp.rest;expect(')');expect('=>');returnType = parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));case '(':lex(); // Check to see if this is actually a grouped type\nif(!match(')') && !match('...')){if(lookahead.type === Token.Identifier){token = lookahead2();isGroupedType = token.value !== '?' && token.value !== ':';}else {isGroupedType = true;}}if(isGroupedType){type = parseType();expect(')'); // If we see a => next then someone was probably confused about\n// function types, so we can provide a better error message\nif(match('=>')){throwError({},Messages.ConfusedAboutFunctionType);}return type;}tmp = parseFunctionTypeParams();params = tmp.params;rest = tmp.rest;expect(')');expect('=>');returnType = parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,null /* typeParameters */));}break;case Token.Keyword:switch(lookahead.value){case 'void':return markerApply(marker,parseVoidType());case 'typeof':return markerApply(marker,parseTypeofType());}break;case Token.StringLiteral:token = lex();if(token.octal){throwError(token,Messages.StrictOctalLiteral);}return markerApply(marker,delegate.createStringLiteralTypeAnnotation(token));}throwUnexpected(lookahead);}", "function _typeof(e){return(_typeof=\"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)}", "type_spec() {\n const startToken = this.currentToken;\n\n let typeTok = this.currentToken;\n if (typeTok.type === Lexer.TokenTypes.TYPE_INTEGER || typeTok.type === Lexer.TokenTypes.TYPE_REAL || typeTok.type === Lexer.TokenTypes.TYPE_BOOLEAN) {\n this.eat(typeTok.type);\n return new AST.TypeNode(typeTok);\n } else {\n throw new ParserException(`Error processing TYPESPEC: Expecting TYPE_INTEGER, TYPE_REAL, or TYPE_BOOLEAN got ${typeTok.type}`, startToken);\n }\n }", "function emitSerializedTypeReferenceNode(node) {\n var location = node.parent;\n while (ts.isDeclaration(location) || ts.isTypeNode(location)) {\n location = location.parent;\n }\n // Clone the type name and parent it to a location outside of the current declaration.\n var typeName = ts.cloneEntityName(node.typeName, location);\n var result = resolver.getTypeReferenceSerializationKind(typeName);\n switch (result) {\n case ts.TypeReferenceSerializationKind.Unknown:\n var temp = createAndRecordTempVariable(0 /* Auto */);\n write(\"(typeof (\");\n emitNodeWithoutSourceMap(temp);\n write(\" = \");\n emitEntityNameAsExpression(typeName, /*useFallback*/ true);\n write(\") === 'function' && \");\n emitNodeWithoutSourceMap(temp);\n write(\") || Object\");\n break;\n case ts.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:\n emitEntityNameAsExpression(typeName, /*useFallback*/ false);\n break;\n case ts.TypeReferenceSerializationKind.VoidType:\n write(\"void 0\");\n break;\n case ts.TypeReferenceSerializationKind.BooleanType:\n write(\"Boolean\");\n break;\n case ts.TypeReferenceSerializationKind.NumberLikeType:\n write(\"Number\");\n break;\n case ts.TypeReferenceSerializationKind.StringLikeType:\n write(\"String\");\n break;\n case ts.TypeReferenceSerializationKind.ArrayLikeType:\n write(\"Array\");\n break;\n case ts.TypeReferenceSerializationKind.ESSymbolType:\n if (languageVersion < 2 /* ES6 */) {\n write(\"typeof Symbol === 'function' ? Symbol : Object\");\n }\n else {\n write(\"Symbol\");\n }\n break;\n case ts.TypeReferenceSerializationKind.TypeWithCallSignature:\n write(\"Function\");\n break;\n case ts.TypeReferenceSerializationKind.ObjectType:\n write(\"Object\");\n break;\n }\n }", "lookAtNodeType(expr) {\n switch(expr.type) {\n case \"blockStmt\": return this.getBlockStmt(expr); \n case \"varDecl\": return this.getVarDecl(expr);\n case \"variableExpr\": return this.getVariableExpr(expr);\n case \"assignExpr\": return this.getAssignExpr(expr);\n case \"functionDecl\": return this.getFunctionDecl(expr);\n case \"expressionStmt\": return this.getExpressionStmt(expr);\n case \"ifStmt\": return this.getIfStmt(expr);\n case \"printStmt\": return this.getPrintStmt(expr);\n case \"returnStmt\": return this.getReturnStmt(expr);\n case \"whileStmt\": return this.getWhileStmt(expr);\n case \"binaryExpr\": return this.getBinaryExpr(expr);\n case \"callExpr\": return this.getCallExpr(expr);\n case \"groupingExpr\": return this.getGroupingExpr(expr);\n case \"literalExpr\": return this.getLiteralExpr(expr);\n case \"logicalExpr\": return this.getLogicalExpr(expr);\n case \"unaryExpr\": return this.getUnaryExpr(expr);\n default:\n throw new RuntimeError('Resolver cannot evaluate expression or statement')\n }\n }", "function checkTypeParameter(node) {\n // Grammar Checking\n if (node.expression) {\n grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);\n }\n checkSourceElement(node.constraint);\n getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)));\n if (produceDiagnostics) {\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0);\n }\n }", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "getType() {}", "TSTypeAnnotation(node) {\n this.visitTypeNodes(node);\n }", "function parseJSDocTypeExpression() {\n var result = createNode(257 /* JSDocTypeExpression */, scanner.getTokenPos());\n parseExpected(15 /* OpenBraceToken */);\n result.type = parseJSDocTopLevelType();\n parseExpected(16 /* CloseBraceToken */);\n fixupParentReferences(result);\n return finishNode(result);\n }", "function visitWithTypeInfo(typeInfo, visitor) {\n\t\t return {\n\t\t enter: function enter(node) {\n\t\t typeInfo.enter(node);\n\t\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t\t if (fn) {\n\t\t var result = fn.apply(visitor, arguments);\n\t\t if (result !== undefined) {\n\t\t typeInfo.leave(node);\n\t\t if (isNode(result)) {\n\t\t typeInfo.enter(result);\n\t\t }\n\t\t }\n\t\t return result;\n\t\t }\n\t\t },\n\t\t leave: function leave(node) {\n\t\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t\t var result = void 0;\n\t\t if (fn) {\n\t\t result = fn.apply(visitor, arguments);\n\t\t }\n\t\t typeInfo.leave(node);\n\t\t return result;\n\t\t }\n\t\t };\n\t\t}", "function emitSerializedTypeOfNode(node) {\n // serialization of the type of a declaration uses the following rules:\n //\n // * The serialized type of a ClassDeclaration is \"Function\"\n // * The serialized type of a ParameterDeclaration is the serialized type of its type annotation.\n // * The serialized type of a PropertyDeclaration is the serialized type of its type annotation.\n // * The serialized type of an AccessorDeclaration is the serialized type of the return type annotation of its getter or parameter type annotation of its setter.\n // * The serialized type of any other FunctionLikeDeclaration is \"Function\".\n // * The serialized type of any other node is \"void 0\".\n //\n // For rules on serializing type annotations, see `serializeTypeNode`.\n switch (node.kind) {\n case 221 /* ClassDeclaration */:\n write(\"Function\");\n return;\n case 145 /* PropertyDeclaration */:\n emitSerializedTypeNode(node.type);\n return;\n case 142 /* Parameter */:\n emitSerializedTypeNode(node.type);\n return;\n case 149 /* GetAccessor */:\n emitSerializedTypeNode(node.type);\n return;\n case 150 /* SetAccessor */:\n emitSerializedTypeNode(ts.getSetAccessorTypeAnnotationNode(node));\n return;\n }\n if (ts.isFunctionLike(node)) {\n write(\"Function\");\n return;\n }\n write(\"void 0\");\n }", "function _params(node, print) {\n // istanbul ignore next\n\n var _this = this;\n\n print.plain(node.typeParameters);\n this.push(\"(\");\n print.list(node.params, {\n iterator: function iterator(node) {\n if (node.optional) _this.push(\"?\");\n print.plain(node.typeAnnotation);\n }\n });\n this.push(\")\");\n\n if (node.returnType) {\n print.plain(node.returnType);\n }\n}", "TSClassImplements(node) {\n this.visitTypeNodes(node);\n }", "function appendOuterTypeParameters(typeParameters, node) {\n while (true) {\n node = node.parent;\n if (!node) {\n return typeParameters;\n }\n if (node.kind === 221 /* ClassDeclaration */ || node.kind === 192 /* ClassExpression */ ||\n node.kind === 220 /* FunctionDeclaration */ || node.kind === 179 /* FunctionExpression */ ||\n node.kind === 147 /* MethodDeclaration */ || node.kind === 180 /* ArrowFunction */) {\n var declarations = node.typeParameters;\n if (declarations) {\n return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations);\n }\n }\n }\n }", "function _params(node, print) {\n\t // istanbul ignore next\n\n\t var _this = this;\n\n\t print.plain(node.typeParameters);\n\t this.push(\"(\");\n\t print.list(node.params, {\n\t iterator: function iterator(node) {\n\t if (node.optional) _this.push(\"?\");\n\t print.plain(node.typeAnnotation);\n\t }\n\t });\n\t this.push(\")\");\n\n\t if (node.returnType) {\n\t print.plain(node.returnType);\n\t }\n\t}", "function _params(node, print) {\n\t // istanbul ignore next\n\n\t var _this = this;\n\n\t print.plain(node.typeParameters);\n\t this.push(\"(\");\n\t print.list(node.params, {\n\t iterator: function iterator(node) {\n\t if (node.optional) _this.push(\"?\");\n\t print.plain(node.typeAnnotation);\n\t }\n\t });\n\t this.push(\")\");\n\n\t if (node.returnType) {\n\t print.plain(node.returnType);\n\t }\n\t}", "function getNamedTypeNode(typeNode) {\n var namedType = typeNode;\n while (namedType.kind === _kinds.LIST_TYPE || namedType.kind === _kinds.NON_NULL_TYPE) {\n namedType = namedType.type;\n }\n return namedType;\n}", "enterTypeAnnotation(ctx) {\n }", "function emitSerializedParameterTypesOfNode(node) {\n // serialization of parameter types uses the following rules:\n //\n // * If the declaration is a class, the parameters of the first constructor with a body are used.\n // * If the declaration is function-like and has a body, the parameters of the function are used.\n //\n // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`.\n if (node) {\n var valueDeclaration = void 0;\n if (node.kind === 221 /* ClassDeclaration */) {\n valueDeclaration = ts.getFirstConstructorWithBody(node);\n }\n else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) {\n valueDeclaration = node;\n }\n if (valueDeclaration) {\n var parameters = valueDeclaration.parameters;\n var skipThisCount = parameters.length && parameters[0].name.originalKeywordKind === 97 /* ThisKeyword */ ? 1 : 0;\n var parameterCount = parameters.length;\n if (parameterCount > skipThisCount) {\n for (var i = skipThisCount; i < parameterCount; i++) {\n if (i > skipThisCount) {\n write(\", \");\n }\n if (parameters[i].dotDotDotToken) {\n var parameterType = parameters[i].type;\n if (parameterType && parameterType.kind === 160 /* ArrayType */) {\n parameterType = parameterType.elementType;\n }\n else if (parameterType && parameterType.kind === 155 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) {\n parameterType = parameterType.typeArguments[0];\n }\n else {\n parameterType = undefined;\n }\n emitSerializedTypeNode(parameterType);\n }\n else {\n emitSerializedTypeOfNode(parameters[i]);\n }\n }\n }\n }\n }\n }", "function Type() {}", "function getType(obj)\r\n{\r\n\r\n for(t in ast.tokens)\r\n {\r\n //console.log(ast.tokens[t].range + \"----\" + obj.range);\r\n if(ast.tokens[t].range === obj.range)\r\n {\r\n //console.log(\"##\"+ast.tokens[t].type);\r\n var type = ast.tokens[t].type;\r\n if( type === 'Identifier')\r\n {\r\n type = lookupType(obj);\r\n }\r\n return type;\r\n\r\n }\r\n else\r\n {\r\n //return lookupType(obj);\r\n }\r\n }\r\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n }", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function readTypeExpression(state) {\n if (fsaTypeAnnotationExpression === null) {\n // Used to read expressions within {} which evaluate to types.\n // Commas must be treated specially as an escape, not a binary operator.\n let fsaOptions = new ExpressionFsa_2.ExpressionFsaOptions();\n fsaOptions.binaryOpsToIgnore = [\",\"];\n fsaOptions.newLineInMiddleDoesNotEndExpression = true;\n fsaTypeAnnotationExpression = new ExpressionFsa_1.ExpressionFsa(fsaOptions);\n }\n let node = fsaTypeAnnotationExpression.runStartToStop(state.ts, state.wholeState);\n state.nodeToFill.params.push(node);\n}", "visitNode(node) { }", "function getContextualType(node) {\n if (isInsideWithStatementBody(node)) {\n // We cannot answer semantic questions within a with block, do not proceed any further\n return undefined;\n }\n if (node.contextualType) {\n return node.contextualType;\n }\n var parent = node.parent;\n switch (parent.kind) {\n case 218 /* VariableDeclaration */:\n case 142 /* Parameter */:\n case 145 /* PropertyDeclaration */:\n case 144 /* PropertySignature */:\n case 169 /* BindingElement */:\n return getContextualTypeForInitializerExpression(node);\n case 180 /* ArrowFunction */:\n case 211 /* ReturnStatement */:\n return getContextualTypeForReturnExpression(node);\n case 190 /* YieldExpression */:\n return getContextualTypeForYieldOperand(parent);\n case 174 /* CallExpression */:\n case 175 /* NewExpression */:\n return getContextualTypeForArgument(parent, node);\n case 177 /* TypeAssertionExpression */:\n case 195 /* AsExpression */:\n return getTypeFromTypeNode(parent.type);\n case 187 /* BinaryExpression */:\n return getContextualTypeForBinaryOperand(node);\n case 253 /* PropertyAssignment */:\n return getContextualTypeForObjectLiteralElement(parent);\n case 170 /* ArrayLiteralExpression */:\n return getContextualTypeForElementExpression(node);\n case 188 /* ConditionalExpression */:\n return getContextualTypeForConditionalOperand(node);\n case 197 /* TemplateSpan */:\n ts.Debug.assert(parent.parent.kind === 189 /* TemplateExpression */);\n return getContextualTypeForSubstitutionExpression(parent.parent, node);\n case 178 /* ParenthesizedExpression */:\n return getContextualType(parent);\n case 248 /* JsxExpression */:\n return getContextualType(parent);\n case 246 /* JsxAttribute */:\n case 247 /* JsxSpreadAttribute */:\n return getContextualTypeForJsxAttribute(parent);\n }\n return undefined;\n }", "function NewExpression(node) {\n if (this.get(\"callee\").isIdentifier()) {\n // only resolve identifier callee\n return t.genericTypeAnnotation(node.callee);\n }\n}", "function NewExpression(node) {\n\t if (this.get(\"callee\").isIdentifier()) {\n\t // only resolve identifier callee\n\t return t.genericTypeAnnotation(node.callee);\n\t }\n\t}", "function NewExpression(node) {\n\t if (this.get(\"callee\").isIdentifier()) {\n\t // only resolve identifier callee\n\t return t.genericTypeAnnotation(node.callee);\n\t }\n\t}", "function visitWithTypeInfo(typeInfo, visitor) {\n\t return {\n\t enter: function enter(node) {\n\t typeInfo.enter(node);\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitor, arguments);\n\t if (result !== undefined) {\n\t typeInfo.leave(node);\n\t if (isNode(result)) {\n\t typeInfo.enter(result);\n\t }\n\t }\n\t return result;\n\t }\n\t },\n\t leave: function leave(node) {\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t var result = void 0;\n\t if (fn) {\n\t result = fn.apply(visitor, arguments);\n\t }\n\t typeInfo.leave(node);\n\t return result;\n\t }\n\t };\n\t}", "function visitWithTypeInfo(typeInfo, visitor) {\n\t return {\n\t enter: function enter(node) {\n\t typeInfo.enter(node);\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitor, arguments);\n\t if (result !== undefined) {\n\t typeInfo.leave(node);\n\t if (isNode(result)) {\n\t typeInfo.enter(result);\n\t }\n\t }\n\t return result;\n\t }\n\t },\n\t leave: function leave(node) {\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t var result = void 0;\n\t if (fn) {\n\t result = fn.apply(visitor, arguments);\n\t }\n\t typeInfo.leave(node);\n\t return result;\n\t }\n\t };\n\t}", "function addTypes(env, sexp, constraints) {\n var type = null;\n switch (sexp.tag) {\n case 'sym':\n if (sexp.val in env) {\n type = env[sexp.val];\n } else {\n throw 'unknown sym ' + sexp.val;\n }\n break;\n case 'str': type = TString; break;\n case 'num': type = TNum; break;\n case 'lst':\n var head = sexp.val[0];\n if (head.val == 'fn') {\n var args = sexp.val[1].val;\n // Create new entry in env for each arg.\n env = Object.create(env);\n args.forEach(function(arg) { env[arg.val] = gentvar(); });\n\n var body = sexp.val.slice(2);\n body.forEach(function(sexp) { addTypes(env, sexp, constraints); });\n type = new Tfn(args.map(function(arg){ return env[arg.val]; }),\n body[body.length-1].type);\n } else {\n // Application of head to rest of sexp.\n sexp.val.forEach(function(sexp) { addTypes(env, sexp, constraints); });\n var args = sexp.val.slice(1);\n\n var fntype = new Tfn(args.map(function(arg) { return arg.type }),\n gentvar());\n constraints.push([head.type, fntype]);\n type = fntype.ret;\n }\n break;\n case 'vec':\n var elemtype = gentvar();\n sexp.val.forEach(function(sexp) {\n addTypes(env, sexp, constraints);\n constraints.push([elemtype, sexp.type]);\n });\n type = newTArray(elemtype);\n break;\n default: throw 'unknown sexp: ' + sexp.tag + ': ' + sexp;\n }\n if (!type)\n throw 'no type for ' + sexp.tag + ': ' + sexp;\n sexp.type = type;\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n\t return {\n\t enter: function enter(node) {\n\t typeInfo.enter(node);\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t if (fn) {\n\t var result = fn.apply(visitor, arguments);\n\t if (result !== undefined) {\n\t typeInfo.leave(node);\n\t if (isNode(result)) {\n\t typeInfo.enter(result);\n\t }\n\t }\n\t return result;\n\t }\n\t },\n\t leave: function leave(node) {\n\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t var result = undefined;\n\t if (fn) {\n\t result = fn.apply(visitor, arguments);\n\t }\n\t typeInfo.leave(node);\n\t return result;\n\t }\n\t };\n\t}", "TSEmptyBodyFunctionExpression(node) {\n const upperTypeMode = this.typeMode;\n const { typeParameters, params, returnType } = node;\n this.typeMode = true;\n this.visit(typeParameters);\n params.forEach(this.visit, this);\n this.visit(returnType);\n this.typeMode = upperTypeMode;\n }", "if (returnType.isTypeOf) {\n const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);\n\n const promise = getPromise(isTypeOf);\n if (promise) {\n return promise.then(isTypeOfResult => {\n if (!isTypeOfResult) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n return collectAndExecuteSubfields(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n parentDirectiveTree,\n execDetails\n );\n });\n }\n\n if (!isTypeOf) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n }", "function innerType(n) { }", "TSIndexSignature(node) {\n this.visitTypeNodes(node);\n }", "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "static parseType(parseTokens) {\n isASTNode = true;\n this.match([\"int\", \"string\", \"boolean\"], parseTokens[tokenPointer], false);\n }", "function _getTypeAnnotation() {\n var node = this.node;\n\n if (!node) {\n // handle initializerless variables, add in checks for loop initializers too\n if (this.key === \"init\" && this.parentPath.isVariableDeclarator()) {\n var declar = this.parentPath.parentPath;\n var declarParent = declar.parentPath;\n\n // for (var NODE in bar) {}\n if (declar.key === \"left\" && declarParent.isForInStatement()) {\n return t.stringTypeAnnotation();\n }\n\n // for (var NODE of bar) {}\n if (declar.key === \"left\" && declarParent.isForOfStatement()) {\n return t.anyTypeAnnotation();\n }\n\n return t.voidTypeAnnotation();\n } else {\n return;\n }\n }\n\n if (node.typeAnnotation) {\n return node.typeAnnotation;\n }\n\n var inferer = inferers[node.type];\n if (inferer) {\n return inferer.call(this, node);\n }\n\n inferer = inferers[this.parentPath.type];\n if (inferer && inferer.validParent) {\n return this.parentPath.getTypeAnnotation();\n }\n}", "function dataTypes() {\n console.log(typeof true);\n console.log(typeof null);\n console.log(typeof undefined);\n console.log(typeof 5);\n console.log(typeof NaN);\n console.log(typeof 'Hello');\n\n}", "function FunctionTypeParam(node, print) {\n\t print.plain(node.name);\n\t if (node.optional) this.push(\"?\");\n\t this.push(\":\");\n\t this.space();\n\t print.plain(node.typeAnnotation);\n\t}", "function FunctionTypeParam(node, print) {\n\t print.plain(node.name);\n\t if (node.optional) this.push(\"?\");\n\t this.push(\":\");\n\t this.space();\n\t print.plain(node.typeAnnotation);\n\t}", "function parseParametersType() {\n var params = [], optionalSequence = false, expr, rest = false, startIndex, restStartIndex = index - 3, nameStartIndex;\n\n while (token !== Token.RPAREN) {\n if (token === Token.REST) {\n // RestParameterType\n consume(Token.REST);\n rest = true;\n }\n\n startIndex = previous;\n\n expr = parseTypeExpression();\n if (expr.type === Syntax.NameExpression && token === Token.COLON) {\n nameStartIndex = previous - expr.name.length;\n // Identifier ':' TypeExpression\n consume(Token.COLON);\n expr = maybeAddRange({\n type: Syntax.ParameterType,\n name: expr.name,\n expression: parseTypeExpression()\n }, [nameStartIndex, previous]);\n }\n if (token === Token.EQUAL) {\n consume(Token.EQUAL);\n expr = maybeAddRange({\n type: Syntax.OptionalType,\n expression: expr\n }, [startIndex, previous]);\n optionalSequence = true;\n } else {\n if (optionalSequence) {\n utility.throwError('unexpected token');\n }\n }\n if (rest) {\n expr = maybeAddRange({\n type: Syntax.RestType,\n expression: expr\n }, [restStartIndex, previous]);\n }\n params.push(expr);\n if (token !== Token.RPAREN) {\n expect(Token.COMMA);\n }\n }\n return params;\n }", "function parsePrimaryType() {\n var params = null, returnType = null,\n marker = markerCreate(), rest = null, tmp,\n typeParameters, token, type, isGroupedType = false;\n \n switch (lookahead.type) {\n case Token.Identifier:\n switch (lookahead.value) {\n case 'any':\n lex();\n return markerApply(marker, delegate.createAnyTypeAnnotation());\n case 'bool': // fallthrough\n case 'boolean':\n lex();\n return markerApply(marker, delegate.createBooleanTypeAnnotation());\n case 'number':\n lex();\n return markerApply(marker, delegate.createNumberTypeAnnotation());\n case 'string':\n lex();\n return markerApply(marker, delegate.createStringTypeAnnotation());\n }\n return markerApply(marker, parseGenericType());\n case Token.Punctuator:\n switch (lookahead.value) {\n case '{':\n return markerApply(marker, parseObjectType());\n case '[':\n return parseTupleType();\n case '<':\n typeParameters = parseTypeParameterDeclaration();\n expect('(');\n tmp = parseFunctionTypeParams();\n params = tmp.params;\n rest = tmp.rest;\n expect(')');\n \n expect('=>');\n \n returnType = parseType();\n \n return markerApply(marker, delegate.createFunctionTypeAnnotation(\n params,\n returnType,\n rest,\n typeParameters\n ));\n case '(':\n lex();\n // Check to see if this is actually a grouped type\n if (!match(')') && !match('...')) {\n if (lookahead.type === Token.Identifier) {\n token = lookahead2();\n isGroupedType = token.value !== '?' && token.value !== ':';\n } else {\n isGroupedType = true;\n }\n }\n \n if (isGroupedType) {\n type = parseType();\n expect(')');\n \n // If we see a => next then someone was probably confused about\n // function types, so we can provide a better error message\n if (match('=>')) {\n throwError({}, Messages.ConfusedAboutFunctionType);\n }\n \n return type;\n }\n \n tmp = parseFunctionTypeParams();\n params = tmp.params;\n rest = tmp.rest;\n \n expect(')');\n \n expect('=>');\n \n returnType = parseType();\n \n return markerApply(marker, delegate.createFunctionTypeAnnotation(\n params,\n returnType,\n rest,\n null /* typeParameters */\n ));\n }\n break;\n case Token.Keyword:\n switch (lookahead.value) {\n case 'void':\n return markerApply(marker, parseVoidType());\n case 'typeof':\n return markerApply(marker, parseTypeofType());\n }\n break;\n case Token.StringLiteral:\n token = lex();\n if (token.octal) {\n throwError(token, Messages.StrictOctalLiteral);\n }\n return markerApply(marker, delegate.createStringLiteralTypeAnnotation(\n token\n ));\n }\n \n throwUnexpected(lookahead);\n }", "static getTypeID(ast) { return ast.typeID }", "type() { }", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = undefined;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}" ]
[ "0.63855946", "0.63855946", "0.6337871", "0.5985986", "0.59039664", "0.5822962", "0.58082587", "0.5699378", "0.56935424", "0.56851244", "0.5678837", "0.5678837", "0.56318885", "0.5628263", "0.5606798", "0.5586454", "0.5550081", "0.5525175", "0.5507126", "0.5359425", "0.5356041", "0.5336264", "0.53346395", "0.5312485", "0.5311936", "0.5311936", "0.52828556", "0.52704406", "0.5266415", "0.5266415", "0.52654624", "0.52605677", "0.52244973", "0.51839596", "0.516223", "0.51379013", "0.5137849", "0.513248", "0.5130237", "0.5118722", "0.51152766", "0.51135284", "0.51108664", "0.5085158", "0.5077406", "0.50759494", "0.5068634", "0.5052443", "0.5052443", "0.50388795", "0.50373745", "0.50339615", "0.50262", "0.50180775", "0.5017219", "0.50079715", "0.50079715", "0.50079715", "0.5007857", "0.5007857", "0.49900305", "0.4988821", "0.49833524", "0.49704", "0.49660045", "0.49660045", "0.4950108", "0.4950108", "0.49473038", "0.49448833", "0.49331784", "0.4931443", "0.4930244", "0.4929517", "0.49278504", "0.49266684", "0.492418", "0.49219826", "0.4916352", "0.4916352", "0.49089053", "0.49087542", "0.4908283", "0.49068987", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.49028006", "0.4900743", "0.48883873", "0.48883873" ]
0.49115095
80
Override. Don't create the reference object in the type mode.
Identifier(node) { this.visitDecorators(node.decorators); if (!this.typeMode) { super.Identifier(node); } this.visit(node.typeAnnotation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getReference() {\n mustInherit();\n }", "function ReferenceToObject(o, r, f) {\n // TODO : seems like I should output the desiredClass information here\n // maybe all references have a name, index, etc. and then the are either undefined\n // what about clobber, can I get an index in an index and then that would not work\n // should the second loop be doing something different?\n var originalRef = r;\n\twhile (r != null) {\n\t\tvar refForm = r.getForm();\n var refClass = r.getDesiredClass();\n var strk = app.typeIDToStringID(refClass);\n if (strk.length == 0) {\n strk = app.typeIDToCharID(refClass);\n }\n\t\tswitch (refForm) {\n\t\t\tcase ReferenceFormType.NAME:\n\t\t\t\to[\"name\"] = r.getName();\n\t\t\t\tbreak;\n\t\t\tcase ReferenceFormType.INDEX:\n\t\t\t\to[\"index\"] = r.getIndex();\n\t\t\t\tbreak;\n\t\t\tcase ReferenceFormType.IDENTIFIER:\n o[\"indentifier\"] = r.getIdentifier();\n break;\n\t\t\tcase ReferenceFormType.OFFSET:\n o[\"offset\"] = r.getOffset();\n break;\n\t\t\tcase ReferenceFormType.ENUMERATED:\n var newT = r.getEnumeratedType();\n var newV = r.getEnumeratedValue();\n o[\"enumerated\"] = new Object();\n o[\"enumerated\"].type = typeIDToCharID(newT);\n o[\"enumerated\"].typeString = typeIDToStringID(newT);\n o[\"enumerated\"].value = typeIDToCharID(newV);\n o[\"enumerated\"].valueString = typeIDToStringID(newV);\n break;\n\t\t\tcase ReferenceFormType.PROPERTY:\n o[\"property\"] = app.typeIDToStringID(r.getProperty());\n if (o[\"property\"].length == 0) {\n o[\"property\"] = app.typeIDToCharID(r.getProperty());\n }\n break;\n\t\t\tcase ReferenceFormType.CLASSTYPE:\n o[\"class\"] = refClass; // i already got that r.getDesiredClass(k);\n break;\n\t\t\tdefault:\n\t\t\t\tmyLogging.LogIt(\"Unsupported type in referenceToObject \" + t);\n\t\t}\n r = r.getContainer();\n try {\n r.getDesiredClass();\n } catch(e) {\n r = null;\n }\n\t}\n\tif (undefined != f) {\n\t\to = f(o);\n\t}\n}", "function resolveForwardRef(type){if(typeof type==='function'&&type.hasOwnProperty('__forward_ref__')){return type();}else{return type;}}", "function MakeRef() {\n return { value: false };\n}", "function MakeRef() {\n return { value: false };\n}", "function MakeRef() {\n return { value: false };\n}", "function MakeRef() {\n return { value: false };\n}", "function getTypeReference(typeInfo, type) {\n return {\n kind: 'Type',\n schema: typeInfo.schema,\n type: type || typeInfo.type\n };\n}", "function deregister() {\n if (Object.prototype.typeOf === boundTypeOf) {\n Object.prototype.typeOf = otypeof;\n otypeof = undefined;\n }\n }", "function deregister() {\n if (Object.prototype.typeOf === boundTypeOf) {\n Object.prototype.typeOf = otypeof;\n otypeof = undefined;\n }\n }", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function isReferenceType(type) {\n return ['Reference', 'CodeableReference'].includes(type);\n}", "convertRefToModel(object, isSchema, isProperty) {\n\t\tif (jsonHelper.isJson(object)) {\n\t\t\treturn object;\n\t\t}\n\t\t// if the object is a string, that means it's a direct ref/type\n\t\tif (typeof object === 'string') {\n\t\t\tif (this.isValidRefValue(object)) {\n\t\t\t\treturn {\n\t\t\t\t\t$ref: '#/definitions/' + object\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn object;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdelete object.typePropertyKind;\n\t\tfor (const id in object) {\n\t\t\tif (!object.hasOwnProperty(id)) continue;\n\n\t\t\tlet val = object[id];\n\t\t\tif (!val) continue;\n\t\t\tif (id === 'type') {\n\t\t\t\tif (_.isArray(object[id]) && object[id].length == 1) object[id] = object[id][0];\n\t\t\t\tval = object[id];\n\t\t\t\tif (val !== 'object' && typeof val === 'string' && !xmlHelper.isXml(val)) {\n\t\t\t\t\tobject[id] = RAMLImporter._modifyUnionType(val);\n\t\t\t\t\tval = object[id];\n\t\t\t\t}\n\t\t\t\tif (jsonHelper.isJson(val)) {\n\t\t\t\t\tobject = val;\n\t\t\t\t\tdelete object[id];\n\t\t\t\t} else if (xmlHelper.isXml(val)) {\n\t\t\t\t\tobject.type = 'object';\n\t\t\t\t} else if (this.isValidRefValues(val)) {\n\t\t\t\t\tobject.ref = val;\n\t\t\t\t\tdelete object[id];\n\t\t\t\t}\n\t\t\t\tif (!isProperty) {\n\t\t\t\t\tRAMLImporter._mapTypesFormats(object, isSchema);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (id === 'example' || id === 'examples') {\n\t\t\t\tobject = RAMLImporter._mapExamples(object);\n\t\t\t} else if (typeof val === 'object') {\n\t\t\t\tif (id === 'items' && !val.hasOwnProperty('type') && !val.hasOwnProperty('properties')) {\n\t\t\t\t\tif (!_.isArray(val)) val.type = 'string';\n\t\t\t\t\telse {\n\t\t\t\t\t\tobject.items = {\n\t\t\t\t\t\t\tref: val[0]\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn object;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (id == 'fixedFacets') { //delete garbage\n\t\t\t\t\tdelete object[id];\n\t\t\t\t} else {\n\t\t\t\t\tif (id == 'xml') { //no process xml object\n\t\t\t\t\t\tobject[id] = val;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobject[id] = this.convertRefToModel(val, isSchema, id === 'properties' && !isProperty);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (id == 'name') { //delete garbage\n\t\t\t\tdelete object[id];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn object;\n\t}", "getType(){return this.__type}", "static initialize(obj, ref) { \n obj['ref'] = ref;\n }", "function register() {\n if (Object.prototype.typeOf !== boundTypeOf) {\n otypeof = Object.prototype.typeOf;\n Object.prototype.typeOf = boundTypeOf;\n }\n }", "function register() {\n if (Object.prototype.typeOf !== boundTypeOf) {\n otypeof = Object.prototype.typeOf;\n Object.prototype.typeOf = boundTypeOf;\n }\n }", "function Type() {\r\n}", "function Type() {}", "function SuperType() {\n\t \t\t\t\tthis.property = true;\n\t \t\t\t}", "get objectReferenceValue() {}", "function Object(){}", "function Object(){}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null,\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "get typeReflection() { return exists && has(WA.Memory.type); }", "function createRef() {\n var refObject = {\n current: null\n };\n Object.seal(refObject);\n return refObject;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "getWeakType() {\n return this;\n }", "getWeakType() {\n return this;\n }", "function NXObject() {}", "constructor(address_of_reference) {\n this.address_of_reference = address_of_reference;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function fixupRef(ref) {\n if (jabberwerx.util.isJWObjRef(ref)) {\n //if this reference should not be persisted at all.\n if(ref.shouldBeSavedWithGraph && !ref.shouldBeSavedWithGraph()) {\n return undefined;\n }\n //JW objects without classnames should not be persisted\n if (!ref._className) {\n return undefined;\n }\n //if this ref should be serialized, add to registry and replace w/ guid\n if (!ref.shouldBeSerializedInline || !ref.shouldBeSerializedInline()) {\n if (registry[ref._guid] === undefined) {\n registry[ref._guid] = ref;\n ref.willBeSerialized && ref.willBeSerialized();\n fixupTree(ref);//returning string, stopping recursion. recurse now\n }\n return ref._guid;\n } else {\n ref.willBeSerialized && ref.willBeSerialized();\n return ref; //will be recursed\n }\n }\n //replace invocations with an easily json-ed object.\n if (jabberwerx.util.isJWInvocation(ref)) {\n return {object: ref.object._guid, methodName: ref.methodName, _jwinvocation_: true};\n }\n return ref; //all other types\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function local_change_type(input_object, new_type)\n {\n if(input_object instanceof new_type)\n return input_object;\n\n var new_object = new new_type();\n new_object.id_block = input_object.id_block;\n new_object.len_block = input_object.len_block;\n new_object.warnings = input_object.warnings;\n new_object.value_before_decode = util_copybuf(input_object.value_before_decode);\n\n return new_object;\n }", "constructor(type) {\n super()\n this.type = type \n }", "get type() { return this._type; }", "get type() { return this._type; }", "get type() { return this._type; }", "function Type() {\n}", "function getRegularTypeOfObjectLiteral(type) {\n if (!(type.flags & 16777216 /* FreshObjectLiteral */)) {\n return type;\n }\n var regularType = type.regularType;\n if (regularType) {\n return regularType;\n }\n var resolved = type;\n var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);\n var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);\n regularNew.flags = resolved.flags & ~16777216 /* FreshObjectLiteral */;\n type.regularType = regularNew;\n return regularNew;\n }", "function setCType(prop, classContext) {\n\tprop.isPtr = false;\n\tprop.CType = undefined;\n\tprop.CConstType = undefined;\n\tprop.CBaseType = undefined;\n\n\t/*\n\t * map basic JSON types\n\t */\n\tswitch ( prop.type ) {\n\tcase 'string':\n\t\tprop.CBaseType = \"std::string\";\n\t\tprop.isPtr = true;\n\t\tbreak;\n\n\tcase 'number':\n\t\tprop.CBaseType = \"double\";\n\t\tbreak;\n\n\tcase 'integer':\n\t\tprop.CBaseType = \"int64_t\";\n\t\tbreak;\n\n\tcase 'boolean':\n\t\tprop.CBaseType = \"bool\";\n\t\tbreak;\n\n\tcase 'object':\n\t\tprop.isPtr = true;\n\t\tprop.CBaseType = prop.className;\n\t\tbreak;\n\n\tcase 'array':\n\t\tprop.isPtr = true;\n\t\t// get type from array items\n\t\tprop.CBaseType = \"std::vector<\" + prop.items.CType + \">\";\n\t\tbreak;\n\n\tcase 'any':\n\t\tprop.isPtr = true;\n\t\tprop.CBaseType = \"std::string\"; // use the JSON text\n\t\tbreak;\n\n\tdefault:\n\t\t// this should never happen\n\t\tbreak;\n\t}\n\t\n\t/*\n\t * handle extended types\n\t */\n\t\n\t// ID\n\tif ( prop.type == 'string' && prop.exttype == 'id' ) {\n\t\tprop.CBaseType = 'ConnectedVision::id_t';\n\t\tprop.isPtr = false;\n\t}\n\n\t\n\t// timestamp\n\tif ( prop.type == 'integer' && prop.exttype == 'timestamp' ) {\n\t\tprop.CBaseType = 'ConnectedVision::timestamp_t';\n\t\tprop.isPtr = false;\n\t}\n\t\n\t// enforce exttype\n\tif ( !prop.exttype )\n\t\tprop.exttype = prop.type;\n\t\n\t// derive C/C++ type from base type\n\tif ( prop.isPtr ) {\n\t\tprop.CType = 'boost::shared_ptr<' + prop.CBaseType + '>';\n\t\tprop.CConstType = 'boost::shared_ptr<const ' + prop.CBaseType + '>';\n\t} else {\n\t\tprop.CType = prop.CBaseType;\n\t\tprop.CConstType = prop.CBaseType;\n\t}\n}", "function reference(factory) {\n if (arguments.length === 2 && typeof arguments[1] === \"string\")\n fail(\"References with base path are no longer supported. Please remove the base path.\")\n return new ReferenceType(factory)\n}", "function Type() {\n this.hooks = [];\n }", "get type () {\n return this._mem.type;\n }", "function wireWeakly(obj, type) {\n var wire = wireContent(type);\n wm.set(obj, wire);\n return wire;\n }", "function LightType() {}", "function createFromType(nativeType, onto) {\n clrTypeTarget = clrTypeTarget || nativeType;\n isPublicProperty = isPublicProperty || dotnet.getPropertyObject(nativeType, \"IsPublic\");\n nameProperty = nameProperty || dotnet.getPropertyObject(nativeType, \"Name\");\n nameSpaceProperty = nameSpaceProperty || dotnet.getPropertyObject(nativeType, \"Namespace\");\n isEnumProperty = isEnumProperty || dotnet.getPropertyObject(nativeType, \"IsEnum\");\n isClassProperty = isClassProperty || dotnet.getPropertyObject(nativeType, \"IsClass\");\n isValueTypeProperty = isValueTypeProperty || dotnet.getPropertyObject(nativeType, \"IsValueType\");\n if(dotnet.getProperty(isPublicProperty, nativeType)) {\n var space = dotnet.getProperty(nameSpaceProperty, nativeType);\n var name = dotnet.getProperty(nameProperty, nativeType);\n var info = { onto:onto, type:nativeType, name:name };\n \n if(space) {\n var spl = space.split('.');\n for(var i=0; i < spl.length; i++) {\n info.onto[spl[i]] = info.onto[spl[i]] || {};\n info.onto = info.onto[spl[i]];\n }\n }\n\n Object.defineProperty(info.onto, name, {\n configurable:true, enumerable:true,\n get:function() { \n delete this.onto[this.name];\n if(dotnet.getProperty(isEnumProperty, this.type)) {\n this.onto[this.name] = createEnum(this.type,this.name);\n } else if (dotnet.getProperty(isClassProperty, this.type) || dotnet.getProperty(isValueTypeProperty, this.type)) {\n this.onto[this.name] = createClass(this.type,this.name);\n }\n return this.onto[this.name];\n }.bind(info)\n });\n }\n}", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "get type() {\n\t\treturn this.__type;\n\t}", "type(val) {\n this._type = val;\n return this;\n }", "constructor (def) {\n if (def.struct == null ||\n def.initType == null ||\n def.class == null ||\n def.name == null ||\n def.createType == null\n ) {\n throw new Error('Custom type was not initialized correctly!')\n }\n this.struct = def.struct\n this.initType = def.initType\n this.createType = def.createType\n this.class = def.class\n this.name = def.name\n if (def.appendAdditionalInfo != null) {\n this.appendAdditionalInfo = def.appendAdditionalInfo\n }\n this.parseArguments = (def.parseArguments || function () {\n return [this]\n }).bind(this)\n this.parseArguments.typeDefinition = this\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}" ]
[ "0.5769283", "0.5671791", "0.56470495", "0.5646003", "0.5646003", "0.5646003", "0.5646003", "0.5640608", "0.5627695", "0.5627695", "0.5600289", "0.5600289", "0.55617654", "0.555032", "0.55361533", "0.5532351", "0.55198705", "0.55198705", "0.5494705", "0.54331046", "0.5418186", "0.54125524", "0.5379616", "0.5379616", "0.5368847", "0.5368847", "0.53653693", "0.5353969", "0.53464466", "0.5337198", "0.5337198", "0.5337198", "0.5336023", "0.5336023", "0.53170776", "0.53146666", "0.5300091", "0.52944106", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52898395", "0.52868366", "0.52850235", "0.52782464", "0.52782464", "0.52782464", "0.5270697", "0.5266736", "0.5228041", "0.52258325", "0.5220912", "0.5215269", "0.52136004", "0.520688", "0.51903176", "0.51759", "0.5171796", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5164115", "0.5154786", "0.515173", "0.5126519", "0.5126519", "0.5126519", "0.5126519", "0.5126519", "0.5126519", "0.5126519", "0.5126519", "0.5126519" ]
0.0
-1
Don't create the reference object for the key if not computed.
ClassProperty(node) { const upperTypeMode = this.typeMode; const { computed, decorators, key, typeAnnotation, value } = node; this.typeMode = false; this.visitDecorators(decorators); if (computed) { this.visit(key); } this.typeMode = true; this.visit(typeAnnotation); this.typeMode = false; this.visit(value); this.typeMode = upperTypeMode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n }", "function get_or_create (src, key) {\n try {\n src[key] = src[key] || {}\n return src[key]\n } catch (e) {\n return {}\n }\n}", "constructor() {\n this.obj = {};\n this.key = 0;\n }", "function Ref(refKey) {\n return Object(vue_class_component__WEBPACK_IMPORTED_MODULE_1__[/* createDecorator */ \"a\"])(function (options, key) {\n options.computed = options.computed || {};\n options.computed[key] = {\n cache: false,\n get: function () {\n return this.$refs[refKey || key];\n },\n };\n });\n}", "function circularReplacer(key, value) {\n if (typeof value === 'object' && value !== null) {\n if (cache.indexOf(value) !== -1) {\n return;\n }\n cache.push(value);\n }\n return value;\n }", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function setHashKey(obj, h) { // 407\n if (h) { // 408\n obj.$$hashKey = h; // 409\n } else { // 410\n delete obj.$$hashKey; // 411\n } // 412\n} // 413", "function createRef() {\n var refObject = {\n current: null,\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function Ref(refKey) {\n return createDecorator(function (options, key) {\n options.computed = options.computed || {};\n options.computed[key] = {\n cache: false,\n get: function () {\n return this.$refs[refKey || key];\n },\n };\n });\n}", "function Ref(refKey) {\n return createDecorator(function (options, key) {\n options.computed = options.computed || {};\n options.computed[key] = {\n cache: false,\n get: function () {\n return this.$refs[refKey || key];\n },\n };\n });\n}", "function Ref(refKey) {\n return createDecorator(function (options, key) {\n options.computed = options.computed || {};\n options.computed[key] = {\n cache: false,\n get: function () {\n return this.$refs[refKey || key];\n },\n };\n });\n}", "function Ref(refKey) {\n return createDecorator(function (options, key) {\n options.computed = options.computed || {};\n options.computed[key] = {\n cache: false,\n get: function () {\n return this.$refs[refKey || key];\n },\n };\n });\n}", "function Ref(refKey) {\n return Object(vue_class_component__WEBPACK_IMPORTED_MODULE_1__[\"createDecorator\"])(function (options, key) {\n options.computed = options.computed || {};\n options.computed[key] = {\n cache: false,\n get: function () {\n return this.$refs[refKey || key];\n },\n };\n });\n}", "function createRef() {\n var refObject = {\n current: null\n };\n Object.seal(refObject);\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}" ]
[ "0.5897251", "0.5897251", "0.5897251", "0.5897251", "0.5897251", "0.5897251", "0.5897251", "0.5897251", "0.5897251", "0.5612076", "0.55985045", "0.55828106", "0.55572534", "0.55173606", "0.55173606", "0.55028814", "0.55028814", "0.5476353", "0.5472209", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.545235", "0.54489154", "0.54202", "0.54202", "0.54202", "0.54202", "0.5387438", "0.5384171", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051", "0.5377051" ]
0.0
-1
Override. Visit call expression.
CallExpression(node) { this.visitTypeParameters(node); this.visit(node.callee); node.arguments.forEach(this.visit, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CallExpression(node, print) {\n\t print.plain(node.callee);\n\n\t this.push(\"(\");\n\n\t var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact;\n\n\t var separator;\n\t if (isPrettyCall) {\n\t separator = \",\\n\";\n\t this.newline();\n\t this.indent();\n\t }\n\n\t print.list(node.arguments, { separator: separator });\n\n\t if (isPrettyCall) {\n\t this.newline();\n\t this.dedent();\n\t }\n\n\t this.push(\")\");\n\t}", "function CallExpression(node, print) {\n\t print.plain(node.callee);\n\n\t this.push(\"(\");\n\n\t var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact;\n\n\t var separator;\n\t if (isPrettyCall) {\n\t separator = \",\\n\";\n\t this.newline();\n\t this.indent();\n\t }\n\n\t print.list(node.arguments, { separator: separator });\n\n\t if (isPrettyCall) {\n\t this.newline();\n\t this.dedent();\n\t }\n\n\t this.push(\")\");\n\t}", "function CallExpression(node, print) {\n print.plain(node.callee);\n\n this.push(\"(\");\n\n var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact;\n\n var separator;\n if (isPrettyCall) {\n separator = \",\\n\";\n this.newline();\n this.indent();\n }\n\n print.list(node.arguments, { separator: separator });\n\n if (isPrettyCall) {\n this.newline();\n this.dedent();\n }\n\n this.push(\")\");\n}", "parseCall(func) {\n // set context for handling brackets inside of arguments\n // this.currentNode = { type: \"call\" };\n const expr = {\n type: \"call\",\n func: func,\n primitive: this.isPrimitiveFunc(func.value),\n args: this.delimited(\"(\", \")\", \",\", this.parseExpression.bind(this)),\n };\n\n return this.maybeArrayIndexing(expr, () => {\n return expr;\n });\n }", "function CallExpression() {\n\t return resolveCall(this.get(\"callee\"));\n\t}", "function CallExpression() {\n\t return resolveCall(this.get(\"callee\"));\n\t}", "function CallExpression() {\n return resolveCall(this.get(\"callee\"));\n}", "function read_expression_call() {\n debug(2, \"read_expression_call\", inspect(state.ctt));\n var ast = ast_new(\"call-expr\");\n\n ast.callee = read_member_expression();\n\n if (is_error(ast.callee)) {\n return ast.callee;\n }\n\n if (!test(\"(\")) {\n return ast.callee; // return just the member expression, there is no call\n }\n\n ast.arguments = read_many([\n read_arguments,\n read_property_access,\n read_index_access\n ], \"unpexpected\", true);\n\n if (is_error(ast.arguments)) {\n return ast.arguments;\n }\n\n return ast_end(ast);\n}", "function call() { //Modified this from function expression to function declaration.\r\n console.log(\"I am calling\");\r\n}", "evaluateCallImpl(args) {\n const callExpr = args.expression.trimLeft().slice(`call `.length);\n // if args.frameID is 'not specified', expression is evaluated in the global scope, according to DAP.\n // default to the topmost stack frame of the current goroutine\n let goroutineId = -1;\n let frameId = 0;\n if (args.frameId) {\n [goroutineId, frameId] = this.stackFrameHandles.get(args.frameId, [goroutineId, frameId]);\n }\n // See https://github.com/go-delve/delve/blob/328cf87808822693dc611591519689dcd42696a3/service/api/types.go#L321-L350\n // for the command args for function call.\n const returnValue = this.delve\n .callPromise('Command', [\n {\n name: 'call',\n goroutineID: goroutineId,\n returnInfoLoadConfig: this.delve.loadConfig,\n expr: callExpr,\n unsafe: false,\n }\n ])\n .then((val) => val, (err) => {\n logError('Failed to call function: ', JSON.stringify(callExpr, null, ' '), '\\n\\rCall error:', err.toString());\n return Promise.reject(err);\n });\n return returnValue;\n }", "function evaluateCallExpression({ node, environment, evaluate, statementTraversalStack, typescript, logger }) {\n const evaluatedArgs = [];\n for (let i = 0; i < node.arguments.length; i++) {\n evaluatedArgs[i] = evaluate.expression(node.arguments[i], environment, statementTraversalStack);\n }\n // Evaluate the expression\n const expressionResult = evaluate.expression(node.expression, environment, statementTraversalStack);\n if (isLazyCall(expressionResult)) {\n const currentThisBinding = expressionContainsSuperKeyword(node.expression, typescript) ? getFromLexicalEnvironment(node, environment, THIS_SYMBOL) : undefined;\n const value = expressionResult.invoke(currentThisBinding != null ? currentThisBinding.literal : undefined, ...evaluatedArgs);\n logger.logResult(value, \"CallExpression\");\n return value;\n }\n // Otherwise, assume that the expression still needs calling\n else {\n // Unless optional chaining is being used, throw a NotCallableError\n if (node.questionDotToken == null && typeof expressionResult !== \"function\") {\n throw new NotCallableError({ value: expressionResult, node: node.expression });\n }\n const value = typeof expressionResult !== \"function\" ? undefined : expressionResult(...evaluatedArgs);\n logger.logResult(value, \"CallExpression\");\n return value;\n }\n}", "function calcCallExpression(env, node) {\n let callee = calcExpression(env, node.callee);\n let arguments = node.arguments.map(node => calcExpression(env, node));\n return callee(...arguments);\n}", "function isCallExpression(node) {\n return node.kind === ts.SyntaxKind.CallExpression;\n}", "OptionalCallExpression(node) {\n this.visitTypeParameters(node);\n this.visit(node.callee);\n node.arguments.forEach(this.visit, this);\n }", "convertToNormalCall(): BabelNodeCallExpression {\n const {moduleName, node, t} = this;\n if (node.arguments.length !== 1) {\n throw errorAt(\n node,\n `Expected ${moduleName}.c to have exactly 1 argument. ${node.arguments.length} was given.`,\n );\n }\n\n const text = normalizeSpaces(\n expandStringConcat(moduleName, node.arguments[0]).value,\n ).trim();\n\n const desc = FbtCommon.getDesc(text);\n if (desc == null || desc === '') {\n throw errorAt(\n node,\n FbtCommon.getUnknownCommonStringErrorMessage(moduleName, text),\n );\n }\n\n const callNode = t.callExpression(t.identifier(moduleName), [\n t.stringLiteral(text),\n t.stringLiteral(desc),\n t.objectExpression([\n t.objectProperty(t.identifier(CommonOption), t.booleanLiteral(true)),\n ]),\n ]);\n\n callNode.loc = node.loc;\n return callNode;\n }", "function_call(idToken) {\n const startToken = this.currentToken;\n let params = [];\n\n try {\n let nextExpr;\n this.eat(Lexer.TokenTypes.LPAREN);\n do {\n try {\n nextExpr = this.expr();\n params.push(nextExpr);\n this.eat(Lexer.TokenTypes.COMMA);\n } catch (e) {\n nextExpr = null;\n }\n } while (nextExpr !== null);\n\n this.eat(Lexer.TokenTypes.RPAREN);\n } catch (e) {\n throw new ParserException('Error processing FUNCTION_CALL', startToken, e);\n }\n\n return new AST.FunctionCallNode(idToken.val, params);\n }", "CallExpression(path) {\n if (path.node.callee.type === 'Super') {\n path.replaceWith(\n t.callExpression(\n t.memberExpression(t.super(), t.identifier('init')),\n path.node.arguments\n )\n );\n }\n }", "function parseCall(tokens) {\n\n var identifier = tokens.eat(); // Consume name\n tokens.eat(\"(\"); // Consume left paren\n // Consume arguments\n var args = [];\n while (!tokens.nextIs(\")\")) {\n args.push(tokens.eat());\n }\n tokens.eat(\")\");\n\n return {\n type: \"call\",\n name: identifier,\n arguments: args,\n toString: function () {\n return identifier + \"(\" + args.join(' ') + \")\";\n }\n };\n}", "function FunctionCall() {\n AST.call(this, \"FUNCALL\");\n this.variableName = \"\";\n this.funName = \"\";\n this.args = [];\n}", "CallExpression(path) {\n if (!t.isIdentifier(path.node.callee)\n || path.node.callee.name !== 'decodeURIComponent'\n ) {\n // 需要是调用 decodeURIComponent函数\n return;\n }\n if (path.node.arguments.length !== 1) {\n return;\n }\n let decodeArg = path.node.arguments[0];\n if (!t.isLiteral(decodeArg)) {\n //参数需要是常量\n return;\n }\n let replace = eval(path.toString());\n path.replaceWith(t.stringLiteral(replace));\n\n //触发父节点的树重新遍历\n path.parentPath.visit();\n }", "function getThisArgumentOfCall(node) {\n if (node.kind === 174 /* CallExpression */) {\n var callee = node.expression;\n if (callee.kind === 172 /* PropertyAccessExpression */) {\n return callee.expression;\n }\n else if (callee.kind === 173 /* ElementAccessExpression */) {\n return callee.expression;\n }\n }\n }", "compileProcCall(opts, result) {\nlet scope = this._scope;\nlet iterator = new Iterator({tokens: opts.expression.tokens, compiler: this._compiler});\nlet CompileCall = require('../compiler/CompileCall').CompileCall;\niterator.skipWhiteSpace().next();\nnew CompileCall({compiler: this._compiler, program: this._program, scope: scope}).compile({\niterator: iterator,\nproc: opts.identifier,\nprocExpression: null,\nprocIdentifier: opts.identifier,\ncallMethod: opts.callMethod,\nselfPointerStackOffset: this._selfPointerStackOffset\n});\nhelper.setStackOffsetToPtr(this._program, this._scope);\nhelper.assignToPtr(this._program, $.CMD_SET, $.T_NUM_G, $.REG_RET);\nopts.index = opts.expression.tokens.length;\nresult.dataSize = 1;\n}", "function createCallEvaluator(memberNode, argNodes) {\n var member = createEvaluator(memberNode)\n , args = [null].concat(wrapArrayEvaluators(argNodes))\n , alen = args.length;\n\n return callEvaluator;\n\n // If we're in the process of gathering module exports, and the called\n // function can't be resolved, then just exit without exploding.\n // What happens inside of a function probably shouldn't influence the\n // top-level export context anyway\n function callEvaluator(ctx, writer) {\n var func = member(ctx, writer);\n\n if ( typeof func !== 'function' || !func.__interpolFunction ) {\n if ( ctx.__interpolExports ) {\n return;\n }\n throw new Error(\"Attempting to call an unblessed function\");\n }\n\n var callArgs = [writer];\n for ( var i = 1; i < alen; i++ ) {\n callArgs[i] = args[i](ctx, writer);\n }\n\n return func.apply(null, callArgs);\n }\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (; ;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "CallExpression (path, { file }) {\n /* determine types of parameters */\n const pp = []\n const np = []\n path.get(\"arguments\").forEach((path) => {\n if (path.isAssignmentExpression() && path.get(\"left\").isIdentifier()) {\n /* assignment expression with an identifier (treated as a named parameter) */\n const name = path.get(\"left\").node.name\n if (np.findIndex((p) => p.get(\"left\").isIdentifier({ name: name })) >= 0)\n throw path.buildCodeFrameError(`named parameter \"${name}\" occurs multiple times`)\n np.push(path)\n }\n else {\n /* other expression */\n pp.push(path)\n }\n })\n\n /* short-circuit processing if there are no named parameters */\n if (np.length === 0)\n return\n\n /* replace the CallExpression with a new one */\n let opts = []\n if (!options.options || !options.caching) {\n if (!options.options)\n opts.push(babel.types.objectProperty(\n babel.types.identifier(\"options\"),\n babel.types.booleanLiteral(false)))\n if (!options.caching)\n opts.push(babel.types.objectProperty(\n babel.types.identifier(\"caching\"),\n babel.types.booleanLiteral(false)))\n opts = [babel.types.objectExpression(opts)]\n }\n path.replaceWith(\n babel.types.callExpression(\n /* the transform function name */\n babel.types.identifier(options.functionName),\n [\n /* the previous context or undefined */\n path.get(\"callee\").isMemberExpression() ?\n path.node.callee.object :\n babel.types.identifier(\"undefined\"),\n\n /* the previous callee */\n path.node.callee,\n\n /* the positional parameters */\n babel.types.arrayExpression(\n pp.map((path) => {\n return path.node\n })\n ),\n\n /* the named parameters */\n babel.types.objectExpression(\n np.map((path) => {\n return babel.types.objectProperty(\n path.get(\"left\").node,\n path.get(\"right\").node\n )\n })\n )\n ].concat(opts)\n )\n )\n\n /* remember that we need the transform function */\n file.set(\"namedParamsNeedTransformFunction\", true)\n }", "function functionCall(stream, a) {\n var name = stream.trypopfuncname(stream, a);\n if (null == name) return null;\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ( ) after function name.');\n var params = [];\n var first = true;\n while (null == stream.trypop(')')) {\n if (!first && null == stream.trypop(','))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected , between arguments of the function.');\n first = false;\n var param = orExpr(stream, a);\n if (param == null)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression as argument of function.');\n params.push(param);\n }\n return a.node('FunctionCall', name, params);\n }", "function functionCall(stream, a) {\n var name = stream.trypopfuncname(stream, a);\n if (null == name) return null;\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ( ) after function name.');\n var params = [];\n var first = true;\n while (null == stream.trypop(')')) {\n if (!first && null == stream.trypop(','))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected , between arguments of the function.');\n first = false;\n var param = orExpr(stream, a);\n if (param == null)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression as argument of function.');\n params.push(param);\n }\n return a.node('FunctionCall', name, params);\n }", "function chainedInstruction(reference, calls, span) {\n var expression = importExpr(reference, null, span);\n\n if (calls.length > 0) {\n for (var i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n } else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n\n return expression;\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (;;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (;;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (;;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function parseLeftHandSideExpressionAllowCall() {\n\t var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n\t startToken = lookahead;\n\t state.allowIn = true;\n\n\t if (matchKeyword('super') && state.inFunctionBody) {\n\t expr = new Node();\n\t lex();\n\t expr = expr.finishSuper();\n\t if (!match('(') && !match('.') && !match('[')) {\n\t throwUnexpectedToken(lookahead);\n\t }\n\t } else {\n\t expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n\t }\n\n\t for (;;) {\n\t if (match('.')) {\n\t isBindingElement = false;\n\t isAssignmentTarget = true;\n\t property = parseNonComputedMember();\n\t expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n\t } else if (match('(')) {\n\t isBindingElement = false;\n\t isAssignmentTarget = false;\n\t args = parseArguments();\n\t expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n\t } else if (match('[')) {\n\t isBindingElement = false;\n\t isAssignmentTarget = true;\n\t property = parseComputedMember();\n\t expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n\t } else if (lookahead.type === Token.Template && lookahead.head) {\n\t quasi = parseTemplateLiteral();\n\t expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n\t } else {\n\t break;\n\t }\n\t }\n\t state.allowIn = previousAllowIn;\n\n\t return expr;\n\t }", "function parseNoCallExpr() {\n const startTokenIndex = state.tokens.length;\n parseExprAtom();\n parseSubscripts(startTokenIndex, true);\n}", "isImplicitCall(): boolean {\n if (this.args.length === 0 || this.args[0].node.virtual) {\n return false;\n }\n let searchStart = this.fn.outerEnd;\n let searchEnd = this.args[0].outerStart;\n return this.indexOfSourceTokenBetweenSourceIndicesMatching(\n searchStart, searchEnd, token => token.type === SourceType.CALL_START) === null;\n }", "function chainedInstruction(reference, calls, span) {\n var expression = importExpr(reference, null, span);\n\n if (calls.length > 0) {\n for (var i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n } else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "visit(arg_element, ...args) {\n MxI.$raiseNotImplementedError(IVisitor, this);\n }", "function ruleFuncCall() {\n\tvar node = null;\n\tvar tmp;\n\n\tif (accept(\"LX_ID\") && _lex[0].name == \"LX_LPAREN\") {\n\t node = {name:\"LX_FUNCALL\", children:[{name:_curr.name, val:_curr.val}]};\n\t shift();\n\t shift();\n\t if ((tmp = ruleAssign())) {\n\t\tnode.children.push(tmp);\n\t\twhile (accept(\"LX_COMMA\") && shift()) {\n\t\t if (!(tmp = ruleAssign()))\n\t\t\treturn (false);\n\t\t node.children.push(tmp);\n\t\t}\n\t }\n\t if (!expect(\"LX_RPAREN\") || !shift())\n\t\treturn (false);\n\t}\n\treturn (node);\n }", "function parseFunctionCall(name) {\n let token, args = [], arg = {};\n\n token = lexer.next();\n if (!matchOp(token, '(')) {\n throw new SyntaxError('Expecting ( in a function call \"' + name + '\"');\n }\n\n token = lexer.peek();\n if (!matchOp(token, ')')) {\n if (name.indexOf(\"step\") >= 0) {\n arg = parseArgument();\n }\n else {\n args = parseArgumentList();\n }\n }\n\n token = lexer.next();\n if (!matchOp(token, ')')) {\n throw new SyntaxError('Expecting ) in a function call \"' + name + '\"');\n }\n if (name.indexOf(\"step\") >= 0) {\n return arg;\n }\n else {\n return {\n 'FunctionCall': {\n 'name': name,\n 'args': args\n }\n }\n }\n }", "function visitFunctionCallArguments(traverse, node, path, state) {\n\n utils.catchup(node.callee.range[0], state);\n traverse(node.callee, [node].concat(path), state);\n\n var args = node['arguments'];\n for (var index = 0; index < args.length; ++index) {\n utils.catchup(args[index].range[0], state);\n traverse(args[index], [node].concat(path), state);\n utils.catchup(args[index].range[1], state);\n }\n\n // delete first comma between the last argument and the closing parenthesis\n utils.catchup(node.range[1], state, function(value) {\n return value.replace(\",\", '');\n });\n\n return false;\n}", "function visitFunctionCallArguments(traverse, node, path, state) {\n\n utils.catchup(node.callee.range[0], state);\n traverse(node.callee, [node].concat(path), state);\n\n var args = node['arguments'];\n for (var index = 0; index < args.length; ++index) {\n utils.catchup(args[index].range[0], state);\n traverse(args[index], [node].concat(path), state);\n utils.catchup(args[index].range[1], state);\n }\n\n // delete first comma between the last argument and the closing parenthesis\n utils.catchup(node.range[1], state, function(value) {\n return value.replace(\",\", '');\n });\n\n return false;\n}", "visit(){\n\t\tif(!this.parent || this.parent.content)\n\t\t\treturn this.convert(...arguments)\n\t}", "function callFunctionBody(expr) {\n return (\n '(function f() {\\n'\n + 'Object.defineProperties(arguments, {1: { writable: false },\\n'\n + ' 2: { configurable: false },\\n'\n + ' 3: { writable: false,\\n'\n + ' configurable: false }});\\n'\n + 'return (' + expr + ');\\n'\n + '})(0, 1, 2, 3);');\n}", "function Call(args, caller, index) {\n this.args = args; // the arguments\n this.caller = caller;\n this.index = index;\n}", "function call_name(n) {\n if (n.children[0].type === IDENTIFIER) {\n return n.children[0].value\n }\n if (n.children[0].type === DOT) {\n return n.children[0].children[1].value\n }\n throw new Error('Can not find name of function called')\n}", "function parseFunctionCall(name) {\n var token, args = [];\n\n token = lexer.next();\n if (!matchOp(token, '(')) {\n throw new SyntaxError('Expecting ( in a function call \"' + name + '\"');\n }\n\n token = lexer.peek();\n if (!matchOp(token, ')')) {\n args = parseArgumentList();\n }\n\n token = lexer.next();\n if (!matchOp(token, ')')) {\n throw new SyntaxError('Expecting ) in a function call \"' + name + '\"');\n }\n\n return {\n 'FunctionCall' : {\n 'name': name,\n 'args': args\n }\n };\n }", "function Expr() {}", "ParenthesizedExpression() {\n this._eat('(');\n const expression = this.Expression();\n this._eat(')');\n return expression;\n }", "function Expression() {\n AddExpression();\n if (currentClass() == RELATIONAL_OPERATOR || currentClass() == LOGICAL_OPERATOR) {\n nextToken();\n Expression();\n return;\n }\n return;\n }", "function maybe_call(expr) {\n expr = expr();\n return is_punc(\"(\") ? parse_call(expr) : expr;\n }", "function hzCallMethodArgs(object, prop, argsArray) {\n\t\tconst seqExp = hzCallMethod(object, prop);\n\t\tseqExp.expressions[0].argument.callee.property.name = \"callMethodArgs\";\n\t\tseqExp.expressions[0].argument.arguments.push(t.arrayExpression(argsArray));\n\t\treturn seqExp;\n\t}", "enterCallValue(ctx) {\n\t}", "function markTailCall(expr) {\n\t\tif (expr.type === \"CallExpression\") {\n\t\t\texpr.isTailCall = true;\n\t\t} else if (expr.type === \"SequenceExpression\" && expr.expressions.length > 0) {\n\t\t\treturn markTailCall(expr.expressions[expr.expressions.length - 1]);\n\t\t} else if (expr.type === \"LogicalExpression\") {\n\t\t\tif (expr.operator === \"&&\" || expr.operator === \"||\")\n\t\t\t\treturn markTailCall(expr.right);\n\t\t} else if (expr.type === \"ConditionalExpression\") {\n\t\t\tmarkTailCall(expr.consequent);\n\t\t\treturn markTailCall(expr.alternate);\n\t\t}\n\t}", "visitNode(node) { }", "parseExpression() {\n return this.maybeCall(() => {\n return this.maybeBinary(this.parseAtom(), 0);\n });\n }", "function getSuperCallAtGivenIndex(ctor, index) {\n if (!ctor.body) {\n return undefined;\n }\n var statements = ctor.body.statements;\n if (!statements || index >= statements.length) {\n return undefined;\n }\n var statement = statements[index];\n if (statement.kind === 202 /* ExpressionStatement */) {\n return ts.isSuperCallExpression(statement.expression) ? statement : undefined;\n }\n }", "function getEffectiveCallArguments(node) {\n var args;\n if (node.kind === 176 /* TaggedTemplateExpression */) {\n var template = node.template;\n args = [undefined];\n if (template.kind === 189 /* TemplateExpression */) {\n ts.forEach(template.templateSpans, function (span) {\n args.push(span.expression);\n });\n }\n }\n else if (node.kind === 143 /* Decorator */) {\n // For a decorator, we return undefined as we will determine\n // the number and types of arguments for a decorator using\n // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below.\n return undefined;\n }\n else {\n args = node.arguments || emptyArray;\n }\n return args;\n }", "function callEvaluator(ctx, writer) {\n var func = member(ctx, writer);\n\n if ( typeof func !== 'function' || !func.__interpolFunction ) {\n if ( ctx.__interpolExports ) {\n return;\n }\n throw new Error(\"Attempting to call an unblessed function\");\n }\n\n var callArgs = [writer];\n for ( var i = 1; i < alen; i++ ) {\n callArgs[i] = args[i](ctx, writer);\n }\n\n return func.apply(null, callArgs);\n }", "function call(label)\n{\n if (typeof novel.subs[label] != 'undefined')\n {\n novel.callStack.push(novel.frame);\n novel.frame = novel.subs[label];\n }\n}", "function isFunctionHadBeenCalled(path) {\n let node = path.node || path;\n let result = [];\n // console.log(node.callee);\n try {\n if (node.type === 'CallExpression') {\n \n // console.log(node.type, '----> isFunctionHadBeenCalled')\n // 1. for fn() / await fn() / () => fn()\n if (node.callee.type === 'Identifier') {\n setResult(node.callee, result);\n }\n\n // 2. for jsx: onClick={a.bind(this, 1)} \n // for: this.hello()\n // onClick={a.bind(this, fn)} fn 函数作为参数暂时检测不了\n // a.b() 暂不支持\n // 因为一般 a = {b: fn} b 暂时检测不了是函数\n if (\n node.callee &&\n node.callee.type === 'MemberExpression'\n ) {\n const object = node.callee.object;\n // a.bind(null, args)\n if (object.type === 'Identifier') {\n setResult(object, result);\n } else if (object.type === 'ThisExpression') {\n // this.hello()\n setResult(node.callee.property, result);\n }\n }\n\n // for a(arguments)\n if (node.arguments.length > 0) {\n node.arguments.forEach(item => {\n handleData(item, result);\n })\n }\n } \n\n // return argument\n if (node.type === 'ReturnStatement') {\n handleData(node.argument, result);\n }\n\n // 3. for jsx: onClick={a} / onClick={this.hello()}\n if (\n node.type === 'JSXExpressionContainer' &&\n node.expression \n ) {\n const expression = node.expression;\n // onClick={a}\n if (expression.type === 'Identifier') {\n setResult(expression, result);\n } else if (expression.type === 'MemberExpression') {\n const object = expression.object;\n if (object.type === 'ThisExpression') {\n // onClick={this.hello()}\n setResult(expression.property, result);\n }\n }\n }\n\n // const a = {fn} || const a = [fn]\n if (\n node.type === 'ObjectExpression' || \n node.type === 'ArrayExpression'\n ) {\n handleData(node, result);\n }\n\n if (result.length > 0) {\n result.forEach(item => eventEmitter.emit(FUNCTION_CALL, item));\n }\n } catch (error) {\n console.log('isFunctionHadBeenCalled catch error:');\n console.log(error);\n }\n}", "function processExpression(node, context, \n\t// some expressions like v-slot props & v-for aliases should be parsed as\n\t// function params\n\tasParams = false, \n\t// v-on handler values may contain multiple statements\n\tasRawStatements = false) {\n\t {\n\t return node;\n\t }\n\t}", "compileMethodCallSelfPointer(opts) {\nif ((opts.selfPointerStackOffset !== false) || !this.getMakeMethodCall(opts.identifier)) {\nreturn;\n}\n// It's a method call...\nthis._scope.incStackOffset();\n// Save the self pointer of the object on the stack.\n// This value is passed to CompileCall.compile from the compileProcCall method in this class.\nif (this._selfPointerStackOffset === false) {\nthis._scope.incStackOffset();\nthis._selfPointerStackOffset = this._scope.getStackOffset();\n}\nhelper.saveSelfPointerToLocal(this._program, this._selfPointerStackOffset, opts.reg);\n}", "function Component_CallSceneInterpreter() {\n Component_CallSceneInterpreter.__super__.constructor.apply(this, arguments);\n }", "function Component_CallSceneInterpreter() {\n Component_CallSceneInterpreter.__super__.constructor.apply(this, arguments);\n }", "function evaluate(expression, callback) {\n\t\tif (_callFrames) {\n\t\t\tInspector.Debugger.evaluateOnCallFrame(_callFrames[0].callFrameId, expression, callback);\n\t\t} else {\n\t\t\tInspector.Runtime.evaluate(expression, callback);\n\t\t}\n\t}", "function hzCallArgs(name, argsArray) {\n\t\tconst seqExp = hzCall(name);\n\t\tseqExp.expressions[0].argument.callee.property.name = \"callArgs\";\n\t\tseqExp.expressions[0].argument.arguments.push(t.arrayExpression(argsArray));\n\t\treturn seqExp;\n\t}", "function process(tpl,state) {\n\tconst t = tpl.t, v = tpl.v, r = state.r;\n\tconst d = state.depth;\n\t// reset WS every time\n\tconst ws = state.ws;\n\tconst hasTag = state.hasTag;\n\t//console.log(t,v,ws,hasTag);\n\tstate.ws = false;\n\tstate.hasTag = 0;\n\t//console.log(t,v,tpl.o);\n\tif(t == 1) {\n\t\tif(v == 1) {\n\t\t\tconst last = r.lastChild();\n\t\t\tif(last && last.t === 2 && last.v == 2) {\n\t\t\t\t// 1. mark call\n\t\t\t\tstate.call[d] = true;\n\t\t\t\t//console.log(\"opencall\",d,_strip(r.peek()));\n\t\t\t\t// nest entire tree\n\t\t\t\t// 2. push comma\n\t\t\t\t// TODO add original position to comma\n\t\t\t\tr.mark(\"call\"+d).push(comma());\n\t\t\t} else {\n\t\t\t\tconst cur = r.peek();\n\t\t\t\tif(v == 1 && cur.t !== 6 && cur.t !== 10 && !(cur.t == 4 && (cur.v < 300 || cur.v > 2000))) {\n\t\t\t\t\t//console.log(cur.t,cur.v,cur.o);\n\t\t\t\t\tr.push(seq());\n\t\t\t\t}\n\t\t\t\tr.open(tpl);\n\t\t\t}\n\t\t} else if(v == 3 && state.xml) {\n\t\t\tr.open(tpl);\n\t\t} else {\n\t\t\tr.open(tpl);\n\t\t}\n\t} else if(t == 2) {\n\t\t// FIXME treat all infix-ops in same depth, not just on close\n\t\tstate.r.push(tpl).close();\n\t\tconst cd = d - 1;\n\t\tif(state.call[cd]) {\n\t\t\t// $(x)(2) => call($(x),2)\n\t\t\tstate.call[cd] = false;\n\t\t\t//console.log(\"call\",r.peek());\n\t\t\tr.unmark(\"call\"+cd).insertBefore(openParen()).openBefore({t:6,v:\"call\"}).close();\n\t\t}\n\t\t/*\n\t\t* 1 * 2 + 3\n\t\t* mult(1,2) + 3\n\t\t* 1 + 2 * 3\n\t\t* add(1,2) * 3 => pre, so nest in last\n\t\t* add(1,2 * 3))\n\t\t* add(1,mult(2,3)) => pre, so next in last (we're in subs, so openBefore )\n\t\t */\n\t\tif(state.infix[d]) {\n\t\t\t//console.log(\"peek-close\",_strip(r.peek()));\n\t\t\t// mark close so we can return to it\n\t\t\tr.mark(\"close\");\n\t\t\thandleInfix(state,d);\n\t\t\tr.unmark(\"close\");\n\t\t\tstate.infix[d] = null;\n\t\t}\n\t} else if(t == 4){\n\t\tif(v == 802 || v == 904 || v == 2005) {\n\t\t\tconst last = r.peek();\n\t\t\tconst test = last && (last.o || last.v);\n\t\t\tconst isEmpty = x => x && Triply.nextSibling(Triply.firstChild(x)) == Triply.lastChild(x);\n\t\t\tif(test && ((simpleTypes.includes(test) && isEmpty(last)) || complexTypes.includes(test) || kinds.includes(test))) {\n\t\t\t\ttpl.o = opMap[ v + 3000];\n\t\t\t\tstate.r.insertAfter(closeParen()).movePreviousSibling().insertBefore(openParen()).openBefore(tpl);\n\t\t\t\treturn state;\n\t\t\t} else if(last.t == 1 && last.v == 1) {\n\t\t\t\tconst prev = r.previous();\n\t\t\t\tconst test = prev && prev.o;\n\t\t\t\tif(test && complexTypes.includes(test)) {\n\t\t\t\t\tif(test == \"function\") {\n\t\t\t\t\t\t// convert function(*) to function((...),item()*)\n\t\t\t\t\t\tstate.r.push(seq()).open(openParen())\n\t\t\t\t\t\t\t.push({t:4,o:\"rest-params\"}).open(openParen()).push(closeParen()).close()\n\t\t\t\t\t\t\t.push(closeParen()).close().push(closeParen()).close()\n\t\t\t\t\t\t\t.push({t:4,o:\"any\"}).open(openParen()).push({t:4,o:\"item\"}).open(openParen()).push(closeParen()).close()\n\t\t\t\t\t\t\t.push(closeParen()).close();\n\t\t\t\t\t}\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(v == 505 && hasTag) {\n\t\t\t// TODO replace with tag and flag XML at depth\n\t\t\tr.pop();\n\t\t\tconst qname = state.qname;\n\t\t\tstate.qname = null;\n\t\t\tif(hasTag == 1) {\n\t\t\t\tr.push(openTag(qname,state.attrs));\n\t\t\t\tstate.xml++;\n\t\t\t\tstate.attrs = [];\n\t\t\t} else if(hasTag == 3 || hasTag == 6) {\n\t\t\t\tr.push(closeTag(qname));//.close();\n\t\t\t}\n\t\t\tstate.infix[d]--;\n\t\t\treturn state;\n\t\t} else if(v == 1901) {\n\t\t\tconst last = r.peek();\n\t\t\tif(last.t == 4 && last.v == 507) {\n\t\t\t\t// close tag\n\t\t\t\tif(hasTag) {\n\t\t\t\t\tconst qname = state.qname;\n\t\t\t\t\tr.pop();\n\t\t\t\t\tr.push(openTag(qname,state.attrs));\n\t\t\t\t\tr.push(tpl);\n\t\t\t\t\tstate.attrs = [];\n\t\t\t\t}\n\t\t\t\tstate.hasTag = hasTag + 2;\n\t\t\t\treturn state;\n\t\t\t}\n\t\t} else if(v == 2600) {\n\t\t\tconst prev = r.previousSibling();\n\t\t\tif(prev && prev.t == 1 && prev.v == 3) {\n\t\t\t\tprev.v += 2000;\n\t\t\t}\n\t\t\tconst last = r.peek(1);\n\t\t\tr.pop();\n\t\t\ttpl.o = last.v;\n\t\t} else if(v == 509 && hasTag == 5) {\n\t\t\t// NOTE treat attrs as pairs\n\t\t\tstate.hasTag = hasTag + 1;\n\t\t\treturn state;\n\t\t}\n\t\tif(v == 119 || v == 2005) {\n\t\t\tif(opMap.hasOwnProperty(v)) tpl.o = opMap[v];\n\t\t\tr.push(tpl).open(openParen()).push(closeParen()).close();\n\t\t} else if(v >= 300 && v < 2000) {\n\t\t\t// NOTE always add prefix to distinguish between infix operators and equivalent functions\n\t\t\tconst last = r.peek();\n\t\t\tconst unaryOp = (v == 801 || v == 802) && (!last || !last.t || last.t == 1 || last.t == 4);\n\t\t\tconst v1 = unaryOp ? v + 900 : v;\n\t\t\ttpl.v = v1;\n\t\t\tconst mappedOp = opMap.hasOwnProperty(v1) ? opMap[v1] : \"n:\"+tpl.o;\n\t\t\ttpl.o = mappedOp;\n\t\t\tr.push(tpl);\n\t\t\tif(!state.infix[d]) state.infix[d] = 0;\n\t\t\tr.mark(d+\":\"+state.infix[d]++);\n\t\t} else {\n\t\t\tr.push(tpl);\n\t\t}\n\t} else if(t == 6) {\n\t\tif(/^\\$/.test(v)) {\n\t\t\t// var\n\t\t\ttpl.v = v.replace(/^\\$/,\"\");\n\t\t\tif(/[0-9]/.test(tpl.v)) tpl.t = 8;\n\t\t\tr.push({t:10,v:\"$\",o:\"$\"}).open(openParen()).push(tpl).push(closeParen()).close();\n\t\t} else {\n\t\t\tconst last = r.peek();\n\t\t\tif(last.t == 4 && last.v == 507 && !ws) {\n\t\t\t\tstate.qname = v;\n\t\t\t\tstate.hasTag = hasTag + 1;\n\t\t\t\treturn state;\n\t\t\t} else if(hasTag == 4) {\n\t\t\t\tstate.hasTag = hasTag + 1;\n\t\t\t\tif(!state.attrs) state.attrs = [];\n\t\t\t\tstate.attrs.push([v]);\n\t\t\t} else {\n\t\t\t\tr.push(tpl);\n\t\t\t}\n\t\t}\n\t} else if(t === 0) {\n\t\tr.push(tpl);\n\t\tif(state.infix[d]) {\n\t\t\t// mark close so we can return to it\n\t\t\tr.mark(\"EOS\");\n\t\t\thandleInfix(state,d);\n\t\t\tr.unmark(\"EOS\");\n\t\t\tstate.infix[d] = null;\n\t\t}\n\t} else if(t === 17){\n\t\t// mark WS\n\t\tstate.ws = true;\n\t\tif(hasTag) state.hasTag = 4;\n\t} else {\n\t\tif(hasTag == 6) {\n\t\t\tstate.attrs.lastItem.push(v);\n\t\t\tstate.hasTag = 1;\n\t\t} else {\n\t\t\tr.push(tpl);\n\t\t}\n\t}\n\tstate.depth = tpl.d;\n\treturn state;\n}", "function ExpressionBlock(){ return ListNode.apply(this,arguments) }", "function superCall(context,methodName){var args=zrUtil.slice(arguments,2);return this.superClass.prototype[methodName].apply(context,args);}", "compileFn(fn, args) {\n\n // apply each argument values to registers\n for (let i = 0; i < args.length; i++) {\n\n let registerIndex = this.registerIndices[i]\n\n // if argument is an array (function call), solve it first\n if (Array.isArray(args[i])) {\n // save current state\n for (let idx = 0; idx < this.registerIndices.length; idx++) {\n this.emit(`push ${this.registerIndices[idx]}`)\n }\n // solve\n this.compileFn(args[i][0], args[i].slice(1))\n // restore state\n for (let idx = this.registerIndices.length - 1; idx >= 0; idx--) {\n this.emit(`pop ${this.registerIndices[idx]}`)\n }\n // apply value from function output\n this.emit(`mov ${registerIndex}, rax`)\n\n // else if the argument is a value apply directly to register\n } else {\n this.emit(`mov ${registerIndex}, ${args[i]}`) // move number in register\n }\n }\n\n // call the function\n this.emit(`call ${this.functions[fn] || fn}`)\n }", "function gSmethodCall(item,methodName,values) {\n\n //console.log('Going!->'+methodName);\n //console.log('Values!->'+values);\n if (gSconsoleInfo && console) {\n console.log('[INFO] gSmethodCall ('+item+').'+methodName+ ' params:'+values);\n }\n\n if (typeof(item)=='string' && methodName=='split') {\n return item.tokenize(values[0]);\n }\n if (typeof(item)=='string' && methodName=='length') {\n return item.length;\n }\n if ((item instanceof Array) && methodName=='join') {\n if (values.size()>0) {\n return item.gSjoin(values[0]);\n } else {\n return item.gSjoin();\n }\n }\n /*if (typeof(item)=='number' && methodName=='times') {\n return (item).times(values[0]);\n }*/\n\n if (!gShasFunc(item,methodName)) {\n\n //console.log('Not Going! '+methodName+ ' - '+item);\n //var nameProperty = methodName.charAt(3).toLowerCase() + methodName.slice(4);\n //var res = function () { return item[nameProperty];}\n //return res;\n\n if (methodName.startsWith('get') || methodName.startsWith('set')) {\n var varName = methodName.charAt(3).toLowerCase() + methodName.slice(4);\n var properties = item.getProperties();\n if (properties.contains(varName)) {\n if (methodName.startsWith('get')) {\n return gSgetProperty(item,varName);\n } else {\n return gSsetProperty(item,varName,values[0]);\n }\n\n }\n }\n\n //Check newInstance\n if (methodName=='newInstance') {\n return item();\n } else {\n\n //Lets check if in any category we have the static method\n if (gScategories.length > 0) {\n var whereExecutes = gScategorySearching(methodName);\n if (whereExecutes!=null) {\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n //Lets check in mixins classes\n if (gSmixins.length>0) {\n var whereExecutes = gSmixinSearching(item,methodName);\n if (whereExecutes!=null) {\n //console.log('Where!'+whereExecutes[methodName]+' - '+item);\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n //Lets check in mixins objects\n if (gSmixinsObjects.length>0) {\n var whereExecutes = gSmixinObjectsSearching(item,methodName);\n if (whereExecutes!=null) {\n //console.log('Where!'+whereExecutes[methodName]+' - '+item);\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n\n //Lets check in delegate\n if (gSactualDelegate!=null && gSactualDelegate[methodName]!=undefined) {\n return gSactualDelegate[methodName].apply(item,values);\n }\n if (gSactualDelegate!=null && item['methodMissing']==undefined\n && gSactualDelegate['methodMissing']!=undefined) {\n return gSmethodCall(gSactualDelegate,methodName,values);\n }\n\n if (item['methodMissing']) {\n\n return item['methodMissing'](methodName,values);\n\n } else {\n\n //Maybe there is a function in the script with the name of the method\n //In Node.js 'this.xxFunction()' in the main context fails\n if (typeof eval(methodName)==='function') {\n return eval(methodName).apply(this,values);\n }\n\n //Not exist the method, throw exception\n throw 'gSmethodCall Method '+ methodName + ' not exist in '+item;\n }\n }\n\n } else {\n var f = item[methodName];\n return f.apply(item,values);\n }\n}", "value(...args) {\n return [...this][methodName](...args);\n }", "function extractFunctionCalls(node, sourceFile, indentLevel) {\n // e.g `function hello()`\n if (ts.isFunctionDeclaration(node)) {\n node.forEachChild(function (child) {\n if (ts.isIdentifier(child)) {\n var declaredFunction = child.getText(sourceFile);\n updateDeclaredFunctions(declaredFunction);\n }\n });\n }\n // First child must be `Identifier`\n // examples of what gets skipped: `fs.readFile('lol.json')` or `ipc.on('something', () => {})`\n if (ts.isCallExpression(node)) {\n var child = node.getChildAt(0, sourceFile);\n if (ts.isIdentifier(child)) {\n var calledFunction = child.getText(sourceFile);\n updateCalledFunctions(calledFunction);\n }\n }\n // logNode(node, sourceFile, indentLevel);\n node.forEachChild(function (child) { return extractFunctionCalls(child, sourceFile, indentLevel + 1); });\n}", "visit(visitor){\n if (visitor.before) {\n visitor.before.call(visitor, this);\n }\n if (visitor.after) {\n visitor.after.call(visitor, this);\n }\n }", "function renderConciseMethod(traverse, property, path, state) {\n if (property.computed) {\n var closingSquareBracketIndex = state.g.source.indexOf(']', property.key.range[1]);\n utils.catchup(closingSquareBracketIndex, state);\n utils.move(closingSquareBracketIndex + 1, state);\n }\n utils.append(\"function\" + (property.value.generator ? \"*\" : \"\"), state);\n path.unshift(property);\n traverse(property.value, path, state);\n path.shift();\n}", "handler(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n }", "constructor() {\n this.TAG = 'Call';\n this.MAP = [\n 'timeStamp',\n 'typeCall',\n 'profile_image',\n 'targetName',\n 'keepAlive',\n 'isLeader',\n 'name',\n 'id_user',\n 'sessionId',\n 'deviceCallId',\n 'target',\n 'videoHours',\n 'agoraIoSupport',\n 'agoraIoSupportReturn',\n ];\n\n this.isIncomingCall = this.isIncomingCall.bind(this);\n }", "_callMethod(service, call) {\n const services = ContainerBuilder.getServiceConditionals(call[1]);\n\n for (const service of services) {\n if (! this.has(service)) {\n return;\n }\n }\n\n call = getCallableFromArray([ service, call[0] ]);\n call.apply(service, this._resolveServices(this.parameterBag.unescapeValue(this.parameterBag.resolveValue(call[1]))));\n }", "Evaluate() {}", "operator(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n }", "function node() {\n invoke(this);\n }", "function method(d, b, clazz, obj, meth, arglist)\n {\n // Sometimes ignore our arguments\n if (rnd(10) == 0)\n arglist = [];\n\n // Stuff in extra arguments\n while (rnd(2))\n arglist.push(val(d, b));\n\n // Emit a method call expression\n switch (rnd(4)) {\n case 0: return clazz + \".prototype.\" + meth + \".apply(\" + obj + \", [\" + arglist.join(\", \") + \"])\";\n case 1: return clazz + \".prototype.\" + meth + \".call(\" + [obj].concat(arglist).join(\", \") + \")\";\n default: return obj + \".\" + meth + \"(\" + arglist.join(\", \") + \")\";\n }\n }", "function method(d, b, clazz, obj, meth, arglist)\n {\n // Sometimes ignore our arguments\n if (rnd(10) == 0)\n arglist = [];\n\n // Stuff in extra arguments\n while (rnd(2))\n arglist.push(val(d, b));\n\n // Emit a method call expression\n switch (rnd(4)) {\n case 0: return clazz + \".prototype.\" + meth + \".apply(\" + obj + \", [\" + arglist.join(\", \") + \"])\";\n case 1: return clazz + \".prototype.\" + meth + \".call(\" + [obj].concat(arglist).join(\", \") + \")\";\n default: return obj + \".\" + meth + \"(\" + arglist.join(\", \") + \")\";\n }\n }", "function method(d, b, clazz, obj, meth, arglist)\n {\n // Sometimes ignore our arguments\n if (rnd(10) == 0)\n arglist = [];\n\n // Stuff in extra arguments\n while (rnd(2))\n arglist.push(val(d, b));\n\n // Emit a method call expression\n switch (rnd(4)) {\n case 0: return clazz + \".prototype.\" + meth + \".apply(\" + obj + \", [\" + arglist.join(\", \") + \"])\";\n case 1: return clazz + \".prototype.\" + meth + \".call(\" + [obj].concat(arglist).join(\", \") + \")\";\n default: return obj + \".\" + meth + \"(\" + arglist.join(\", \") + \")\";\n }\n }", "function method(d, b, clazz, obj, meth, arglist)\n {\n // Sometimes ignore our arguments\n if (rnd(10) == 0)\n arglist = [];\n\n // Stuff in extra arguments\n while (rnd(2))\n arglist.push(val(d, b));\n\n // Emit a method call expression\n switch (rnd(4)) {\n case 0: return clazz + \".prototype.\" + meth + \".apply(\" + obj + \", [\" + arglist.join(\", \") + \"])\";\n case 1: return clazz + \".prototype.\" + meth + \".call(\" + [obj].concat(arglist).join(\", \") + \")\";\n default: return obj + \".\" + meth + \"(\" + arglist.join(\", \") + \")\";\n }\n }", "function method(d, b, clazz, obj, meth, arglist)\n {\n // Sometimes ignore our arguments\n if (rnd(10) == 0)\n arglist = [];\n\n // Stuff in extra arguments\n while (rnd(2))\n arglist.push(val(d, b));\n\n // Emit a method call expression\n switch (rnd(4)) {\n case 0: return clazz + \".prototype.\" + meth + \".apply(\" + obj + \", [\" + arglist.join(\", \") + \"])\";\n case 1: return clazz + \".prototype.\" + meth + \".call(\" + [obj].concat(arglist).join(\", \") + \")\";\n default: return obj + \".\" + meth + \"(\" + arglist.join(\", \") + \")\";\n }\n }", "function ParenthesizedExpression(node, print) {\n this.push(\"(\");\n print.plain(node.expression);\n this.push(\")\");\n}", "function Call({\n handle,\n params,\n hash\n}) {\n return [op(0\n /* PushFrame */\n ), op('SimpleArgs', {\n params,\n hash,\n atNames: false\n }), op(16\n /* Helper */\n , handle), op(1\n /* PopFrame */\n ), op(35\n /* Fetch */\n , $v0)];\n}", "functioncall() {\n return (\"Function called!\")\n }", "event(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n }", "function ParenthesizedExpression(node, print) {\n\t this.push(\"(\");\n\t print.plain(node.expression);\n\t this.push(\")\");\n\t}", "function ParenthesizedExpression(node, print) {\n\t this.push(\"(\");\n\t print.plain(node.expression);\n\t this.push(\")\");\n\t}", "function visitCarnaval (mList){\n for(var i =0 , num = mList.length ; i<num ; i++ ) {\n // mList[i]();\n mList[i].call();\n }\n}", "function CALL(state) {\n var fn = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'CALL[]', fn);\n }\n\n // saves callers program\n var cip = state.ip;\n var cprog = state.prog;\n\n state.prog = state.funcs[fn];\n\n // executes the function\n exec(state);\n\n // restores the callers program\n state.ip = cip;\n state.prog = cprog;\n\n if (exports.DEBUG) {\n console.log(++state.step, 'returning from', fn);\n }\n }", "funcArguments () {\n let args = [];\n let ch = this.next('(');\n\n while (ch) {\n ch = this.white();\n if (ch === ')') {\n this.next(')');\n return new Arguments(this, args)\n } else {\n args.push(this.expression());\n ch = this.white();\n }\n if (ch !== ')') { this.next(','); }\n }\n\n this.error('Bad arguments to function');\n }", "function getCalleeName(call) {\n if (ts.isIdentifier(call.expression)) {\n return call.expression.text;\n }\n if (ts.isPropertyAccessExpression(call.expression)) {\n return call.expression.name.text;\n }\n return null;\n }", "function Decorator(node, print) {\n\t this.push(\"@\");\n\t print.plain(node.expression);\n\t this.newline();\n\t}", "function Decorator(node, print) {\n\t this.push(\"@\");\n\t print.plain(node.expression);\n\t this.newline();\n\t}" ]
[ "0.7055646", "0.7055646", "0.6912887", "0.6781301", "0.67125803", "0.67125803", "0.6670544", "0.6592914", "0.6406094", "0.62578416", "0.6112439", "0.61092705", "0.6025362", "0.5993078", "0.5987108", "0.59021384", "0.58816135", "0.58739346", "0.58288455", "0.5779929", "0.5742681", "0.5643774", "0.5618888", "0.5618308", "0.56124765", "0.56027776", "0.56027776", "0.55301464", "0.55288917", "0.55288917", "0.55288917", "0.55274093", "0.54256755", "0.53777844", "0.5349735", "0.5334332", "0.5334332", "0.5334332", "0.5331962", "0.52963555", "0.52792186", "0.5277063", "0.5277063", "0.52598846", "0.52571297", "0.523687", "0.52277154", "0.5168629", "0.5146965", "0.5133822", "0.51269966", "0.5117633", "0.5111598", "0.50886", "0.5087743", "0.5087459", "0.5066739", "0.5049598", "0.50463873", "0.504405", "0.5004791", "0.4980569", "0.49762285", "0.4973161", "0.49709547", "0.49709547", "0.49703205", "0.49636632", "0.4954325", "0.49531913", "0.49514633", "0.4938563", "0.49340013", "0.49226376", "0.4917785", "0.49137768", "0.49090865", "0.48894617", "0.48884386", "0.48830888", "0.4882076", "0.4879309", "0.48747784", "0.48592508", "0.48592508", "0.48592508", "0.48592508", "0.48592508", "0.48574594", "0.4849813", "0.48492664", "0.48469418", "0.4846854", "0.4846854", "0.48437262", "0.48369876", "0.4835558", "0.4835411", "0.48249117", "0.48249117" ]
0.76877934
0
Visit optional member expression.
OptionalMemberExpression(node) { this.visit(node.object); if (node.computed) { this.visit(node.property); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMemberOptional(node) {\n switch (node.type) {\n case utils_1.AST_NODE_TYPES.TSPropertySignature:\n case utils_1.AST_NODE_TYPES.TSMethodSignature:\n case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:\n case utils_1.AST_NODE_TYPES.PropertyDefinition:\n case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:\n case utils_1.AST_NODE_TYPES.MethodDefinition:\n return !!node.optional;\n }\n return false;\n}", "OptionalCallExpression(node) {\n this.visitTypeParameters(node);\n this.visit(node.callee);\n node.arguments.forEach(this.visit, this);\n }", "function getOptional(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.optionalEnd);pos = token.optionalEnd + 1;return newNode(NodeType.OptionalType,content,line,column);}", "function isOptionalOptionalCallExpression(node) {\n return (node.type === ts_estree_1.AST_NODE_TYPES.OptionalCallExpression &&\n // this flag means the call expression itself is option\n // i.e. it is foo.bar?.() and not foo?.bar()\n node.optional);\n}", "function OptionalDecorator() { }", "function OptionalDecorator() { }", "function OptionalDecorator() {}", "function OptionalDecorator() {}", "function OptionalDecorator() {}", "function optionalidentifier(fnparam, prop, preserve) {\n if (!state.tokens.next.identifier) {\n return;\n }\n \n if (!preserve) {\n advance();\n }\n \n var curr = state.tokens.curr;\n var val = state.tokens.curr.value;\n \n if (!isReserved(curr)) {\n return val;\n }\n \n if (prop) {\n if (state.inES5()) {\n return val;\n }\n }\n \n if (fnparam && val === \"undefined\") {\n return val;\n }\n \n warning(\"W024\", state.tokens.curr, state.tokens.curr.id);\n return val;\n }", "get optional() {\n return this._optional;\n }", "function MemberExpression(node, print) {\n\t var obj = node.object;\n\t print.plain(obj);\n\n\t if (!node.computed && t.isMemberExpression(node.property)) {\n\t throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n\t }\n\n\t var computed = node.computed;\n\t if (t.isLiteral(node.property) && _lodashLangIsNumber2[\"default\"](node.property.value)) {\n\t computed = true;\n\t }\n\n\t if (computed) {\n\t this.push(\"[\");\n\t print.plain(node.property);\n\t this.push(\"]\");\n\t } else {\n\t if (t.isLiteral(node.object)) {\n\t var val = this._Literal(node.object);\n\t if (_isInteger2[\"default\"](+val) && !SCIENTIFIC_NOTATION.test(val) && !this.endsWith(\".\")) {\n\t this.push(\".\");\n\t }\n\t }\n\n\t this.push(\".\");\n\t print.plain(node.property);\n\t }\n\t}", "function OptionalDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function MemberExpression(node, print) {\n var obj = node.object;\n print.plain(obj);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n var computed = node.computed;\n if (t.isLiteral(node.property) && _lodashLangIsNumber2[\"default\"](node.property.value)) {\n computed = true;\n }\n\n if (computed) {\n this.push(\"[\");\n print.plain(node.property);\n this.push(\"]\");\n } else {\n if (t.isLiteral(node.object)) {\n var val = this._Literal(node.object);\n if (_isInteger2[\"default\"](+val) && !ZERO_DECIMAL_INTEGER.test(val) && !SCIENTIFIC_NOTATION.test(val) && !this.endsWith(\".\") && !NON_DECIMAL_NUMERIC_LITERAL.test(val)) {\n this.push(\".\");\n }\n }\n\n this.push(\".\");\n print.plain(node.property);\n }\n}", "function MemberExpression(node, print) {\n\t var obj = node.object;\n\t print.plain(obj);\n\n\t if (!node.computed && t.isMemberExpression(node.property)) {\n\t throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n\t }\n\n\t var computed = node.computed;\n\t if (t.isLiteral(node.property) && _lodashLangIsNumber2[\"default\"](node.property.value)) {\n\t computed = true;\n\t }\n\n\t if (computed) {\n\t this.push(\"[\");\n\t print.plain(node.property);\n\t this.push(\"]\");\n\t } else {\n\t if (t.isLiteral(node.object)) {\n\t var val = this._Literal(node.object);\n\t if (_isInteger2[\"default\"](+val) && !ZERO_DECIMAL_INTEGER.test(val) && !SCIENTIFIC_NOTATION.test(val) && !this.endsWith(\".\") && !NON_DECIMAL_NUMERIC_LITERAL.test(val)) {\n\t this.push(\".\");\n\t }\n\t }\n\n\t this.push(\".\");\n\t print.plain(node.property);\n\t }\n\t}", "Optional(item) {\r\n return { ...item, modifier: exports.OptionalModifier };\r\n }", "function appendToMemberExpression(member /*: Object*/, append /*: Object*/, computed /*:: ?: boolean*/) /*: Object*/ {\n\t member.object = t.memberExpression(member.object, member.property, member.computed);\n\t member.property = append;\n\t member.computed = !!computed;\n\t return member;\n\t}", "function JSXMemberExpression(node, print) {\n\t print.plain(node.object);\n\t this.push(\".\");\n\t print.plain(node.property);\n\t}", "function JSXMemberExpression(node, print) {\n\t print.plain(node.object);\n\t this.push(\".\");\n\t print.plain(node.property);\n\t}", "function isOptionalOptionalChain(node) {\n return (node.type === experimental_utils_1.AST_NODE_TYPES.OptionalCallExpression &&\n // this flag means the call expression itself is option\n // i.e. it is foo.bar?.() and not foo?.bar()\n node.optional);\n}", "function JSXMemberExpression(node, print) {\n print.plain(node.object);\n this.push(\".\");\n print.plain(node.property);\n}", "function appendToMemberExpression(member, append, computed) {\n\t member.object = t.memberExpression(member.object, member.property, member.computed);\n\t member.property = append;\n\t member.computed = !!computed;\n\t return member;\n\t}", "function appendToMemberExpression(member, append, computed) {\n\t member.object = t.memberExpression(member.object, member.property, member.computed);\n\t member.property = append;\n\t member.computed = !!computed;\n\t return member;\n\t}", "function appendToMemberExpression(member, append, computed) {\n\t member.object = t.memberExpression(member.object, member.property, member.computed);\n\t member.property = append;\n\t member.computed = !!computed;\n\t return member;\n\t}", "function appendToMemberExpression(member, append, computed) {\n\t member.object = t.memberExpression(member.object, member.property, member.computed);\n\t member.property = append;\n\t member.computed = !!computed;\n\t return member;\n\t}", "function parseEnumMember() {\n var node = createNode(255 /* EnumMember */, scanner.getStartPos());\n node.name = parsePropertyName();\n node.initializer = allowInAnd(parseNonParameterInitializer);\n return finishNode(node);\n }", "function appendToMemberExpression(member, append, computed) {\n member.object = t.memberExpression(member.object, member.property, member.computed);\n member.property = append;\n member.computed = !!computed;\n return member;\n}", "function appendToMemberExpression(member, append, computed) {\n member.object = t.memberExpression(member.object, member.property, member.computed);\n member.property = append;\n member.computed = !!computed;\n return member;\n}", "function optional(p) {\n var p = toParser(p);\n var pid = parser_id++;\n return function(state) {\n var savedState = state;\n var cached = savedState.getCached(pid);\n if(cached)\n return cached;\n var r = p(state);\n cached = r || make_result(state, \"\", false);\n savedState.putCached(pid, cached);\n return cached;\n }\n}", "function checkMemberExpression(node) {\n // we dont care about x.y, only x[y]\n if (!node.computed) {\n return;\n }\n\n if (node.property.type === \"SequenceExpression\") {\n context.report(node, \"Using a comma operator in an index may be misleading. Multidimensional indecies do not use commas.\");\n }\n }", "function optional(S) {\n return new Struct({\n type: `${S.type}?`,\n schema: S.schema,\n validator: (value, ctx) => {\n return value === undefined || ctx.check(value, S);\n }\n });\n}", "function optional(S) {\n return new Struct({\n type: `${S.type}?`,\n schema: S.schema,\n validator: (value, ctx) => {\n return value === undefined || ctx.check(value, S);\n }\n });\n}", "function buildMatchMemberExpression(match, allowPartial) {\n var parts = match.split(\".\");\n\n return function (member) {\n // not a member expression\n if (!t.isMemberExpression(member)) return false;\n\n var search = [member];\n var i = 0;\n\n while (search.length) {\n var node = search.shift();\n\n if (allowPartial && i === parts.length) {\n return true;\n }\n\n if (t.isIdentifier(node)) {\n // this part doesn't match\n if (parts[i] !== node.name) return false;\n } else if (t.isLiteral(node)) {\n // this part doesn't match\n if (parts[i] !== node.value) return false;\n } else if (t.isMemberExpression(node)) {\n if (node.computed && !t.isLiteral(node.property)) {\n // we can't deal with this\n return false;\n } else {\n search.push(node.object);\n search.push(node.property);\n continue;\n }\n } else {\n // we can't deal with this\n return false;\n }\n\n // too many parts\n if (++i > parts.length) {\n return false;\n }\n }\n\n return true;\n };\n}", "function optional(validator) {\n var res = function (val) {\n return val === undefined || validator(val);\n };\n res.assert = function (val) {\n if (val !== undefined) {\n (0, assert_1.default)(validator)(val);\n }\n };\n res.schema = 'optional(' + (0, schema_1.default)(validator) + ')';\n return res;\n}", "parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }", "function buildMatchMemberExpression(match, allowPartial) {\n var parts = match.split(\".\");\n\n return function (member) {\n // not a member expression\n if (!t.isMemberExpression(member)) return false;\n\n var search = [member];\n var i = 0;\n\n while (search.length) {\n var node = search.shift();\n\n if (allowPartial && i === parts.length) {\n return true;\n }\n\n if (t.isIdentifier(node)) {\n // this part doesn't match\n if (parts[i] !== node.name) return false;\n } else if (t.isStringLiteral(node)) {\n // this part doesn't match\n if (parts[i] !== node.value) return false;\n } else if (t.isMemberExpression(node)) {\n if (node.computed && !t.isStringLiteral(node.property)) {\n // we can't deal with this\n return false;\n } else {\n search.push(node.object);\n search.push(node.property);\n continue;\n }\n } else {\n // we can't deal with this\n return false;\n }\n\n // too many parts\n if (++i > parts.length) {\n return false;\n }\n }\n\n return true;\n };\n}", "function buildMatchMemberExpression(match, allowPartial) {\n\t var parts = match.split(\".\");\n\n\t return function (member) {\n\t // not a member expression\n\t if (!t.isMemberExpression(member)) return false;\n\n\t var search = [member];\n\t var i = 0;\n\n\t while (search.length) {\n\t var node = search.shift();\n\n\t if (allowPartial && i === parts.length) {\n\t return true;\n\t }\n\n\t if (t.isIdentifier(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.name) return false;\n\t } else if (t.isLiteral(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.value) return false;\n\t } else if (t.isMemberExpression(node)) {\n\t if (node.computed && !t.isLiteral(node.property)) {\n\t // we can't deal with this\n\t return false;\n\t } else {\n\t search.push(node.object);\n\t search.push(node.property);\n\t continue;\n\t }\n\t } else {\n\t // we can't deal with this\n\t return false;\n\t }\n\n\t // too many parts\n\t if (++i > parts.length) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t };\n\t}", "function buildMatchMemberExpression(match, allowPartial) {\n\t var parts = match.split(\".\");\n\n\t return function (member) {\n\t // not a member expression\n\t if (!t.isMemberExpression(member)) return false;\n\n\t var search = [member];\n\t var i = 0;\n\n\t while (search.length) {\n\t var node = search.shift();\n\n\t if (allowPartial && i === parts.length) {\n\t return true;\n\t }\n\n\t if (t.isIdentifier(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.name) return false;\n\t } else if (t.isLiteral(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.value) return false;\n\t } else if (t.isMemberExpression(node)) {\n\t if (node.computed && !t.isLiteral(node.property)) {\n\t // we can't deal with this\n\t return false;\n\t } else {\n\t search.push(node.object);\n\t search.push(node.property);\n\t continue;\n\t }\n\t } else {\n\t // we can't deal with this\n\t return false;\n\t }\n\n\t // too many parts\n\t if (++i > parts.length) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t };\n\t}", "expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }", "function expectOptionalToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "function expectOptionalToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "function expectOptionalToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "function expectOptionalToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "function expresrionPars(node) {\n if(node.right==null && node.left==null) {\n // if(node.type=='MemberExpression')\n // return memberExpressionValue(node);\n // else\n return expresionValue(node);\n }\n else if(node.right!=null && node.left!=null) {\n return expresrionPars(node.left)+ node.operator + expresrionPars(node.right);\n }\n\n}", "function buildMatchMemberExpression(match, allowPartial) {\n\t var parts = match.split(\".\");\n\n\t return function (member) {\n\t // not a member expression\n\t if (!t.isMemberExpression(member)) return false;\n\n\t var search = [member];\n\t var i = 0;\n\n\t while (search.length) {\n\t var node = search.shift();\n\n\t if (allowPartial && i === parts.length) {\n\t return true;\n\t }\n\n\t if (t.isIdentifier(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.name) return false;\n\t } else if (t.isStringLiteral(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.value) return false;\n\t } else if (t.isMemberExpression(node)) {\n\t if (node.computed && !t.isStringLiteral(node.property)) {\n\t // we can't deal with this\n\t return false;\n\t } else {\n\t search.push(node.object);\n\t search.push(node.property);\n\t continue;\n\t }\n\t } else {\n\t // we can't deal with this\n\t return false;\n\t }\n\n\t // too many parts\n\t if (++i > parts.length) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t };\n\t}", "function buildMatchMemberExpression(match, allowPartial) {\n\t var parts = match.split(\".\");\n\n\t return function (member) {\n\t // not a member expression\n\t if (!t.isMemberExpression(member)) return false;\n\n\t var search = [member];\n\t var i = 0;\n\n\t while (search.length) {\n\t var node = search.shift();\n\n\t if (allowPartial && i === parts.length) {\n\t return true;\n\t }\n\n\t if (t.isIdentifier(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.name) return false;\n\t } else if (t.isStringLiteral(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.value) return false;\n\t } else if (t.isMemberExpression(node)) {\n\t if (node.computed && !t.isStringLiteral(node.property)) {\n\t // we can't deal with this\n\t return false;\n\t } else {\n\t search.push(node.object);\n\t search.push(node.property);\n\t continue;\n\t }\n\t } else {\n\t // we can't deal with this\n\t return false;\n\t }\n\n\t // too many parts\n\t if (++i > parts.length) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t };\n\t}", "function _isOptionalChaining(context) {\n var expr = context.expr;\n if (\n expr.charCodeAt(context.index) === QUMARK_CODE &&\n expr.charCodeAt(context.index + 1) === PERIOD_CODE &&\n !_isDecimalDigit(expr.charCodeAt(context.index + 2))\n ) {\n return true;\n }\n return false;\n }", "function OptionalVector() {\n if (currentClass() == IDENTIFIER) {\n if (isAssignmentHappening) {\n let currentIdData = symbolTable.deepSearchSymbol(currentToken());\n // CHECK ASSIGNMENT TYPE\n if (currentIdData['type'] !== currentAssignmentType) {\n const error = `Linha: ${currentLine()}: Atribuição inválida. Tipo de símbolo de origem [${currentIdData['id']}][${currentIdData['type']}] diferente do de destino ${currentAssignmentId}[${currentAssignmentType}].`;\n semanticAnalyzer.insert(error);\n }\n }\n\n currentId = currentToken();\n nextToken();\n VectorIndex();\n return;\n } else {\n let errorMessage = \"Recebido tipo não esperado: \" + currentClass();\n handleError(errorMessage);\n recovery(\";\");\n return;\n }\n }", "parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }", "function expectOptionalKeyword(lexer, value) {\n var token = lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "function validateOptionalArgType(functionName,type,position,argument){if(argument!==undefined){validateArgType(functionName,type,position,argument);}}", "function optionalNonCapturingGroup(xs) {\n return requiredNonCapturingGroup (xs) + '?';\n }", "get asOptional() {\n return optional(this.get, this.set)\n }", "function optional(transformer, opts) {\n\t if (transformer.metadata.optional && !_lodashCollectionIncludes2[\"default\"](opts.optional, transformer.key)) return false;\n\t}", "function optional(transformer, opts) {\n\t if (transformer.metadata.optional && !_lodashCollectionIncludes2[\"default\"](opts.optional, transformer.key)) return false;\n\t}", "function Member(obj) {\n return obj.first && obj.last && obj.sex;\n}", "function expectOptionalKeyword(lexer, value) {\n var token = lexer.token;\n\n if (token.kind === _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "function expectOptionalKeyword(lexer, value) {\n var token = lexer.token;\n\n if (token.kind === _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n\n return undefined;\n}", "expectOptionalKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }", "function buildMatchMemberExpression(match /*:string*/, allowPartial /*:: ?: boolean*/) /*: Function*/ {\n\t var parts = match.split(\".\");\n\n\t return function (member) {\n\t // not a member expression\n\t if (!t.isMemberExpression(member)) return false;\n\n\t var search = [member];\n\t var i = 0;\n\n\t while (search.length) {\n\t var node = search.shift();\n\n\t if (allowPartial && i === parts.length) {\n\t return true;\n\t }\n\n\t if (t.isIdentifier(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.name) return false;\n\t } else if (t.isStringLiteral(node)) {\n\t // this part doesn't match\n\t if (parts[i] !== node.value) return false;\n\t } else if (t.isMemberExpression(node)) {\n\t if (node.computed && !t.isStringLiteral(node.property)) {\n\t // we can't deal with this\n\t return false;\n\t } else {\n\t search.push(node.object);\n\t search.push(node.property);\n\t continue;\n\t }\n\t } else {\n\t // we can't deal with this\n\t return false;\n\t }\n\n\t // too many parts\n\t if (++i > parts.length) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t };\n\t}", "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, TokenKind.EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, TokenKind.PIPE));\n }\n\n return types;\n}", "function optional(transformer, opts) {\n if (transformer.metadata.optional && !_lodashCollectionIncludes2[\"default\"](opts.optional, transformer.key)) return false;\n}", "function calcMemberExpression(env, node) {\n let object = calcExpression(env, node.object);\n if (!object) {\n return undefined;\n }\n if (node.computed) {\n\n }\n let property = node.computed ? calcExpression(env, node.property) : node.property.name;\n return object[property];\n}", "function validateNode(node) {\n return [\n node.type === \"AssignmentExpression\" && node.left.type === \"MemberExpression\"\n ];\n}", "function maybeModifier (predicate) {\n\t return function () {\n\t if (!check.defined(arguments[0]) || check.nulled(arguments[0])) {\n\t return true\n\t }\n\t return predicate.apply(null, arguments)\n\t }\n\t }", "function internalProperty(options){return property({attribute:false,hasChanged:options===null||options===void 0?void 0:options.hasChanged});}", "function expectOptionalKeyword(lexer, value) {\n var token = lexer.token;\n\n if (token.kind === _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME && token.value === value) {\n lexer.advance();\n return true;\n }\n\n return false;\n}", "vfel_parseExpressionOnly() {\n\t\t\tvar node = this.startNodeAt(this.start, this.startLoc);\n\t\t\tthis.expect(tt.vfelExpressionStart); // consuming '{!'\n\t\t\tthis.inMergeField = true;\n\t\t\tnode.value = this.parseMaybeAssign();\n\t\t\tthis.inMergeField = false;\n\t\t\t// consuming '}' without continuing tokenization, basically this.expect(tt.vfelExpressionEnd)\n\t\t\t// but without this.nextToken() in the end\n\t\t\tif (this.type !== tt.vfelExpressionEnd) this.raiseRecoverable('Unterminated VFEL expression');\n\t\t\tif (this.options.onToken) this.options.onToken(new Token(this));\n\t\t\tthis.lastTokEnd = this.end;\n\t\t\tthis.lastTokStart = this.start;\n\t\t\tthis.lastTokEndLoc = this.endLoc;\n\t\t\tthis.lastTokStartLoc = this.startLoc;\n\t\t\treturn this.finishNode(node, 'VFELExpression');\n\t\t}", "parseExpression() {\n return this.maybeCall(() => {\n return this.maybeBinary(this.parseAtom(), 0);\n });\n }", "_addJSDocTypeToMember(node, thisNode) {\n const foundType = this._jsDocDefs.find((typeDef) => {\n const commentEndLine = typeDef.loc.end.line;\n const functionStartLine = node.loc.start.line;\n\n return functionStartLine === commentEndLine + 1;\n });\n\n if (foundType) {\n const type = (foundType.value.match(JSDOC_MEMBER_REGEX) || [])[1] || 'any';\n node.tdType = new TDType(type);\n\n if (thisNode && thisNode.tdType) {\n thisNode.tdType.addPropertyOrMethod(node.property.name, node.tdType.typeString);\n }\n }\n }", "function parseUnionMembers(parser) {\n var members = [];\n do {\n members.push(parseNamedType(parser));\n } while (skip(parser, _lexer.TokenKind.PIPE));\n return members;\n}", "ReadonlyOptional(item) {\r\n return { ...item, modifier: exports.ReadonlyOptionalModifier };\r\n }", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n }", "function validateNamedOptionalType(functionName,type,optionName,argument){if(argument!==undefined){validateNamedType(functionName,type,optionName,argument);}}", "function parseMember(object, member, parseArgs={}) {\n\t\n\t//debug(\"Parsing member \"+dispTokens(member)+\" of object \"+dispTokens(object));\n\t\n\tvar name = member[0].text;\n\t//debug(\"name = \"+name);\n\tvar args = [];\n\tif (member.length > 1 && member[1].text === '(') {\n\t\targs = splitTokens(member.slice(2, member.length-1), \",\");\n\t}\n\t\n\tif (name.length === 1 && name >= 'A' && name <= 'Z') {\n\t\treturn tows(\"_playerVar\", valueFuncKw)+\"(\"+parse(object)+\", \"+name+\")\";\n\t} else if (name === \"append\") {\n\t\tif (parseArgs.isWholeInstruction === true) {\n\t\t\treturn parseAssignment(object, args[0], true, \"_appendToArray\");\n\t\t\t\n\t\t} else {\n\t\t\treturn tows(\"_appendToArray\", valueFuncKw)+\"(\"+parse(object)+\", \"+parse(args[0])+\")\";\n\t\t}\n\t\t\n\t} else if (object[0].text === \"Button\") {\n\t\treturn tows(\"Button.\"+name, buttonKw);\n\t\t\n\t} else if (object[0].text === \"Clip\") {\n\t\treturn tows(\"Clip.\"+name, clipKw);\n\t\t\n\t} else if (object[0].text === \"Color\") {\n\t\treturn tows(\"Color.\"+name, colorKw);\n\t\t\n\t} else if (object[0].text === \"Comms\") {\n\t\treturn tows(\"Comms.\"+name, commsKw);\n\t\t\n\t} else if (object[0].text === \"Effect\") {\n\t\treturn tows(\"Effect.\"+name, effectKw.concat(playEffectKw));\n\t\t\n\t} else if (name === \"exclude\") {\n\t\treturn tows(\"_removeFromArray\", valueFuncKw)+\"(\"+parse(object)+\", \"+parse(args[0])+\")\";\n\t\t\n\t} else if (name === \"format\") {\n\t\tformatArgs = args;\n\t\tvar result = parseString(tokenizeString(object[0].text.substring(1, object[0].text.length-1)));\n\t\tformatArgs = [];\n\t\treturn result;\n\t\t\n\t} else if (name === \"getHitPosition\") {\n\t\treturn parse(object, {raycastType:\"getHitPosition\"});\n\t\t\n\t} else if (name === \"getNormal\") {\n\t\treturn parse(object, {raycastType:\"getNormal\"});\n\t\t\n\t} else if (name === \"getPlayerHit\") {\n\t\treturn parse(object, {raycastType:\"getPlayerHit\"});\n\t\t\n\t} else if (name === \"hasLoS\") {\n\t\treturn parse(object, {raycastType:\"hasLoS\"});\n\t\t\n\t} else if (object[0].text === \"Hero\") {\n\t\treturn tows(\"_hero\", valueFuncKw)+\"(\"+tows(\"Hero.\"+name, heroKw)+\")\";\n\t\t\n\t} else if (object[0].text === \"Icon\") {\n\t\treturn tows(\"Icon.\"+name, iconKw);\n\t\t\n\t} else if (object[0].text === \"Impulse\") {\n\t\treturn tows(\"Impulse.\"+name, impulseKw);\n\t\t\n\t} else if (object[0].text === \"Invis\") {\n\t\treturn tows(\"Invis.\"+name, invisKw);\n\t\t\n\t} else if (name === \"index\") {\n\t\treturn tows(\"_indexOfArrayValue\", valueFuncKw)+\"(\"+parse(object)+\", \"+parse(args[0])+\")\";\n\t\t\n\t} else if (object[0].text === \"LosCheck\") {\n\t\treturn tows(\"LosCheck.\"+name, losCheckKw);\n\t\t\n\t} else if (object[0].text === \"Position\") {\n\t\treturn tows(\"Position.\"+name, positionKw);\n\t\t\n\t} else if (object[0].text === \"random\" && object.length === 1) {\n\t\tif (name === \"randint\" || name === \"uniform\") {\n\t\t\treturn tows(\"random.\"+name, valueFuncKw)+\"(\"+parse(args[0])+\", \"+parse(args[1])+\")\";\n\t\t} else if (name === \"shuffle\" || name === \"choice\") {\n\t\t\treturn tows(\"random.\"+name, valueFuncKw)+\"(\"+parse(args[0])+\")\";\n\t\t} else {\n\t\t\terror(\"Unhandled member 'random.\"+name+\"'\");\n\t\t}\n\t\t\n\t} else if (object[0].text === \"Reeval\") {\n\t\treturn tows(\"Reeval.\"+name, reevaluationKw);\n\t\t\n\t} else if (object[0].text === \"Relativity\") {\n\t\treturn tows(\"Relativity.\"+name, relativeKw);\n\t\t\n\t} else if (name === \"remove\") {\n\t\treturn parseAssignment(object, args[0], true, \"_removeFromArrayByValue\");\n\t\t\n\t} else if (name === \"slice\") {\n\t\treturn tows(\"_arraySlice\", valueFuncKw)+\"(\"+parse(object)+\", \"+parse(args[0])+\", \"+parse(args[1])+\")\";\n\t\t\n\t} else if (object[0].text === \"Status\") {\n\t\treturn tows(\"Status.\"+name, statusKw);\n\t\t\n\t} else if (object[0].text === \"Team\") {\n\t\treturn tows(\"Team.\"+name, teamKw);\n\t\t\n\t} else if (object[0].text === \"Transform\") {\n\t\treturn tows(\"Transform.\"+name, transformationKw);\n\t\t\n\t} else if (object[0].text === \"Vector\") {\n\t\treturn tows(\"Vector.\"+name, valueFuncKw);\n\t\t\n\t} else if (object[0].text === \"Wait\") {\n\t\treturn tows(\"Wait.\"+name, waitKw);\n\t\t\n\t} else if (name === \"x\") {\n\t\treturn tows(\"_xComponentOf\", valueFuncKw)+\"(\"+parse(object)+\")\";\n\t} else if (name === \"y\") {\n\t\treturn tows(\"_yComponentOf\", valueFuncKw)+\"(\"+parse(object)+\")\";\n\t} else if (name === \"z\") {\n\t\treturn tows(\"_zComponentOf\", valueFuncKw)+\"(\"+parse(object)+\")\";\n\t} else {\n\t\t\n\t\t//Check for player function\n\t\ttry {\n\t\t\tvar translation = tows(\"_&\"+name, funcKw);\n\t\t} catch (Error) {\n\t\t\terror(\"Unhandled member \", member[0]);\n\t\t}\n\t\t\n\t\tvar result = translation+\"(\"+parse(object);\n\t\tfor (var i = 0; i < args.length; i++) {\n\t\t\tresult += \", \"+parse(args[i]);\n\t\t}\n\t\tresult += \")\";\n\t\treturn result;\n\t}\n\t\n\terror(\"This shouldn't happen\");\n\t\n}", "reflectMember(node, kind, decorators, isStatic) {\n let value = null;\n let name = null;\n let nameNode = null;\n if (!isClassMemberType(node)) {\n return null;\n }\n if (isStatic && isPropertyAccess(node)) {\n name = node.name.text;\n value = kind === ClassMemberKind.Property ? node.parent.right : null;\n }\n else if (isThisAssignment(node)) {\n kind = ClassMemberKind.Property;\n name = node.left.name.text;\n value = node.right;\n isStatic = false;\n }\n else if (ts.isConstructorDeclaration(node)) {\n kind = ClassMemberKind.Constructor;\n name = 'constructor';\n isStatic = false;\n }\n if (kind === null) {\n this.logger.warn(`Unknown member type: \"${node.getText()}`);\n return null;\n }\n if (!name) {\n if (isNamedDeclaration(node)) {\n name = node.name.text;\n nameNode = node.name;\n }\n else {\n return null;\n }\n }\n // If we have still not determined if this is a static or instance member then\n // look for the `static` keyword on the declaration\n if (isStatic === undefined) {\n isStatic = node.modifiers !== undefined &&\n node.modifiers.some(mod => mod.kind === ts.SyntaxKind.StaticKeyword);\n }\n const type = node.type || null;\n return {\n node,\n implementation: node,\n kind,\n type,\n name,\n nameNode,\n value,\n isStatic,\n decorators: decorators || []\n };\n }", "function genTernaryExp(el){return el.once?genOnce(el):genElement(el);}", "function discoverMembers(node, context) {\n var e_1, _a, e_2, _b;\n var _c, _d, _e, _f;\n var ts = context.ts, checker = context.checker;\n // Never pick up members not declared directly on the declaration node being traversed\n if (node.parent !== context.declarationNode) {\n return undefined;\n }\n // static get observedAttributes() { return ['c', 'l']; }\n if (ts.isGetAccessor(node) && hasModifier(node, ts.SyntaxKind.StaticKeyword)) {\n if (node.name.getText() === \"observedAttributes\" && node.body != null) {\n var members = [];\n // Find either the first \"return\" statement or the first \"array literal expression\"\n var arrayLiteralExpression = (_d = (_c = node.body.statements.find(function (statement) { return ts.isReturnStatement(statement); })) === null || _c === void 0 ? void 0 : _c.expression, (_d !== null && _d !== void 0 ? _d : node.body.statements.find(function (statement) { return ts.isArrayLiteralExpression(statement); })));\n if (arrayLiteralExpression != null && ts.isArrayLiteralExpression(arrayLiteralExpression)) {\n try {\n // Emit an attribute for each string literal in the array.\n for (var _g = __values(arrayLiteralExpression.elements), _h = _g.next(); !_h.done; _h = _g.next()) {\n var attrNameNode = _h.value;\n var attrName = ts.isStringLiteralLike(attrNameNode) ? attrNameNode.text : undefined;\n if (attrName == null)\n continue;\n members.push({\n priority: \"medium\",\n member: {\n node: attrNameNode,\n jsDoc: getJsDoc(attrNameNode, ts),\n kind: \"attribute\",\n attrName: attrName,\n type: undefined // () => ({ kind: SimpleTypeKind.ANY } as SimpleType),\n }\n });\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_a = _g.return)) _a.call(_g);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n return members;\n }\n }\n // class { myProp = \"hello\"; }\n else if (ts.isPropertyDeclaration(node) || ts.isPropertySignature(node)) {\n var name_1 = node.name, initializer = node.initializer;\n if (ts.isIdentifier(name_1) || ts.isStringLiteralLike(name_1)) {\n // Find default value based on initializer\n var resolvedDefaultValue = initializer != null ? resolveNodeValue(initializer, context) : undefined;\n var def = resolvedDefaultValue != null ? resolvedDefaultValue.value : (_e = initializer) === null || _e === void 0 ? void 0 : _e.getText();\n return [\n {\n priority: \"high\",\n member: {\n node: node,\n kind: \"property\",\n jsDoc: getJsDoc(node, ts),\n propName: name_1.text,\n type: lazy(function () { return checker.getTypeAtLocation(node); }),\n default: def,\n visibility: getMemberVisibilityFromNode(node, ts),\n modifiers: getModifiersFromNode(node, ts)\n //required: isPropertyRequired(node, context.checker),\n }\n }\n ];\n }\n }\n // class { set myProp(value: string) { ... } }\n else if (ts.isSetAccessor(node) || ts.isGetAccessor(node)) {\n var name_2 = node.name, parameters = node.parameters;\n if (ts.isIdentifier(name_2)) {\n var parameter_1 = ts.isSetAccessor(node) != null && ((_f = parameters) === null || _f === void 0 ? void 0 : _f.length) > 0 ? parameters[0] : undefined;\n return [\n {\n priority: \"high\",\n member: {\n node: node,\n jsDoc: getJsDoc(node, ts),\n kind: \"property\",\n propName: name_2.text,\n type: lazy(function () { return (parameter_1 == null ? context.checker.getTypeAtLocation(node) : context.checker.getTypeAtLocation(parameter_1)); }),\n visibility: getMemberVisibilityFromNode(node, ts),\n modifiers: getModifiersFromNode(node, ts)\n }\n }\n ];\n }\n }\n // constructor { super(); this.title = \"Hello\"; }\n else if (ts.isConstructorDeclaration(node)) {\n if (node.body != null) {\n var assignments = node.body.statements\n .filter(function (stmt) { return ts.isExpressionStatement(stmt); })\n .map(function (stmt) { return stmt.expression; })\n .filter(function (exp) { return ts.isBinaryExpression(exp); });\n var members = [];\n var _loop_1 = function (assignment) {\n var left = assignment.left, right = assignment.right;\n if (ts.isPropertyAccessExpression(left)) {\n if (left.expression.kind === ts.SyntaxKind.ThisKeyword) {\n var propName = left.name.getText();\n var resolvedInitializer = resolveNodeValue(right, context);\n var def = resolvedInitializer != null ? resolvedInitializer.value : undefined; //right.getText();\n members.push({\n priority: \"low\",\n member: {\n node: node,\n kind: \"property\",\n propName: propName,\n default: def,\n type: function () { return relaxType(toSimpleType(checker.getTypeAtLocation(right), checker)); },\n jsDoc: getJsDoc(assignment.parent, ts),\n visibility: isNamePrivate(propName) ? \"private\" : undefined\n }\n });\n }\n }\n };\n try {\n for (var assignments_1 = __values(assignments), assignments_1_1 = assignments_1.next(); !assignments_1_1.done; assignments_1_1 = assignments_1.next()) {\n var assignment = assignments_1_1.value;\n _loop_1(assignment);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (assignments_1_1 && !assignments_1_1.done && (_b = assignments_1.return)) _b.call(assignments_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return members;\n }\n }\n return undefined;\n}", "function parseUnionMembers(parser) {\n\t var members = [];\n\t do {\n\t members.push(parseNamedType(parser));\n\t } while (skip(parser, _lexer.TokenKind.PIPE));\n\t return members;\n\t}", "function optimiseMemberExpression(parent, offset) {\n if (offset === 0) return;\n\n var newExpr;\n var prop = parent.property;\n\n if (t.isLiteral(prop)) {\n prop.value += offset;\n prop.raw = String(prop.value);\n } else {\n // // UnaryExpression, BinaryExpression\n newExpr = t.binaryExpression(\"+\", prop, t.literal(offset));\n parent.property = newExpr;\n }\n}", "function optional(arg, fallback) {\n return (arg !== void 0) ? arg : fallback;\n}", "optional(condition, optionalMiddleware) {\n return this.use(getOptionalMiddleware(condition, optionalMiddleware));\n }", "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n }\n\n return types;\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function optimiseMemberExpression(parent, offset) {\n\t if (offset === 0) return;\n\n\t var newExpr;\n\t var prop = parent.property;\n\n\t if (t.isLiteral(prop)) {\n\t prop.value += offset;\n\t prop.raw = String(prop.value);\n\t } else {\n\t // // UnaryExpression, BinaryExpression\n\t newExpr = t.binaryExpression(\"+\", prop, t.literal(offset));\n\t parent.property = newExpr;\n\t }\n\t}", "function optimiseMemberExpression(parent, offset) {\n\t if (offset === 0) return;\n\n\t var newExpr;\n\t var prop = parent.property;\n\n\t if (t.isLiteral(prop)) {\n\t prop.value += offset;\n\t prop.raw = String(prop.value);\n\t } else {\n\t // // UnaryExpression, BinaryExpression\n\t newExpr = t.binaryExpression(\"+\", prop, t.literal(offset));\n\t parent.property = newExpr;\n\t }\n\t}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function getMemberDefinition(spaces, fieldName, val) {\n if (fieldName === undefined) {\n return '';\n }\n return '\\n' + spaces + fieldName + '?:' + getType(val) + ';';\n}", "function AcceptMaybeParam(may) {}", "function genTernaryExp (el) {\n\t return el.once ? genOnce(el) : genElement(el)\n\t }", "function genTernaryExp (el) {\n\t return el.once ? genOnce(el) : genElement(el)\n\t }", "function genTernaryExp (el) {\n\t return el.once ? genOnce(el) : genElement(el)\n\t }" ]
[ "0.72638094", "0.60792464", "0.575961", "0.5671042", "0.5537067", "0.5537067", "0.5438472", "0.5438472", "0.5438472", "0.52460855", "0.5189921", "0.51878893", "0.51337385", "0.5067663", "0.5032017", "0.50065076", "0.5001416", "0.49751812", "0.49751812", "0.49579543", "0.49163398", "0.49069658", "0.49069658", "0.49069658", "0.49069658", "0.49052995", "0.48910403", "0.48910403", "0.48315716", "0.4827004", "0.48211876", "0.48211876", "0.47629952", "0.47606003", "0.47457922", "0.47377768", "0.47257236", "0.47257236", "0.47175848", "0.47018406", "0.47018406", "0.47018406", "0.47018406", "0.4697763", "0.46945673", "0.46945673", "0.46752727", "0.46699685", "0.463571", "0.46226504", "0.46131423", "0.4594358", "0.45874876", "0.45740908", "0.45740908", "0.45327914", "0.4504751", "0.4504751", "0.44730386", "0.44507024", "0.44476172", "0.44474196", "0.44086167", "0.44054776", "0.44007427", "0.4394304", "0.43860412", "0.43755132", "0.43624973", "0.4360069", "0.43576866", "0.4349692", "0.4340811", "0.43269414", "0.43250975", "0.43231094", "0.431192", "0.43089896", "0.42982337", "0.42883295", "0.42855382", "0.4283033", "0.4279155", "0.4271506", "0.4260517", "0.4260517", "0.4260517", "0.4260517", "0.4260517", "0.4260517", "0.42576537", "0.42576537", "0.42538548", "0.42538548", "0.42538548", "0.4241125", "0.42160547", "0.42114377", "0.42114377", "0.42114377" ]
0.82389426
0
Visit optional call expression.
OptionalCallExpression(node) { this.visitTypeParameters(node); this.visit(node.callee); node.arguments.forEach(this.visit, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOptionalOptionalCallExpression(node) {\n return (node.type === ts_estree_1.AST_NODE_TYPES.OptionalCallExpression &&\n // this flag means the call expression itself is option\n // i.e. it is foo.bar?.() and not foo?.bar()\n node.optional);\n}", "function parseNoCallExpr() {\n const startTokenIndex = state.tokens.length;\n parseExprAtom();\n parseSubscripts(startTokenIndex, true);\n}", "function isOptionalOptionalChain(node) {\n return (node.type === experimental_utils_1.AST_NODE_TYPES.OptionalCallExpression &&\n // this flag means the call expression itself is option\n // i.e. it is foo.bar?.() and not foo?.bar()\n node.optional);\n}", "function maybe_call(expr) {\n expr = expr();\n return is_punc(\"(\") ? parse_call(expr) : expr;\n }", "OptionalMemberExpression(node) {\n this.visit(node.object);\n if (node.computed) {\n this.visit(node.property);\n }\n }", "CallExpression(node) {\n this.visitTypeParameters(node);\n this.visit(node.callee);\n node.arguments.forEach(this.visit, this);\n }", "isImplicitCall(): boolean {\n if (this.args.length === 0 || this.args[0].node.virtual) {\n return false;\n }\n let searchStart = this.fn.outerEnd;\n let searchEnd = this.args[0].outerStart;\n return this.indexOfSourceTokenBetweenSourceIndicesMatching(\n searchStart, searchEnd, token => token.type === SourceType.CALL_START) === null;\n }", "function isCallExpression(node) {\n return node.kind === ts.SyntaxKind.CallExpression;\n}", "function read_expression_call() {\n debug(2, \"read_expression_call\", inspect(state.ctt));\n var ast = ast_new(\"call-expr\");\n\n ast.callee = read_member_expression();\n\n if (is_error(ast.callee)) {\n return ast.callee;\n }\n\n if (!test(\"(\")) {\n return ast.callee; // return just the member expression, there is no call\n }\n\n ast.arguments = read_many([\n read_arguments,\n read_property_access,\n read_index_access\n ], \"unpexpected\", true);\n\n if (is_error(ast.arguments)) {\n return ast.arguments;\n }\n\n return ast_end(ast);\n}", "function optional(p) {\n var p = toParser(p);\n var pid = parser_id++;\n return function(state) {\n var savedState = state;\n var cached = savedState.getCached(pid);\n if(cached)\n return cached;\n var r = p(state);\n cached = r || make_result(state, \"\", false);\n savedState.putCached(pid, cached);\n return cached;\n }\n}", "function OptionalDecorator() {}", "function OptionalDecorator() {}", "function OptionalDecorator() {}", "parseCall(func) {\n // set context for handling brackets inside of arguments\n // this.currentNode = { type: \"call\" };\n const expr = {\n type: \"call\",\n func: func,\n primitive: this.isPrimitiveFunc(func.value),\n args: this.delimited(\"(\", \")\", \",\", this.parseExpression.bind(this)),\n };\n\n return this.maybeArrayIndexing(expr, () => {\n return expr;\n });\n }", "function OptionalDecorator() { }", "function OptionalDecorator() { }", "function CallExpression(node, print) {\n print.plain(node.callee);\n\n this.push(\"(\");\n\n var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact;\n\n var separator;\n if (isPrettyCall) {\n separator = \",\\n\";\n this.newline();\n this.indent();\n }\n\n print.list(node.arguments, { separator: separator });\n\n if (isPrettyCall) {\n this.newline();\n this.dedent();\n }\n\n this.push(\")\");\n}", "function CallExpression() {\n return resolveCall(this.get(\"callee\"));\n}", "function CallExpression(node, print) {\n\t print.plain(node.callee);\n\n\t this.push(\"(\");\n\n\t var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact;\n\n\t var separator;\n\t if (isPrettyCall) {\n\t separator = \",\\n\";\n\t this.newline();\n\t this.indent();\n\t }\n\n\t print.list(node.arguments, { separator: separator });\n\n\t if (isPrettyCall) {\n\t this.newline();\n\t this.dedent();\n\t }\n\n\t this.push(\")\");\n\t}", "function CallExpression(node, print) {\n\t print.plain(node.callee);\n\n\t this.push(\"(\");\n\n\t var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact;\n\n\t var separator;\n\t if (isPrettyCall) {\n\t separator = \",\\n\";\n\t this.newline();\n\t this.indent();\n\t }\n\n\t print.list(node.arguments, { separator: separator });\n\n\t if (isPrettyCall) {\n\t this.newline();\n\t this.dedent();\n\t }\n\n\t this.push(\")\");\n\t}", "function validateOptionalArgType(functionName,type,position,argument){if(argument!==undefined){validateArgType(functionName,type,position,argument);}}", "function OptionalDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function CallExpression() {\n\t return resolveCall(this.get(\"callee\"));\n\t}", "function CallExpression() {\n\t return resolveCall(this.get(\"callee\"));\n\t}", "function optional(a = 1, b = 1) {\n console.log(\"a+b\", a + b)\n}", "function _isOptionalChaining(context) {\n var expr = context.expr;\n if (\n expr.charCodeAt(context.index) === QUMARK_CODE &&\n expr.charCodeAt(context.index + 1) === PERIOD_CODE &&\n !_isDecimalDigit(expr.charCodeAt(context.index + 2))\n ) {\n return true;\n }\n return false;\n }", "convertToNormalCall(): BabelNodeCallExpression {\n const {moduleName, node, t} = this;\n if (node.arguments.length !== 1) {\n throw errorAt(\n node,\n `Expected ${moduleName}.c to have exactly 1 argument. ${node.arguments.length} was given.`,\n );\n }\n\n const text = normalizeSpaces(\n expandStringConcat(moduleName, node.arguments[0]).value,\n ).trim();\n\n const desc = FbtCommon.getDesc(text);\n if (desc == null || desc === '') {\n throw errorAt(\n node,\n FbtCommon.getUnknownCommonStringErrorMessage(moduleName, text),\n );\n }\n\n const callNode = t.callExpression(t.identifier(moduleName), [\n t.stringLiteral(text),\n t.stringLiteral(desc),\n t.objectExpression([\n t.objectProperty(t.identifier(CommonOption), t.booleanLiteral(true)),\n ]),\n ]);\n\n callNode.loc = node.loc;\n return callNode;\n }", "parseExpression() {\n return this.maybeCall(() => {\n return this.maybeBinary(this.parseAtom(), 0);\n });\n }", "function markTailCall(expr) {\n\t\tif (expr.type === \"CallExpression\") {\n\t\t\texpr.isTailCall = true;\n\t\t} else if (expr.type === \"SequenceExpression\" && expr.expressions.length > 0) {\n\t\t\treturn markTailCall(expr.expressions[expr.expressions.length - 1]);\n\t\t} else if (expr.type === \"LogicalExpression\") {\n\t\t\tif (expr.operator === \"&&\" || expr.operator === \"||\")\n\t\t\t\treturn markTailCall(expr.right);\n\t\t} else if (expr.type === \"ConditionalExpression\") {\n\t\t\tmarkTailCall(expr.consequent);\n\t\t\treturn markTailCall(expr.alternate);\n\t\t}\n\t}", "function evaluateCallExpression({ node, environment, evaluate, statementTraversalStack, typescript, logger }) {\n const evaluatedArgs = [];\n for (let i = 0; i < node.arguments.length; i++) {\n evaluatedArgs[i] = evaluate.expression(node.arguments[i], environment, statementTraversalStack);\n }\n // Evaluate the expression\n const expressionResult = evaluate.expression(node.expression, environment, statementTraversalStack);\n if (isLazyCall(expressionResult)) {\n const currentThisBinding = expressionContainsSuperKeyword(node.expression, typescript) ? getFromLexicalEnvironment(node, environment, THIS_SYMBOL) : undefined;\n const value = expressionResult.invoke(currentThisBinding != null ? currentThisBinding.literal : undefined, ...evaluatedArgs);\n logger.logResult(value, \"CallExpression\");\n return value;\n }\n // Otherwise, assume that the expression still needs calling\n else {\n // Unless optional chaining is being used, throw a NotCallableError\n if (node.questionDotToken == null && typeof expressionResult !== \"function\") {\n throw new NotCallableError({ value: expressionResult, node: node.expression });\n }\n const value = typeof expressionResult !== \"function\" ? undefined : expressionResult(...evaluatedArgs);\n logger.logResult(value, \"CallExpression\");\n return value;\n }\n}", "function isLongCurriedCallExpression( path ) {\n\tconst node = path.getValue();\n\tconst parent = path.getParentNode();\n\treturn isCallOrOptionalCallExpression( node ) && isCallOrOptionalCallExpression( parent ) && parent.callee === node && node.arguments.length > parent.arguments.length && parent.arguments.length > 0;\n}", "function optArguments_ES6(...args){\n const err=args.shift();\n const callback=(typeof args[args.length-1]=='function')? args.pop() : null;\n const optionalA=(args.length>0) ? args.shift() : null;\n const optionalB=(args.length>0)? args.shift(): null;\n\n if(err && callback) return callback(err);\n\n console.log('optionalA:', optionalA);\n console.log('optionalB:', optionalB);\n console.log('callback:', callback);\n \t }", "function ruleFuncCall() {\n\tvar node = null;\n\tvar tmp;\n\n\tif (accept(\"LX_ID\") && _lex[0].name == \"LX_LPAREN\") {\n\t node = {name:\"LX_FUNCALL\", children:[{name:_curr.name, val:_curr.val}]};\n\t shift();\n\t shift();\n\t if ((tmp = ruleAssign())) {\n\t\tnode.children.push(tmp);\n\t\twhile (accept(\"LX_COMMA\") && shift()) {\n\t\t if (!(tmp = ruleAssign()))\n\t\t\treturn (false);\n\t\t node.children.push(tmp);\n\t\t}\n\t }\n\t if (!expect(\"LX_RPAREN\") || !shift())\n\t\treturn (false);\n\t}\n\treturn (node);\n }", "function functionCall(stream, a) {\n var name = stream.trypopfuncname(stream, a);\n if (null == name) return null;\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ( ) after function name.');\n var params = [];\n var first = true;\n while (null == stream.trypop(')')) {\n if (!first && null == stream.trypop(','))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected , between arguments of the function.');\n first = false;\n var param = orExpr(stream, a);\n if (param == null)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression as argument of function.');\n params.push(param);\n }\n return a.node('FunctionCall', name, params);\n }", "function functionCall(stream, a) {\n var name = stream.trypopfuncname(stream, a);\n if (null == name) return null;\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ( ) after function name.');\n var params = [];\n var first = true;\n while (null == stream.trypop(')')) {\n if (!first && null == stream.trypop(','))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected , between arguments of the function.');\n first = false;\n var param = orExpr(stream, a);\n if (param == null)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression as argument of function.');\n params.push(param);\n }\n return a.node('FunctionCall', name, params);\n }", "function _optionalChain(ops) {\n let lastAccessLHS = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] ;\n const fn = ops[i + 1] ;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = fn((...args) => (value ).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n }", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n }", "function zero(operation) {\n\tif(arguments.length === 0){\n\t\treturn 0;\n\t}\n\treturn operation(0);\n}", "function _optionalChain(ops) {\n let lastAccessLHS = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] ;\n const fn = ops[i + 1] ;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = fn((...args) => (value ).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}", "parseExpressionNoBinary() {\n\t\treturn this.maybeCall(() => {\n\t\t\treturn this.parseAtom();\n\t\t});\n\t}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\r\n if (argument !== undefined) {\r\n validateArgType(functionName, type, position, argument);\r\n }\r\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function validateOptionalArgType(functionName, type, position, argument) {\n if (argument !== undefined) {\n validateArgType(functionName, type, position, argument);\n }\n}", "function foo() {\n\tvar a = arguments[0] !== (void 0) ? arguments[0] : 2;\n\tconsole.log( a );\n}", "function _optionalChain(ops) {\n\t let lastAccessLHS = undefined;\n\t let value = ops[0];\n\t let i = 1;\n\t while (i < ops.length) {\n\t const op = ops[i] ;\n\t const fn = ops[i + 1] ;\n\t i += 2;\n\t // by checking for loose equality to `null`, we catch both `null` and `undefined`\n\t if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n\t // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n\t return;\n\t }\n\t if (op === 'access' || op === 'optionalAccess') {\n\t lastAccessLHS = value;\n\t value = fn(value);\n\t } else if (op === 'call' || op === 'optionalCall') {\n\t value = fn((...args) => (value ).call(lastAccessLHS, ...args));\n\t lastAccessLHS = undefined;\n\t }\n\t }\n\t return value;\n\t}", "function isLodashCallExpression(node) {\n return true;\n}", "function buildLookaheadFuncForOptionalProd(occurrence, ruleGrammar, prodType, k, tokenMatcher, tokenClassIdentityFunc, tokenInstanceIdentityFunc, dynamicTokensEnabled) {\n var lookAheadPaths = getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, k);\n return buildSingleAlternativeLookaheadFunction(lookAheadPaths[0], tokenMatcher, tokenClassIdentityFunc, tokenInstanceIdentityFunc, dynamicTokensEnabled);\n}", "function baseParseSubscript(\n startTokenIndex,\n noCalls,\n stopState,\n) {\n if (!noCalls && eat(TokenType.doubleColon)) {\n parseNoCallExpr();\n stopState.stop = true;\n // Propagate startTokenIndex so that `a::b?.()` will keep `a` as the first token. We may want\n // to revisit this in the future when fully supporting bind syntax.\n parseSubscripts(startTokenIndex, noCalls);\n } else if (match(TokenType.questionDot)) {\n state.tokens[startTokenIndex].isOptionalChainStart = true;\n if (noCalls && lookaheadType() === TokenType.parenL) {\n stopState.stop = true;\n return;\n }\n next();\n state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n\n if (eat(TokenType.bracketL)) {\n parseExpression();\n expect(TokenType.bracketR);\n } else if (eat(TokenType.parenL)) {\n parseCallExpressionArguments();\n } else {\n parseMaybePrivateName();\n }\n } else if (eat(TokenType.dot)) {\n state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n parseMaybePrivateName();\n } else if (eat(TokenType.bracketL)) {\n state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n parseExpression();\n expect(TokenType.bracketR);\n } else if (!noCalls && match(TokenType.parenL)) {\n if (atPossibleAsync()) {\n // We see \"async\", but it's possible it's a usage of the name \"async\". Parse as if it's a\n // function call, and if we see an arrow later, backtrack and re-parse as a parameter list.\n const snapshot = state.snapshot();\n const asyncStartTokenIndex = state.tokens.length;\n next();\n state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n\n const callContextId = getNextContextId();\n\n state.tokens[state.tokens.length - 1].contextId = callContextId;\n parseCallExpressionArguments();\n state.tokens[state.tokens.length - 1].contextId = callContextId;\n\n if (shouldParseAsyncArrow()) {\n // We hit an arrow, so backtrack and start again parsing function parameters.\n state.restoreFromSnapshot(snapshot);\n stopState.stop = true;\n state.scopeDepth++;\n\n parseFunctionParams();\n parseAsyncArrowFromCallExpression(asyncStartTokenIndex);\n }\n } else {\n next();\n state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex;\n const callContextId = getNextContextId();\n state.tokens[state.tokens.length - 1].contextId = callContextId;\n parseCallExpressionArguments();\n state.tokens[state.tokens.length - 1].contextId = callContextId;\n }\n } else if (match(TokenType.backQuote)) {\n // Tagged template expression.\n parseTemplate();\n } else {\n stopState.stop = true;\n }\n}", "function chainedInstruction(reference, calls, span) {\n var expression = importExpr(reference, null, span);\n\n if (calls.length > 0) {\n for (var i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n } else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n\n return expression;\n }", "function optionalidentifier(fnparam, prop, preserve) {\n if (!state.tokens.next.identifier) {\n return;\n }\n \n if (!preserve) {\n advance();\n }\n \n var curr = state.tokens.curr;\n var val = state.tokens.curr.value;\n \n if (!isReserved(curr)) {\n return val;\n }\n \n if (prop) {\n if (state.inES5()) {\n return val;\n }\n }\n \n if (fnparam && val === \"undefined\") {\n return val;\n }\n \n warning(\"W024\", state.tokens.curr, state.tokens.curr.id);\n return val;\n }", "function nodeIsObjCall(node) {\n return node.type === 'CallExpression'\n && node.callee.type === 'MemberExpression'\n && node.callee.object\n && (node.callee.object.type === 'Identifier' ||\n node.callee.object.type === 'MemberExpression');\n }", "function opt_FUNCTION(callme) {\r\n\to3_text = (callme ? (typeof callme=='string' ? (/.+\\(.*\\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));\r\n\r\n\treturn 0;\r\n}", "function trailingFunctionArgument(args, includeNoop = true) {\n const callback = util_1.asFunction(util_1.last(args));\n return includeNoop || util_1.isUserFunction(callback) ? callback : undefined;\n}", "function trailingFunctionArgument(args, includeNoop = true) {\n const callback = util_1.asFunction(util_1.last(args));\n return includeNoop || util_1.isUserFunction(callback) ? callback : undefined;\n}", "function f_ext( a, b ) { null.should_not_be_called; return a * 10 + b; }", "async function _asyncOptionalChain(ops) {\n let lastAccessLHS = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] ;\n const fn = ops[i + 1] ;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = await fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = await fn((...args) => (value ).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}", "function unprocessed(exp) {\n\t if (exp.type === 'functionCall'\n\t\t&& exp.function === 'http://ns.inria.fr/sparql-template/process') {\n\t\t return exp.args[0];\n\t } else {\n\t\t return exp;\n\t }\n }", "function getOptional(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.optionalEnd);pos = token.optionalEnd + 1;return newNode(NodeType.OptionalType,content,line,column);}", "function chainedInstruction(reference, calls, span) {\n var expression = importExpr(reference, null, span);\n\n if (calls.length > 0) {\n for (var i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n } else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n\n return expression;\n}", "'CallExpression:exit'(node) {\n if ((0, _utils.isExpectCall)(node) && node.parent.type === _experimentalUtils.AST_NODE_TYPES.ExpressionStatement) {\n context.report({\n messageId: 'noAssertions',\n node\n });\n }\n }", "function parseCall(tokens) {\n\n var identifier = tokens.eat(); // Consume name\n tokens.eat(\"(\"); // Consume left paren\n // Consume arguments\n var args = [];\n while (!tokens.nextIs(\")\")) {\n args.push(tokens.eat());\n }\n tokens.eat(\")\");\n\n return {\n type: \"call\",\n name: identifier,\n arguments: args,\n toString: function () {\n return identifier + \"(\" + args.join(' ') + \")\";\n }\n };\n}", "function transformChainExpression(node) {\n if (node.type === \"CallExpression\") {\n node.type = \"OptionalCallExpression\";\n node.callee = transformChainExpression(node.callee);\n } else if (node.type === \"MemberExpression\") {\n node.type = \"OptionalMemberExpression\";\n node.object = transformChainExpression(node.object);\n }\n // typescript\n else if (node.type === \"TSNonNullExpression\") {\n node.expression = transformChainExpression(node.expression);\n }\n return node;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function addProcessorForOptional(argProcessorList, argName, prompt) {\n addProcessorFor(argProcessorList, argName, prompt, undefined, function() { return true;}, undefined, undefined);\n}", "function optional(arg, fallback) {\n return (arg !== void 0) ? arg : fallback;\n}", "CallExpression (path, { file }) {\n /* determine types of parameters */\n const pp = []\n const np = []\n path.get(\"arguments\").forEach((path) => {\n if (path.isAssignmentExpression() && path.get(\"left\").isIdentifier()) {\n /* assignment expression with an identifier (treated as a named parameter) */\n const name = path.get(\"left\").node.name\n if (np.findIndex((p) => p.get(\"left\").isIdentifier({ name: name })) >= 0)\n throw path.buildCodeFrameError(`named parameter \"${name}\" occurs multiple times`)\n np.push(path)\n }\n else {\n /* other expression */\n pp.push(path)\n }\n })\n\n /* short-circuit processing if there are no named parameters */\n if (np.length === 0)\n return\n\n /* replace the CallExpression with a new one */\n let opts = []\n if (!options.options || !options.caching) {\n if (!options.options)\n opts.push(babel.types.objectProperty(\n babel.types.identifier(\"options\"),\n babel.types.booleanLiteral(false)))\n if (!options.caching)\n opts.push(babel.types.objectProperty(\n babel.types.identifier(\"caching\"),\n babel.types.booleanLiteral(false)))\n opts = [babel.types.objectExpression(opts)]\n }\n path.replaceWith(\n babel.types.callExpression(\n /* the transform function name */\n babel.types.identifier(options.functionName),\n [\n /* the previous context or undefined */\n path.get(\"callee\").isMemberExpression() ?\n path.node.callee.object :\n babel.types.identifier(\"undefined\"),\n\n /* the previous callee */\n path.node.callee,\n\n /* the positional parameters */\n babel.types.arrayExpression(\n pp.map((path) => {\n return path.node\n })\n ),\n\n /* the named parameters */\n babel.types.objectExpression(\n np.map((path) => {\n return babel.types.objectProperty(\n path.get(\"left\").node,\n path.get(\"right\").node\n )\n })\n )\n ].concat(opts)\n )\n )\n\n /* remember that we need the transform function */\n file.set(\"namedParamsNeedTransformFunction\", true)\n }", "function checkCallExpression(node) {\n // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true\n checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments);\n var signature = getResolvedSignature(node);\n if (node.expression.kind === 95 /* SuperKeyword */) {\n return voidType;\n }\n if (node.kind === 175 /* NewExpression */) {\n var declaration = signature.declaration;\n if (declaration &&\n declaration.kind !== 148 /* Constructor */ &&\n declaration.kind !== 152 /* ConstructSignature */ &&\n declaration.kind !== 157 /* ConstructorType */ &&\n !ts.isJSDocConstructSignature(declaration)) {\n // When resolved signature is a call signature (and not a construct signature) the result type is any, unless\n // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations\n // in a JS file\n // Note:JS inferred classes might come from a variable declaration instead of a function declaration.\n // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration.\n var funcSymbol = node.expression.kind === 69 /* Identifier */ ?\n getResolvedSymbol(node.expression) :\n checkExpression(node.expression).symbol;\n if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) {\n return getInferredClassType(funcSymbol);\n }\n else if (compilerOptions.noImplicitAny) {\n error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);\n }\n return anyType;\n }\n }\n // In JavaScript files, calls to any identifier 'require' are treated as external module imports\n if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) {\n return resolveExternalModuleTypeByLiteral(node.arguments[0]);\n }\n return getReturnTypeOfSignature(signature);\n }", "function validateNamedOptionalType(functionName,type,optionName,argument){if(argument!==undefined){validateNamedType(functionName,type,optionName,argument);}}", "function calcCallExpression(env, node) {\n let callee = calcExpression(env, node.callee);\n let arguments = node.arguments.map(node => calcExpression(env, node));\n return callee(...arguments);\n}", "function bindOptional(func) {\n return func ? func.bind(gl) : function() { func.apply(gl, arguments); };\n }", "CallExpression(path) {\n if (path.node.callee.type === 'Super') {\n path.replaceWith(\n t.callExpression(\n t.memberExpression(t.super(), t.identifier('init')),\n path.node.arguments\n )\n );\n }\n }", "function isMemberOptional(node) {\n switch (node.type) {\n case utils_1.AST_NODE_TYPES.TSPropertySignature:\n case utils_1.AST_NODE_TYPES.TSMethodSignature:\n case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:\n case utils_1.AST_NODE_TYPES.PropertyDefinition:\n case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:\n case utils_1.AST_NODE_TYPES.MethodDefinition:\n return !!node.optional;\n }\n return false;\n}", "adoptedCallback() {\n // nop\n }", "function primaryExpr(stream, a) {\n var x = stream.trypopliteral();\n if (null == x)\n x = stream.trypopnumber();\n if (null != x) {\n return x;\n }\n var varRef = stream.trypopvarref();\n if (null != varRef) return a.node('VariableReference', varRef);\n var funCall = functionCall(stream, a);\n if (null != funCall) {\n return funCall;\n }\n if (stream.trypop('(')) {\n var e = orExpr(stream, a);\n if (null == e)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression after (.');\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ) after expression.');\n return e;\n }\n return null;\n }", "function primaryExpr(stream, a) {\n var x = stream.trypopliteral();\n if (null == x)\n x = stream.trypopnumber();\n if (null != x) {\n return x;\n }\n var varRef = stream.trypopvarref();\n if (null != varRef) return a.node('VariableReference', varRef);\n var funCall = functionCall(stream, a);\n if (null != funCall) {\n return funCall;\n }\n if (stream.trypop('(')) {\n var e = orExpr(stream, a);\n if (null == e)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression after (.');\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ) after expression.');\n return e;\n }\n return null;\n }", "optionalCall (handler, functionName, args = []) {\n return new Promise((resolve, reject) => {\n if (handler && typeof handler[functionName] === 'function') {\n try {\n const result = handler[functionName].apply(handler, args);\n return resolve(result);\n }\n catch (error) {\n reject(error);\n }\n }\n\n return resolve();\n });\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (; ;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function zero(func) { return func ? func(0) : 0; }", "function f_ext_2( a, b ) { null.should_not_be_called; return a * 20 + b; }", "function buildLookaheadFuncForOptionalProd(occurrence, ruleGrammar, k, dynamicTokensEnabled, prodType, lookaheadBuilder) {\n var lookAheadPaths = getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, k);\n var tokenMatcher = areTokenCategoriesNotUsed(lookAheadPaths)\n ? tokens_1.tokenStructuredMatcherNoCategories\n : tokens_1.tokenStructuredMatcher;\n return lookaheadBuilder(lookAheadPaths[0], tokenMatcher, dynamicTokensEnabled);\n}", "evaluateCallImpl(args) {\n const callExpr = args.expression.trimLeft().slice(`call `.length);\n // if args.frameID is 'not specified', expression is evaluated in the global scope, according to DAP.\n // default to the topmost stack frame of the current goroutine\n let goroutineId = -1;\n let frameId = 0;\n if (args.frameId) {\n [goroutineId, frameId] = this.stackFrameHandles.get(args.frameId, [goroutineId, frameId]);\n }\n // See https://github.com/go-delve/delve/blob/328cf87808822693dc611591519689dcd42696a3/service/api/types.go#L321-L350\n // for the command args for function call.\n const returnValue = this.delve\n .callPromise('Command', [\n {\n name: 'call',\n goroutineID: goroutineId,\n returnInfoLoadConfig: this.delve.loadConfig,\n expr: callExpr,\n unsafe: false,\n }\n ])\n .then((val) => val, (err) => {\n logError('Failed to call function: ', JSON.stringify(callExpr, null, ' '), '\\n\\rCall error:', err.toString());\n return Promise.reject(err);\n });\n return returnValue;\n }", "function CallOrNoop(O, P, arg, nameForError) {\n const method = O[P];\n if (method === undefined) {\n return undefined;\n }\n if (typeof method !== 'function') {\n throw new TypeError(errTmplMustBeFunctionOrUndefined(nameForError));\n }\n\n return callFunction(method, O, arg);\n }", "function call_name(n) {\n if (n.children[0].type === IDENTIFIER) {\n return n.children[0].value\n }\n if (n.children[0].type === DOT) {\n return n.children[0].children[1].value\n }\n throw new Error('Can not find name of function called')\n}", "function shouldAddParenthesesToChainElement(path) {\n // Babel, this was implemented before #13735, can use `path.match` as estree does\n const { node, parent, grandparent, key } = path;\n if (\n (node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\") &&\n ((key === \"object\" && parent.type === \"MemberExpression\") ||\n (key === \"callee\" &&\n (parent.type === \"CallExpression\" ||\n parent.type === \"NewExpression\")) ||\n (parent.type === \"TSNonNullExpression\" &&\n grandparent.type === \"MemberExpression\" &&\n grandparent.object === parent))\n ) {\n return true;\n }\n\n // ESTree, same logic as babel\n if (\n path.match(\n () => node.type === \"CallExpression\" || node.type === \"MemberExpression\",\n (node, name) => name === \"expression\" && node.type === \"ChainExpression\",\n ) &&\n (path.match(\n undefined,\n undefined,\n (node, name) =>\n (name === \"callee\" &&\n ((node.type === \"CallExpression\" && !node.optional) ||\n node.type === \"NewExpression\")) ||\n (name === \"object\" &&\n node.type === \"MemberExpression\" &&\n !node.optional),\n ) ||\n path.match(\n undefined,\n undefined,\n (node, name) =>\n name === \"expression\" && node.type === \"TSNonNullExpression\",\n (node, name) => name === \"object\" && node.type === \"MemberExpression\",\n ))\n ) {\n return true;\n }\n\n // Babel treat `(a?.b!).c` and `(a?.b)!.c` the same, https://github.com/babel/babel/discussions/15077\n // Use this to align with babel\n if (\n path.match(\n () => node.type === \"CallExpression\" || node.type === \"MemberExpression\",\n (node, name) =>\n name === \"expression\" && node.type === \"TSNonNullExpression\",\n (node, name) => name === \"expression\" && node.type === \"ChainExpression\",\n (node, name) => name === \"object\" && node.type === \"MemberExpression\",\n )\n ) {\n return true;\n }\n\n // This function only handle cases above\n return false;\n}", "parseExpression() {\n\t\treturn this.maybeCall(() => {\n\t\t\tlet atom = this.parseAtom();\n\t\t\tif (atom) {\n\t\t\t\treturn this.maybeBinary(atom, 0);\n\t\t\t}\n\t\t});\n\t}", "function call() { //Modified this from function expression to function declaration.\r\n console.log(\"I am calling\");\r\n}", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (;;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (;;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function parseLeftHandSideExpressionAllowCall() {\n var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;\n\n startToken = lookahead;\n state.allowIn = true;\n\n if (matchKeyword('super') && state.inFunctionBody) {\n expr = new Node();\n lex();\n expr = expr.finishSuper();\n if (!match('(') && !match('.') && !match('[')) {\n throwUnexpectedToken(lookahead);\n }\n } else {\n expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);\n }\n\n for (;;) {\n if (match('.')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseNonComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);\n } else if (match('(')) {\n isBindingElement = false;\n isAssignmentTarget = false;\n args = parseArguments();\n expr = new WrappingNode(startToken).finishCallExpression(expr, args);\n } else if (match('[')) {\n isBindingElement = false;\n isAssignmentTarget = true;\n property = parseComputedMember();\n expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);\n } else if (lookahead.type === Token.Template && lookahead.head) {\n quasi = parseTemplateLiteral();\n expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);\n } else {\n break;\n }\n }\n state.allowIn = previousAllowIn;\n\n return expr;\n }", "function noargFun() {\n console.info(arguments.callee);\n console.info(arguments.caller);\n}", "function_call(idToken) {\n const startToken = this.currentToken;\n let params = [];\n\n try {\n let nextExpr;\n this.eat(Lexer.TokenTypes.LPAREN);\n do {\n try {\n nextExpr = this.expr();\n params.push(nextExpr);\n this.eat(Lexer.TokenTypes.COMMA);\n } catch (e) {\n nextExpr = null;\n }\n } while (nextExpr !== null);\n\n this.eat(Lexer.TokenTypes.RPAREN);\n } catch (e) {\n throw new ParserException('Error processing FUNCTION_CALL', startToken, e);\n }\n\n return new AST.FunctionCallNode(idToken.val, params);\n }" ]
[ "0.75082976", "0.63943857", "0.6356074", "0.6276941", "0.5937039", "0.5763123", "0.5743164", "0.5663026", "0.55844384", "0.5575244", "0.5541972", "0.5541972", "0.5541972", "0.5448456", "0.5429165", "0.5429165", "0.5428071", "0.5418215", "0.5410078", "0.5410078", "0.5336382", "0.53303105", "0.52505016", "0.52505016", "0.51965886", "0.5181489", "0.5177967", "0.5177604", "0.51567", "0.5097539", "0.5032031", "0.49807245", "0.49498776", "0.4944524", "0.4944524", "0.4941466", "0.49015698", "0.4896713", "0.48930094", "0.4892153", "0.488247", "0.488247", "0.488247", "0.48745972", "0.48745972", "0.48745972", "0.48745972", "0.48745972", "0.48745972", "0.4865519", "0.48569274", "0.48472393", "0.4841428", "0.4812016", "0.48017296", "0.4800823", "0.4790531", "0.47850242", "0.47638038", "0.47439706", "0.47439706", "0.4727389", "0.47132763", "0.47007406", "0.46935326", "0.46930158", "0.4690001", "0.46890298", "0.46820256", "0.4681321", "0.4681321", "0.4681321", "0.4669807", "0.46682394", "0.46646595", "0.46562985", "0.4656285", "0.4635017", "0.46285677", "0.4627972", "0.46268335", "0.46262687", "0.46259296", "0.46259296", "0.46141466", "0.4611817", "0.46052584", "0.4601925", "0.45948222", "0.45854276", "0.45834243", "0.45786938", "0.45779312", "0.456956", "0.45569548", "0.45548934", "0.45548934", "0.45548934", "0.45263314", "0.4513632" ]
0.8270302
0
Define the variable of this function declaration only once. Because to avoid confusion of `noredeclare` rule by overloading.
TSDeclareFunction(node) { const scopeManager = this.scopeManager; const upperScope = this.currentScope(); const { id, typeParameters, params, returnType } = node; // Ignore this if other overload have already existed. if (id) { const variable = upperScope.set.get(id.name); const defs = variable === null || variable === void 0 ? void 0 : variable.defs; const existed = defs === null || defs === void 0 ? void 0 : defs.some((d) => d.type === 'FunctionName'); if (!existed) { upperScope.__define(id, new experimental_utils_1.TSESLintScope.Definition('FunctionName', id, node, null, null, null)); } } // Open the function scope. scopeManager.__nestEmptyFunctionScope(node); const innerScope = this.currentScope(); // Process the type parameters this.visit(typeParameters); // Process parameter declarations. for (let i = 0; i < params.length; ++i) { this.visitPattern(params[i], { processRightHandNodes: true }, (pattern, info) => { innerScope.__define(pattern, new experimental_utils_1.TSESLintScope.ParameterDefinition(pattern, node, i, info.rest)); // Set `variable.eslintUsed` to tell ESLint that the variable is used. const variable = innerScope.set.get(pattern.name); if (variable) { variable.eslintUsed = true; } this.referencingDefaultValue(pattern, info.assignments, null, true); }); } // Process the return type. this.visit(returnType); // Close the function scope. this.close(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo() {\n a = 1; // no declaration\n}", "function foo() {\n\ta = 1;\t// `a` not formally declared\n}", "function foo() {\n\ta = 3;\n\n\t//console.log( a );\t// 3\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\"\n // to the top of `foo()`\n}", "function foo() {\n a = 3;\n console.log(a); // 3\n var a; // declaration is \"hoisted\"\n // to the top of `foo()`\n }", "function foo() {\n\ta = 3;\n\n\tconsole.log( a );\t// 3\n\n\tvar a;\t\t\t\t// declaration is \"hoisted\"\n\t\t\t\t\t\t // to the top of `foo()`\n}", "function Declare() {\r\n}", "function foo() {\n var a = b = 0;\n}", "function foo() {\n var a = b = 0;\n}", "function forgettingDeclaringVariablesBeforeUseingDeclaresThemOnTheGlobalObject(){\n i = 1;//ReferenceError in strict mode.\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 one() {\n\t// this 'a' var only belongs to the one() fn\n\tvar a = 1;\n\tconsole.log(a);\n}", "function f1(a = 0) {\n var a;\n}", "function preDeclareHoisted(scope, node) {\n node.traverseTopDown(\n // var bla;\n 'VarDecl(x)', function(b, node) {\n node.setAnnotation(\"scope\", scope);\n scope.declare(b.x.value, b.x, PROPER);\n return node;\n },\n // var bla = 10;\n 'VarDeclInit(x, e)', function(b, node) {\n node.setAnnotation(\"scope\", scope);\n scope.declare(b.x.value, b.x, PROPER);\n },\n // function bla(farg) { }\n 'Function(x, _, _)', function(b, node) {\n node.setAnnotation(\"scope\", scope);\n if(b.x.value) {\n scope.declare(b.x.value, b.x, PROPER);\n }\n return node;\n }\n );\n }", "function foo(){\n undefined = 2; // really bad idea;\n}", "function foo() {\n expect(a).be.undefined;\n a = 3;\n expect(a).to.eql(3);\n var a; // declaration is \"hoisted\" to the top of `foo()`\n expect(a).to.eql(3);\n }", "function f(x) {\n var x = 100; // error: interferes with parameter declaration\n}", "function func2() {\n var b = 10;\n //var b = 20; error: can't have both declarations of 'b'\n }", "function one() {\n // this `a` only belongs to the `one()` function\n var a = 1;\n console.log( a );\n}", "function secondFunction(){\r\n\tlet numLet = 100;\r\n\tvar numVar = 200;\r\n\tlet NUM_CONST = 300;\r\n\r\n\tconsole.log(\"Redeclared numLet from inside secondFunction\",numLet);\r\n\tconsole.log(\"Redeclared numVar fron inside secondFunction\",numVar);\r\n\r\n}", "function foo() {\n bar = 4; // ASSIGN_BEFORE_DECL alarm\n var bar;\n console.log(bar);\n}", "function foo(){\n\ta = 3;\n\n\tconsole.log(a); //3\n\n\tvar a;\t\t// declaration is hoisted at top of foo.\n}", "function funcDeclare() {\n console.log(\"Function declared inside if\");\n }", "function f1() {\n var n = 5;\n if (true) {\n var _n = 10;\n }\n console.log(n); // 5\n}", "function once(fn){var called=false;return function(){var args=[],len=arguments.length;while(len--){args[len]=arguments[len];}if(called){return;}called=true;return fn.apply(this,args);};}", "function functionName() {\n {let one, two;\n one = 1;\n two = 2;\n }\n}", "function foo(){\n 'use strict';\n var undefined = 2;\n console.log( undefined ); // 2\n}", "function foo() {\n var bar;\n}", "function func1(){\n var hey = 10;\n var hey = 20; // BAD PRACTICE!\n console.log(hey);\n }", "function foo() {\n var a;\n console.log( a ); // undefined\n a = 2;\n}", "function variableHoisted() {\n var var1;\n if (true) {\n var1 = 1;\n } else {\n var1 = 2;\n }\n return var1;\n}", "function foo() {\n a = a + 1;\n}", "function functionDeclarationHoisted() {\n function bar() { return 1; }\n function bar() { return 2; }\n return bar();\n}", "function aFunc() {\n // declaring a here - scoped here\n let a = 1;\n}", "function once(func) {\n return function(){\n var f = func;\n func = null; // Here we are nulling out the func after we set the func to f that way if we try to call the func again it's null so it will not work\n return f.apply(\n this,\n arguments\n );\n };\n}", "function useLessFuntion() {\n // function scope\n var myVariable = \"Some Text\";\n}", "function DeclareFunction(node, print) {\n\t this.push(\"declare function \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation.typeAnnotation);\n\t this.semicolon();\n\t}", "function DeclareFunction(node, print) {\n\t this.push(\"declare function \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation.typeAnnotation);\n\t this.semicolon();\n\t}", "function if_partial_post_init(b) {\n let x:number;\n if (b) {\n x = 0;\n }\n var y:number = x; // error, possibly uninitialized\n}", "function foo() {\n var a;\n console.log(a); // undefined\n a = 2;\n}", "function foo() {\n var a;\n console.log(a); // undefined\n a = 2;\n}", "function once(fn){var called=false;return function(){if(called){return;}called=true;return fn.apply(this,arguments);};}", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "function once(fn){var called=false;return function(){if(!called){called=true;fn.apply(this,arguments);}};}", "function DeclareFunction(node, print) {\n this.push(\"declare function \");\n print.plain(node.id);\n print.plain(node.id.typeAnnotation.typeAnnotation);\n this.semicolon();\n}", "function firstFun() { //function acts like a cage for variables\n var first_variable; //local declaration of the first_variable\n var first_vartiable = \"Not anymore!!!\"; //local declaration gets assigned value of \"Not anymore\"\n console.log(first_variable) //This is never called\n}", "function bar(){\n if(!foo){\n var foo = 10;\n }\n console.log(foo);\n}", "function add()\n{\n var xx = \"sdsjd\"; //variable declared inside function can only be used for that function(function scoped)\n}", "function functionDeclaration() {}", "function foo() {\n var a;\n console.log( a );\n var a = 2;\n}", "function arbitraryFunction() {\n var x = 0;\n}", "function f(shouldInitialize) {\n if (shouldInitialize) {\n var x = 10;\n }\n return x;\n}", "function once(f) {\n return function() {\n var _f = f;\n f = null;\n return _f.apply(this, arguments);\n };\n}", "function declaredFunctionTwo(a, b) {\n return a * b;\n}", "function returnUndef(){\n let x;\n return x;\n}", "function doSomething() {\n console.log(\"declaration\");\n}", "function redefine() {\n\t\theaders = getHeaders();\n\t\treset()\n\t\trebuild();\n\t}", "function bar() { /* Global Scope: Do you know about `bar`? NO: cache ref */\n var foo = 'baz'; /* bar Scope: Do you know about `foo`? NO: cache ref */\n\n function baz() { /* bar Scope: Do you know about `baz`? NO: cache ref */\n /* baz Scope: Do you know about `foo` (parameter)? NO: cache ref */\n foo = 'bam'; /* baz Scope: Do you know about `foo`? YES */\n bam = 'yay'; /* baz Scope: Do you know about `bam`? NO: cache ref in global scope */\n }\n baz(); /* IGNORE: not invoking functions at compilation */\n}", "function emptyFunction() { // 306\n // dummy // 307\n } // 308", "function scope(){\n var x = 33 // If 'var' is removed, output will show 33, 33. It will reassign x as 33 once the scope function is called\n console.log(x)\n}", "function nonewFun() {}", "function hoistedFunction() {\n console.log('I work, even if they call me before my definition.');\n}", "function foo() {\n kaz = 1; // 'var' missing, ReferenceError.\n}", "function fill(){\n f=1;\n}", "function uneFonction() {\n var uneFonctionVar1 = 1; //locale\n let uneFonctionVar2 = 2; //locale\n uneFonctionVar3 = 3; //globale car declaree sans mot clef !!!\n}", "function foo() {\n var x;\n bar();\n x = 1;\n}", "function __(x) {\r\n\tx = undefined;\r\n}", "function TempVars() {\n}", "function sing1() {\n console.log(\"la la la\");\n} // This never gets used", "__init2() {this.noAnonFunctionType = false}", "function one(){\n \n}", "function noexpand(func, ...args) {\n const prev_expanding = exports.defs.expanding;\n exports.defs.expanding = false;\n try {\n return func(...args);\n }\n finally {\n exports.defs.expanding = prev_expanding;\n }\n}", "function f1_f() {\n ;\n}", "function functionDeclarationHoisting() {\n function bar() { return 1; }\n return bar();\n function bar() { return 2; }\n}", "function funcD1() {\n d = 1;\n}", "function funcD1() {\n d = 1;\n}", "setupOnce() {\n this.ignoreOnError = this.ignoreOnError;\n const global = getGlobalObject();\n fill(global, 'setTimeout', this.wrapTimeFunction.bind(this));\n fill(global, 'setInterval', this.wrapTimeFunction.bind(this));\n fill(global, 'requestAnimationFrame', this.wrapRAF.bind(this));\n [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n ].forEach(this.wrapEventTarget.bind(this));\n }", "function chooseMystery(){\t\t\n\tfunction chooseMystery(){\t//1. gets hoisted and allocated\n\t\treturn 12;\n\t}\n\treturn chooseMystery();\n\t\n\tfunction chooseMystery(){\t//2. gets hoisted and allocated, but overwrites (1.)\n\t\treturn 7;\n\t}\n}", "function chooseMystery(){\t\t\n\t\n\treturn chooseMystery();\t\t// \n\t\n\tvar chooseMystery = function(){\t// 1. hoisted, allocated, set to undefined.\n\t\treturn 12;\t\t\t\t//\n\t}\n\t\n\tvar chooseMystery function(){\t// 2. hoisted, allocated, set to undefined, overwrites first var.\n\t\treturn 7;\t\t\t\t\t\n\t}\n}", "function funcD1() {\n d = 1;\n}", "function markOnce(tree,index,key){markStatic(tree,\"__once__\"+index+(key?\"_\"+key:\"\"),true);return tree;}", "function markOnce(tree,index,key){markStatic(tree,\"__once__\"+index+(key?\"_\"+key:\"\"),true);return tree;}", "function func(name1, name) {\n // changed name to name1 to compile\n \"use strict\"; // can be scoped to function\n // duplicate paramter names are not allowed\n return;\n}", "function foo() {\n bar();\n var x = 1;\n}", "function foo()\n{\n console.log('Function Declaration');\n}", "function funcD1() {\n d = 1;\n}", "function foo4(){}", "function f0(a, a) {\n}", "FunctionDeclaration() {\n pushContext();\n }", "function foo(){}", "function foo(){}", "function defineVariable(){\r\n //define a variable \"count\" with value 0\r\n let count = 0;\r\n //then increment it\r\n count += 1;\r\n //finally return it\r\n return count;\r\n}", "function once(fn) {\n var first = true;\n return function(...args) {\n if (first) {\n first = false;\n return fn(...args);\n }\n }\n}", "function once (fn) {\r\n var called = false;\r\n return function () {\r\n var args = [], len = arguments.length;\r\n while ( len-- ) args[ len ] = arguments[ len ];\r\n\r\n if (called) { return }\r\n called = true;\r\n return fn.apply(this, args)\r\n }\r\n}", "function declareFunction(core, name, type, body, decl) {\n var codePtr = core.functions.length;\n var value = void 0;\n if (body) {\n value = new _value.FunctionValue(type, codePtr, name, body, decl);\n } else {\n value = new _value.BuiltinValue(type, codePtr, name);\n }\n core.functions.push(value);\n core.globalMap[name] = value;\n}", "function once(fn) {\n var called = false;\n return function () {\n var args = [],\n len = arguments.length;\n while (len--) {\n args[len] = arguments[len];\n }if (called) {\n return;\n }\n called = true;\n return fn.apply(this, args);\n };\n}", "function once(fn) {\n var called = false;\n return function () {\n var args = [],\n len = arguments.length;\n while (len--) {\n args[len] = arguments[len];\n }if (called) {\n return;\n }\n called = true;\n return fn.apply(this, args);\n };\n}", "function once(fn) {\n var called = false;\n return function () {\n var args = [],\n len = arguments.length;\n while (len--) {\n args[len] = arguments[len];\n }if (called) {\n return;\n }\n called = true;\n return fn.apply(this, args);\n };\n}", "function ourReuseableFunction() {\n console.log(\"Tony\", \"Obriku\");\n\n}", "function f25() {\n var x;\n var y = x;\n}", "VariableDeclaration(path) {\n // this removes the `makeShortcode` function\n if (path.node.declarations[0].id.name === 'makeShortcode') {\n path.remove()\n }\n\n // this removes any variable that is set using the `makeShortcode` function\n if (\n path.node &&\n path.node.declarations &&\n path.node.declarations[0] &&\n path.node.declarations[0].init &&\n path.node.declarations[0].init.callee &&\n path.node.declarations[0].init.callee.name === 'makeShortcode'\n ) {\n path.remove()\n }\n }" ]
[ "0.6452602", "0.64449865", "0.6136066", "0.6061973", "0.6027008", "0.6012318", "0.5997244", "0.5997244", "0.59782624", "0.5847118", "0.58056253", "0.5783792", "0.5744532", "0.5698111", "0.569544", "0.5693675", "0.5657812", "0.55944777", "0.55708855", "0.5560843", "0.55068755", "0.5434666", "0.538455", "0.5380441", "0.53480476", "0.53331447", "0.5292592", "0.52627707", "0.52582246", "0.5250805", "0.5250178", "0.5235576", "0.5225525", "0.5215961", "0.52150357", "0.5212686", "0.5212686", "0.5179856", "0.5174078", "0.5174078", "0.51690924", "0.5163149", "0.5163149", "0.5160844", "0.51520735", "0.5150604", "0.5143145", "0.5141", "0.513716", "0.51170117", "0.5108295", "0.5101349", "0.50644696", "0.5054746", "0.5038435", "0.50326467", "0.4989643", "0.4984097", "0.4969808", "0.4962631", "0.4960916", "0.49584857", "0.49473813", "0.49447244", "0.49226576", "0.4915018", "0.49118707", "0.49067494", "0.48931384", "0.48774257", "0.48685938", "0.48682332", "0.486216", "0.4858612", "0.4858612", "0.48581588", "0.4850496", "0.4848249", "0.48410028", "0.48393682", "0.48393682", "0.48381692", "0.4837608", "0.48291108", "0.48251668", "0.48209953", "0.48209658", "0.48207355", "0.48115477", "0.48115477", "0.48110664", "0.48085713", "0.48051387", "0.47923276", "0.47922722", "0.47922722", "0.47922722", "0.47904587", "0.47741115", "0.4771322" ]
0.58068705
10
Create reference objects for the references in parameters and return type.
TSEmptyBodyFunctionExpression(node) { const upperTypeMode = this.typeMode; const { typeParameters, params, returnType } = node; this.typeMode = true; this.visit(typeParameters); params.forEach(this.visit, this); this.visit(returnType); this.typeMode = upperTypeMode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ReferenceToObject(o, r, f) {\n // TODO : seems like I should output the desiredClass information here\n // maybe all references have a name, index, etc. and then the are either undefined\n // what about clobber, can I get an index in an index and then that would not work\n // should the second loop be doing something different?\n var originalRef = r;\n\twhile (r != null) {\n\t\tvar refForm = r.getForm();\n var refClass = r.getDesiredClass();\n var strk = app.typeIDToStringID(refClass);\n if (strk.length == 0) {\n strk = app.typeIDToCharID(refClass);\n }\n\t\tswitch (refForm) {\n\t\t\tcase ReferenceFormType.NAME:\n\t\t\t\to[\"name\"] = r.getName();\n\t\t\t\tbreak;\n\t\t\tcase ReferenceFormType.INDEX:\n\t\t\t\to[\"index\"] = r.getIndex();\n\t\t\t\tbreak;\n\t\t\tcase ReferenceFormType.IDENTIFIER:\n o[\"indentifier\"] = r.getIdentifier();\n break;\n\t\t\tcase ReferenceFormType.OFFSET:\n o[\"offset\"] = r.getOffset();\n break;\n\t\t\tcase ReferenceFormType.ENUMERATED:\n var newT = r.getEnumeratedType();\n var newV = r.getEnumeratedValue();\n o[\"enumerated\"] = new Object();\n o[\"enumerated\"].type = typeIDToCharID(newT);\n o[\"enumerated\"].typeString = typeIDToStringID(newT);\n o[\"enumerated\"].value = typeIDToCharID(newV);\n o[\"enumerated\"].valueString = typeIDToStringID(newV);\n break;\n\t\t\tcase ReferenceFormType.PROPERTY:\n o[\"property\"] = app.typeIDToStringID(r.getProperty());\n if (o[\"property\"].length == 0) {\n o[\"property\"] = app.typeIDToCharID(r.getProperty());\n }\n break;\n\t\t\tcase ReferenceFormType.CLASSTYPE:\n o[\"class\"] = refClass; // i already got that r.getDesiredClass(k);\n break;\n\t\t\tdefault:\n\t\t\t\tmyLogging.LogIt(\"Unsupported type in referenceToObject \" + t);\n\t\t}\n r = r.getContainer();\n try {\n r.getDesiredClass();\n } catch(e) {\n r = null;\n }\n\t}\n\tif (undefined != f) {\n\t\to = f(o);\n\t}\n}", "function composeRef() {\n for (\n var _len = arguments.length, refs = new Array(_len), _key = 0;\n _key < _len;\n _key++\n ) {\n refs[_key] = arguments[_key];\n }\n\n return function(node) {\n refs.forEach(function(ref) {\n fillRef(ref, node);\n });\n };\n }", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "static initialize(obj, ref) { \n obj['ref'] = ref;\n }", "function createRef() {\n var refObject = {\n current: null,\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n var refList = refs.filter(function (ref) {\n return ref;\n });\n if (refList.length <= 1) {\n return refList[0];\n }\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "static createReferences(tree){\n\t\tlet root = new Taxon(tree.validName, null, tree._id,\n\t\t\ttree.img_src, tree.description, tree.url,\n\t\t\ttree.isCompress, tree.isMarked, \n\t\t\ttree.selected, tree.isInsideBar);\n\n\t\tTreeManager.createReferencesAux(tree.children, root);\n\n\t\treturn root;\n\t}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "refs(builder) {\n const refs = new Array(this.size);\n\n for (let i = 0, l = refs.length; i < l; ++i) {\n refs[i] = this.ref(builder, i);\n }\n\n return refs;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "function createReference(initialValues) {\n var referenceType = entityManager.metadataStore.getEntityType('Reference');\n // create a new reference entity\n var entity = entityManager.createEntity(referenceType, initialValues);\n entity.Type = 'SP.Data.Research_x0020_ReferencesListItem';\n entity['odata.type'] = 'SpResourceTracker.Models.Reference';\n return entity;\n }", "function createRef() {\n var refObject = {\n current: null\n };\n Object.seal(refObject);\n return refObject;\n }", "function createRefObject() {\n let current = null\n let previous = null\n\n return {\n get current() {\n return current\n },\n\n set current(value) {\n previous = current\n current = value\n },\n\n get previous() {\n return previous\n }\n }\n}", "function getReferences(){\n\tlet references = Object;\n\treferences.slideshow = document.getElementById(\"carouselImage\"); //carousel div reference\n\treferences.buttons = document.getElementsByClassName(\"changeImage\"); //list of buttons to navigate the image carousel\n\treferences.font = document.getElementById(\"linkFont\");\n\treferences.imagePane = document.getElementById(\"displayedImg\"); //img tag reference\n\treferences.caption = document.getElementById(\"imageCaption\");\n\treturn references\n}", "function FindReferences(data, referencesFound) {\n\n if (Array.isArray(data)) {\n\n //console.log(\"It's an array\");\n\n // It is array\n var count;\n for (count = 0; count < data.length; count++) {\n FindReferences(data[count], referencesFound)\n }\n }\n else if (data !== null && typeof (data) === 'object') {\n\n //console.log(\"It's an object\");\n\n // It is object\n for (var k in data) {\n FindReferences(data[k], referencesFound)\n }\n\n } else if (typeof (data) === 'string') {\n\n //console.log(\"It's a value! -> \" + data);\n\n // It is a strig\n if (isReference(data)) {\n //console.log(\"\\tHay que validar una referencia a \" + data.split('-')[0]);\n referencesFound.push(data);\n }\n\n }\n}", "function genRefs( from='INDEX', to='WORK_TREE', )\n{\n\tif( to === 'WORK_TREE' )\n\t{\n\t\tif( from === 'INDEX' )\n\t\t\treturn [];\n\t\telse\n\t\t\treturn [ from, ];\n\t}\n\telse\n\tif( from === 'WORK_TREE' )\n\t{\n\t\tif( to === 'INDEX' )\n\t\t\treturn [ '-R', ];\n\t\telse\n\t\t\treturn [ '-R', to, ];\n\t}\n\telse\n\tif( to === 'INDEX' )\n\t\treturn [ '--cached', from, ];\n}", "function createRef() {\n var refObject = (function (element) {\n refObject.current = element;\n });\n // This getter is here to support the deprecated value prop on the refObject.\n Object.defineProperty(refObject, 'value', {\n get: function () {\n return refObject.current;\n }\n });\n refObject.current = null;\n return refObject;\n}", "findReferences() {\n this._references = new References();\n const excludedExpressions = new Set();\n const visitCallExpression = (e) => {\n for (const p of e.args) {\n this._references.expressions.add(p);\n }\n //add calls that were not excluded (from loop below)\n if (!excludedExpressions.has(e)) {\n this._references.expressions.add(e);\n }\n //if this call is part of a longer expression that includes a call higher up, find that higher one and remove it\n if (e.callee) {\n let node = e.callee;\n while (node) {\n //the primary goal for this loop. If we found a parent call expression, remove it from `references`\n if ((0, reflection_1.isCallExpression)(node)) {\n this.references.expressions.delete(node);\n excludedExpressions.add(node);\n //stop here. even if there are multiple calls in the chain, each child will find and remove its closest parent, so that reduces excess walking.\n break;\n //when we hit a variable expression, we're definitely at the leftmost expression so stop\n }\n else if ((0, reflection_1.isVariableExpression)(node)) {\n break;\n //if\n }\n else if ((0, reflection_1.isDottedGetExpression)(node) || (0, reflection_1.isIndexedGetExpression)(node)) {\n node = node.obj;\n }\n else {\n //some expression we don't understand. log it and quit the loop\n this.logger.info('Encountered unknown expression while calculating function expression chain', node);\n break;\n }\n }\n }\n };\n this.ast.walk((0, visitors_1.createVisitor)({\n AssignmentStatement: s => {\n this._references.assignmentStatements.push(s);\n this.references.expressions.add(s.value);\n },\n ClassStatement: s => {\n this._references.classStatements.push(s);\n },\n ClassFieldStatement: s => {\n if (s.initialValue) {\n this._references.expressions.add(s.initialValue);\n }\n },\n NamespaceStatement: s => {\n this._references.namespaceStatements.push(s);\n },\n FunctionStatement: s => {\n this._references.functionStatements.push(s);\n },\n ImportStatement: s => {\n this._references.importStatements.push(s);\n },\n LibraryStatement: s => {\n this._references.libraryStatements.push(s);\n },\n FunctionExpression: (expression, parent) => {\n if (!(0, reflection_1.isMethodStatement)(parent)) {\n this._references.functionExpressions.push(expression);\n }\n },\n NewExpression: e => {\n this._references.newExpressions.push(e);\n for (const p of e.call.args) {\n this._references.expressions.add(p);\n }\n },\n ExpressionStatement: s => {\n this._references.expressions.add(s.expression);\n },\n CallfuncExpression: e => {\n visitCallExpression(e);\n },\n CallExpression: e => {\n visitCallExpression(e);\n },\n AALiteralExpression: e => {\n this.addPropertyHints(e);\n this._references.expressions.add(e);\n for (const member of e.elements) {\n if ((0, reflection_1.isAAMemberExpression)(member)) {\n this._references.expressions.add(member.value);\n }\n }\n },\n BinaryExpression: (e, parent) => {\n //walk the chain of binary expressions and add each one to the list of expressions\n const expressions = [e];\n let expression;\n while ((expression = expressions.pop())) {\n if ((0, reflection_1.isBinaryExpression)(expression)) {\n expressions.push(expression.left, expression.right);\n }\n else {\n this._references.expressions.add(expression);\n }\n }\n },\n ArrayLiteralExpression: e => {\n for (const element of e.elements) {\n //keep everything except comments\n if (!(0, reflection_1.isCommentStatement)(element)) {\n this._references.expressions.add(element);\n }\n }\n },\n DottedGetExpression: e => {\n this.addPropertyHints(e.name);\n },\n DottedSetStatement: e => {\n this.addPropertyHints(e.name);\n },\n EnumStatement: e => {\n this._references.enumStatements.push(e);\n },\n ConstStatement: s => {\n this._references.constStatements.push(s);\n },\n UnaryExpression: e => {\n this._references.expressions.add(e);\n },\n IncrementStatement: e => {\n this._references.expressions.add(e);\n }\n }), {\n walkMode: visitors_1.WalkMode.visitAllRecursive\n });\n }", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}" ]
[ "0.6230035", "0.5872314", "0.5870682", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.5867747", "0.57621855", "0.57524574", "0.57404864", "0.57404864", "0.5694966", "0.5691945", "0.5681764", "0.56736547", "0.56736547", "0.5664505", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.56592166", "0.5643027", "0.5580799", "0.5541844", "0.5507214", "0.54642963", "0.54209596", "0.5413231", "0.5410471", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101", "0.5405101" ]
0.0
-1
Don't make variable because it declares only types. Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations.
TSInterfaceDeclaration(node) { this.visitTypeNodes(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "function isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\";\n}", "function f1(){\n var x;\n \n return typeof x;\n}", "function get_all_nodes_by_type(ast, typename) {\n\tvar nodes = [];\n\ttraverse(ast, function (node) {\n\t\tif (node.type == typename) {\n\t\t\tnodes.push(node);\n\t\t}\n\t});\n\treturn nodes;\n}", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function TypeRecursion() {}", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function getType(x) {\n if (!x) return false;\n if (x.element) return 'item';\n if (x instanceof HTMLElement) return 'html';\n if (x instanceof $) return 'jquery';\n return false;\n}", "function sc_typeof( x ) {\n return typeof x;\n}", "function scopeAndTypeCheck(root) {\n //Block sets scope\n if (root.nodeName === \"Block\") {\n //If seen before, go to parent scope\n if (root.visited === true) {\n currentScope = currentScope.parent;\n }\n else {\n //Has been visited, now\n root.visited = true;\n //Make new scope for new block\n if (currentScope !== null) {\n var oldScope = currentScope; //current scope is now old\n currentScope = new SymbolTableNode('Scope', currentScope.nodeVal + 1, {}, currentScope, []); //create a new scope\n oldScope.children.push(currentScope); //child of old scope\n currentScope.parent = oldScope; //scope is now the parent\n }\n else {\n currentScope = new SymbolTableNode('Scope', 0, {}, null, []);\n SymbolTableInstance = new SymbolTable(currentScope, currentScope);\n }\n //Check each Statement\n for (var i = 0; i < root.children.length; i++) {\n scopeAndTypeCheck(root.children[i]);\n }\n //When done checking all Statements under this Block, close the scope and return to the parent scope\n if (currentScope.parent !== null) {\n currentScope = currentScope.parent;\n }\n }\n }\n else if (root.nodeName === \"VariableDeclaration\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n //If this variable already exists in this scope...\n if (currentScope.find(root.children[1])) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[1].nodeVal + \" was redeclared on line \" + root.children[1].lineNumber);\n }\n else {\n currentScope.addVariable(root.children[1], root.children[0]);\n }\n }\n else if (root.nodeName === \"Assignment\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n //Variable has not been found yet\n var isFound = false;\n //Type of parent variable\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not...\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n //If variable is not found in current scope... must search parent scopes\n if (!isFound) {\n //Search all parent scopes, and save type if found\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n //If still not found, it's undeclared.\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true;\n }\n }\n //Find the type - whether in this scope or in parent scope.\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n //The type of the RightVal.\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type errors - mismatch of Left and Right sides\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Output\") {\n //Set scope of variable\n root.children[0].scope = currentScope.nodeVal;\n //Variable is not yet found\n var isFound = false;\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"OutputVal\") {\n if (root.children[0].nodeVal !== \"?\") {\n isFound = currentScope.find(root.children[0]);\n }\n }\n //\"?\" means literal - no scope errors are shown in case of printing a literal int, bool or string\n if (!isFound && root.children[0].nodeVal !== \"?\") {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Printing counts as variable use\n }\n }\n }\n else if (root.nodeName === \"If\" || root.nodeName === \"While\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n scopeAndTypeCheck(root.children[0]); //check test\n scopeAndTypeCheck(root.children[1]); //check block\n }\n else if (root.nodeName === \"CompareTest\") {\n //Set scope of variables\n root.children[0].scope = currentScope.nodeVal;\n root.children[1].scope = currentScope.nodeVal;\n var isFound = false;\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n if (!isFound) {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Comparing counts as variable use\n }\n }\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type mismatches in comparability\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Add\") {\n }\n else {\n }\n}", "function getContextualType(node) {\n if (isInsideWithStatementBody(node)) {\n // We cannot answer semantic questions within a with block, do not proceed any further\n return undefined;\n }\n if (node.contextualType) {\n return node.contextualType;\n }\n var parent = node.parent;\n switch (parent.kind) {\n case 218 /* VariableDeclaration */:\n case 142 /* Parameter */:\n case 145 /* PropertyDeclaration */:\n case 144 /* PropertySignature */:\n case 169 /* BindingElement */:\n return getContextualTypeForInitializerExpression(node);\n case 180 /* ArrowFunction */:\n case 211 /* ReturnStatement */:\n return getContextualTypeForReturnExpression(node);\n case 190 /* YieldExpression */:\n return getContextualTypeForYieldOperand(parent);\n case 174 /* CallExpression */:\n case 175 /* NewExpression */:\n return getContextualTypeForArgument(parent, node);\n case 177 /* TypeAssertionExpression */:\n case 195 /* AsExpression */:\n return getTypeFromTypeNode(parent.type);\n case 187 /* BinaryExpression */:\n return getContextualTypeForBinaryOperand(node);\n case 253 /* PropertyAssignment */:\n return getContextualTypeForObjectLiteralElement(parent);\n case 170 /* ArrayLiteralExpression */:\n return getContextualTypeForElementExpression(node);\n case 188 /* ConditionalExpression */:\n return getContextualTypeForConditionalOperand(node);\n case 197 /* TemplateSpan */:\n ts.Debug.assert(parent.parent.kind === 189 /* TemplateExpression */);\n return getContextualTypeForSubstitutionExpression(parent.parent, node);\n case 178 /* ParenthesizedExpression */:\n return getContextualType(parent);\n case 248 /* JsxExpression */:\n return getContextualType(parent);\n case 246 /* JsxAttribute */:\n case 247 /* JsxSpreadAttribute */:\n return getContextualTypeForJsxAttribute(parent);\n }\n return undefined;\n }", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "function createTypeExpression(node) {\n if (node.type == 'Identifier') {\n return node;\n } else if (node.type == 'QualifiedTypeIdentifier') {\n return t.memberExpression(createTypeExpression(node.qualification), createTypeExpression(node.id));\n }\n\n throw this.errorWithNode('Unsupported type: ' + node.type);\n }", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function Type(x) {\n\t if (x === null)\n\t return 1 /* Null */;\n\t switch (typeof x) {\n\t case \"undefined\": return 0 /* Undefined */;\n\t case \"boolean\": return 2 /* Boolean */;\n\t case \"string\": return 3 /* String */;\n\t case \"symbol\": return 4 /* Symbol */;\n\t case \"number\": return 5 /* Number */;\n\t case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n\t default: return 6 /* Object */;\n\t }\n\t }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function isType(node) {\n return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function evaluateVariableStatement(_a) {\n var { node } = _a, rest = __rest(_a, [\"node\"]);\n evaluateVariableDeclarationList(Object.assign({ node: node.declarationList }, rest));\n}", "function innerType(n) { }", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function walkTreeVars(tree) {\n walkAddParent(tree, node => {\n if (!node || !node.type)\n return;\n switch (node.type) {\n case 'BlockStatement':\n return initBlock(node);\n case 'VariableDeclarator':\n return addLocalVar(node);\n }\n });\n}", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "function getVariables(node) {\r\n var variables = [], anonymousTypes = [], name, type;\r\n var declarationList = Array.isArray(node.declarationList)\r\n ? node.declarationList : [node.declarationList];\r\n for (var i = 0; i < declarationList.length; i++) {\r\n var declarations = declarationList[i].declarations;\r\n for (var j = 0; j < declarations.length; j++) {\r\n name = declarations[j].name.text;\r\n if (declarations[j].type.kind == ts.SyntaxKind.TypeLiteral) {\r\n type = visitInterface(declarations[j].type, { name: name + \"Type\", anonymous: true });\r\n anonymousTypes.push(type);\r\n type = type.name;\r\n }\r\n else {\r\n type = getType(declarations[j].type);\r\n }\r\n variables.push({\r\n name: name,\r\n type: type,\r\n static: true,\r\n parameters: []\r\n });\r\n }\r\n }\r\n return {\r\n variables: variables,\r\n anonymousTypes: anonymousTypes\r\n };\r\n}", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function typeOfValue(x) {\n return typeof x;\n}", "lookAtNodeType(expr) {\n switch(expr.type) {\n case \"blockStmt\": return this.getBlockStmt(expr); \n case \"varDecl\": return this.getVarDecl(expr);\n case \"variableExpr\": return this.getVariableExpr(expr);\n case \"assignExpr\": return this.getAssignExpr(expr);\n case \"functionDecl\": return this.getFunctionDecl(expr);\n case \"expressionStmt\": return this.getExpressionStmt(expr);\n case \"ifStmt\": return this.getIfStmt(expr);\n case \"printStmt\": return this.getPrintStmt(expr);\n case \"returnStmt\": return this.getReturnStmt(expr);\n case \"whileStmt\": return this.getWhileStmt(expr);\n case \"binaryExpr\": return this.getBinaryExpr(expr);\n case \"callExpr\": return this.getCallExpr(expr);\n case \"groupingExpr\": return this.getGroupingExpr(expr);\n case \"literalExpr\": return this.getLiteralExpr(expr);\n case \"logicalExpr\": return this.getLogicalExpr(expr);\n case \"unaryExpr\": return this.getUnaryExpr(expr);\n default:\n throw new RuntimeError('Resolver cannot evaluate expression or statement')\n }\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function initTypeVariableScopeTracking(state) {\n state.g.typeVariableScopeDepth = {};\n}", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function $type(obj){\n if (obj == undefined) \n return false;\n if (obj.htmlElement) \n return 'element';\n var type = typeof obj;\n if (type == 'object' && obj.nodeName) {\n switch (obj.nodeType) {\n case 1:\n return 'element';\n case 3:\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n }\n if (type == 'object' || type == 'function') {\n switch (obj.constructor) {\n case Array:\n return 'array';\n case RegExp:\n return 'regexp';\n }\n if (typeof obj.length == 'number') {\n if (obj.item) \n return 'collection';\n if (obj.callee) \n return 'arguments';\n }\n }\n return type;\n}", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n // If the variable type is not an input type, return an error.\n if (type && !(0, _typeDefinition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n }\n }\n };\n}", "getTypeNode() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.type);\r\n }", "function Type() {\n if (currentToken() == \"inteiro\" || currentToken() == \"real\" || currentToken() == \"texto\" || currentToken() == \"boleano\" || currentToken() == \"vazio\" || currentClass() == IDENTIFIER) {\n currentType = currentToken();\n return;\n } else {\n let errorMessage = \"Tipo de variável não reconhecido\";\n handleError(errorMessage);\n return;\n }\n }", "function evaluateTypeOfExpression({ node, environment, evaluate, statementTraversalStack }) {\n return typeof evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function staticallyVerifyType(node, types) {\n if (isNodeNully(node)) {\n return types.indexOf(\"null\") > -1 || types.indexOf(\"undefined\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"Literal\") {\n if (node.regex) {\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(\"RegExp\")) ? TYPE_VALID : TYPE_INVALID;\n } else {\n return types.indexOf(typeof node.value) > -1 ? TYPE_VALID : TYPE_INVALID;\n }\n } else if (node.type === \"ObjectExpression\") {\n return types.indexOf(\"object\") > -1 || types.indexOf(\"shape\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"ArrayExpression\") {\n return types.indexOf(\"array\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (t.isFunction(node)) {\n return types.indexOf(\"function\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'NewExpression' && node.callee.type === 'Identifier') {\n // this is of the form `return new SomeClass()`\n // @fixme it should be possible to do this with non computed member expressions too\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(node.callee.name)) ? TYPE_VALID : TYPE_UNKNOWN;\n } else if (isBooleanExpression(node)) {\n return types.indexOf('boolean') > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'Identifier') {\n // check the scope to see if this is a `const` value\n return node;\n } else {\n return TYPE_UNKNOWN; // will produce a runtime type check\n }\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function isIndependentVariableLikeDeclaration(node) {\n return node.type && isIndependentType(node.type) || !node.type && !node.initializer;\n }", "function $type(obj){\r\n if (!$defined(obj)) \r\n return false;\r\n if (obj.htmlElement) \r\n return 'element';\r\n var type = typeof obj;\r\n if (type == 'object' && obj.nodeName) {\r\n switch (obj.nodeType) {\r\n case 1:\r\n return 'element';\r\n case 3:\r\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\r\n }\r\n }\r\n if (type == 'object' || type == 'function') {\r\n switch (obj.constructor) {\r\n case Array:\r\n return 'array';\r\n case RegExp:\r\n return 'regexp';\r\n case Class:\r\n return 'class';\r\n }\r\n if (typeof obj.length == 'number') {\r\n if (obj.item) \r\n return 'collection';\r\n if (obj.callee) \r\n return 'arguments';\r\n }\r\n }\r\n return type;\r\n }", "compileNode(o) {\r\n\t\t\t\t\tvar answer, compiledName, isValue, name, properties, prototype, ref1, ref2, ref3, ref4, val;\r\n\t\t\t\t\tisValue = this.variable instanceof Value;\r\n\t\t\t\t\tif (isValue) {\r\n\t\t\t\t\t\t// If `@variable` is an array or an object, we’re destructuring;\r\n\t\t\t\t\t\t// if it’s also `isAssignable()`, the destructuring syntax is supported\r\n\t\t\t\t\t\t// in ES and we can output it as is; otherwise we `@compileDestructuring`\r\n\t\t\t\t\t\t// and convert this ES-unsupported destructuring into acceptable output.\r\n\t\t\t\t\t\tif (this.variable.isArray() || this.variable.isObject()) {\r\n\t\t\t\t\t\t\tif (!this.variable.isAssignable()) {\r\n\t\t\t\t\t\t\t\tif (this.variable.isObject() && this.variable.base.hasSplat()) {\r\n\t\t\t\t\t\t\t\t\treturn this.compileObjectDestruct(o);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\treturn this.compileDestructuring(o);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.variable.isSplice()) {\r\n\t\t\t\t\t\t\treturn this.compileSplice(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.isConditional()) {\r\n\t\t\t\t\t\t\treturn this.compileConditional(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((ref1 = this.context) === '//=' || ref1 === '%%=') {\r\n\t\t\t\t\t\t\treturn this.compileSpecialMath(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addScopeVariables(o);\r\n\t\t\t\t\tif (this.value instanceof Code) {\r\n\t\t\t\t\t\tif (this.value.isStatic) {\r\n\t\t\t\t\t\t\tthis.value.name = this.variable.properties[0];\r\n\t\t\t\t\t\t} else if (((ref2 = this.variable.properties) != null ? ref2.length : void 0) >= 2) {\r\n\t\t\t\t\t\t\tref3 = this.variable.properties, [...properties] = ref3, [prototype, name] = splice.call(properties, -2);\r\n\t\t\t\t\t\t\tif (((ref4 = prototype.name) != null ? ref4.value : void 0) === 'prototype') {\r\n\t\t\t\t\t\t\t\tthis.value.name = name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tval = this.value.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tcompiledName = this.variable.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tif (this.context === 'object') {\r\n\t\t\t\t\t\tif (this.variable.shouldCache()) {\r\n\t\t\t\t\t\t\tcompiledName.unshift(this.makeCode('['));\r\n\t\t\t\t\t\t\tcompiledName.push(this.makeCode(']'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn compiledName.concat(this.makeCode(': '), val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer = compiledName.concat(this.makeCode(` ${this.context || '='} `), val);\r\n\t\t\t\t\t// Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Assignment_without_declaration,\r\n\t\t\t\t\t// if we’re destructuring without declaring, the destructuring assignment must be wrapped in parentheses.\r\n\t\t\t\t\t// The assignment is wrapped in parentheses if 'o.level' has lower precedence than LEVEL_LIST (3)\r\n\t\t\t\t\t// (i.e. LEVEL_COND (4), LEVEL_OP (5) or LEVEL_ACCESS (6)), or if we're destructuring object, e.g. {a,b} = obj.\r\n\t\t\t\t\tif (o.level > LEVEL_LIST || isValue && this.variable.base instanceof Obj && !this.nestedLhs && !(this.param === true)) {\r\n\t\t\t\t\t\treturn this.wrapInParentheses(answer);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "static getTypeID(ast) { return ast.typeID }", "function VariablesAreInputTypes(context) {\n\t return {\n\t VariableDefinition: function VariableDefinition(node) {\n\t var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n\t // If the variable type is not an input type, return an error.\n\t if (type && !(0, _typeDefinition.isInputType)(type)) {\n\t var variableName = node.variable.name.value;\n\t context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n\t }\n\t }\n\t };\n\t}", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n // If the variable type is not an input type, return an error.\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _printer.print)(node.type)), [node.type]));\n }\n }\n };\n}", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type); // If the variable type is not an input type, return an error.\n\n if (type && !Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](nonInputTypeOnVarMessage(variableName, Object(_language_printer__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type)), node.type));\n }\n }\n };\n}", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function checkTypeNodeAsExpression(node) {\n // When we are emitting type metadata for decorators, we need to try to check the type\n // as if it were an expression so that we can emit the type in a value position when we\n // serialize the type metadata.\n if (node && node.kind === 155 /* TypeReference */) {\n var root = getFirstIdentifier(node.typeName);\n var meaning = root.parent.kind === 155 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */;\n // Resolve type so we know which symbol is referenced\n var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);\n // Resolved symbol is alias\n if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */) {\n var aliasTarget = resolveAlias(rootSymbol);\n // If alias has value symbol - mark alias as referenced\n if (aliasTarget.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {\n markAliasSymbolAsReferenced(rootSymbol);\n }\n }\n }\n }", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function hoistVars(ast) {\n var scopes = getScopes(ast);\n console.log(scopes.__nodeToScope);\n return\n query(ast, 'VariableDeclaration').forEach(function (node) {\n var scope = scopes.__get(node);\n console.log(\"=================================================================================\");\n console.log(scope);\n console.log(\"=================================================================================\");\n console.log(node);\n console.log(\"=================================================================================\");\n });\n}", "CheckingDataTypes()\n {\n // USE TYPEOF TO CHECK THE TYPE OF A VARIABLE AT RUNTIME\n let b = true;\n console.log(typeof b);\n\n console.log(typeof foo);\n }", "function $type(obj){\n\tif (obj === null || obj === undefined) return false;\n\tvar type = typeof obj;\n\tif (type == 'object'){\n\t\tif (obj.htmlElement) return 'element';\n\t\tif (obj.push) return 'array';\n\t\tif (obj.nodeName){\n\t\t\tswitch (obj.nodeType){\n\t\t\t\tcase 1: return 'element';\n\t\t\t\tcase 3: return obj.nodeValue.test(/\\S/) ? 'textnode' : 'whitespace';\n\t\t\t}\n\t\t}\n\t}\n\treturn type;\n}", "function parseJSDocTypeExpression() {\n var result = createNode(257 /* JSDocTypeExpression */, scanner.getTokenPos());\n parseExpected(15 /* OpenBraceToken */);\n result.type = parseJSDocTopLevelType();\n parseExpected(16 /* CloseBraceToken */);\n fixupParentReferences(result);\n return finishNode(result);\n }", "function isVar(x) {\n\treturn x.props && x.props.has('is','variable')\n}", "function addVar(type) {\n\t\tif (isIntoFunction) {\n\t\t\tlocalVarTable.push(type);\n\t\t\tlocalVarTable.push(thisToken);\n\t\t} else {\n\t\t\tvarTable.push({\n\t\t\t\tname: thisToken,\n\t\t\t\ttype: type,\n\t\t\t\tlength: 1\n\t\t\t});\n\t\t\tasm.push(' _' + thisToken + ' word ? ');\n\t\t\tasm.push(' ');\n\t\t}\n\t}", "function XPathResult_resultType() {\n var success;\n if(checkInitialization(builder, \"XPathResult_resultType\") != null) return;\n var doc;\n var resolver;\n var evaluator;\n var expression = \"/staff/employee\";\n var contextNode;\n var inresult = null;\n\n var outresult = null;\n\n var inNodeType;\n var outNodeType;\n var ANY_TYPE = 0;\n var NUMBER_TYPE = 1;\n var STRING_TYPE = 2;\n var BOOLEAN_TYPE = 3;\n var UNORDERED_NODE_ITERATOR_TYPE = 4;\n var ORDERED_NODE_ITERATOR_TYPE = 5;\n var UNORDERED_NODE_SNAPSHOT_TYPE = 6;\n var ORDERED_NODE_SNAPSHOT_TYPE = 7;\n var ANY_UNORDERED_NODE_TYPE = 8;\n var FIRST_ORDERED_NODE_TYPE = 9;\n var isTypeEqual;\n nodeTypeList = new Array();\n nodeTypeList[0] = 0;\n nodeTypeList[1] = 1;\n nodeTypeList[2] = 2;\n nodeTypeList[3] = 3;\n nodeTypeList[4] = 4;\n nodeTypeList[5] = 5;\n nodeTypeList[6] = 6;\n nodeTypeList[7] = 7;\n nodeTypeList[8] = 8;\n nodeTypeList[9] = 9;\n\n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n evaluator = createXPathEvaluator(doc);\nresolver = evaluator.createNSResolver(doc);\n contextNode = doc;\nfor(var indexN65737 = 0;indexN65737 < nodeTypeList.length; indexN65737++) {\n inNodeType = nodeTypeList[indexN65737];\n outresult = evaluator.evaluate(expression,contextNode,resolver,inNodeType,inresult);\n outNodeType = outresult.resultType;\n\n if(\n (inNodeType == ANY_TYPE)\n ) {\n assertEquals(\"ANY_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == NUMBER_TYPE)\n ) {\n assertEquals(\"NUMBER_TYPE_resulttype\",NUMBER_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == STRING_TYPE)\n ) {\n assertEquals(\"STRING_TYPE_resulttype\",STRING_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == BOOLEAN_TYPE)\n ) {\n assertEquals(\"BOOLEAN_TYPE_resulttype\",BOOLEAN_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_ITERATOR_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_ITERATOR_TYPE_resulttype\",ORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_SNAPSHOT_TYPE_resulttype\",UNORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_SNAPSHOT_TYPE_resulttype\",ORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ANY_UNORDERED_NODE_TYPE)\n ) {\n assertEquals(\"ANY_UNORDERED_NODE_TYPE_resulttype\",ANY_UNORDERED_NODE_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == FIRST_ORDERED_NODE_TYPE)\n ) {\n assertEquals(\"FIRST_ORDERED_NODE_TYPE_resulttype\",FIRST_ORDERED_NODE_TYPE,outNodeType);\n\n }\n\n }\n\n}", "function typeValidation(variable, type) {\n // Your code should be here ;) \n return typeof(variable) === type;\n}", "function processType(typeCache, resLoader, rawType, ctx) {\n var xsdNS = 'http://www.w3.org/2001/XMLSchema';\n if(!rawType || !(ctx instanceof LocalContext))\n throw new Error('Invalid raw type or context.');\n var result = undefined;\n // Function to process attributes\n var processAttrs = function(target) {\n var attrs = { };\n Util.arrayEach(target.attribute, function(attr) {\n attrs[attr.name + ((attr.use === 'required') ? '' : '?')] = stripNS(attr.type);\n }); \n return attrs; \n }\n if(rawType.sequence) {\n result = { '_$attrs': processAttrs(rawType) };\n var processElements = function(elements, context, target) {\n Util.arrayEach(elements, function(el) {\n var elType = undefined,\n elTypeNS = undefined;\n // Find occurrence info\n if(el.minOccurs === 'unbounded') el.minOccurs = 0;\n if(el.maxOccurs === 'unbounded') el.maxOccurs = Number.MAX_VALUE;\n if(typeof el.minOccurs !== 'number') el.minOccurs = 1;\n if(typeof el.maxOccurs !== 'number') el.maxOccurs = 1;\n var namePost = '';\n if(el.minOccurs === 1 && el.maxOccurs === 1) namePost = '';\n else if(el.minOccurs === 0 && el.maxOccurs === 1) namePost = '?';\n else namePost = '*';\n if(el.ref) {\n var referred = context.parseNamespace(el.ref),\n refEl = resLoader.searchInNamespace(referred.namespace, ['element', referred.value]);\n if(!refEl) throw new Error(\n 'Referred element `' + referred.value + '\\' not found in namespace `' + referred.namespace + '\\'.'\n );\n elType = refEl.type;\n elTypeNS = refEl.typeNamespace;\n } else {\n if(!el.type) {\n if(el.complexType) target[el.name + namePost] = processType(typeCache, resLoader, el.complexType, context);\n else if(el.simpleType) throw new Error('Not supported.');\n else throw new Error('Invalid element definition, no type specified.');\n return;\n }\n var parsed = context.parseNamespace(el.type);\n elType = parsed.value;\n elTypeNS = parsed.namespace;\n }\n // Basic Type\n if(elTypeNS === xsdNS) target[el.name + namePost] = elType;\n else {\n // console.log('ns: ' + elTypeNS + ' type: ' + elType);\n cacheType(typeCache, resLoader, elTypeNS, elType, true);\n target[el.name + namePost] = { '_$type': elType, '_$namespace': elTypeNS };\n }\n });\n }\n processElements(rawType.sequence.element, ctx, result);\n Util.arrayEach(rawType.sequence.choice, function(ch) {\n result['_$choices'] = result['_$choices'] || [];\n var thisChoice = { };\n // Find occurrence info\n if(ch.minOccurs === 'unbounded') ch.minOccurs = 0;\n if(ch.maxOccurs === 'unbounded') ch.maxOccurs = Number.MAX_VALUE;\n if(typeof ch.minOccurs !== 'number') ch.minOccurs = 1;\n if(typeof ch.maxOccurs !== 'number') ch.maxOccurs = 1;\n if(ch.minOccurs === 1 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '';\n else if(ch.minOccurs === 0 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '?';\n else thisChoice['_$occurrence'] = '*'; \n processElements(ch.element, ctx, thisChoice);\n result['_$choices'].push(thisChoice);\n });\n } else if(rawType.simpleContent || rawType.complexContent) {\n // We're processing some complexType\n // Under complexContent/simpleContent we only support [extension]\n result = processType(typeCache, resLoader, rawType.simpleContent ||rawType.complexContent, ctx); \n } else if(rawType.extension) { \n var baseType = ctx.parseNamespace(rawType.extension.base);\n if(baseType.namespace === xsdNS) {\n // If rawType.extension.base is base type(ie. under xsd namespace), then it has only [attribute]s.\n result = { '_$attrs': processAttrs(rawType.extension) };\n } else {\n // If rawType.extension.base is defined type, then it may have [attribute]s or [sequence,element]s.\n result = processType(typeCache, resLoader, rawType.extension, ctx) || { }; // in case that no sequence is defined.\n cacheType(typeCache, resLoader, baseType.namespace, baseType.value, true);\n result['_$base'] = { '_$type': baseType.value, '_$namespace': baseType.namespace };\n }\n } else if(rawType.restriction) {\n // We're processing some simpleType, only support enumeration for now, and ignore [base].\n result = [];\n Util.arrayEach(rawType.restriction.enumeration, \n function(entry) { entry.value && result.push(entry.value); });\n }\n \n return result;\n}", "function Type(x) {\n\tswitch (typeof x) {\n\tcase \"undefined\":\n\t\treturn \"Undefined\";\n\tcase \"boolean\":\n\t\treturn \"Boolean\";\n\tcase \"number\":\n\t\treturn \"Number\";\n\tcase \"string\":\n\t\treturn \"String\";\n\t}\n\tif (x === null) return \"Null\";\n\tif (x.Class !== undefined) return \"Object\";\n\tif (x.referencedName !== undefined) return \"Reference\";\n\tif (x.HasBinding !== undefined) return \"EnvironmentRecord\";\n\tassert(false);\n}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {\n if (declaration.flags & 134217728 /* JavaScriptFile */) {\n // If this is a variable in a JavaScript file, then use the JSDoc type (if it has\n // one as its type), otherwise fallback to the below standard TS codepaths to\n // try to figure it out.\n var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);\n if (type && type !== unknownType) {\n return type;\n }\n }\n // A variable declared in a for..in statement is always of type string\n if (declaration.parent.parent.kind === 207 /* ForInStatement */) {\n return stringType;\n }\n if (declaration.parent.parent.kind === 208 /* ForOfStatement */) {\n // checkRightHandSideOfForOf will return undefined if the for-of expression type was\n // missing properties/signatures required to get its iteratedType (like\n // [Symbol.iterator] or next). This may be because we accessed properties from anyType,\n // or it may have led to an error inside getElementTypeOfIterable.\n return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;\n }\n if (ts.isBindingPattern(declaration.parent)) {\n return getTypeForBindingElement(declaration);\n }\n // Use type from type annotation if one is present\n if (declaration.type) {\n return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality);\n }\n if (declaration.kind === 142 /* Parameter */) {\n var func = declaration.parent;\n // For a parameter of a set accessor, use the type of the get accessor if one is present\n if (func.kind === 150 /* SetAccessor */ && !ts.hasDynamicName(func)) {\n var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149 /* GetAccessor */);\n if (getter) {\n var getterSignature = getSignatureFromDeclaration(getter);\n var thisParameter = getAccessorThisParameter(func);\n if (thisParameter && declaration === thisParameter) {\n // Use the type from the *getter*\n ts.Debug.assert(!thisParameter.type);\n return getTypeOfSymbol(getterSignature.thisParameter);\n }\n return getReturnTypeOfSignature(getterSignature);\n }\n }\n // Use contextual parameter type if one is available\n var type = void 0;\n if (declaration.symbol.name === \"this\") {\n var thisParameter = getContextualThisParameter(func);\n type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;\n }\n else {\n type = getContextuallyTypedParameterType(declaration);\n }\n if (type) {\n return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);\n }\n }\n // Use the type of the initializer expression if one is present\n if (declaration.initializer) {\n return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality);\n }\n // If it is a short-hand property assignment, use the type of the identifier\n if (declaration.kind === 254 /* ShorthandPropertyAssignment */) {\n return checkIdentifier(declaration.name);\n }\n // If the declaration specifies a binding pattern, use the type implied by the binding pattern\n if (ts.isBindingPattern(declaration.name)) {\n return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true);\n }\n // No type specified and nothing can be inferred\n return undefined;\n }", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type);\n\n if (type && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n var typeName = Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type);\n\n if (type && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n var typeName = Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function astFromValue(_x, _x2) {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t var value = _x,\n\t type = _x2;\n\t _value = _ret = stringNum = isIntValue = fields = undefined;\n\t _again = false;\n\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _typeDefinition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if ((0, _jsutilsIsNullish2['default'])(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (Array.isArray(_value)) {\n\t var _ret = (function () {\n\t var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n\t return {\n\t v: {\n\t kind: _languageKinds.LIST,\n\t values: _value.map(function (item) {\n\t var itemValue = astFromValue(item, itemType);\n\t (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n\t return itemValue;\n\t })\n\t }\n\t };\n\t })();\n\n\t if (typeof _ret === 'object') return _ret.v;\n\t } else if (type instanceof _typeDefinition.GraphQLList) {\n\t // Because GraphQL will accept single values as a \"list of one\" when\n\t // expecting a list, if there's a non-array value and an expected list type,\n\t // create an AST using the list's item type.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if (typeof _value === 'boolean') {\n\t return { kind: _languageKinds.BOOLEAN, value: _value };\n\t }\n\n\t // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n\t // differentiate if available, otherwise prefer Int if the value is a\n\t // valid Int.\n\t if (typeof _value === 'number') {\n\t var stringNum = String(_value);\n\t var isIntValue = /^[0-9]+$/.test(stringNum);\n\t if (isIntValue) {\n\t if (type === _typeScalars.GraphQLFloat) {\n\t return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n\t }\n\t return { kind: _languageKinds.INT, value: stringNum };\n\t }\n\t return { kind: _languageKinds.FLOAT, value: stringNum };\n\t }\n\n\t // JavaScript strings can be Enum values or String values. Use the\n\t // GraphQLType to differentiate if possible.\n\t if (typeof _value === 'string') {\n\t if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n\t return { kind: _languageKinds.ENUM, value: _value };\n\t }\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n\t }\n\n\t // last remaining possible typeof\n\t (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object.\n\t var fields = [];\n\t _Object$keys(_value).forEach(function (fieldName) {\n\t var fieldType = undefined;\n\t if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n\t var fieldDef = type.getFields()[fieldName];\n\t fieldType = fieldDef && fieldDef.type;\n\t }\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fields.push({\n\t kind: _languageKinds.OBJECT_FIELD,\n\t name: { kind: _languageKinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return { kind: _languageKinds.OBJECT, fields: fields };\n\t }\n\t}", "function DeclareVariable(node, print) {\n this.push(\"declare var \");\n print.plain(node.id);\n print.plain(node.id.typeAnnotation);\n this.semicolon();\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected value node: ' + (0, _inspect[\"default\"])(valueNode));\n}", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "function hc_nodecommentnodetype() {\n var success;\n var doc;\n var testList;\n var commentNode;\n var commentNodeName;\n var nodeType;\n doc = load(\"hc_staff\");\n testList = doc.childNodes;\n\n for(var indexN65600 = 0;indexN65600 < testList.length; indexN65600++) {\n commentNode = testList.item(indexN65600);\n commentNodeName = commentNode.nodeName;\n\n \n\tif(\n\t(\"#comment\" == commentNodeName)\n\t) {\n\tnodeType = commentNode.nodeType;\n\n assertEquals(\"existingCommentNodeType\",8,nodeType);\n \n\t}\n\t\n\t}\n commentNode = doc.createComment(\"This is a comment\");\n nodeType = commentNode.nodeType;\n\n assertEquals(\"createdCommentNodeType\",8,nodeType);\n \n}", "function narrowType(type, expr, assumeTrue) {\n switch (expr.kind) {\n case 69 /* Identifier */:\n case 97 /* ThisKeyword */:\n case 172 /* PropertyAccessExpression */:\n return narrowTypeByTruthiness(type, expr, assumeTrue);\n case 174 /* CallExpression */:\n return narrowTypeByTypePredicate(type, expr, assumeTrue);\n case 178 /* ParenthesizedExpression */:\n return narrowType(type, expr.expression, assumeTrue);\n case 187 /* BinaryExpression */:\n return narrowTypeByBinaryExpression(type, expr, assumeTrue);\n case 185 /* PrefixUnaryExpression */:\n if (expr.operator === 49 /* ExclamationToken */) {\n return narrowType(type, expr.operand, !assumeTrue);\n }\n break;\n }\n return type;\n }", "function relaxType(type) {\n switch (type.kind) {\n case SimpleTypeKind.INTERSECTION:\n case SimpleTypeKind.UNION:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ENUM:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ARRAY:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.PROMISE:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.OBJECT:\n return {\n name: type.name,\n kind: SimpleTypeKind.OBJECT\n };\n case SimpleTypeKind.INTERFACE:\n case SimpleTypeKind.FUNCTION:\n case SimpleTypeKind.CLASS:\n return {\n name: type.name,\n kind: SimpleTypeKind.ANY\n };\n case SimpleTypeKind.NUMBER_LITERAL:\n return { kind: SimpleTypeKind.NUMBER };\n case SimpleTypeKind.STRING_LITERAL:\n return { kind: SimpleTypeKind.STRING };\n case SimpleTypeKind.BOOLEAN_LITERAL:\n return { kind: SimpleTypeKind.BOOLEAN };\n case SimpleTypeKind.BIG_INT_LITERAL:\n return { kind: SimpleTypeKind.BIG_INT };\n case SimpleTypeKind.ENUM_MEMBER:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.ALIAS:\n return __assign(__assign({}, type), { target: relaxType(type.target) });\n case SimpleTypeKind.NULL:\n case SimpleTypeKind.UNDEFINED:\n return { kind: SimpleTypeKind.ANY };\n default:\n return type;\n }\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n var typeName = (0, _printer.print)(node.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n var typeName = (0, _printer.print)(node.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function changeVariableType(variables) {\n for (var i in variables) {\n var variable = variables[i];\n if (variable[\"type\"] === \"TEXT\") {\n variable[\"type\"] = \"STRING\";\n }\n if (isNotUndefinedOrNull(variable.variableSet) && variable.variableSet.length > 0) {\n changeVariableType(variable.variableSet);\n }\n }\n}", "function getContextualTypeForConditionalOperand(node) {\n var conditional = node.parent;\n return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined;\n }", "function findTypeNodes(elem,type) {\n // Remove superfluous text nodes and merge adjacent text nodes\n elem.normalize();\n \n var typeNodes = new Array();\n // Search all children of this element to see which ones are the right type of node\n for(var nodeI = 0; nodeI < elem.childNodes.length; nodeI++) {\n if(elem.childNodes[nodeI].nodeType == type) typeNodes.push(elem.childNodes[nodeI]); // If it is a the right type of node, add it to the array\n else {\n // If not a the right type of node, search it in turn\n typeNodes = typeNodes.concat(findTypeNodes(elem.childNodes[nodeI],type));\n }\n }\n return typeNodes; // return the array\n}", "function VariableDeclaration(){ return ListNode.apply(this,arguments) }", "function DeclareVariable(node, print) {\n\t this.push(\"declare var \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation);\n\t this.semicolon();\n\t}" ]
[ "0.58858746", "0.58368564", "0.5826715", "0.57162446", "0.5668555", "0.5668555", "0.5585563", "0.5585563", "0.55811375", "0.55398476", "0.5510413", "0.5464499", "0.5436088", "0.54202086", "0.5418953", "0.5368937", "0.5345962", "0.53455883", "0.5313088", "0.529631", "0.5277158", "0.52666944", "0.5264016", "0.52602124", "0.5241391", "0.5241391", "0.52332187", "0.5216421", "0.5204967", "0.51988846", "0.5186549", "0.5179868", "0.51788217", "0.51788217", "0.51788217", "0.5174449", "0.51717067", "0.51717067", "0.51717067", "0.51717067", "0.51717067", "0.51717067", "0.51717067", "0.51669234", "0.5147062", "0.5147062", "0.514226", "0.5140221", "0.51165783", "0.5112921", "0.51094764", "0.50995225", "0.50982195", "0.50982195", "0.50982195", "0.50982195", "0.50982195", "0.50982195", "0.5094788", "0.50864446", "0.50763583", "0.50759184", "0.5075479", "0.5068323", "0.50629467", "0.50588596", "0.50373095", "0.50366044", "0.50366044", "0.50366044", "0.50351524", "0.50280565", "0.5022762", "0.50206035", "0.5011499", "0.500935", "0.500078", "0.49806607", "0.49706656", "0.4969397", "0.4957504", "0.4957504", "0.49521345", "0.49424914", "0.49402893", "0.49402893", "0.49360484", "0.49355268", "0.49342355", "0.4932109", "0.4932109", "0.49275506", "0.49164417", "0.49139944", "0.49119872", "0.49119872", "0.49092183", "0.49091768", "0.4908227", "0.49013495", "0.48939994" ]
0.0
-1
Don't make variable because it declares only types. Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations.
TSClassImplements(node) { this.visitTypeNodes(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "function isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\";\n}", "function f1(){\n var x;\n \n return typeof x;\n}", "function get_all_nodes_by_type(ast, typename) {\n\tvar nodes = [];\n\ttraverse(ast, function (node) {\n\t\tif (node.type == typename) {\n\t\t\tnodes.push(node);\n\t\t}\n\t});\n\treturn nodes;\n}", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function TypeRecursion() {}", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function getType(x) {\n if (!x) return false;\n if (x.element) return 'item';\n if (x instanceof HTMLElement) return 'html';\n if (x instanceof $) return 'jquery';\n return false;\n}", "function sc_typeof( x ) {\n return typeof x;\n}", "function scopeAndTypeCheck(root) {\n //Block sets scope\n if (root.nodeName === \"Block\") {\n //If seen before, go to parent scope\n if (root.visited === true) {\n currentScope = currentScope.parent;\n }\n else {\n //Has been visited, now\n root.visited = true;\n //Make new scope for new block\n if (currentScope !== null) {\n var oldScope = currentScope; //current scope is now old\n currentScope = new SymbolTableNode('Scope', currentScope.nodeVal + 1, {}, currentScope, []); //create a new scope\n oldScope.children.push(currentScope); //child of old scope\n currentScope.parent = oldScope; //scope is now the parent\n }\n else {\n currentScope = new SymbolTableNode('Scope', 0, {}, null, []);\n SymbolTableInstance = new SymbolTable(currentScope, currentScope);\n }\n //Check each Statement\n for (var i = 0; i < root.children.length; i++) {\n scopeAndTypeCheck(root.children[i]);\n }\n //When done checking all Statements under this Block, close the scope and return to the parent scope\n if (currentScope.parent !== null) {\n currentScope = currentScope.parent;\n }\n }\n }\n else if (root.nodeName === \"VariableDeclaration\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n //If this variable already exists in this scope...\n if (currentScope.find(root.children[1])) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[1].nodeVal + \" was redeclared on line \" + root.children[1].lineNumber);\n }\n else {\n currentScope.addVariable(root.children[1], root.children[0]);\n }\n }\n else if (root.nodeName === \"Assignment\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n //Variable has not been found yet\n var isFound = false;\n //Type of parent variable\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not...\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n //If variable is not found in current scope... must search parent scopes\n if (!isFound) {\n //Search all parent scopes, and save type if found\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n //If still not found, it's undeclared.\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true;\n }\n }\n //Find the type - whether in this scope or in parent scope.\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n //The type of the RightVal.\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type errors - mismatch of Left and Right sides\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Output\") {\n //Set scope of variable\n root.children[0].scope = currentScope.nodeVal;\n //Variable is not yet found\n var isFound = false;\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"OutputVal\") {\n if (root.children[0].nodeVal !== \"?\") {\n isFound = currentScope.find(root.children[0]);\n }\n }\n //\"?\" means literal - no scope errors are shown in case of printing a literal int, bool or string\n if (!isFound && root.children[0].nodeVal !== \"?\") {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Printing counts as variable use\n }\n }\n }\n else if (root.nodeName === \"If\" || root.nodeName === \"While\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n scopeAndTypeCheck(root.children[0]); //check test\n scopeAndTypeCheck(root.children[1]); //check block\n }\n else if (root.nodeName === \"CompareTest\") {\n //Set scope of variables\n root.children[0].scope = currentScope.nodeVal;\n root.children[1].scope = currentScope.nodeVal;\n var isFound = false;\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n if (!isFound) {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Comparing counts as variable use\n }\n }\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type mismatches in comparability\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Add\") {\n }\n else {\n }\n}", "function getContextualType(node) {\n if (isInsideWithStatementBody(node)) {\n // We cannot answer semantic questions within a with block, do not proceed any further\n return undefined;\n }\n if (node.contextualType) {\n return node.contextualType;\n }\n var parent = node.parent;\n switch (parent.kind) {\n case 218 /* VariableDeclaration */:\n case 142 /* Parameter */:\n case 145 /* PropertyDeclaration */:\n case 144 /* PropertySignature */:\n case 169 /* BindingElement */:\n return getContextualTypeForInitializerExpression(node);\n case 180 /* ArrowFunction */:\n case 211 /* ReturnStatement */:\n return getContextualTypeForReturnExpression(node);\n case 190 /* YieldExpression */:\n return getContextualTypeForYieldOperand(parent);\n case 174 /* CallExpression */:\n case 175 /* NewExpression */:\n return getContextualTypeForArgument(parent, node);\n case 177 /* TypeAssertionExpression */:\n case 195 /* AsExpression */:\n return getTypeFromTypeNode(parent.type);\n case 187 /* BinaryExpression */:\n return getContextualTypeForBinaryOperand(node);\n case 253 /* PropertyAssignment */:\n return getContextualTypeForObjectLiteralElement(parent);\n case 170 /* ArrayLiteralExpression */:\n return getContextualTypeForElementExpression(node);\n case 188 /* ConditionalExpression */:\n return getContextualTypeForConditionalOperand(node);\n case 197 /* TemplateSpan */:\n ts.Debug.assert(parent.parent.kind === 189 /* TemplateExpression */);\n return getContextualTypeForSubstitutionExpression(parent.parent, node);\n case 178 /* ParenthesizedExpression */:\n return getContextualType(parent);\n case 248 /* JsxExpression */:\n return getContextualType(parent);\n case 246 /* JsxAttribute */:\n case 247 /* JsxSpreadAttribute */:\n return getContextualTypeForJsxAttribute(parent);\n }\n return undefined;\n }", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "function createTypeExpression(node) {\n if (node.type == 'Identifier') {\n return node;\n } else if (node.type == 'QualifiedTypeIdentifier') {\n return t.memberExpression(createTypeExpression(node.qualification), createTypeExpression(node.id));\n }\n\n throw this.errorWithNode('Unsupported type: ' + node.type);\n }", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function Type(x) {\n\t if (x === null)\n\t return 1 /* Null */;\n\t switch (typeof x) {\n\t case \"undefined\": return 0 /* Undefined */;\n\t case \"boolean\": return 2 /* Boolean */;\n\t case \"string\": return 3 /* String */;\n\t case \"symbol\": return 4 /* Symbol */;\n\t case \"number\": return 5 /* Number */;\n\t case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n\t default: return 6 /* Object */;\n\t }\n\t }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function isType(node) {\n return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function evaluateVariableStatement(_a) {\n var { node } = _a, rest = __rest(_a, [\"node\"]);\n evaluateVariableDeclarationList(Object.assign({ node: node.declarationList }, rest));\n}", "function innerType(n) { }", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function walkTreeVars(tree) {\n walkAddParent(tree, node => {\n if (!node || !node.type)\n return;\n switch (node.type) {\n case 'BlockStatement':\n return initBlock(node);\n case 'VariableDeclarator':\n return addLocalVar(node);\n }\n });\n}", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "function getVariables(node) {\r\n var variables = [], anonymousTypes = [], name, type;\r\n var declarationList = Array.isArray(node.declarationList)\r\n ? node.declarationList : [node.declarationList];\r\n for (var i = 0; i < declarationList.length; i++) {\r\n var declarations = declarationList[i].declarations;\r\n for (var j = 0; j < declarations.length; j++) {\r\n name = declarations[j].name.text;\r\n if (declarations[j].type.kind == ts.SyntaxKind.TypeLiteral) {\r\n type = visitInterface(declarations[j].type, { name: name + \"Type\", anonymous: true });\r\n anonymousTypes.push(type);\r\n type = type.name;\r\n }\r\n else {\r\n type = getType(declarations[j].type);\r\n }\r\n variables.push({\r\n name: name,\r\n type: type,\r\n static: true,\r\n parameters: []\r\n });\r\n }\r\n }\r\n return {\r\n variables: variables,\r\n anonymousTypes: anonymousTypes\r\n };\r\n}", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function typeOfValue(x) {\n return typeof x;\n}", "lookAtNodeType(expr) {\n switch(expr.type) {\n case \"blockStmt\": return this.getBlockStmt(expr); \n case \"varDecl\": return this.getVarDecl(expr);\n case \"variableExpr\": return this.getVariableExpr(expr);\n case \"assignExpr\": return this.getAssignExpr(expr);\n case \"functionDecl\": return this.getFunctionDecl(expr);\n case \"expressionStmt\": return this.getExpressionStmt(expr);\n case \"ifStmt\": return this.getIfStmt(expr);\n case \"printStmt\": return this.getPrintStmt(expr);\n case \"returnStmt\": return this.getReturnStmt(expr);\n case \"whileStmt\": return this.getWhileStmt(expr);\n case \"binaryExpr\": return this.getBinaryExpr(expr);\n case \"callExpr\": return this.getCallExpr(expr);\n case \"groupingExpr\": return this.getGroupingExpr(expr);\n case \"literalExpr\": return this.getLiteralExpr(expr);\n case \"logicalExpr\": return this.getLogicalExpr(expr);\n case \"unaryExpr\": return this.getUnaryExpr(expr);\n default:\n throw new RuntimeError('Resolver cannot evaluate expression or statement')\n }\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function initTypeVariableScopeTracking(state) {\n state.g.typeVariableScopeDepth = {};\n}", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function $type(obj){\n if (obj == undefined) \n return false;\n if (obj.htmlElement) \n return 'element';\n var type = typeof obj;\n if (type == 'object' && obj.nodeName) {\n switch (obj.nodeType) {\n case 1:\n return 'element';\n case 3:\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n }\n if (type == 'object' || type == 'function') {\n switch (obj.constructor) {\n case Array:\n return 'array';\n case RegExp:\n return 'regexp';\n }\n if (typeof obj.length == 'number') {\n if (obj.item) \n return 'collection';\n if (obj.callee) \n return 'arguments';\n }\n }\n return type;\n}", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n // If the variable type is not an input type, return an error.\n if (type && !(0, _typeDefinition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n }\n }\n };\n}", "getTypeNode() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.type);\r\n }", "function Type() {\n if (currentToken() == \"inteiro\" || currentToken() == \"real\" || currentToken() == \"texto\" || currentToken() == \"boleano\" || currentToken() == \"vazio\" || currentClass() == IDENTIFIER) {\n currentType = currentToken();\n return;\n } else {\n let errorMessage = \"Tipo de variável não reconhecido\";\n handleError(errorMessage);\n return;\n }\n }", "function evaluateTypeOfExpression({ node, environment, evaluate, statementTraversalStack }) {\n return typeof evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function staticallyVerifyType(node, types) {\n if (isNodeNully(node)) {\n return types.indexOf(\"null\") > -1 || types.indexOf(\"undefined\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"Literal\") {\n if (node.regex) {\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(\"RegExp\")) ? TYPE_VALID : TYPE_INVALID;\n } else {\n return types.indexOf(typeof node.value) > -1 ? TYPE_VALID : TYPE_INVALID;\n }\n } else if (node.type === \"ObjectExpression\") {\n return types.indexOf(\"object\") > -1 || types.indexOf(\"shape\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"ArrayExpression\") {\n return types.indexOf(\"array\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (t.isFunction(node)) {\n return types.indexOf(\"function\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'NewExpression' && node.callee.type === 'Identifier') {\n // this is of the form `return new SomeClass()`\n // @fixme it should be possible to do this with non computed member expressions too\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(node.callee.name)) ? TYPE_VALID : TYPE_UNKNOWN;\n } else if (isBooleanExpression(node)) {\n return types.indexOf('boolean') > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'Identifier') {\n // check the scope to see if this is a `const` value\n return node;\n } else {\n return TYPE_UNKNOWN; // will produce a runtime type check\n }\n }", "function isIndependentVariableLikeDeclaration(node) {\n return node.type && isIndependentType(node.type) || !node.type && !node.initializer;\n }", "function $type(obj){\r\n if (!$defined(obj)) \r\n return false;\r\n if (obj.htmlElement) \r\n return 'element';\r\n var type = typeof obj;\r\n if (type == 'object' && obj.nodeName) {\r\n switch (obj.nodeType) {\r\n case 1:\r\n return 'element';\r\n case 3:\r\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\r\n }\r\n }\r\n if (type == 'object' || type == 'function') {\r\n switch (obj.constructor) {\r\n case Array:\r\n return 'array';\r\n case RegExp:\r\n return 'regexp';\r\n case Class:\r\n return 'class';\r\n }\r\n if (typeof obj.length == 'number') {\r\n if (obj.item) \r\n return 'collection';\r\n if (obj.callee) \r\n return 'arguments';\r\n }\r\n }\r\n return type;\r\n }", "static getTypeID(ast) { return ast.typeID }", "compileNode(o) {\r\n\t\t\t\t\tvar answer, compiledName, isValue, name, properties, prototype, ref1, ref2, ref3, ref4, val;\r\n\t\t\t\t\tisValue = this.variable instanceof Value;\r\n\t\t\t\t\tif (isValue) {\r\n\t\t\t\t\t\t// If `@variable` is an array or an object, we’re destructuring;\r\n\t\t\t\t\t\t// if it’s also `isAssignable()`, the destructuring syntax is supported\r\n\t\t\t\t\t\t// in ES and we can output it as is; otherwise we `@compileDestructuring`\r\n\t\t\t\t\t\t// and convert this ES-unsupported destructuring into acceptable output.\r\n\t\t\t\t\t\tif (this.variable.isArray() || this.variable.isObject()) {\r\n\t\t\t\t\t\t\tif (!this.variable.isAssignable()) {\r\n\t\t\t\t\t\t\t\tif (this.variable.isObject() && this.variable.base.hasSplat()) {\r\n\t\t\t\t\t\t\t\t\treturn this.compileObjectDestruct(o);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\treturn this.compileDestructuring(o);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.variable.isSplice()) {\r\n\t\t\t\t\t\t\treturn this.compileSplice(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.isConditional()) {\r\n\t\t\t\t\t\t\treturn this.compileConditional(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((ref1 = this.context) === '//=' || ref1 === '%%=') {\r\n\t\t\t\t\t\t\treturn this.compileSpecialMath(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addScopeVariables(o);\r\n\t\t\t\t\tif (this.value instanceof Code) {\r\n\t\t\t\t\t\tif (this.value.isStatic) {\r\n\t\t\t\t\t\t\tthis.value.name = this.variable.properties[0];\r\n\t\t\t\t\t\t} else if (((ref2 = this.variable.properties) != null ? ref2.length : void 0) >= 2) {\r\n\t\t\t\t\t\t\tref3 = this.variable.properties, [...properties] = ref3, [prototype, name] = splice.call(properties, -2);\r\n\t\t\t\t\t\t\tif (((ref4 = prototype.name) != null ? ref4.value : void 0) === 'prototype') {\r\n\t\t\t\t\t\t\t\tthis.value.name = name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tval = this.value.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tcompiledName = this.variable.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tif (this.context === 'object') {\r\n\t\t\t\t\t\tif (this.variable.shouldCache()) {\r\n\t\t\t\t\t\t\tcompiledName.unshift(this.makeCode('['));\r\n\t\t\t\t\t\t\tcompiledName.push(this.makeCode(']'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn compiledName.concat(this.makeCode(': '), val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer = compiledName.concat(this.makeCode(` ${this.context || '='} `), val);\r\n\t\t\t\t\t// Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Assignment_without_declaration,\r\n\t\t\t\t\t// if we’re destructuring without declaring, the destructuring assignment must be wrapped in parentheses.\r\n\t\t\t\t\t// The assignment is wrapped in parentheses if 'o.level' has lower precedence than LEVEL_LIST (3)\r\n\t\t\t\t\t// (i.e. LEVEL_COND (4), LEVEL_OP (5) or LEVEL_ACCESS (6)), or if we're destructuring object, e.g. {a,b} = obj.\r\n\t\t\t\t\tif (o.level > LEVEL_LIST || isValue && this.variable.base instanceof Obj && !this.nestedLhs && !(this.param === true)) {\r\n\t\t\t\t\t\treturn this.wrapInParentheses(answer);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function VariablesAreInputTypes(context) {\n\t return {\n\t VariableDefinition: function VariableDefinition(node) {\n\t var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n\t // If the variable type is not an input type, return an error.\n\t if (type && !(0, _typeDefinition.isInputType)(type)) {\n\t var variableName = node.variable.name.value;\n\t context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n\t }\n\t }\n\t };\n\t}", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n // If the variable type is not an input type, return an error.\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _printer.print)(node.type)), [node.type]));\n }\n }\n };\n}", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type); // If the variable type is not an input type, return an error.\n\n if (type && !Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](nonInputTypeOnVarMessage(variableName, Object(_language_printer__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type)), node.type));\n }\n }\n };\n}", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function checkTypeNodeAsExpression(node) {\n // When we are emitting type metadata for decorators, we need to try to check the type\n // as if it were an expression so that we can emit the type in a value position when we\n // serialize the type metadata.\n if (node && node.kind === 155 /* TypeReference */) {\n var root = getFirstIdentifier(node.typeName);\n var meaning = root.parent.kind === 155 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */;\n // Resolve type so we know which symbol is referenced\n var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);\n // Resolved symbol is alias\n if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */) {\n var aliasTarget = resolveAlias(rootSymbol);\n // If alias has value symbol - mark alias as referenced\n if (aliasTarget.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {\n markAliasSymbolAsReferenced(rootSymbol);\n }\n }\n }\n }", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function hoistVars(ast) {\n var scopes = getScopes(ast);\n console.log(scopes.__nodeToScope);\n return\n query(ast, 'VariableDeclaration').forEach(function (node) {\n var scope = scopes.__get(node);\n console.log(\"=================================================================================\");\n console.log(scope);\n console.log(\"=================================================================================\");\n console.log(node);\n console.log(\"=================================================================================\");\n });\n}", "CheckingDataTypes()\n {\n // USE TYPEOF TO CHECK THE TYPE OF A VARIABLE AT RUNTIME\n let b = true;\n console.log(typeof b);\n\n console.log(typeof foo);\n }", "function $type(obj){\n\tif (obj === null || obj === undefined) return false;\n\tvar type = typeof obj;\n\tif (type == 'object'){\n\t\tif (obj.htmlElement) return 'element';\n\t\tif (obj.push) return 'array';\n\t\tif (obj.nodeName){\n\t\t\tswitch (obj.nodeType){\n\t\t\t\tcase 1: return 'element';\n\t\t\t\tcase 3: return obj.nodeValue.test(/\\S/) ? 'textnode' : 'whitespace';\n\t\t\t}\n\t\t}\n\t}\n\treturn type;\n}", "function parseJSDocTypeExpression() {\n var result = createNode(257 /* JSDocTypeExpression */, scanner.getTokenPos());\n parseExpected(15 /* OpenBraceToken */);\n result.type = parseJSDocTopLevelType();\n parseExpected(16 /* CloseBraceToken */);\n fixupParentReferences(result);\n return finishNode(result);\n }", "function isVar(x) {\n\treturn x.props && x.props.has('is','variable')\n}", "function addVar(type) {\n\t\tif (isIntoFunction) {\n\t\t\tlocalVarTable.push(type);\n\t\t\tlocalVarTable.push(thisToken);\n\t\t} else {\n\t\t\tvarTable.push({\n\t\t\t\tname: thisToken,\n\t\t\t\ttype: type,\n\t\t\t\tlength: 1\n\t\t\t});\n\t\t\tasm.push(' _' + thisToken + ' word ? ');\n\t\t\tasm.push(' ');\n\t\t}\n\t}", "function XPathResult_resultType() {\n var success;\n if(checkInitialization(builder, \"XPathResult_resultType\") != null) return;\n var doc;\n var resolver;\n var evaluator;\n var expression = \"/staff/employee\";\n var contextNode;\n var inresult = null;\n\n var outresult = null;\n\n var inNodeType;\n var outNodeType;\n var ANY_TYPE = 0;\n var NUMBER_TYPE = 1;\n var STRING_TYPE = 2;\n var BOOLEAN_TYPE = 3;\n var UNORDERED_NODE_ITERATOR_TYPE = 4;\n var ORDERED_NODE_ITERATOR_TYPE = 5;\n var UNORDERED_NODE_SNAPSHOT_TYPE = 6;\n var ORDERED_NODE_SNAPSHOT_TYPE = 7;\n var ANY_UNORDERED_NODE_TYPE = 8;\n var FIRST_ORDERED_NODE_TYPE = 9;\n var isTypeEqual;\n nodeTypeList = new Array();\n nodeTypeList[0] = 0;\n nodeTypeList[1] = 1;\n nodeTypeList[2] = 2;\n nodeTypeList[3] = 3;\n nodeTypeList[4] = 4;\n nodeTypeList[5] = 5;\n nodeTypeList[6] = 6;\n nodeTypeList[7] = 7;\n nodeTypeList[8] = 8;\n nodeTypeList[9] = 9;\n\n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n evaluator = createXPathEvaluator(doc);\nresolver = evaluator.createNSResolver(doc);\n contextNode = doc;\nfor(var indexN65737 = 0;indexN65737 < nodeTypeList.length; indexN65737++) {\n inNodeType = nodeTypeList[indexN65737];\n outresult = evaluator.evaluate(expression,contextNode,resolver,inNodeType,inresult);\n outNodeType = outresult.resultType;\n\n if(\n (inNodeType == ANY_TYPE)\n ) {\n assertEquals(\"ANY_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == NUMBER_TYPE)\n ) {\n assertEquals(\"NUMBER_TYPE_resulttype\",NUMBER_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == STRING_TYPE)\n ) {\n assertEquals(\"STRING_TYPE_resulttype\",STRING_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == BOOLEAN_TYPE)\n ) {\n assertEquals(\"BOOLEAN_TYPE_resulttype\",BOOLEAN_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_ITERATOR_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_ITERATOR_TYPE_resulttype\",ORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_SNAPSHOT_TYPE_resulttype\",UNORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_SNAPSHOT_TYPE_resulttype\",ORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ANY_UNORDERED_NODE_TYPE)\n ) {\n assertEquals(\"ANY_UNORDERED_NODE_TYPE_resulttype\",ANY_UNORDERED_NODE_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == FIRST_ORDERED_NODE_TYPE)\n ) {\n assertEquals(\"FIRST_ORDERED_NODE_TYPE_resulttype\",FIRST_ORDERED_NODE_TYPE,outNodeType);\n\n }\n\n }\n\n}", "function typeValidation(variable, type) {\n // Your code should be here ;) \n return typeof(variable) === type;\n}", "function processType(typeCache, resLoader, rawType, ctx) {\n var xsdNS = 'http://www.w3.org/2001/XMLSchema';\n if(!rawType || !(ctx instanceof LocalContext))\n throw new Error('Invalid raw type or context.');\n var result = undefined;\n // Function to process attributes\n var processAttrs = function(target) {\n var attrs = { };\n Util.arrayEach(target.attribute, function(attr) {\n attrs[attr.name + ((attr.use === 'required') ? '' : '?')] = stripNS(attr.type);\n }); \n return attrs; \n }\n if(rawType.sequence) {\n result = { '_$attrs': processAttrs(rawType) };\n var processElements = function(elements, context, target) {\n Util.arrayEach(elements, function(el) {\n var elType = undefined,\n elTypeNS = undefined;\n // Find occurrence info\n if(el.minOccurs === 'unbounded') el.minOccurs = 0;\n if(el.maxOccurs === 'unbounded') el.maxOccurs = Number.MAX_VALUE;\n if(typeof el.minOccurs !== 'number') el.minOccurs = 1;\n if(typeof el.maxOccurs !== 'number') el.maxOccurs = 1;\n var namePost = '';\n if(el.minOccurs === 1 && el.maxOccurs === 1) namePost = '';\n else if(el.minOccurs === 0 && el.maxOccurs === 1) namePost = '?';\n else namePost = '*';\n if(el.ref) {\n var referred = context.parseNamespace(el.ref),\n refEl = resLoader.searchInNamespace(referred.namespace, ['element', referred.value]);\n if(!refEl) throw new Error(\n 'Referred element `' + referred.value + '\\' not found in namespace `' + referred.namespace + '\\'.'\n );\n elType = refEl.type;\n elTypeNS = refEl.typeNamespace;\n } else {\n if(!el.type) {\n if(el.complexType) target[el.name + namePost] = processType(typeCache, resLoader, el.complexType, context);\n else if(el.simpleType) throw new Error('Not supported.');\n else throw new Error('Invalid element definition, no type specified.');\n return;\n }\n var parsed = context.parseNamespace(el.type);\n elType = parsed.value;\n elTypeNS = parsed.namespace;\n }\n // Basic Type\n if(elTypeNS === xsdNS) target[el.name + namePost] = elType;\n else {\n // console.log('ns: ' + elTypeNS + ' type: ' + elType);\n cacheType(typeCache, resLoader, elTypeNS, elType, true);\n target[el.name + namePost] = { '_$type': elType, '_$namespace': elTypeNS };\n }\n });\n }\n processElements(rawType.sequence.element, ctx, result);\n Util.arrayEach(rawType.sequence.choice, function(ch) {\n result['_$choices'] = result['_$choices'] || [];\n var thisChoice = { };\n // Find occurrence info\n if(ch.minOccurs === 'unbounded') ch.minOccurs = 0;\n if(ch.maxOccurs === 'unbounded') ch.maxOccurs = Number.MAX_VALUE;\n if(typeof ch.minOccurs !== 'number') ch.minOccurs = 1;\n if(typeof ch.maxOccurs !== 'number') ch.maxOccurs = 1;\n if(ch.minOccurs === 1 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '';\n else if(ch.minOccurs === 0 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '?';\n else thisChoice['_$occurrence'] = '*'; \n processElements(ch.element, ctx, thisChoice);\n result['_$choices'].push(thisChoice);\n });\n } else if(rawType.simpleContent || rawType.complexContent) {\n // We're processing some complexType\n // Under complexContent/simpleContent we only support [extension]\n result = processType(typeCache, resLoader, rawType.simpleContent ||rawType.complexContent, ctx); \n } else if(rawType.extension) { \n var baseType = ctx.parseNamespace(rawType.extension.base);\n if(baseType.namespace === xsdNS) {\n // If rawType.extension.base is base type(ie. under xsd namespace), then it has only [attribute]s.\n result = { '_$attrs': processAttrs(rawType.extension) };\n } else {\n // If rawType.extension.base is defined type, then it may have [attribute]s or [sequence,element]s.\n result = processType(typeCache, resLoader, rawType.extension, ctx) || { }; // in case that no sequence is defined.\n cacheType(typeCache, resLoader, baseType.namespace, baseType.value, true);\n result['_$base'] = { '_$type': baseType.value, '_$namespace': baseType.namespace };\n }\n } else if(rawType.restriction) {\n // We're processing some simpleType, only support enumeration for now, and ignore [base].\n result = [];\n Util.arrayEach(rawType.restriction.enumeration, \n function(entry) { entry.value && result.push(entry.value); });\n }\n \n return result;\n}", "function Type(x) {\n\tswitch (typeof x) {\n\tcase \"undefined\":\n\t\treturn \"Undefined\";\n\tcase \"boolean\":\n\t\treturn \"Boolean\";\n\tcase \"number\":\n\t\treturn \"Number\";\n\tcase \"string\":\n\t\treturn \"String\";\n\t}\n\tif (x === null) return \"Null\";\n\tif (x.Class !== undefined) return \"Object\";\n\tif (x.referencedName !== undefined) return \"Reference\";\n\tif (x.HasBinding !== undefined) return \"EnvironmentRecord\";\n\tassert(false);\n}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {\n if (declaration.flags & 134217728 /* JavaScriptFile */) {\n // If this is a variable in a JavaScript file, then use the JSDoc type (if it has\n // one as its type), otherwise fallback to the below standard TS codepaths to\n // try to figure it out.\n var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);\n if (type && type !== unknownType) {\n return type;\n }\n }\n // A variable declared in a for..in statement is always of type string\n if (declaration.parent.parent.kind === 207 /* ForInStatement */) {\n return stringType;\n }\n if (declaration.parent.parent.kind === 208 /* ForOfStatement */) {\n // checkRightHandSideOfForOf will return undefined if the for-of expression type was\n // missing properties/signatures required to get its iteratedType (like\n // [Symbol.iterator] or next). This may be because we accessed properties from anyType,\n // or it may have led to an error inside getElementTypeOfIterable.\n return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;\n }\n if (ts.isBindingPattern(declaration.parent)) {\n return getTypeForBindingElement(declaration);\n }\n // Use type from type annotation if one is present\n if (declaration.type) {\n return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality);\n }\n if (declaration.kind === 142 /* Parameter */) {\n var func = declaration.parent;\n // For a parameter of a set accessor, use the type of the get accessor if one is present\n if (func.kind === 150 /* SetAccessor */ && !ts.hasDynamicName(func)) {\n var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149 /* GetAccessor */);\n if (getter) {\n var getterSignature = getSignatureFromDeclaration(getter);\n var thisParameter = getAccessorThisParameter(func);\n if (thisParameter && declaration === thisParameter) {\n // Use the type from the *getter*\n ts.Debug.assert(!thisParameter.type);\n return getTypeOfSymbol(getterSignature.thisParameter);\n }\n return getReturnTypeOfSignature(getterSignature);\n }\n }\n // Use contextual parameter type if one is available\n var type = void 0;\n if (declaration.symbol.name === \"this\") {\n var thisParameter = getContextualThisParameter(func);\n type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;\n }\n else {\n type = getContextuallyTypedParameterType(declaration);\n }\n if (type) {\n return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);\n }\n }\n // Use the type of the initializer expression if one is present\n if (declaration.initializer) {\n return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality);\n }\n // If it is a short-hand property assignment, use the type of the identifier\n if (declaration.kind === 254 /* ShorthandPropertyAssignment */) {\n return checkIdentifier(declaration.name);\n }\n // If the declaration specifies a binding pattern, use the type implied by the binding pattern\n if (ts.isBindingPattern(declaration.name)) {\n return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true);\n }\n // No type specified and nothing can be inferred\n return undefined;\n }", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type);\n\n if (type && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n var typeName = Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type);\n\n if (type && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n var typeName = Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function astFromValue(_x, _x2) {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t var value = _x,\n\t type = _x2;\n\t _value = _ret = stringNum = isIntValue = fields = undefined;\n\t _again = false;\n\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _typeDefinition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if ((0, _jsutilsIsNullish2['default'])(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (Array.isArray(_value)) {\n\t var _ret = (function () {\n\t var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n\t return {\n\t v: {\n\t kind: _languageKinds.LIST,\n\t values: _value.map(function (item) {\n\t var itemValue = astFromValue(item, itemType);\n\t (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n\t return itemValue;\n\t })\n\t }\n\t };\n\t })();\n\n\t if (typeof _ret === 'object') return _ret.v;\n\t } else if (type instanceof _typeDefinition.GraphQLList) {\n\t // Because GraphQL will accept single values as a \"list of one\" when\n\t // expecting a list, if there's a non-array value and an expected list type,\n\t // create an AST using the list's item type.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if (typeof _value === 'boolean') {\n\t return { kind: _languageKinds.BOOLEAN, value: _value };\n\t }\n\n\t // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n\t // differentiate if available, otherwise prefer Int if the value is a\n\t // valid Int.\n\t if (typeof _value === 'number') {\n\t var stringNum = String(_value);\n\t var isIntValue = /^[0-9]+$/.test(stringNum);\n\t if (isIntValue) {\n\t if (type === _typeScalars.GraphQLFloat) {\n\t return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n\t }\n\t return { kind: _languageKinds.INT, value: stringNum };\n\t }\n\t return { kind: _languageKinds.FLOAT, value: stringNum };\n\t }\n\n\t // JavaScript strings can be Enum values or String values. Use the\n\t // GraphQLType to differentiate if possible.\n\t if (typeof _value === 'string') {\n\t if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n\t return { kind: _languageKinds.ENUM, value: _value };\n\t }\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n\t }\n\n\t // last remaining possible typeof\n\t (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object.\n\t var fields = [];\n\t _Object$keys(_value).forEach(function (fieldName) {\n\t var fieldType = undefined;\n\t if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n\t var fieldDef = type.getFields()[fieldName];\n\t fieldType = fieldDef && fieldDef.type;\n\t }\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fields.push({\n\t kind: _languageKinds.OBJECT_FIELD,\n\t name: { kind: _languageKinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return { kind: _languageKinds.OBJECT, fields: fields };\n\t }\n\t}", "function DeclareVariable(node, print) {\n this.push(\"declare var \");\n print.plain(node.id);\n print.plain(node.id.typeAnnotation);\n this.semicolon();\n}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected value node: ' + (0, _inspect[\"default\"])(valueNode));\n}", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "function hc_nodecommentnodetype() {\n var success;\n var doc;\n var testList;\n var commentNode;\n var commentNodeName;\n var nodeType;\n doc = load(\"hc_staff\");\n testList = doc.childNodes;\n\n for(var indexN65600 = 0;indexN65600 < testList.length; indexN65600++) {\n commentNode = testList.item(indexN65600);\n commentNodeName = commentNode.nodeName;\n\n \n\tif(\n\t(\"#comment\" == commentNodeName)\n\t) {\n\tnodeType = commentNode.nodeType;\n\n assertEquals(\"existingCommentNodeType\",8,nodeType);\n \n\t}\n\t\n\t}\n commentNode = doc.createComment(\"This is a comment\");\n nodeType = commentNode.nodeType;\n\n assertEquals(\"createdCommentNodeType\",8,nodeType);\n \n}", "function narrowType(type, expr, assumeTrue) {\n switch (expr.kind) {\n case 69 /* Identifier */:\n case 97 /* ThisKeyword */:\n case 172 /* PropertyAccessExpression */:\n return narrowTypeByTruthiness(type, expr, assumeTrue);\n case 174 /* CallExpression */:\n return narrowTypeByTypePredicate(type, expr, assumeTrue);\n case 178 /* ParenthesizedExpression */:\n return narrowType(type, expr.expression, assumeTrue);\n case 187 /* BinaryExpression */:\n return narrowTypeByBinaryExpression(type, expr, assumeTrue);\n case 185 /* PrefixUnaryExpression */:\n if (expr.operator === 49 /* ExclamationToken */) {\n return narrowType(type, expr.operand, !assumeTrue);\n }\n break;\n }\n return type;\n }", "function relaxType(type) {\n switch (type.kind) {\n case SimpleTypeKind.INTERSECTION:\n case SimpleTypeKind.UNION:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ENUM:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ARRAY:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.PROMISE:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.OBJECT:\n return {\n name: type.name,\n kind: SimpleTypeKind.OBJECT\n };\n case SimpleTypeKind.INTERFACE:\n case SimpleTypeKind.FUNCTION:\n case SimpleTypeKind.CLASS:\n return {\n name: type.name,\n kind: SimpleTypeKind.ANY\n };\n case SimpleTypeKind.NUMBER_LITERAL:\n return { kind: SimpleTypeKind.NUMBER };\n case SimpleTypeKind.STRING_LITERAL:\n return { kind: SimpleTypeKind.STRING };\n case SimpleTypeKind.BOOLEAN_LITERAL:\n return { kind: SimpleTypeKind.BOOLEAN };\n case SimpleTypeKind.BIG_INT_LITERAL:\n return { kind: SimpleTypeKind.BIG_INT };\n case SimpleTypeKind.ENUM_MEMBER:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.ALIAS:\n return __assign(__assign({}, type), { target: relaxType(type.target) });\n case SimpleTypeKind.NULL:\n case SimpleTypeKind.UNDEFINED:\n return { kind: SimpleTypeKind.ANY };\n default:\n return type;\n }\n}", "function getContextualTypeForConditionalOperand(node) {\n var conditional = node.parent;\n return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined;\n }", "function findTypeNodes(elem,type) {\n // Remove superfluous text nodes and merge adjacent text nodes\n elem.normalize();\n \n var typeNodes = new Array();\n // Search all children of this element to see which ones are the right type of node\n for(var nodeI = 0; nodeI < elem.childNodes.length; nodeI++) {\n if(elem.childNodes[nodeI].nodeType == type) typeNodes.push(elem.childNodes[nodeI]); // If it is a the right type of node, add it to the array\n else {\n // If not a the right type of node, search it in turn\n typeNodes = typeNodes.concat(findTypeNodes(elem.childNodes[nodeI],type));\n }\n }\n return typeNodes; // return the array\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n var typeName = (0, _printer.print)(node.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n var typeName = (0, _printer.print)(node.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function changeVariableType(variables) {\n for (var i in variables) {\n var variable = variables[i];\n if (variable[\"type\"] === \"TEXT\") {\n variable[\"type\"] = \"STRING\";\n }\n if (isNotUndefinedOrNull(variable.variableSet) && variable.variableSet.length > 0) {\n changeVariableType(variable.variableSet);\n }\n }\n}", "function VariableDeclaration(){ return ListNode.apply(this,arguments) }", "function DeclareVariable(node, print) {\n\t this.push(\"declare var \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation);\n\t this.semicolon();\n\t}" ]
[ "0.58864784", "0.5839879", "0.5824313", "0.57177603", "0.5672717", "0.5672717", "0.55865353", "0.55865353", "0.55816233", "0.55388767", "0.55121714", "0.54630387", "0.54358697", "0.5420922", "0.5420816", "0.53716373", "0.53464085", "0.5344339", "0.53124994", "0.5295558", "0.52779406", "0.52677786", "0.52627134", "0.5261635", "0.5242108", "0.5242108", "0.5231951", "0.5217149", "0.52029395", "0.51980466", "0.5185149", "0.5180393", "0.517783", "0.517783", "0.517783", "0.51721233", "0.5170904", "0.5170904", "0.5170904", "0.5170904", "0.5170904", "0.5170904", "0.5170904", "0.51687145", "0.51460856", "0.51460856", "0.5144882", "0.5138256", "0.51161903", "0.5111338", "0.5109814", "0.5100715", "0.5100715", "0.5100715", "0.5100715", "0.5100715", "0.5100715", "0.5098823", "0.5093883", "0.5088041", "0.507567", "0.5074653", "0.50737506", "0.50664616", "0.506119", "0.50605255", "0.50391096", "0.50382453", "0.50382453", "0.50382453", "0.50327176", "0.50258166", "0.5024782", "0.5021694", "0.50099665", "0.50063723", "0.50041044", "0.49791792", "0.49725935", "0.49679828", "0.49562472", "0.49562472", "0.49504533", "0.4942284", "0.49380106", "0.49380106", "0.49349684", "0.4933929", "0.4933171", "0.49329382", "0.49329382", "0.492902", "0.49162748", "0.49128798", "0.4912023", "0.4911726", "0.49097836", "0.49097836", "0.4906814", "0.48988184", "0.48924798" ]
0.0
-1
Don't make variable because it declares only types. Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations.
TSIndexSignature(node) { this.visitTypeNodes(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "function isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\";\n}", "function f1(){\n var x;\n \n return typeof x;\n}", "function get_all_nodes_by_type(ast, typename) {\n\tvar nodes = [];\n\ttraverse(ast, function (node) {\n\t\tif (node.type == typename) {\n\t\t\tnodes.push(node);\n\t\t}\n\t});\n\treturn nodes;\n}", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function TypeRecursion() {}", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function getType(x) {\n if (!x) return false;\n if (x.element) return 'item';\n if (x instanceof HTMLElement) return 'html';\n if (x instanceof $) return 'jquery';\n return false;\n}", "function sc_typeof( x ) {\n return typeof x;\n}", "function scopeAndTypeCheck(root) {\n //Block sets scope\n if (root.nodeName === \"Block\") {\n //If seen before, go to parent scope\n if (root.visited === true) {\n currentScope = currentScope.parent;\n }\n else {\n //Has been visited, now\n root.visited = true;\n //Make new scope for new block\n if (currentScope !== null) {\n var oldScope = currentScope; //current scope is now old\n currentScope = new SymbolTableNode('Scope', currentScope.nodeVal + 1, {}, currentScope, []); //create a new scope\n oldScope.children.push(currentScope); //child of old scope\n currentScope.parent = oldScope; //scope is now the parent\n }\n else {\n currentScope = new SymbolTableNode('Scope', 0, {}, null, []);\n SymbolTableInstance = new SymbolTable(currentScope, currentScope);\n }\n //Check each Statement\n for (var i = 0; i < root.children.length; i++) {\n scopeAndTypeCheck(root.children[i]);\n }\n //When done checking all Statements under this Block, close the scope and return to the parent scope\n if (currentScope.parent !== null) {\n currentScope = currentScope.parent;\n }\n }\n }\n else if (root.nodeName === \"VariableDeclaration\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n //If this variable already exists in this scope...\n if (currentScope.find(root.children[1])) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[1].nodeVal + \" was redeclared on line \" + root.children[1].lineNumber);\n }\n else {\n currentScope.addVariable(root.children[1], root.children[0]);\n }\n }\n else if (root.nodeName === \"Assignment\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n //Variable has not been found yet\n var isFound = false;\n //Type of parent variable\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not...\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n //If variable is not found in current scope... must search parent scopes\n if (!isFound) {\n //Search all parent scopes, and save type if found\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n //If still not found, it's undeclared.\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true;\n }\n }\n //Find the type - whether in this scope or in parent scope.\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n //The type of the RightVal.\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type errors - mismatch of Left and Right sides\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Output\") {\n //Set scope of variable\n root.children[0].scope = currentScope.nodeVal;\n //Variable is not yet found\n var isFound = false;\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"OutputVal\") {\n if (root.children[0].nodeVal !== \"?\") {\n isFound = currentScope.find(root.children[0]);\n }\n }\n //\"?\" means literal - no scope errors are shown in case of printing a literal int, bool or string\n if (!isFound && root.children[0].nodeVal !== \"?\") {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Printing counts as variable use\n }\n }\n }\n else if (root.nodeName === \"If\" || root.nodeName === \"While\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n scopeAndTypeCheck(root.children[0]); //check test\n scopeAndTypeCheck(root.children[1]); //check block\n }\n else if (root.nodeName === \"CompareTest\") {\n //Set scope of variables\n root.children[0].scope = currentScope.nodeVal;\n root.children[1].scope = currentScope.nodeVal;\n var isFound = false;\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n if (!isFound) {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Comparing counts as variable use\n }\n }\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type mismatches in comparability\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Add\") {\n }\n else {\n }\n}", "function getContextualType(node) {\n if (isInsideWithStatementBody(node)) {\n // We cannot answer semantic questions within a with block, do not proceed any further\n return undefined;\n }\n if (node.contextualType) {\n return node.contextualType;\n }\n var parent = node.parent;\n switch (parent.kind) {\n case 218 /* VariableDeclaration */:\n case 142 /* Parameter */:\n case 145 /* PropertyDeclaration */:\n case 144 /* PropertySignature */:\n case 169 /* BindingElement */:\n return getContextualTypeForInitializerExpression(node);\n case 180 /* ArrowFunction */:\n case 211 /* ReturnStatement */:\n return getContextualTypeForReturnExpression(node);\n case 190 /* YieldExpression */:\n return getContextualTypeForYieldOperand(parent);\n case 174 /* CallExpression */:\n case 175 /* NewExpression */:\n return getContextualTypeForArgument(parent, node);\n case 177 /* TypeAssertionExpression */:\n case 195 /* AsExpression */:\n return getTypeFromTypeNode(parent.type);\n case 187 /* BinaryExpression */:\n return getContextualTypeForBinaryOperand(node);\n case 253 /* PropertyAssignment */:\n return getContextualTypeForObjectLiteralElement(parent);\n case 170 /* ArrayLiteralExpression */:\n return getContextualTypeForElementExpression(node);\n case 188 /* ConditionalExpression */:\n return getContextualTypeForConditionalOperand(node);\n case 197 /* TemplateSpan */:\n ts.Debug.assert(parent.parent.kind === 189 /* TemplateExpression */);\n return getContextualTypeForSubstitutionExpression(parent.parent, node);\n case 178 /* ParenthesizedExpression */:\n return getContextualType(parent);\n case 248 /* JsxExpression */:\n return getContextualType(parent);\n case 246 /* JsxAttribute */:\n case 247 /* JsxSpreadAttribute */:\n return getContextualTypeForJsxAttribute(parent);\n }\n return undefined;\n }", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "function createTypeExpression(node) {\n if (node.type == 'Identifier') {\n return node;\n } else if (node.type == 'QualifiedTypeIdentifier') {\n return t.memberExpression(createTypeExpression(node.qualification), createTypeExpression(node.id));\n }\n\n throw this.errorWithNode('Unsupported type: ' + node.type);\n }", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function Type(x) {\n\t if (x === null)\n\t return 1 /* Null */;\n\t switch (typeof x) {\n\t case \"undefined\": return 0 /* Undefined */;\n\t case \"boolean\": return 2 /* Boolean */;\n\t case \"string\": return 3 /* String */;\n\t case \"symbol\": return 4 /* Symbol */;\n\t case \"number\": return 5 /* Number */;\n\t case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n\t default: return 6 /* Object */;\n\t }\n\t }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function isType(node) {\n return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n}", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function evaluateVariableStatement(_a) {\n var { node } = _a, rest = __rest(_a, [\"node\"]);\n evaluateVariableDeclarationList(Object.assign({ node: node.declarationList }, rest));\n}", "function innerType(n) { }", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function walkTreeVars(tree) {\n walkAddParent(tree, node => {\n if (!node || !node.type)\n return;\n switch (node.type) {\n case 'BlockStatement':\n return initBlock(node);\n case 'VariableDeclarator':\n return addLocalVar(node);\n }\n });\n}", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "function getVariables(node) {\r\n var variables = [], anonymousTypes = [], name, type;\r\n var declarationList = Array.isArray(node.declarationList)\r\n ? node.declarationList : [node.declarationList];\r\n for (var i = 0; i < declarationList.length; i++) {\r\n var declarations = declarationList[i].declarations;\r\n for (var j = 0; j < declarations.length; j++) {\r\n name = declarations[j].name.text;\r\n if (declarations[j].type.kind == ts.SyntaxKind.TypeLiteral) {\r\n type = visitInterface(declarations[j].type, { name: name + \"Type\", anonymous: true });\r\n anonymousTypes.push(type);\r\n type = type.name;\r\n }\r\n else {\r\n type = getType(declarations[j].type);\r\n }\r\n variables.push({\r\n name: name,\r\n type: type,\r\n static: true,\r\n parameters: []\r\n });\r\n }\r\n }\r\n return {\r\n variables: variables,\r\n anonymousTypes: anonymousTypes\r\n };\r\n}", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function typeOfValue(x) {\n return typeof x;\n}", "lookAtNodeType(expr) {\n switch(expr.type) {\n case \"blockStmt\": return this.getBlockStmt(expr); \n case \"varDecl\": return this.getVarDecl(expr);\n case \"variableExpr\": return this.getVariableExpr(expr);\n case \"assignExpr\": return this.getAssignExpr(expr);\n case \"functionDecl\": return this.getFunctionDecl(expr);\n case \"expressionStmt\": return this.getExpressionStmt(expr);\n case \"ifStmt\": return this.getIfStmt(expr);\n case \"printStmt\": return this.getPrintStmt(expr);\n case \"returnStmt\": return this.getReturnStmt(expr);\n case \"whileStmt\": return this.getWhileStmt(expr);\n case \"binaryExpr\": return this.getBinaryExpr(expr);\n case \"callExpr\": return this.getCallExpr(expr);\n case \"groupingExpr\": return this.getGroupingExpr(expr);\n case \"literalExpr\": return this.getLiteralExpr(expr);\n case \"logicalExpr\": return this.getLogicalExpr(expr);\n case \"unaryExpr\": return this.getUnaryExpr(expr);\n default:\n throw new RuntimeError('Resolver cannot evaluate expression or statement')\n }\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function initTypeVariableScopeTracking(state) {\n state.g.typeVariableScopeDepth = {};\n}", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function $type(obj){\n if (obj == undefined) \n return false;\n if (obj.htmlElement) \n return 'element';\n var type = typeof obj;\n if (type == 'object' && obj.nodeName) {\n switch (obj.nodeType) {\n case 1:\n return 'element';\n case 3:\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n }\n if (type == 'object' || type == 'function') {\n switch (obj.constructor) {\n case Array:\n return 'array';\n case RegExp:\n return 'regexp';\n }\n if (typeof obj.length == 'number') {\n if (obj.item) \n return 'collection';\n if (obj.callee) \n return 'arguments';\n }\n }\n return type;\n}", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "static isNode(n) {\n return n && typeof n === \"object\" && typeof n.type === \"string\";\n }", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n // If the variable type is not an input type, return an error.\n if (type && !(0, _typeDefinition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n }\n }\n };\n}", "getTypeNode() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.type);\r\n }", "function Type() {\n if (currentToken() == \"inteiro\" || currentToken() == \"real\" || currentToken() == \"texto\" || currentToken() == \"boleano\" || currentToken() == \"vazio\" || currentClass() == IDENTIFIER) {\n currentType = currentToken();\n return;\n } else {\n let errorMessage = \"Tipo de variável não reconhecido\";\n handleError(errorMessage);\n return;\n }\n }", "function evaluateTypeOfExpression({ node, environment, evaluate, statementTraversalStack }) {\n return typeof evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function staticallyVerifyType(node, types) {\n if (isNodeNully(node)) {\n return types.indexOf(\"null\") > -1 || types.indexOf(\"undefined\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"Literal\") {\n if (node.regex) {\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(\"RegExp\")) ? TYPE_VALID : TYPE_INVALID;\n } else {\n return types.indexOf(typeof node.value) > -1 ? TYPE_VALID : TYPE_INVALID;\n }\n } else if (node.type === \"ObjectExpression\") {\n return types.indexOf(\"object\") > -1 || types.indexOf(\"shape\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === \"ArrayExpression\") {\n return types.indexOf(\"array\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (t.isFunction(node)) {\n return types.indexOf(\"function\") > -1 || types.indexOf(\"object\") > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'NewExpression' && node.callee.type === 'Identifier') {\n // this is of the form `return new SomeClass()`\n // @fixme it should be possible to do this with non computed member expressions too\n return types.indexOf(\"object\") > -1 || types.some(identifierMatcher(node.callee.name)) ? TYPE_VALID : TYPE_UNKNOWN;\n } else if (isBooleanExpression(node)) {\n return types.indexOf('boolean') > -1 ? TYPE_VALID : TYPE_INVALID;\n } else if (node.type === 'Identifier') {\n // check the scope to see if this is a `const` value\n return node;\n } else {\n return TYPE_UNKNOWN; // will produce a runtime type check\n }\n }", "function isIndependentVariableLikeDeclaration(node) {\n return node.type && isIndependentType(node.type) || !node.type && !node.initializer;\n }", "function $type(obj){\r\n if (!$defined(obj)) \r\n return false;\r\n if (obj.htmlElement) \r\n return 'element';\r\n var type = typeof obj;\r\n if (type == 'object' && obj.nodeName) {\r\n switch (obj.nodeType) {\r\n case 1:\r\n return 'element';\r\n case 3:\r\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\r\n }\r\n }\r\n if (type == 'object' || type == 'function') {\r\n switch (obj.constructor) {\r\n case Array:\r\n return 'array';\r\n case RegExp:\r\n return 'regexp';\r\n case Class:\r\n return 'class';\r\n }\r\n if (typeof obj.length == 'number') {\r\n if (obj.item) \r\n return 'collection';\r\n if (obj.callee) \r\n return 'arguments';\r\n }\r\n }\r\n return type;\r\n }", "compileNode(o) {\r\n\t\t\t\t\tvar answer, compiledName, isValue, name, properties, prototype, ref1, ref2, ref3, ref4, val;\r\n\t\t\t\t\tisValue = this.variable instanceof Value;\r\n\t\t\t\t\tif (isValue) {\r\n\t\t\t\t\t\t// If `@variable` is an array or an object, we’re destructuring;\r\n\t\t\t\t\t\t// if it’s also `isAssignable()`, the destructuring syntax is supported\r\n\t\t\t\t\t\t// in ES and we can output it as is; otherwise we `@compileDestructuring`\r\n\t\t\t\t\t\t// and convert this ES-unsupported destructuring into acceptable output.\r\n\t\t\t\t\t\tif (this.variable.isArray() || this.variable.isObject()) {\r\n\t\t\t\t\t\t\tif (!this.variable.isAssignable()) {\r\n\t\t\t\t\t\t\t\tif (this.variable.isObject() && this.variable.base.hasSplat()) {\r\n\t\t\t\t\t\t\t\t\treturn this.compileObjectDestruct(o);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\treturn this.compileDestructuring(o);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.variable.isSplice()) {\r\n\t\t\t\t\t\t\treturn this.compileSplice(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.isConditional()) {\r\n\t\t\t\t\t\t\treturn this.compileConditional(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((ref1 = this.context) === '//=' || ref1 === '%%=') {\r\n\t\t\t\t\t\t\treturn this.compileSpecialMath(o);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.addScopeVariables(o);\r\n\t\t\t\t\tif (this.value instanceof Code) {\r\n\t\t\t\t\t\tif (this.value.isStatic) {\r\n\t\t\t\t\t\t\tthis.value.name = this.variable.properties[0];\r\n\t\t\t\t\t\t} else if (((ref2 = this.variable.properties) != null ? ref2.length : void 0) >= 2) {\r\n\t\t\t\t\t\t\tref3 = this.variable.properties, [...properties] = ref3, [prototype, name] = splice.call(properties, -2);\r\n\t\t\t\t\t\t\tif (((ref4 = prototype.name) != null ? ref4.value : void 0) === 'prototype') {\r\n\t\t\t\t\t\t\t\tthis.value.name = name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tval = this.value.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tcompiledName = this.variable.compileToFragments(o, LEVEL_LIST);\r\n\t\t\t\t\tif (this.context === 'object') {\r\n\t\t\t\t\t\tif (this.variable.shouldCache()) {\r\n\t\t\t\t\t\t\tcompiledName.unshift(this.makeCode('['));\r\n\t\t\t\t\t\t\tcompiledName.push(this.makeCode(']'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn compiledName.concat(this.makeCode(': '), val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanswer = compiledName.concat(this.makeCode(` ${this.context || '='} `), val);\r\n\t\t\t\t\t// Per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Assignment_without_declaration,\r\n\t\t\t\t\t// if we’re destructuring without declaring, the destructuring assignment must be wrapped in parentheses.\r\n\t\t\t\t\t// The assignment is wrapped in parentheses if 'o.level' has lower precedence than LEVEL_LIST (3)\r\n\t\t\t\t\t// (i.e. LEVEL_COND (4), LEVEL_OP (5) or LEVEL_ACCESS (6)), or if we're destructuring object, e.g. {a,b} = obj.\r\n\t\t\t\t\tif (o.level > LEVEL_LIST || isValue && this.variable.base instanceof Obj && !this.nestedLhs && !(this.param === true)) {\r\n\t\t\t\t\t\treturn this.wrapInParentheses(answer);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn answer;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function VariablesAreInputTypes(context) {\n\t return {\n\t VariableDefinition: function VariableDefinition(node) {\n\t var type = (0, _utilitiesTypeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n\t // If the variable type is not an input type, return an error.\n\t if (type && !(0, _typeDefinition.isInputType)(type)) {\n\t var variableName = node.variable.name.value;\n\t context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _languagePrinter.print)(node.type)), [node.type]));\n\t }\n\t }\n\t };\n\t}", "static getTypeID(ast) { return ast.typeID }", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n // If the variable type is not an input type, return an error.\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _printer.print)(node.type)), [node.type]));\n }\n }\n };\n}", "function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type); // If the variable type is not an input type, return an error.\n\n if (type && !Object(_type_definition__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](nonInputTypeOnVarMessage(variableName, Object(_language_printer__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type)), node.type));\n }\n }\n };\n}", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function checkTypeNodeAsExpression(node) {\n // When we are emitting type metadata for decorators, we need to try to check the type\n // as if it were an expression so that we can emit the type in a value position when we\n // serialize the type metadata.\n if (node && node.kind === 155 /* TypeReference */) {\n var root = getFirstIdentifier(node.typeName);\n var meaning = root.parent.kind === 155 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */;\n // Resolve type so we know which symbol is referenced\n var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);\n // Resolved symbol is alias\n if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */) {\n var aliasTarget = resolveAlias(rootSymbol);\n // If alias has value symbol - mark alias as referenced\n if (aliasTarget.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {\n markAliasSymbolAsReferenced(rootSymbol);\n }\n }\n }\n }", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function hoistVars(ast) {\n var scopes = getScopes(ast);\n console.log(scopes.__nodeToScope);\n return\n query(ast, 'VariableDeclaration').forEach(function (node) {\n var scope = scopes.__get(node);\n console.log(\"=================================================================================\");\n console.log(scope);\n console.log(\"=================================================================================\");\n console.log(node);\n console.log(\"=================================================================================\");\n });\n}", "CheckingDataTypes()\n {\n // USE TYPEOF TO CHECK THE TYPE OF A VARIABLE AT RUNTIME\n let b = true;\n console.log(typeof b);\n\n console.log(typeof foo);\n }", "function $type(obj){\n\tif (obj === null || obj === undefined) return false;\n\tvar type = typeof obj;\n\tif (type == 'object'){\n\t\tif (obj.htmlElement) return 'element';\n\t\tif (obj.push) return 'array';\n\t\tif (obj.nodeName){\n\t\t\tswitch (obj.nodeType){\n\t\t\t\tcase 1: return 'element';\n\t\t\t\tcase 3: return obj.nodeValue.test(/\\S/) ? 'textnode' : 'whitespace';\n\t\t\t}\n\t\t}\n\t}\n\treturn type;\n}", "function parseJSDocTypeExpression() {\n var result = createNode(257 /* JSDocTypeExpression */, scanner.getTokenPos());\n parseExpected(15 /* OpenBraceToken */);\n result.type = parseJSDocTopLevelType();\n parseExpected(16 /* CloseBraceToken */);\n fixupParentReferences(result);\n return finishNode(result);\n }", "function isVar(x) {\n\treturn x.props && x.props.has('is','variable')\n}", "function addVar(type) {\n\t\tif (isIntoFunction) {\n\t\t\tlocalVarTable.push(type);\n\t\t\tlocalVarTable.push(thisToken);\n\t\t} else {\n\t\t\tvarTable.push({\n\t\t\t\tname: thisToken,\n\t\t\t\ttype: type,\n\t\t\t\tlength: 1\n\t\t\t});\n\t\t\tasm.push(' _' + thisToken + ' word ? ');\n\t\t\tasm.push(' ');\n\t\t}\n\t}", "function XPathResult_resultType() {\n var success;\n if(checkInitialization(builder, \"XPathResult_resultType\") != null) return;\n var doc;\n var resolver;\n var evaluator;\n var expression = \"/staff/employee\";\n var contextNode;\n var inresult = null;\n\n var outresult = null;\n\n var inNodeType;\n var outNodeType;\n var ANY_TYPE = 0;\n var NUMBER_TYPE = 1;\n var STRING_TYPE = 2;\n var BOOLEAN_TYPE = 3;\n var UNORDERED_NODE_ITERATOR_TYPE = 4;\n var ORDERED_NODE_ITERATOR_TYPE = 5;\n var UNORDERED_NODE_SNAPSHOT_TYPE = 6;\n var ORDERED_NODE_SNAPSHOT_TYPE = 7;\n var ANY_UNORDERED_NODE_TYPE = 8;\n var FIRST_ORDERED_NODE_TYPE = 9;\n var isTypeEqual;\n nodeTypeList = new Array();\n nodeTypeList[0] = 0;\n nodeTypeList[1] = 1;\n nodeTypeList[2] = 2;\n nodeTypeList[3] = 3;\n nodeTypeList[4] = 4;\n nodeTypeList[5] = 5;\n nodeTypeList[6] = 6;\n nodeTypeList[7] = 7;\n nodeTypeList[8] = 8;\n nodeTypeList[9] = 9;\n\n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n evaluator = createXPathEvaluator(doc);\nresolver = evaluator.createNSResolver(doc);\n contextNode = doc;\nfor(var indexN65737 = 0;indexN65737 < nodeTypeList.length; indexN65737++) {\n inNodeType = nodeTypeList[indexN65737];\n outresult = evaluator.evaluate(expression,contextNode,resolver,inNodeType,inresult);\n outNodeType = outresult.resultType;\n\n if(\n (inNodeType == ANY_TYPE)\n ) {\n assertEquals(\"ANY_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == NUMBER_TYPE)\n ) {\n assertEquals(\"NUMBER_TYPE_resulttype\",NUMBER_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == STRING_TYPE)\n ) {\n assertEquals(\"STRING_TYPE_resulttype\",STRING_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == BOOLEAN_TYPE)\n ) {\n assertEquals(\"BOOLEAN_TYPE_resulttype\",BOOLEAN_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_ITERATOR_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_ITERATOR_TYPE_resulttype\",ORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_SNAPSHOT_TYPE_resulttype\",UNORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_SNAPSHOT_TYPE_resulttype\",ORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ANY_UNORDERED_NODE_TYPE)\n ) {\n assertEquals(\"ANY_UNORDERED_NODE_TYPE_resulttype\",ANY_UNORDERED_NODE_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == FIRST_ORDERED_NODE_TYPE)\n ) {\n assertEquals(\"FIRST_ORDERED_NODE_TYPE_resulttype\",FIRST_ORDERED_NODE_TYPE,outNodeType);\n\n }\n\n }\n\n}", "function typeValidation(variable, type) {\n // Your code should be here ;) \n return typeof(variable) === type;\n}", "function processType(typeCache, resLoader, rawType, ctx) {\n var xsdNS = 'http://www.w3.org/2001/XMLSchema';\n if(!rawType || !(ctx instanceof LocalContext))\n throw new Error('Invalid raw type or context.');\n var result = undefined;\n // Function to process attributes\n var processAttrs = function(target) {\n var attrs = { };\n Util.arrayEach(target.attribute, function(attr) {\n attrs[attr.name + ((attr.use === 'required') ? '' : '?')] = stripNS(attr.type);\n }); \n return attrs; \n }\n if(rawType.sequence) {\n result = { '_$attrs': processAttrs(rawType) };\n var processElements = function(elements, context, target) {\n Util.arrayEach(elements, function(el) {\n var elType = undefined,\n elTypeNS = undefined;\n // Find occurrence info\n if(el.minOccurs === 'unbounded') el.minOccurs = 0;\n if(el.maxOccurs === 'unbounded') el.maxOccurs = Number.MAX_VALUE;\n if(typeof el.minOccurs !== 'number') el.minOccurs = 1;\n if(typeof el.maxOccurs !== 'number') el.maxOccurs = 1;\n var namePost = '';\n if(el.minOccurs === 1 && el.maxOccurs === 1) namePost = '';\n else if(el.minOccurs === 0 && el.maxOccurs === 1) namePost = '?';\n else namePost = '*';\n if(el.ref) {\n var referred = context.parseNamespace(el.ref),\n refEl = resLoader.searchInNamespace(referred.namespace, ['element', referred.value]);\n if(!refEl) throw new Error(\n 'Referred element `' + referred.value + '\\' not found in namespace `' + referred.namespace + '\\'.'\n );\n elType = refEl.type;\n elTypeNS = refEl.typeNamespace;\n } else {\n if(!el.type) {\n if(el.complexType) target[el.name + namePost] = processType(typeCache, resLoader, el.complexType, context);\n else if(el.simpleType) throw new Error('Not supported.');\n else throw new Error('Invalid element definition, no type specified.');\n return;\n }\n var parsed = context.parseNamespace(el.type);\n elType = parsed.value;\n elTypeNS = parsed.namespace;\n }\n // Basic Type\n if(elTypeNS === xsdNS) target[el.name + namePost] = elType;\n else {\n // console.log('ns: ' + elTypeNS + ' type: ' + elType);\n cacheType(typeCache, resLoader, elTypeNS, elType, true);\n target[el.name + namePost] = { '_$type': elType, '_$namespace': elTypeNS };\n }\n });\n }\n processElements(rawType.sequence.element, ctx, result);\n Util.arrayEach(rawType.sequence.choice, function(ch) {\n result['_$choices'] = result['_$choices'] || [];\n var thisChoice = { };\n // Find occurrence info\n if(ch.minOccurs === 'unbounded') ch.minOccurs = 0;\n if(ch.maxOccurs === 'unbounded') ch.maxOccurs = Number.MAX_VALUE;\n if(typeof ch.minOccurs !== 'number') ch.minOccurs = 1;\n if(typeof ch.maxOccurs !== 'number') ch.maxOccurs = 1;\n if(ch.minOccurs === 1 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '';\n else if(ch.minOccurs === 0 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '?';\n else thisChoice['_$occurrence'] = '*'; \n processElements(ch.element, ctx, thisChoice);\n result['_$choices'].push(thisChoice);\n });\n } else if(rawType.simpleContent || rawType.complexContent) {\n // We're processing some complexType\n // Under complexContent/simpleContent we only support [extension]\n result = processType(typeCache, resLoader, rawType.simpleContent ||rawType.complexContent, ctx); \n } else if(rawType.extension) { \n var baseType = ctx.parseNamespace(rawType.extension.base);\n if(baseType.namespace === xsdNS) {\n // If rawType.extension.base is base type(ie. under xsd namespace), then it has only [attribute]s.\n result = { '_$attrs': processAttrs(rawType.extension) };\n } else {\n // If rawType.extension.base is defined type, then it may have [attribute]s or [sequence,element]s.\n result = processType(typeCache, resLoader, rawType.extension, ctx) || { }; // in case that no sequence is defined.\n cacheType(typeCache, resLoader, baseType.namespace, baseType.value, true);\n result['_$base'] = { '_$type': baseType.value, '_$namespace': baseType.namespace };\n }\n } else if(rawType.restriction) {\n // We're processing some simpleType, only support enumeration for now, and ignore [base].\n result = [];\n Util.arrayEach(rawType.restriction.enumeration, \n function(entry) { entry.value && result.push(entry.value); });\n }\n \n return result;\n}", "function Type(x) {\n\tswitch (typeof x) {\n\tcase \"undefined\":\n\t\treturn \"Undefined\";\n\tcase \"boolean\":\n\t\treturn \"Boolean\";\n\tcase \"number\":\n\t\treturn \"Number\";\n\tcase \"string\":\n\t\treturn \"String\";\n\t}\n\tif (x === null) return \"Null\";\n\tif (x.Class !== undefined) return \"Object\";\n\tif (x.referencedName !== undefined) return \"Reference\";\n\tif (x.HasBinding !== undefined) return \"EnvironmentRecord\";\n\tassert(false);\n}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function isVar(node) {\n\t return t.isVariableDeclaration(node, { kind: \"var\" }) && !node._let;\n\t}", "function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {\n if (declaration.flags & 134217728 /* JavaScriptFile */) {\n // If this is a variable in a JavaScript file, then use the JSDoc type (if it has\n // one as its type), otherwise fallback to the below standard TS codepaths to\n // try to figure it out.\n var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);\n if (type && type !== unknownType) {\n return type;\n }\n }\n // A variable declared in a for..in statement is always of type string\n if (declaration.parent.parent.kind === 207 /* ForInStatement */) {\n return stringType;\n }\n if (declaration.parent.parent.kind === 208 /* ForOfStatement */) {\n // checkRightHandSideOfForOf will return undefined if the for-of expression type was\n // missing properties/signatures required to get its iteratedType (like\n // [Symbol.iterator] or next). This may be because we accessed properties from anyType,\n // or it may have led to an error inside getElementTypeOfIterable.\n return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType;\n }\n if (ts.isBindingPattern(declaration.parent)) {\n return getTypeForBindingElement(declaration);\n }\n // Use type from type annotation if one is present\n if (declaration.type) {\n return addOptionality(getTypeFromTypeNode(declaration.type), /*optional*/ declaration.questionToken && includeOptionality);\n }\n if (declaration.kind === 142 /* Parameter */) {\n var func = declaration.parent;\n // For a parameter of a set accessor, use the type of the get accessor if one is present\n if (func.kind === 150 /* SetAccessor */ && !ts.hasDynamicName(func)) {\n var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 149 /* GetAccessor */);\n if (getter) {\n var getterSignature = getSignatureFromDeclaration(getter);\n var thisParameter = getAccessorThisParameter(func);\n if (thisParameter && declaration === thisParameter) {\n // Use the type from the *getter*\n ts.Debug.assert(!thisParameter.type);\n return getTypeOfSymbol(getterSignature.thisParameter);\n }\n return getReturnTypeOfSignature(getterSignature);\n }\n }\n // Use contextual parameter type if one is available\n var type = void 0;\n if (declaration.symbol.name === \"this\") {\n var thisParameter = getContextualThisParameter(func);\n type = thisParameter ? getTypeOfSymbol(thisParameter) : undefined;\n }\n else {\n type = getContextuallyTypedParameterType(declaration);\n }\n if (type) {\n return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);\n }\n }\n // Use the type of the initializer expression if one is present\n if (declaration.initializer) {\n return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality);\n }\n // If it is a short-hand property assignment, use the type of the identifier\n if (declaration.kind === 254 /* ShorthandPropertyAssignment */) {\n return checkIdentifier(declaration.name);\n }\n // If the declaration specifies a binding pattern, use the type implied by the binding pattern\n if (ts.isBindingPattern(declaration.name)) {\n return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true);\n }\n // No type specified and nothing can be inferred\n return undefined;\n }", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type);\n\n if (type && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n var typeName = Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = Object(_utilities_typeFromAST_mjs__WEBPACK_IMPORTED_MODULE_3__[\"typeFromAST\"])(context.getSchema(), node.type);\n\n if (type && !Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isInputType\"])(type)) {\n var variableName = node.variable.name.value;\n var typeName = Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_1__[\"print\"])(node.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function DeclareVariable(node, print) {\n this.push(\"declare var \");\n print.plain(node.id);\n print.plain(node.id.typeAnnotation);\n this.semicolon();\n}", "function astFromValue(_x, _x2) {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t var value = _x,\n\t type = _x2;\n\t _value = _ret = stringNum = isIntValue = fields = undefined;\n\t _again = false;\n\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _typeDefinition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if ((0, _jsutilsIsNullish2['default'])(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (Array.isArray(_value)) {\n\t var _ret = (function () {\n\t var itemType = type instanceof _typeDefinition.GraphQLList ? type.ofType : null;\n\t return {\n\t v: {\n\t kind: _languageKinds.LIST,\n\t values: _value.map(function (item) {\n\t var itemValue = astFromValue(item, itemType);\n\t (0, _jsutilsInvariant2['default'])(itemValue, 'Could not create AST item.');\n\t return itemValue;\n\t })\n\t }\n\t };\n\t })();\n\n\t if (typeof _ret === 'object') return _ret.v;\n\t } else if (type instanceof _typeDefinition.GraphQLList) {\n\t // Because GraphQL will accept single values as a \"list of one\" when\n\t // expecting a list, if there's a non-array value and an expected list type,\n\t // create an AST using the list's item type.\n\t _x = _value;\n\t _x2 = type.ofType;\n\t _again = true;\n\t continue _function;\n\t }\n\n\t if (typeof _value === 'boolean') {\n\t return { kind: _languageKinds.BOOLEAN, value: _value };\n\t }\n\n\t // JavaScript numbers can be Float or Int values. Use the GraphQLType to\n\t // differentiate if available, otherwise prefer Int if the value is a\n\t // valid Int.\n\t if (typeof _value === 'number') {\n\t var stringNum = String(_value);\n\t var isIntValue = /^[0-9]+$/.test(stringNum);\n\t if (isIntValue) {\n\t if (type === _typeScalars.GraphQLFloat) {\n\t return { kind: _languageKinds.FLOAT, value: stringNum + '.0' };\n\t }\n\t return { kind: _languageKinds.INT, value: stringNum };\n\t }\n\t return { kind: _languageKinds.FLOAT, value: stringNum };\n\t }\n\n\t // JavaScript strings can be Enum values or String values. Use the\n\t // GraphQLType to differentiate if possible.\n\t if (typeof _value === 'string') {\n\t if (type instanceof _typeDefinition.GraphQLEnumType && /^[_a-zA-Z][_a-zA-Z0-9]*$/.test(_value)) {\n\t return { kind: _languageKinds.ENUM, value: _value };\n\t }\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return { kind: _languageKinds.STRING, value: JSON.stringify(_value).slice(1, -1) };\n\t }\n\n\t // last remaining possible typeof\n\t (0, _jsutilsInvariant2['default'])(typeof _value === 'object' && _value !== null);\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object.\n\t var fields = [];\n\t _Object$keys(_value).forEach(function (fieldName) {\n\t var fieldType = undefined;\n\t if (type instanceof _typeDefinition.GraphQLInputObjectType) {\n\t var fieldDef = type.getFields()[fieldName];\n\t fieldType = fieldDef && fieldDef.type;\n\t }\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fields.push({\n\t kind: _languageKinds.OBJECT_FIELD,\n\t name: { kind: _languageKinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return { kind: _languageKinds.OBJECT, fields: fields };\n\t }\n\t}", "function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case _kinds.Kind.NULL:\n return null;\n\n case _kinds.Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case _kinds.Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case _kinds.Kind.STRING:\n case _kinds.Kind.ENUM:\n case _kinds.Kind.BOOLEAN:\n return valueNode.value;\n\n case _kinds.Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case _kinds.Kind.OBJECT:\n return (0, _keyValMap[\"default\"])(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case _kinds.Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected value node: ' + (0, _inspect[\"default\"])(valueNode));\n}", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "function hc_nodecommentnodetype() {\n var success;\n var doc;\n var testList;\n var commentNode;\n var commentNodeName;\n var nodeType;\n doc = load(\"hc_staff\");\n testList = doc.childNodes;\n\n for(var indexN65600 = 0;indexN65600 < testList.length; indexN65600++) {\n commentNode = testList.item(indexN65600);\n commentNodeName = commentNode.nodeName;\n\n \n\tif(\n\t(\"#comment\" == commentNodeName)\n\t) {\n\tnodeType = commentNode.nodeType;\n\n assertEquals(\"existingCommentNodeType\",8,nodeType);\n \n\t}\n\t\n\t}\n commentNode = doc.createComment(\"This is a comment\");\n nodeType = commentNode.nodeType;\n\n assertEquals(\"createdCommentNodeType\",8,nodeType);\n \n}", "function narrowType(type, expr, assumeTrue) {\n switch (expr.kind) {\n case 69 /* Identifier */:\n case 97 /* ThisKeyword */:\n case 172 /* PropertyAccessExpression */:\n return narrowTypeByTruthiness(type, expr, assumeTrue);\n case 174 /* CallExpression */:\n return narrowTypeByTypePredicate(type, expr, assumeTrue);\n case 178 /* ParenthesizedExpression */:\n return narrowType(type, expr.expression, assumeTrue);\n case 187 /* BinaryExpression */:\n return narrowTypeByBinaryExpression(type, expr, assumeTrue);\n case 185 /* PrefixUnaryExpression */:\n if (expr.operator === 49 /* ExclamationToken */) {\n return narrowType(type, expr.operand, !assumeTrue);\n }\n break;\n }\n return type;\n }", "function relaxType(type) {\n switch (type.kind) {\n case SimpleTypeKind.INTERSECTION:\n case SimpleTypeKind.UNION:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ENUM:\n return __assign(__assign({}, type), { types: type.types.map(function (t) { return relaxType(t); }) });\n case SimpleTypeKind.ARRAY:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.PROMISE:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.OBJECT:\n return {\n name: type.name,\n kind: SimpleTypeKind.OBJECT\n };\n case SimpleTypeKind.INTERFACE:\n case SimpleTypeKind.FUNCTION:\n case SimpleTypeKind.CLASS:\n return {\n name: type.name,\n kind: SimpleTypeKind.ANY\n };\n case SimpleTypeKind.NUMBER_LITERAL:\n return { kind: SimpleTypeKind.NUMBER };\n case SimpleTypeKind.STRING_LITERAL:\n return { kind: SimpleTypeKind.STRING };\n case SimpleTypeKind.BOOLEAN_LITERAL:\n return { kind: SimpleTypeKind.BOOLEAN };\n case SimpleTypeKind.BIG_INT_LITERAL:\n return { kind: SimpleTypeKind.BIG_INT };\n case SimpleTypeKind.ENUM_MEMBER:\n return __assign(__assign({}, type), { type: relaxType(type.type) });\n case SimpleTypeKind.ALIAS:\n return __assign(__assign({}, type), { target: relaxType(type.target) });\n case SimpleTypeKind.NULL:\n case SimpleTypeKind.UNDEFINED:\n return { kind: SimpleTypeKind.ANY };\n default:\n return type;\n }\n}", "function getContextualTypeForConditionalOperand(node) {\n var conditional = node.parent;\n return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined;\n }", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n var typeName = (0, _printer.print)(node.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type);\n\n if (type && !(0, _definition.isInputType)(type)) {\n var variableName = node.variable.name.value;\n var typeName = (0, _printer.print)(node.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\"), node.type));\n }\n }\n };\n}", "function findTypeNodes(elem,type) {\n // Remove superfluous text nodes and merge adjacent text nodes\n elem.normalize();\n \n var typeNodes = new Array();\n // Search all children of this element to see which ones are the right type of node\n for(var nodeI = 0; nodeI < elem.childNodes.length; nodeI++) {\n if(elem.childNodes[nodeI].nodeType == type) typeNodes.push(elem.childNodes[nodeI]); // If it is a the right type of node, add it to the array\n else {\n // If not a the right type of node, search it in turn\n typeNodes = typeNodes.concat(findTypeNodes(elem.childNodes[nodeI],type));\n }\n }\n return typeNodes; // return the array\n}", "function changeVariableType(variables) {\n for (var i in variables) {\n var variable = variables[i];\n if (variable[\"type\"] === \"TEXT\") {\n variable[\"type\"] = \"STRING\";\n }\n if (isNotUndefinedOrNull(variable.variableSet) && variable.variableSet.length > 0) {\n changeVariableType(variable.variableSet);\n }\n }\n}", "function VariableDeclaration(){ return ListNode.apply(this,arguments) }", "function DeclareVariable(node, print) {\n\t this.push(\"declare var \");\n\t print.plain(node.id);\n\t print.plain(node.id.typeAnnotation);\n\t this.semicolon();\n\t}" ]
[ "0.58845335", "0.5837593", "0.5822618", "0.5714619", "0.56684077", "0.56684077", "0.5583225", "0.5583225", "0.5580578", "0.5539787", "0.5508642", "0.5459345", "0.54351276", "0.5418386", "0.54161954", "0.53692025", "0.53459704", "0.5343195", "0.5309313", "0.52924657", "0.5274552", "0.52677286", "0.52634704", "0.52596414", "0.5238228", "0.5238228", "0.5234162", "0.5213206", "0.5203496", "0.51949507", "0.5182572", "0.5178842", "0.51749045", "0.51749045", "0.51749045", "0.5174482", "0.51677746", "0.51677746", "0.51677746", "0.51677746", "0.51677746", "0.51677746", "0.51677746", "0.5164593", "0.5143162", "0.5143162", "0.51424754", "0.5137855", "0.5112868", "0.51090276", "0.51055324", "0.510106", "0.510106", "0.510106", "0.510106", "0.510106", "0.510106", "0.50963837", "0.50945836", "0.50840384", "0.50762594", "0.507307", "0.5072674", "0.50659776", "0.5060642", "0.50558186", "0.5036827", "0.5036745", "0.5036745", "0.5036745", "0.5033298", "0.5022541", "0.502076", "0.50185347", "0.5010966", "0.50075644", "0.5000436", "0.49777848", "0.4970818", "0.4965359", "0.49570224", "0.49570224", "0.4949908", "0.4939009", "0.49376094", "0.49376094", "0.4936031", "0.49356836", "0.49330238", "0.4931798", "0.4931798", "0.49270004", "0.49129668", "0.49122554", "0.49104506", "0.49092194", "0.49092194", "0.49081883", "0.49076772", "0.49006885", "0.48945615" ]
0.0
-1
Switch to the type mode and visit child nodes to find `typeof x` expression in type declarations.
TSTypeAnnotation(node) { this.visitTypeNodes(node); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_type() {\n tree.addNode('type', 'branch');\n if (foundTokensCopy[parseCounter][1] == 'int') {\n match('int', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'string') {\n match('string', parseCounter);\n parseCounter++;\n } else if (foundTokensCopy[parseCounter][1] == 'boolean') {\n match('boolean', parseCounter);\n parseCounter++;\n }\n tree.endChildren();\n\n}", "function get_all_nodes_by_type(ast, typename) {\n\tvar nodes = [];\n\ttraverse(ast, function (node) {\n\t\tif (node.type == typename) {\n\t\t\tnodes.push(node);\n\t\t}\n\t});\n\treturn nodes;\n}", "function TypeRecursion() {}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n\t return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n\t}", "function isType(node) {\n return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);\n}", "function findTypeNodes(elem,type) {\n // Remove superfluous text nodes and merge adjacent text nodes\n elem.normalize();\n \n var typeNodes = new Array();\n // Search all children of this element to see which ones are the right type of node\n for(var nodeI = 0; nodeI < elem.childNodes.length; nodeI++) {\n if(elem.childNodes[nodeI].nodeType == type) typeNodes.push(elem.childNodes[nodeI]); // If it is a the right type of node, add it to the array\n else {\n // If not a the right type of node, search it in turn\n typeNodes = typeNodes.concat(findTypeNodes(elem.childNodes[nodeI],type));\n }\n }\n return typeNodes; // return the array\n}", "function getContextualType(node) {\n if (isInsideWithStatementBody(node)) {\n // We cannot answer semantic questions within a with block, do not proceed any further\n return undefined;\n }\n if (node.contextualType) {\n return node.contextualType;\n }\n var parent = node.parent;\n switch (parent.kind) {\n case 218 /* VariableDeclaration */:\n case 142 /* Parameter */:\n case 145 /* PropertyDeclaration */:\n case 144 /* PropertySignature */:\n case 169 /* BindingElement */:\n return getContextualTypeForInitializerExpression(node);\n case 180 /* ArrowFunction */:\n case 211 /* ReturnStatement */:\n return getContextualTypeForReturnExpression(node);\n case 190 /* YieldExpression */:\n return getContextualTypeForYieldOperand(parent);\n case 174 /* CallExpression */:\n case 175 /* NewExpression */:\n return getContextualTypeForArgument(parent, node);\n case 177 /* TypeAssertionExpression */:\n case 195 /* AsExpression */:\n return getTypeFromTypeNode(parent.type);\n case 187 /* BinaryExpression */:\n return getContextualTypeForBinaryOperand(node);\n case 253 /* PropertyAssignment */:\n return getContextualTypeForObjectLiteralElement(parent);\n case 170 /* ArrayLiteralExpression */:\n return getContextualTypeForElementExpression(node);\n case 188 /* ConditionalExpression */:\n return getContextualTypeForConditionalOperand(node);\n case 197 /* TemplateSpan */:\n ts.Debug.assert(parent.parent.kind === 189 /* TemplateExpression */);\n return getContextualTypeForSubstitutionExpression(parent.parent, node);\n case 178 /* ParenthesizedExpression */:\n return getContextualType(parent);\n case 248 /* JsxExpression */:\n return getContextualType(parent);\n case 246 /* JsxAttribute */:\n case 247 /* JsxSpreadAttribute */:\n return getContextualTypeForJsxAttribute(parent);\n }\n return undefined;\n }", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "function nodeTypeTest(stream, a) {\n if ('(' !== stream.peek2()) {\n return null;\n }\n var type = stream.trypop(['comment', 'text', 'processing-instruction', 'node']);\n if (null != type) {\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Should not happen.');\n var param = undefined;\n if (type == 'processing-instruction') {\n param = stream.trypopliteral();\n }\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected close parens.');\n return type\n }\n }", "getTypeNode() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.type);\r\n }", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "function visit(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n updateEachKey(type.getTypeMap(), function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map. Because\n // we're using updateEachKey, the result of visit(namedType) may\n // cause the type to be removed or replaced.\n return visit(namedType);\n }\n });\n return type;\n }\n if (type instanceof graphql_1.GraphQLObjectType) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n var newObject = callMethod('visitObject', type);\n if (newObject) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (type instanceof graphql_1.GraphQLInterfaceType) {\n var newInterface = callMethod('visitInterface', type);\n if (newInterface) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (type instanceof graphql_1.GraphQLInputObjectType) {\n var newInputObject_1 = callMethod('visitInputObject', type);\n if (newInputObject_1) {\n updateEachKey(newInputObject_1.getFields(), function (field) {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n return callMethod('visitInputFieldDefinition', field, {\n objectType: newInputObject_1,\n });\n });\n }\n return newInputObject_1;\n }\n if (type instanceof graphql_1.GraphQLScalarType) {\n return callMethod('visitScalar', type);\n }\n if (type instanceof graphql_1.GraphQLUnionType) {\n return callMethod('visitUnion', type);\n }\n if (type instanceof graphql_1.GraphQLEnumType) {\n var newEnum_1 = callMethod('visitEnum', type);\n if (newEnum_1) {\n updateEachKey(newEnum_1.getValues(), function (value) {\n return callMethod('visitEnumValue', value, {\n enumType: newEnum_1,\n });\n });\n }\n return newEnum_1;\n }\n throw new Error(\"Unexpected schema type: \" + type);\n }", "function visit(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n // Unlike the other types, the root GraphQLSchema object cannot be\n // replaced by visitor methods, because that would make life very hard\n // for SchemaVisitor subclasses that rely on the original schema object.\n callMethod('visitSchema', type);\n updateEachKey(type.getTypeMap(), function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n // Call visit recursively to let it determine which concrete\n // subclass of GraphQLNamedType we found in the type map. Because\n // we're using updateEachKey, the result of visit(namedType) may\n // cause the type to be removed or replaced.\n return visit(namedType);\n }\n });\n return type;\n }\n if (type instanceof graphql_1.GraphQLObjectType) {\n // Note that callMethod('visitObject', type) may not actually call any\n // methods, if there are no @directive annotations associated with this\n // type, or if this SchemaDirectiveVisitor subclass does not override\n // the visitObject method.\n var newObject = callMethod('visitObject', type);\n if (newObject) {\n visitFields(newObject);\n }\n return newObject;\n }\n if (type instanceof graphql_1.GraphQLInterfaceType) {\n var newInterface = callMethod('visitInterface', type);\n if (newInterface) {\n visitFields(newInterface);\n }\n return newInterface;\n }\n if (type instanceof graphql_1.GraphQLInputObjectType) {\n var newInputObject_1 = callMethod('visitInputObject', type);\n if (newInputObject_1) {\n updateEachKey(newInputObject_1.getFields(), function (field) {\n // Since we call a different method for input object fields, we\n // can't reuse the visitFields function here.\n return callMethod('visitInputFieldDefinition', field, {\n objectType: newInputObject_1,\n });\n });\n }\n return newInputObject_1;\n }\n if (type instanceof graphql_1.GraphQLScalarType) {\n return callMethod('visitScalar', type);\n }\n if (type instanceof graphql_1.GraphQLUnionType) {\n return callMethod('visitUnion', type);\n }\n if (type instanceof graphql_1.GraphQLEnumType) {\n var newEnum_1 = callMethod('visitEnum', type);\n if (newEnum_1) {\n updateEachKey(newEnum_1.getValues(), function (value) {\n return callMethod('visitEnumValue', value, {\n enumType: newEnum_1,\n });\n });\n }\n return newEnum_1;\n }\n throw new Error(\"Unexpected schema type: \" + type);\n }", "function evaluateTypeOfExpression({ node, environment, evaluate, statementTraversalStack }) {\n return typeof evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "function parseJSDocTypeExpression() {\n var result = createNode(257 /* JSDocTypeExpression */, scanner.getTokenPos());\n parseExpected(15 /* OpenBraceToken */);\n result.type = parseJSDocTopLevelType();\n parseExpected(16 /* CloseBraceToken */);\n fixupParentReferences(result);\n return finishNode(result);\n }", "function getType(x) {\n if (!x) return false;\n if (x.element) return 'item';\n if (x instanceof HTMLElement) return 'html';\n if (x instanceof $) return 'jquery';\n return false;\n}", "static getTypeID(ast) { return ast.typeID }", "function tokenTypes(n) {\r\n\tif (n.parent) {\r\n\t\tvar tt = [n.type];\r\n\t\treturn tt.concat(tokenTypes(n.parent));\r\n } else {\r\n \treturn n.type;\r\n\t}\r\n}", "function match(node, ...types) {\n for (let i = 0; i < types.length; i++) {\n const type = types[i];\n if (node.type === type) {\n return true;\n }\n }\n return false;\n}", "function processType(typeCache, resLoader, rawType, ctx) {\n var xsdNS = 'http://www.w3.org/2001/XMLSchema';\n if(!rawType || !(ctx instanceof LocalContext))\n throw new Error('Invalid raw type or context.');\n var result = undefined;\n // Function to process attributes\n var processAttrs = function(target) {\n var attrs = { };\n Util.arrayEach(target.attribute, function(attr) {\n attrs[attr.name + ((attr.use === 'required') ? '' : '?')] = stripNS(attr.type);\n }); \n return attrs; \n }\n if(rawType.sequence) {\n result = { '_$attrs': processAttrs(rawType) };\n var processElements = function(elements, context, target) {\n Util.arrayEach(elements, function(el) {\n var elType = undefined,\n elTypeNS = undefined;\n // Find occurrence info\n if(el.minOccurs === 'unbounded') el.minOccurs = 0;\n if(el.maxOccurs === 'unbounded') el.maxOccurs = Number.MAX_VALUE;\n if(typeof el.minOccurs !== 'number') el.minOccurs = 1;\n if(typeof el.maxOccurs !== 'number') el.maxOccurs = 1;\n var namePost = '';\n if(el.minOccurs === 1 && el.maxOccurs === 1) namePost = '';\n else if(el.minOccurs === 0 && el.maxOccurs === 1) namePost = '?';\n else namePost = '*';\n if(el.ref) {\n var referred = context.parseNamespace(el.ref),\n refEl = resLoader.searchInNamespace(referred.namespace, ['element', referred.value]);\n if(!refEl) throw new Error(\n 'Referred element `' + referred.value + '\\' not found in namespace `' + referred.namespace + '\\'.'\n );\n elType = refEl.type;\n elTypeNS = refEl.typeNamespace;\n } else {\n if(!el.type) {\n if(el.complexType) target[el.name + namePost] = processType(typeCache, resLoader, el.complexType, context);\n else if(el.simpleType) throw new Error('Not supported.');\n else throw new Error('Invalid element definition, no type specified.');\n return;\n }\n var parsed = context.parseNamespace(el.type);\n elType = parsed.value;\n elTypeNS = parsed.namespace;\n }\n // Basic Type\n if(elTypeNS === xsdNS) target[el.name + namePost] = elType;\n else {\n // console.log('ns: ' + elTypeNS + ' type: ' + elType);\n cacheType(typeCache, resLoader, elTypeNS, elType, true);\n target[el.name + namePost] = { '_$type': elType, '_$namespace': elTypeNS };\n }\n });\n }\n processElements(rawType.sequence.element, ctx, result);\n Util.arrayEach(rawType.sequence.choice, function(ch) {\n result['_$choices'] = result['_$choices'] || [];\n var thisChoice = { };\n // Find occurrence info\n if(ch.minOccurs === 'unbounded') ch.minOccurs = 0;\n if(ch.maxOccurs === 'unbounded') ch.maxOccurs = Number.MAX_VALUE;\n if(typeof ch.minOccurs !== 'number') ch.minOccurs = 1;\n if(typeof ch.maxOccurs !== 'number') ch.maxOccurs = 1;\n if(ch.minOccurs === 1 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '';\n else if(ch.minOccurs === 0 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '?';\n else thisChoice['_$occurrence'] = '*'; \n processElements(ch.element, ctx, thisChoice);\n result['_$choices'].push(thisChoice);\n });\n } else if(rawType.simpleContent || rawType.complexContent) {\n // We're processing some complexType\n // Under complexContent/simpleContent we only support [extension]\n result = processType(typeCache, resLoader, rawType.simpleContent ||rawType.complexContent, ctx); \n } else if(rawType.extension) { \n var baseType = ctx.parseNamespace(rawType.extension.base);\n if(baseType.namespace === xsdNS) {\n // If rawType.extension.base is base type(ie. under xsd namespace), then it has only [attribute]s.\n result = { '_$attrs': processAttrs(rawType.extension) };\n } else {\n // If rawType.extension.base is defined type, then it may have [attribute]s or [sequence,element]s.\n result = processType(typeCache, resLoader, rawType.extension, ctx) || { }; // in case that no sequence is defined.\n cacheType(typeCache, resLoader, baseType.namespace, baseType.value, true);\n result['_$base'] = { '_$type': baseType.value, '_$namespace': baseType.namespace };\n }\n } else if(rawType.restriction) {\n // We're processing some simpleType, only support enumeration for now, and ignore [base].\n result = [];\n Util.arrayEach(rawType.restriction.enumeration, \n function(entry) { entry.value && result.push(entry.value); });\n }\n \n return result;\n}", "function set_node_type_change_handler() {\n let node_type_input = $('#batch_connect_session_context_node_type');\n node_type_input.change(node_type_change_hander);\n}", "function readTypeExpression(state) {\n if (fsaTypeAnnotationExpression === null) {\n // Used to read expressions within {} which evaluate to types.\n // Commas must be treated specially as an escape, not a binary operator.\n let fsaOptions = new ExpressionFsa_2.ExpressionFsaOptions();\n fsaOptions.binaryOpsToIgnore = [\",\"];\n fsaOptions.newLineInMiddleDoesNotEndExpression = true;\n fsaTypeAnnotationExpression = new ExpressionFsa_1.ExpressionFsa(fsaOptions);\n }\n let node = fsaTypeAnnotationExpression.runStartToStop(state.ts, state.wholeState);\n state.nodeToFill.params.push(node);\n}", "function isNode(x) {\n return x !== null && typeof x === \"object\" && typeof x.type === \"string\";\n}", "getType() {\n return this.root.getType();\n }", "static isOfMyType(node) {\n return true; // default implementation: if the tagname matches, it's mine.\n }", "function visit(node) {\n // Only consider exported nodes\n if (!isNodeExported(node))\n return;\n if (node.kind === ts.SyntaxKind.EnumDeclaration) {\n var enNode = node;\n var symbol = checker.getSymbolAtLocation(enNode.name);\n if (!!symbol && generateDts) {\n visitEnumNode(enNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.FunctionDeclaration) {\n var fnNode = node;\n var symbol = checker.getSymbolAtLocation(fnNode.name);\n if (!!symbol && generateDts) {\n visitFunctionNode(fnNode, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.VariableStatement) {\n var vsNode = node;\n if (vsNode.declarationList.declarations.length > 0) {\n var varNode = vsNode.declarationList.declarations[0];\n var symbol = checker.getSymbolAtLocation(varNode.name);\n if (!!symbol && (generateDts || isSymbolHasComments(symbol))) {\n visitVariableNode(varNode, symbol);\n }\n }\n }\n else if (node.kind === ts.SyntaxKind.ClassDeclaration) {\n // This is a top level class, get its symbol\n var symbol = checker.getSymbolAtLocation(node.name);\n if (!symbol)\n return;\n if (generateDts || isSymbolHasComments(symbol)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.InterfaceDeclaration) {\n // This is a top level class, get its symbol\n var name_1 = node.name;\n var symbol = checker.getSymbolAtLocation(name_1);\n if (generateDts || isSymbolHasComments(symbol) || isOptionsInterface(name_1.text)) {\n visitDocumentedNode(node, symbol);\n }\n }\n else if (node.kind === ts.SyntaxKind.ModuleDeclaration) {\n // This is a namespace, visit its children\n ts.forEachChild(node, visit);\n }\n else if (node.kind === ts.SyntaxKind.ExportDeclaration) {\n visitExportDeclarationNode(node);\n }\n }", "function Type(x) {\n\t if (x === null)\n\t return 1 /* Null */;\n\t switch (typeof x) {\n\t case \"undefined\": return 0 /* Undefined */;\n\t case \"boolean\": return 2 /* Boolean */;\n\t case \"string\": return 3 /* String */;\n\t case \"symbol\": return 4 /* Symbol */;\n\t case \"number\": return 5 /* Number */;\n\t case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n\t default: return 6 /* Object */;\n\t }\n\t }", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "type_spec() {\n const startToken = this.currentToken;\n\n let typeTok = this.currentToken;\n if (typeTok.type === Lexer.TokenTypes.TYPE_INTEGER || typeTok.type === Lexer.TokenTypes.TYPE_REAL || typeTok.type === Lexer.TokenTypes.TYPE_BOOLEAN) {\n this.eat(typeTok.type);\n return new AST.TypeNode(typeTok);\n } else {\n throw new ParserException(`Error processing TYPESPEC: Expecting TYPE_INTEGER, TYPE_REAL, or TYPE_BOOLEAN got ${typeTok.type}`, startToken);\n }\n }", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function typeEval(d) {\n if (d.type === \"\") {\n d.children.forEach(typeEval);\n //if children, count children failure #\n if (d.children) {\n\n var failureCount = 0;\n var goodCount = 0;\n\n for (var i = 0; i < d.children.length; i++) {\n if ( d.children[i].type === 1 ) {\n failureCount++;\n } else if ( d.children[i].type === 0 ) {\n goodCount++;\n }\n }\n\n if (failureCount >= d.children.length/2) {\n console.log( failureCount + \" = red \" );\n d.type = 1;\n } else if (goodCount >= d.children.length/2) {\n d.type = 0;\n }\n\n }\n }\n}", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function one(node) {\n var result\n\n if (!type || node.type === type) {\n result = visitor(node, stack.concat())\n }\n\n if (node.children && result !== false) {\n return all(node.children, node)\n }\n\n return result\n }", "function isTypoTypeof(left, right, state) {\n var values;\n \n if (state.option.notypeof)\n return false;\n \n if (!left || !right)\n return false;\n \n values = state.inESNext() ? typeofValues.es6 : typeofValues.es3;\n \n if (right.type === \"(identifier)\" && right.value === \"typeof\" && left.type === \"(string)\")\n return !_.contains(values, left.value);\n \n return false;\n }", "function XPathResult_resultType() {\n var success;\n if(checkInitialization(builder, \"XPathResult_resultType\") != null) return;\n var doc;\n var resolver;\n var evaluator;\n var expression = \"/staff/employee\";\n var contextNode;\n var inresult = null;\n\n var outresult = null;\n\n var inNodeType;\n var outNodeType;\n var ANY_TYPE = 0;\n var NUMBER_TYPE = 1;\n var STRING_TYPE = 2;\n var BOOLEAN_TYPE = 3;\n var UNORDERED_NODE_ITERATOR_TYPE = 4;\n var ORDERED_NODE_ITERATOR_TYPE = 5;\n var UNORDERED_NODE_SNAPSHOT_TYPE = 6;\n var ORDERED_NODE_SNAPSHOT_TYPE = 7;\n var ANY_UNORDERED_NODE_TYPE = 8;\n var FIRST_ORDERED_NODE_TYPE = 9;\n var isTypeEqual;\n nodeTypeList = new Array();\n nodeTypeList[0] = 0;\n nodeTypeList[1] = 1;\n nodeTypeList[2] = 2;\n nodeTypeList[3] = 3;\n nodeTypeList[4] = 4;\n nodeTypeList[5] = 5;\n nodeTypeList[6] = 6;\n nodeTypeList[7] = 7;\n nodeTypeList[8] = 8;\n nodeTypeList[9] = 9;\n\n var docRef = null;\n if (typeof(this.doc) != 'undefined') {\n docRef = this.doc;\n }\n doc = load(docRef, \"doc\", \"staff\");\n evaluator = createXPathEvaluator(doc);\nresolver = evaluator.createNSResolver(doc);\n contextNode = doc;\nfor(var indexN65737 = 0;indexN65737 < nodeTypeList.length; indexN65737++) {\n inNodeType = nodeTypeList[indexN65737];\n outresult = evaluator.evaluate(expression,contextNode,resolver,inNodeType,inresult);\n outNodeType = outresult.resultType;\n\n if(\n (inNodeType == ANY_TYPE)\n ) {\n assertEquals(\"ANY_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == NUMBER_TYPE)\n ) {\n assertEquals(\"NUMBER_TYPE_resulttype\",NUMBER_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == STRING_TYPE)\n ) {\n assertEquals(\"STRING_TYPE_resulttype\",STRING_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == BOOLEAN_TYPE)\n ) {\n assertEquals(\"BOOLEAN_TYPE_resulttype\",BOOLEAN_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_ITERATOR_TYPE_resulttype\",UNORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_ITERATOR_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_ITERATOR_TYPE_resulttype\",ORDERED_NODE_ITERATOR_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == UNORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"UNORDERED_NODE_SNAPSHOT_TYPE_resulttype\",UNORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ORDERED_NODE_SNAPSHOT_TYPE)\n ) {\n assertEquals(\"ORDERED_NODE_SNAPSHOT_TYPE_resulttype\",ORDERED_NODE_SNAPSHOT_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == ANY_UNORDERED_NODE_TYPE)\n ) {\n assertEquals(\"ANY_UNORDERED_NODE_TYPE_resulttype\",ANY_UNORDERED_NODE_TYPE,outNodeType);\n\n }\n\n if(\n (inNodeType == FIRST_ORDERED_NODE_TYPE)\n ) {\n assertEquals(\"FIRST_ORDERED_NODE_TYPE_resulttype\",FIRST_ORDERED_NODE_TYPE,outNodeType);\n\n }\n\n }\n\n}", "function $type(obj){\n if (obj == undefined) \n return false;\n if (obj.htmlElement) \n return 'element';\n var type = typeof obj;\n if (type == 'object' && obj.nodeName) {\n switch (obj.nodeType) {\n case 1:\n return 'element';\n case 3:\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n }\n if (type == 'object' || type == 'function') {\n switch (obj.constructor) {\n case Array:\n return 'array';\n case RegExp:\n return 'regexp';\n }\n if (typeof obj.length == 'number') {\n if (obj.item) \n return 'collection';\n if (obj.callee) \n return 'arguments';\n }\n }\n return type;\n}", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "lookAtNodeType(expr) {\n switch(expr.type) {\n case \"blockStmt\": return this.getBlockStmt(expr); \n case \"varDecl\": return this.getVarDecl(expr);\n case \"variableExpr\": return this.getVariableExpr(expr);\n case \"assignExpr\": return this.getAssignExpr(expr);\n case \"functionDecl\": return this.getFunctionDecl(expr);\n case \"expressionStmt\": return this.getExpressionStmt(expr);\n case \"ifStmt\": return this.getIfStmt(expr);\n case \"printStmt\": return this.getPrintStmt(expr);\n case \"returnStmt\": return this.getReturnStmt(expr);\n case \"whileStmt\": return this.getWhileStmt(expr);\n case \"binaryExpr\": return this.getBinaryExpr(expr);\n case \"callExpr\": return this.getCallExpr(expr);\n case \"groupingExpr\": return this.getGroupingExpr(expr);\n case \"literalExpr\": return this.getLiteralExpr(expr);\n case \"logicalExpr\": return this.getLogicalExpr(expr);\n case \"unaryExpr\": return this.getUnaryExpr(expr);\n default:\n throw new RuntimeError('Resolver cannot evaluate expression or statement')\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function scopeAndTypeCheck(root) {\n //Block sets scope\n if (root.nodeName === \"Block\") {\n //If seen before, go to parent scope\n if (root.visited === true) {\n currentScope = currentScope.parent;\n }\n else {\n //Has been visited, now\n root.visited = true;\n //Make new scope for new block\n if (currentScope !== null) {\n var oldScope = currentScope; //current scope is now old\n currentScope = new SymbolTableNode('Scope', currentScope.nodeVal + 1, {}, currentScope, []); //create a new scope\n oldScope.children.push(currentScope); //child of old scope\n currentScope.parent = oldScope; //scope is now the parent\n }\n else {\n currentScope = new SymbolTableNode('Scope', 0, {}, null, []);\n SymbolTableInstance = new SymbolTable(currentScope, currentScope);\n }\n //Check each Statement\n for (var i = 0; i < root.children.length; i++) {\n scopeAndTypeCheck(root.children[i]);\n }\n //When done checking all Statements under this Block, close the scope and return to the parent scope\n if (currentScope.parent !== null) {\n currentScope = currentScope.parent;\n }\n }\n }\n else if (root.nodeName === \"VariableDeclaration\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n //If this variable already exists in this scope...\n if (currentScope.find(root.children[1])) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[1].nodeVal + \" was redeclared on line \" + root.children[1].lineNumber);\n }\n else {\n currentScope.addVariable(root.children[1], root.children[0]);\n }\n }\n else if (root.nodeName === \"Assignment\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n //Variable has not been found yet\n var isFound = false;\n //Type of parent variable\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not...\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n //If variable is not found in current scope... must search parent scopes\n if (!isFound) {\n //Search all parent scopes, and save type if found\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n //If still not found, it's undeclared.\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true;\n }\n }\n //Find the type - whether in this scope or in parent scope.\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n //The type of the RightVal.\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type errors - mismatch of Left and Right sides\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be set to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Output\") {\n //Set scope of variable\n root.children[0].scope = currentScope.nodeVal;\n //Variable is not yet found\n var isFound = false;\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"OutputVal\") {\n if (root.children[0].nodeVal !== \"?\") {\n isFound = currentScope.find(root.children[0]);\n }\n }\n //\"?\" means literal - no scope errors are shown in case of printing a literal int, bool or string\n if (!isFound && root.children[0].nodeVal !== \"?\") {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Printing counts as variable use\n }\n }\n }\n else if (root.nodeName === \"If\" || root.nodeName === \"While\") {\n //Set scope of variables\n root.children[1].scope = currentScope.nodeVal;\n root.children[0].scope = currentScope.nodeVal;\n scopeAndTypeCheck(root.children[0]); //check test\n scopeAndTypeCheck(root.children[1]); //check block\n }\n else if (root.nodeName === \"CompareTest\") {\n //Set scope of variables\n root.children[0].scope = currentScope.nodeVal;\n root.children[1].scope = currentScope.nodeVal;\n var isFound = false;\n var parentType = \"\";\n //Check if var exists in current scope in symbol table - and parent scope, if not\n if (root.children[0].nodeName === \"LeftVal\") {\n isFound = currentScope.find(root.children[0]);\n }\n if (!isFound) {\n if (currentScope.parent !== null) {\n var searchScope = currentScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n while (searchScope.parent !== null && !isFound) {\n searchScope = searchScope.parent;\n isFound = searchScope.find(root.children[0]);\n if (isFound) {\n parentType = searchScope.getType(root.children[0]);\n }\n }\n }\n if (!isFound) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is not found on line \" + root.children[0].lineNumber);\n }\n else {\n root.children[0].isUsed = true; //Comparing counts as variable use\n }\n }\n var type = \"\";\n if (parentType === \"\") {\n type = currentScope.getType(root.children[0]);\n }\n else {\n type = parentType;\n }\n var otherType = \"\";\n if (root.children[1].nodeType === \"ID\") {\n otherType = currentScope.getType(root.children[1]);\n }\n //Type mismatches in comparability\n if (otherType !== \"\" && type !== otherType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + otherType + \" on line \" + root.children[0].lineNumber);\n }\n else if (otherType === \"\" && type !== root.children[1].nodeType) {\n errorlog(\"Semantic Analysis Error - Variable \" + root.children[0].nodeVal + \" is of type \" + type + \" and cannot be compared to type \" + root.children[1].nodeType + \" on line \" + root.children[0].lineNumber);\n }\n }\n else if (root.nodeName === \"Add\") {\n }\n else {\n }\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n\t\t return {\n\t\t enter: function enter(node) {\n\t\t typeInfo.enter(node);\n\t\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n\t\t if (fn) {\n\t\t var result = fn.apply(visitor, arguments);\n\t\t if (result !== undefined) {\n\t\t typeInfo.leave(node);\n\t\t if (isNode(result)) {\n\t\t typeInfo.enter(result);\n\t\t }\n\t\t }\n\t\t return result;\n\t\t }\n\t\t },\n\t\t leave: function leave(node) {\n\t\t var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n\t\t var result = void 0;\n\t\t if (fn) {\n\t\t result = fn.apply(visitor, arguments);\n\t\t }\n\t\t typeInfo.leave(node);\n\t\t return result;\n\t\t }\n\t\t };\n\t\t}", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function Type(x) {\r\n if (x === null)\r\n return 1 /* Null */;\r\n switch (typeof x) {\r\n case \"undefined\": return 0 /* Undefined */;\r\n case \"boolean\": return 2 /* Boolean */;\r\n case \"string\": return 3 /* String */;\r\n case \"symbol\": return 4 /* Symbol */;\r\n case \"number\": return 5 /* Number */;\r\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\r\n default: return 6 /* Object */;\r\n }\r\n }", "function $type(obj){\r\n if (!$defined(obj)) \r\n return false;\r\n if (obj.htmlElement) \r\n return 'element';\r\n var type = typeof obj;\r\n if (type == 'object' && obj.nodeName) {\r\n switch (obj.nodeType) {\r\n case 1:\r\n return 'element';\r\n case 3:\r\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\r\n }\r\n }\r\n if (type == 'object' || type == 'function') {\r\n switch (obj.constructor) {\r\n case Array:\r\n return 'array';\r\n case RegExp:\r\n return 'regexp';\r\n case Class:\r\n return 'class';\r\n }\r\n if (typeof obj.length == 'number') {\r\n if (obj.item) \r\n return 'collection';\r\n if (obj.callee) \r\n return 'arguments';\r\n }\r\n }\r\n return type;\r\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }", "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "function isNodeType(type) {\n\t return t.isType(this.type, type);\n\t}", "function processType(type_subcomponent) {\n\n // types_subcomponent is either a group_bracket or a subtype,\n // which both contain subcontexts at [1]\n \n let types_arr = type_subcomponent[1];\n\n let types = [];\n\n for(let type_item of types_arr) {\n\n // Each type_item is a subcontext which contain types at [1]\n \n // A type item must only have a maximum of 2 children\n if(type_item[1].length>2)\n throw(`Unexpected ${type_item[1].length} elements `+\n `inside type (only max. 2 expected) at `+\n `line ${type_item[2][0].line} `+\n `column ${type_item[2][0].column}`);\n\n \n if(// If type item has 2 children, \n // first child must be NAME and second as SUBTYPE \n (type_item[1].length==2 && \n !(type_item[1][0][0].isOf(SubComponentType.NAME) && \n type_item[1][1][0].isOf(SubComponentType.SUBTYPE))) ||\n\n // If type item has 1 child, it must be NAME\n (type_item[1].length==1 && !type_item[1][0][0].isOf(SubComponentType.NAME)))\n\n throw(`Unexpected type format given (must be NAME or NAME<SUBTYPES>) at `+\n `line ${type_item[2][0].line} `+\n `column ${type_item[2][0].column}`);\n\n \n let type = new TypeItem();\n type.name = type_item[1][0][1];\n if(type_item[1][1]) type.subtype = processType(type_item[1][1]);\n \n types.push(type);\n }\n\n let typecontext = new TypeContext();\n typecontext.type_items = types;\n typecontext.start = type_subcomponent[2][0];\n typecontext.end = type_subcomponent[2][1];\n\n return typecontext;\n\n}", "function getNamedTypeNode(typeNode) {\n var namedType = typeNode;\n while (namedType.kind === _kinds.LIST_TYPE || namedType.kind === _kinds.NON_NULL_TYPE) {\n namedType = namedType.type;\n }\n return namedType;\n}", "function getType(obj)\r\n{\r\n\r\n for(t in ast.tokens)\r\n {\r\n //console.log(ast.tokens[t].range + \"----\" + obj.range);\r\n if(ast.tokens[t].range === obj.range)\r\n {\r\n //console.log(\"##\"+ast.tokens[t].type);\r\n var type = ast.tokens[t].type;\r\n if( type === 'Identifier')\r\n {\r\n type = lookupType(obj);\r\n }\r\n return type;\r\n\r\n }\r\n else\r\n {\r\n //return lookupType(obj);\r\n }\r\n }\r\n}", "function isNodeType(type) {\n return t.isType(this.type, type);\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function checkNodeType(node, type) {\n if (node && node.type === type) {\n // The definition of ParseNode<TYPE> doesn't communicate to flow that\n // `type: TYPE` (as that's not explicitly mentioned anywhere), though that\n // happens to be true for all our value types.\n // $FlowFixMe\n return node;\n }\n\n return null;\n}", "function evaluateTypeAssertion({ node, environment, evaluate, statementTraversalStack }) {\n return evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function typeToken() {\n\t\tvar type = thisToken;\n\t\tif (lastToken == '*')\n\t\t\ttype = '*' + type;\n\t\tgetToken();\n\t\tremoveNewLine();\n\t\tif (thisToken == '*' || thisToken == '&') {\n\t\t\tif (thisToken == '*')\n\t\t\t\ttype = thisToken + type;\n\t\t\tgetToken();\n\t\t}\n\t\t//type cast, not implemented\n\t\tif (thisToken == ')') {\n\t\t\tgetToken();\n\t\t\texecut();\n\t\t\treturn;\n\t\t}\n\t\tgetToken();\n\t\t//call function registration\n\t\tif (thisToken == '(') {\n\t\t\tpreviousToken();\n\t\t\taddFunction(type);\n\t\t} else if (thisToken == '[') {\n\t\t\taddArray(type);\n\t\t}\n\t\t//declaration of variables of the same type, separated by commas, assignment is not supported\n\t\telse if (thisToken == ',') {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t\tgetToken();\n\t\t\twhile (thisToken && thisToken != ';') {\n\t\t\t\tgetToken();\n\t\t\t\taddVar(type);\n\t\t\t\tgetToken();\n\t\t\t\tif (!(thisToken == ',' || thisToken == ';'))\n\t\t\t\t\tputError(lineCount, 17, '');\n\t\t\t\t//info(\"\" + lineCount + \" unsupported variable declaration\");\n\t\t\t}\n\t\t} else {\n\t\t\tpreviousToken();\n\t\t\taddVar(type);\n\t\t}\n\t}", "function isNodeType(type /*: string*/) /*: boolean*/ {\n\t return t.isType(this.type, type);\n\t}", "function isNodeType(type /*: string*/) /*: boolean*/ {\n\t return t.isType(this.type, type);\n\t}", "static parseType(parseTokens) {\n isASTNode = true;\n this.match([\"int\", \"string\", \"boolean\"], parseTokens[tokenPointer], false);\n }", "function checkTypeNodeAsExpression(node) {\n // When we are emitting type metadata for decorators, we need to try to check the type\n // as if it were an expression so that we can emit the type in a value position when we\n // serialize the type metadata.\n if (node && node.kind === 155 /* TypeReference */) {\n var root = getFirstIdentifier(node.typeName);\n var meaning = root.parent.kind === 155 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */;\n // Resolve type so we know which symbol is referenced\n var rootSymbol = resolveName(root, root.text, meaning | 8388608 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);\n // Resolved symbol is alias\n if (rootSymbol && rootSymbol.flags & 8388608 /* Alias */) {\n var aliasTarget = resolveAlias(rootSymbol);\n // If alias has value symbol - mark alias as referenced\n if (aliasTarget.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {\n markAliasSymbolAsReferenced(rootSymbol);\n }\n }\n }\n }", "function getNodeType(node) {\n const tsNode = service.esTreeNodeToTSNodeMap.get(node);\n const type = typeChecker.getTypeAtLocation(tsNode);\n return getBaseType(type);\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n }", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (Object(_language_ast_mjs__WEBPACK_IMPORTED_MODULE_3__[\"isNode\"])(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = Object(_language_visitor_mjs__WEBPACK_IMPORTED_MODULE_2__[\"getVisitFn\"])(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function narrowType(type, expr, assumeTrue) {\n switch (expr.kind) {\n case 69 /* Identifier */:\n case 97 /* ThisKeyword */:\n case 172 /* PropertyAccessExpression */:\n return narrowTypeByTruthiness(type, expr, assumeTrue);\n case 174 /* CallExpression */:\n return narrowTypeByTypePredicate(type, expr, assumeTrue);\n case 178 /* ParenthesizedExpression */:\n return narrowType(type, expr.expression, assumeTrue);\n case 187 /* BinaryExpression */:\n return narrowTypeByBinaryExpression(type, expr, assumeTrue);\n case 185 /* PrefixUnaryExpression */:\n if (expr.operator === 49 /* ExclamationToken */) {\n return narrowType(type, expr.operand, !assumeTrue);\n }\n break;\n }\n return type;\n }", "function matchType() {\n\t\tvar pattern = /^(int|string|boolean)/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null){\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = undefined;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}", "function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */false);\n if (fn) {\n var result = fn.apply(visitor, arguments);\n if (result !== undefined) {\n typeInfo.leave(node);\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind, /* isLeaving */true);\n var result = void 0;\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n typeInfo.leave(node);\n return result;\n }\n };\n}" ]
[ "0.61191785", "0.5871666", "0.5708964", "0.5628587", "0.5628587", "0.5404643", "0.53770334", "0.5364447", "0.53539765", "0.53539765", "0.53485525", "0.53485525", "0.53423786", "0.53335994", "0.52903", "0.527996", "0.527996", "0.52652687", "0.52536625", "0.52406645", "0.5156149", "0.5137667", "0.5131424", "0.51227015", "0.5110596", "0.50896555", "0.5081709", "0.507491", "0.5040911", "0.50325435", "0.49936512", "0.49925464", "0.49873886", "0.49867353", "0.4981676", "0.4959868", "0.4942591", "0.4933165", "0.4933165", "0.4933165", "0.4933165", "0.4933165", "0.4933165", "0.49143758", "0.49020034", "0.48931578", "0.4892215", "0.4891021", "0.48882645", "0.48882645", "0.48882645", "0.48882645", "0.48882645", "0.48882645", "0.48882645", "0.48871183", "0.48756", "0.4871819", "0.4871819", "0.4871819", "0.4870253", "0.48603916", "0.48603916", "0.48589632", "0.48589632", "0.48589632", "0.48489934", "0.4848336", "0.48377758", "0.483196", "0.48307386", "0.48307386", "0.48307386", "0.48279747", "0.48187655", "0.48181504", "0.48181504", "0.4816039", "0.48131528", "0.48086777", "0.48073643", "0.48073643", "0.4799494", "0.479682", "0.479269", "0.4784508", "0.4784508", "0.4784508", "0.4784508", "0.4784508", "0.4784508", "0.4776326", "0.47628042", "0.47604352", "0.47537506", "0.47537506", "0.47537506", "0.47537506", "0.47537506", "0.47537506", "0.47537506" ]
0.0
-1
Set the renderer dimensions to the max dimension of the canvas. This assumes a 1:1 aspect ratio but improves the output resolution.
updateRenderDimensions(window) { const maxDimension = Math.max(this.renderer.domElement.clientWidth, this.renderer.domElement.clientHeight); // Set the pixel ratio to set the correct resolution for high PPI displays. this.renderer.setPixelRatio(window.devicePixelRatio); this.renderer.setSize(maxDimension, maxDimension, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeRendererToDisplaySize(renderer) {\n const canvas = renderer.domElement;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n if (canvas.width !== width || canvas.height !== height) {\n renderer.setSize(width, height, false);\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n }\n}", "function resizeCanvas() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n\n renderer.setSize( window.innerWidth, window.innerHeight );\n}", "function resizeRendererToDisplaySize() {\n\tconst canvas = renderer.domElement;\n\tconst pixelRatio = window.devicePixelRatio;\n\tconst width = canvas.clientWidth * pixelRatio | 0;\n\tconst height = canvas.clientHeight * pixelRatio | 0;\n\tconst needResize = canvas.width !== width || canvas.height !== height;\n\tif (needResize) {\n\t renderer.setSize(width, height, false);\n\t}\n\treturn needResize;\n}", "adjustCanvasDimension() {\n const canvasImage = this.canvasImage.scale(1);\n const {width, height} = canvasImage.getBoundingRect();\n const maxDimension = this._calcMaxDimension(width, height);\n\n this.setCanvasCssDimension({\n width: '100%',\n height: '100%', // Set height '' for IE9\n 'max-width': `${maxDimension.width}px`,\n 'max-height': `${maxDimension.height}px`\n });\n\n this.setCanvasBackstoreDimension({\n width,\n height\n });\n this._canvas.centerObject(canvasImage);\n }", "function resizeCanvasToDisplaySize() {\n const width = window.innerWidth\n const height = window.innerHeight\n const pixelRatio = window.devicePixelRatio\n\n const size = renderer.getSize()\n if (canvas.width !== width || canvas.height !== height) {\n renderer.setPixelRatio(pixelRatio)\n renderer.setSize(width, height)\n camera.aspect = width / height\n camera.updateProjectionMatrix()\n }\n}", "function resize() {\n // Set renderer size and pixel ratio\n renderer.setSize(xSize, ySize, false);\n renderer.setPixelRatio(1);\n // renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1);\n // Set camera aspect ratio\n dummy_camera.aspect = window.innerWidth / window.innerHeight;\n dummy_camera.updateProjectionMatrix();\n}", "updateMaxCanvasRegion() {\n this.maxCanvasRegion.width = this.windowWidth;\n this.maxCanvasRegion.height = this.windowHeight;\n if (this.node === document.body)\n return;\n const containerRect = this.node.getBoundingClientRect();\n this.maxCanvasRegion.width = containerRect.width;\n this.maxCanvasRegion.height = containerRect.height;\n }", "updateMaxCanvasRegion() {\n this.maxCanvasRegion.width = this.windowWidth;\n this.maxCanvasRegion.height = this.windowHeight;\n if (this.node === document.body)\n return;\n const containerRect = this.node.getBoundingClientRect();\n this.maxCanvasRegion.width = containerRect.width;\n this.maxCanvasRegion.height = containerRect.height;\n }", "updateMaxCanvasRegion() {\n this.maxCanvasRegion.width = this.windowWidth;\n this.maxCanvasRegion.height = this.windowHeight;\n if (this.node === document.body)\n return;\n const containerRect = this.node.getBoundingClientRect();\n this.maxCanvasRegion.width = containerRect.width;\n this.maxCanvasRegion.height = containerRect.height;\n }", "function resizeRendererToDisplaySize(renderer) {\n const canvas = renderer.domElement;\n\n //for HD displays\n const pixelRatio = window.devicePixelRatio;\n const width = (canvas.clientWidth * pixelRatio) | 0;\n const height = (canvas.clientHeight * pixelRatio) | 0;\n\n // if you don't want to adjust to pixel ratios, then use below code for width and height\n // const width = canvas.clientWidth;\n // const height = canvas.clientHeight;\n const needResize = canvas.width !== width || canvas.height !== height;\n if (needResize) {\n renderer.setSize(width, height, false);\n }\n\n return needResize;\n }", "function resizeRendererToDisplaySize(renderer) {\n \n }", "function adjustMaxCanvasSize() {\n var windowWidth = window.innerWidth;\n var numFitSm = parseInt(0.8 * windowWidth / state.inputSize, 10); // for smaller screens\n var numFitLg = parseInt(0.65 * windowWidth / state.inputSize, 10); // for large screens\n function update(widthText, heightText, maxWidth, maxHeight) {\n widthText = document.createTextNode(widthText);\n heightText = document.createTextNode(heightText);\n $(\"#width-label\").html(widthText.data);\n $(\"#height-label\").html(heightText.data);\n $(\"#input-width\").attr(\"max\", maxWidth);\n $(\"#input-height\").attr(\"max\", maxHeight);\n }\n if (windowWidth >= 768) {\n update(\n \"Width (max \" + numFitLg + \"): \",\n \"Height (max \" + numFitLg * 2 + \"): \",\n numFitLg,\n numFitLg * 2\n );\n } else {\n update(\n \"Width (max \" + numFitSm + \"): \",\n \"Height (max \" + numFitLg * 2 + \"): \",\n numFitSm,\n numFitSm * 2\n );\n }\n }", "function setSize(){\n\t\tif(window.innerWidth > window.innerHeight * (2/1)){\n\t\t\tcanvas.style.height = window.innerHeight + \" px\";\n\t\t\tcanvas.style.width = window.innerHeight * (2/1);\n\t\t}else{\n\t\t\tcanvas.style.height = window.innerHeight * (1/2) + \" px\";\n\t\t\tcanvas.style.width = window.innerHeight + \" px\";\n\t\t}\n\t}", "function resizeRendererToDisplaySize(renderer) {\n const canvas = renderer.domElement;\n const width = canvas.clientWidth;\n const height = canvas.clientHeight;\n const needResize = canvas.width !== width || canvas.height !== height;\n if (needResize) {\n renderer.setSize(width, height, false);\n }\n return needResize;\n }", "setRendererSize(w,h) {\n\n }", "function adjustCanvasSize() {\n CANVAS.width = CANVAS_WIDTH;\n CANVAS.height = window.innerHeight;\n}", "function resizeRendererToDisplaySize(renderer) {\n const canvas = renderer.domElement;\n const pixelRatio = window.devicePixelRatio; // For HD-DPI displays\n const width = canvas.clientWidth * pixelRatio | 0;\n const height = canvas.clientHeight * pixelRatio | 0;\n const needResize = canvas.width !== width || canvas.height !== height;\n if (needResize) {\n renderer.setSize(width, height, false);\n }\n return needResize;\n }", "function resizeRendererToDisplaySize(renderer) {\n const canvas = renderer.domElement;\n const pixelRatio = window.devicePixelRatio;\n const width = canvas.clientWidth * pixelRatio | 0;\n const height = canvas.clientHeight * pixelRatio | 0;\n const needResize = canvas.width !== width || canvas.height !== height;\n if (needResize) {\n renderer.setSize(width, height, false);\n }\n return needResize;\n }", "function resize() {\n var width = container.offsetWidth;\n var height = container.offsetHeight;\n\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n\n renderer.setSize(width, height);\n renderer.setSize(width, height);\n }", "function setCanvasDimensions() {\n // On small screens (e.g. phones), we want to \"zoom out\" so players can still see at least\n // 800 in-game units of width.\n const scaleRatio = Math.max(1, 800 / window.innerWidth)\n canvas.width = scaleRatio * window.innerWidth\n canvas.height = scaleRatio * window.innerHeight\n}", "resize() {\n this.renderer.setSize( this.container.offsetWidth, this.container.offsetHeight );\n this.composer.setSize( this.container.offsetWidth, this.container.offsetHeight );\n this.camera.aspect = this.container.offsetWidth / this.container.offsetHeight;\n this.camera.updateProjectionMatrix();\n this.requestRender();\n }", "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function resize() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n}", "function resize() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n}", "function resize() {\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n}", "resizeImmediate() {\n this.size = vec2.fromValues(this.canvas.parentElement.clientWidth, this.canvas.parentElement.clientHeight);\n this.dpi = window.devicePixelRatio;\n\n this.canvas.style.width = '100%';\n this.canvas.style.height = '100%';\n\n vec2.scale(this.size, this.size, this.options.scale);\n\n this.canvas.width = this.size[0] * this.dpi;\n this.canvas.height = this.size[1] * this.dpi;\n\n this.flagDirty();\n this.draw_required = true;\n\n Logger.debug(`Resizing renderer to ${this.size} @ ${this.dpi}x`);\n }", "function resize() {\n const container = document.getElementById('container');\n const w = container.offsetWidth;\n const h = container.offsetHeight;\n renderer.setSize(w, h);\n camera.aspect = w / h;\n camera.updateProjectionMatrix();\n}", "function updateDimensions() {\n\n\t\twindowHeight \t\t= main.innerHeight()-350;\n\t\t\n\t\twindowWidth \t\t= virtualhand.innerWidth();\n\n\t\t/*\n\t\t * The three.js area and renderer are resized to fit the page\n\t\t */\n\t\tvar renderHeight \t= windowHeight - 5;\n\n\t\trenderArea.css({width: windowWidth, height: renderHeight});\n\n\t\trenderer.setSize(windowWidth, renderHeight);\n\n\t}", "function setCanvasSize() {\n\t\t// Get the screen height and width\n\t\tscreenHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;\n\t\tscreenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;\n\t\t// Figure out which one is smaller\n\t\tminScreenSide = ( screenWidth < screenHeight ) ? screenWidth : screenHeight;\n\t\t// Figure out if the timer is at its max size\n\t\tif ( (minScreenSide + 2*timerPadding ) > maxTimerSide ) {\n\t\t\tcanvasSide = maxTimerSide - 2*timerPadding;\n\t\t} else {\n\t\t\tcanvasSide = minScreenSide;\n\t\t}\n\t\tcanvas.height = canvasSide;\n\t\tcanvas.width = canvasSide;\n\t\t//logDimensions();\n\t}", "function setCanvasSize() {\n\t\t// Get the screen height and width\n\t\tscreenHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;\n\t\tscreenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;\n\t\t// Figure out which one is smaller\n\t\tminScreenSide = ( screenWidth < screenHeight ) ? screenWidth : screenHeight;\n\t\t// Figure out if the timer is at its max size\n\t\tif ( (minScreenSide + 2*timerPadding ) > maxTimerSide ) {\n\t\t\tcanvasSide = maxTimerSide - 2*timerPadding;\n\t\t} else {\n\t\t\tcanvasSide = minScreenSide;\n\t\t}\n\t\tcanvas.height = canvasSide;\n\t\tcanvas.width = canvasSide;\n\t\t//logDimensions();\n\t}", "setSize(width, height) {\n this.cssRenderer.setSize(width, height);\n this.cssCamera.aspect = width / height;\n this.cssCamera.updateProjectionMatrix();\n }", "function setSize(){\n\n\tvar winW = 600, winH = 400;\n\tif (document.body && document.body.offsetWidth) {\n\t winW = document.body.offsetWidth;\n\t winH = document.body.offsetHeight;\n\t}\n\tif (document.compatMode=='CSS1Compat' &&\n\t\tdocument.documentElement &&\n\t\tdocument.documentElement.offsetWidth ) {\n\t winW = document.documentElement.offsetWidth;\n\t winH = document.documentElement.offsetHeight;\n\t}\n\tif (window.innerWidth && window.innerHeight) {\n\t winW = window.innerWidth;\n\t winH = window.innerHeight;\n\t}\n\t\n\tvar canvas = document.getElementById(\"canvas\");\n\t\tcanvas.height = (winH - 25);\n\t\tcanvas.width = (winW - 5);\n\t\tconstants.MAX_X = winW - 5;\n\t\tconstants.MAX_Y = winH - 25;\n\t\n}", "resize() {\n if (!this.canvasContainer) return;\n var containerWidth = this.canvasContainer.offsetWidth;\n var containerHeight = this.canvasContainer.offsetHeight;\n\n if (this._renderMode === 'svg' && this._svgCanvas) {\n this.paper.view.viewSize.width = containerWidth;\n this.paper.view.viewSize.height = containerHeight;\n } else if (this._renderMode === 'webgl' && this._webGLCanvas) {\n this._pixiApp.renderer.resize(containerWidth, containerHeight);\n }\n }", "function onResize() {\n canvas.height = window.innerHeight;\n canvas.width = window.innerWidth;\n\n canvasMin = Math.min(canvas.width, canvas.height);\n canvasMax = Math.max(canvas.width, canvas.height);\n}", "function resize() {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function resize() {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function resize() {\n renderer.setSize(window.innerWidth,window.innerHeight);\n camera.aspect = window.innerWidth/window.innerHeight;\n camera.updateProjectionMatrix();\n}", "function resize() {\n renderer.setSize(window.innerWidth,window.innerHeight);\n camera.aspect = window.innerWidth/window.innerHeight;\n camera.updateProjectionMatrix();\n}", "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 respondCanvas() { \n var container = $($canvas).parent();\n\n $canvas.attr('width', $(container).width() ); //max width\n $canvas.attr('height', $(container).height() ); //max height\n\n $tmpCanvas.attr('width', $(container).width() ); //max width\n $tmpCanvas.attr('height', $(container).height() ); //max height\n }", "_setSize() {\n this.colorPickerCanvas.style.width = '100%';\n this.colorPickerCanvas.style.height = '100%';\n\n this.colorPickerCanvas.width = 289 * this.pixelRatio;\n this.colorPickerCanvas.height = 289 * this.pixelRatio;\n }", "function resize() {\n var nativePixelRatio = window.devicePixelRatio = window.devicePixelRatio ||\n Math.round(window.screen.availWidth / document.documentElement.clientWidth);\n\n var devicePixelRatio = nativePixelRatio;\n\n var width = window.innerWidth;\n var height = window.innerHeight;\n self.camera.aspect = devicePixelRatio;\n self.camera.updateProjectionMatrix();\n self.renderer.setSize(width, height);\n self.effect.setSize(width, height);\n }", "function reSize(){\n \twindowHeight = window.innerHeight;\n\twindowWidth = window.innerWidth;\n\trenderer.setSize(windowWidth, windowHeight);\n\tcamera.aspect = windowWidth/windowHeight;\n\tcamera.updateProjectionMatrix();\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 setSize() {\n canvas.width = iOS ? screen.width : window.innerWidth;\n canvas.height = iOS ? screen.height : window.innerHeight;\n}", "function doResize()\r\n{\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix(); // Need to call this for the change in aspect to take effect.\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n}", "function setCanvasDimensions() {\n var canvas = document.getElementById('canvas');\n var width = window.innerWidth * 0.73408;\n var height = window.innerHeight * 0.58378;\n canvas.width = width;\n canvas.height = height;\n}", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) * .67;\n\t\tcanvas.height = (window.innerHeight) * .69;\n\t\tredraw();\n\t}", "function resize () {\n const width = viewportElement.clientWidth\n const height = viewportElement.clientHeight\n if (canvas.width !== width || canvas.height !== height) {\n // console.log(\"Canvas resized from \", canvas.width, canvas.height, \" to \", width, height)\n canvas.clientWidth = width\n canvas.clientHeight = height\n canvas.width = width\n canvas.height = height\n\n camera.aspect = (width / height)\n camera.updateProjectionMatrix()\n renderer.setSize(width, height)\n\n calculateBoardCornerScreenCoordinates()\n }\n}", "function canvasResizer() {\n if (window.innerWidth < 505) {\n gElCanvas.width = 250;\n gElCanvas.height = 250;\n resizer = 0.5;\n } else if (window.innerWidth < 1100) {\n gElCanvas.width = 350;\n gElCanvas.height = 350;\n resizer = 0.7;\n } else {\n gElCanvas.width = 500;\n gElCanvas.height = 500;\n resizer = 1;\n }\n\n renderCanvas();\n}", "function resizeCanvas() {\n\t\tcanvas.width = (window.innerWidth) - 150;\n\t\tcanvas.height = (window.innerHeight) - 100;\n\t\tredraw();\n\t}", "function onResize() {\n if (camera instanceof PerspectiveCamera) {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n }\n renderer.setSize(window.innerWidth, window.innerHeight);\n}", "function resizeCanvas() {\n c.width = c.clientWidth;\n c.height = c.clientHeight;\n c.aspect = c.width/c.height;\n gl.viewport(0,0,c.width,c.height);\n feedback.allocate2(c.width,c.height);\n\theightflow.allocate(c.width,c.height);\n}", "resize () {\n document.body.style.overflow = 'hidden'\n\n const maxMulti = 20\n // overflow pixels\n const padding = 1\n const w = 320\n const h = 180\n const availW = window.innerWidth\n const availH = window.innerHeight\n // - 20 for padding\n const maxW = Math.floor(availW / (w - padding))\n const maxH = Math.floor(availH / (h - padding))\n let multi = maxW < maxH ? maxW : maxH\n\n if (multi > maxMulti) multi = maxMulti\n\n const canvas = document.getElementsByTagName('canvas')[0]\n canvas.style.width = `${multi * w}px`\n canvas.style.height = `${multi * h}px`\n }", "function resize() {\n _screenWidth = window.innerWidth\n _screenHeight = window.innerHeight\n\n // camera settings for to be actual size\n _mainCamera.aspect = _screenWidth / _screenHeight\n _mainCamera.updateProjectionMatrix()\n _mainCamera.position.z = (_screenHeight * 0.5) / Math.tan((_mainCamera.fov * 0.5) * Math.PI / 180)\n\n _renderer.setSize(_screenWidth, _screenHeight)\n\n // update something\n}", "function resizeCanvas()\n{\n\tvar canvas = $('#canvas');\n\tvar container = $(canvas).parent();\n\tcanvas.attr('width', $(container).width() ); // Max width\n\tcanvas.attr('height', $(container).height() ); // Max height\n}", "function resize() {\r\n \r\n var aspect = window.innerWidth / window.innerHeight;\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n camera.aspect = aspect;\r\n camera.updateProjectionMatrix();\r\n// printMatrix('camera',camera.projectionMatrix);\r\n}", "function onResize() {\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n renderer.setSize(window.innerWidth, window.innerHeight);\r\n}", "function doResize() {\n var canvas = document.getElementById(\"drone-sim-canvas\");\n if((window.innerWidth > 40) && (window.innerHeight > 240)) {\n console.log(\"Canvas size changed.\");\n canvas.width = window.innerWidth-16;\n canvas.height = window.innerHeight-200;\n var w=canvas.clientWidth;\n var h=canvas.clientHeight;\n\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.viewport(0.0, 0.0, w, h);\n\n aspectRatio = w/h;\n }\n}", "function ResizeCanvas() {\n paper.view.viewSize = [window.innerWidth-300, window.innerHeight];\n }", "updateSize() {\n const totalWidth = Math.round(this.width / this.params.pixelRatio);\n const requiredCanvases = Math.ceil(\n totalWidth / this.maxCanvasElementWidth\n );\n\n while (this.canvases.length < requiredCanvases) {\n this.addCanvas();\n }\n\n while (this.canvases.length > requiredCanvases) {\n this.removeCanvas();\n }\n\n this.canvases.forEach((entry, i) => {\n // Add some overlap to prevent vertical white stripes, keep the width even for simplicity.\n let canvasWidth =\n this.maxCanvasWidth + 2 * Math.ceil(this.params.pixelRatio / 2);\n\n if (i == this.canvases.length - 1) {\n canvasWidth =\n this.width -\n this.maxCanvasWidth * (this.canvases.length - 1);\n }\n\n this.updateDimensions(entry, canvasWidth, this.height);\n this.clearWaveForEntry(entry);\n });\n }", "function onWindowResize() {\n scene.setCameraAspect(window.innerWidth / window.innerHeight);\n renderer.setSize(window.innerWidth, window.innerHeight);\n}", "onWindowResize() {\n for(var scene in this.scenes){\n scene.camera.aspect = this.screenWidth / this.screenHeight;\n scene.camera.updateProjectionMatrix();\n }\n this.renderer.setSize( this.screenWidth, this.screenHeight );\n }", "function resize() {\n\t\t\tcanvas.width = container.offsetWidth;\n\t\t\tcanvas.height = container.offsetHeight;\n\t\t}", "function onWindowResize() {\n\tscene.setCameraAspect(window.innerWidth / window.innerHeight);\n\trenderer.setSize(window.innerWidth, window.innerHeight);\n}", "function set_canvas_size() {\n canvas_width = the_canvas.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,\n canvas_height = the_canvas.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n }", "function onWindowResize() {\r\n\tcamera.aspect = window.innerWidth / window.innerHeight;\r\n\tcamera.updateProjectionMatrix();\r\n\trenderer.setSize(window.innerWidth, window.innerHeight);\r\n}", "onWindowResize() {\n //Das Div in dem der VisualizationsCanvas liegt wird var wrapper zugewiesen\n let wrapper = $('#visualizationsCanvasDiv');\n //die Hoehe des divs wird entsprechend dem verhältnis der vorhandenenn hoehe und dem canvas div zu vorhandenen Hoehe angepasst\n wrapper.height((window.innerHeight * (wrapper.width() / window.innerWidth)));\n //Aspect = Hoehen zu Breiten Verhaeltnis\n var aspect = $(\"#visualizationsCanvasDiv\").width() / $(\"#visualizationsCanvasDiv\").height();\n //Wenn Kamera links starten soll(linke Ecke des Canvas = 0) sonst startet Kamera in der Mitte\n if (this.startLeft) {\n this.camera.left = 0;\n this.camera.right = this.frustumSize * aspect;\n } else {\n this.camera.left = this.frustumSize * aspect / -2;\n this.camera.right = this.frustumSize * aspect / 2;\n }\n //Oberes und unteres Ende der Kamera wird gesetzt \n this.camera.top = this.frustumSize / 2;\n this.camera.bottom = this.frustumSize / -2;\n //Kamera wird aktualisiert\n this.camera.updateProjectionMatrix();\n this.camera.updateMatrixWorld();\n //Renderer Groesse wird neu gesetzt\n this.renderer.setSize(wrapper.width(), wrapper.height());\n if (window.actionDrivenRender)\n this.render();\n }", "function onResize() {\n canvas.width = window.innerWidth * 0.75;\n canvas.height = window.innerHeight;\n }", "resize() {\n if (this._isShutDown) return;\n this._canvas.width = window.innerWidth;\n this._canvas.height = window.innerHeight;\n this.redraw();\n }", "function onWindowResize() {\n camera.aspect = container.clientWidth / container.clientHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(container.clientWidth, container.clientHeight);\n}", "function canvasResize() {\n if (!canvas) return;\n\n canvas.width = innerWidth;\n canvas.height = innerHeight;\n gl.viewport(0, 0, innerWidth, innerHeight);\n\n screenRatio = innerWidth / innerHeight;\n mat4.perspective(projection, 45 * Math.PI / 180, screenRatio, 0.1, 1000);\n\n gl.bindTexture(gl.TEXTURE_2D, FBOsoffscreen.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, innerWidth, innerHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, FBOsoffscreen.colorRenderBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, innerWidth, innerHeight);\n\n if (screenRatio < 1.2 && innerWidth < 850) {\n window.cameraZ = 65;\n camera.pos = [0, 0, cameraZ];\n } else {\n window.cameraZ = 45;\n camera.pos = [0, 0, cameraZ];\n }\n}", "function onResize() {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = (window.innerWidth / window.innerHeight);\n camera.updateProjectionMatrix();\n}", "function resize() {\n app.renderer.autoResize = true;\n app.renderer.resize(window.innerWidth, window.innerHeight);\n circle.x = window.innerWidth/2;\n circle.y = window.innerHeight/2;\n}", "function onResize() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\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 onReshape() {\n\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize( window.innerWidth, window.innerHeight );\n\n}", "setSize(w,h){\n\n\t\t//set the size of the canvas, on chrome we need to set it 3 ways to make it work perfectly.\n\t\tthis.ctx.canvas.style.width = w + \"px\";\n\t\tthis.ctx.canvas.style.height = h + \"px\";\n\t\tthis.ctx.canvas.width = w;\n\t\tthis.ctx.canvas.height = h;\n\n\t\t//when updating the canvas size, must reset the viewport of the canvas \n\t\t//else the resolution webgl renders at will not change\n\t\tthis.ctx.viewport(0,0,w,h);\n\t\tthis.width = w;\t//Need to save Width and Height to resize viewport for WebVR\n\t\tthis.height = h;\n\n\t\treturn this;\n\t}", "resizeCanvas() {\n const containerWidth = this.worldContainer.offsetWidth;\n this.canvasWidth = containerWidth;\n this.canvasHeight = containerWidth;\n\n this.canvas.width = this.canvasWidth;\n this.canvas.height = this.canvasHeight;\n\n this.cellSize = this.canvasWidth / this.colNumber;\n this.renderWorld();\n }", "function onWindowResize() {\n\n\tcamera.aspect = window.innerWidth / window.innerHeight;\n\tcamera.updateProjectionMatrix();\n\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n\n}", "function onWindowResize() {\n\n\tcamera.aspect = window.innerWidth / window.innerHeight;\n\tcamera.updateProjectionMatrix();\n\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n\n}", "function onWindowResize() {\n\tcamera.aspect = window.innerWidth / window.innerHeight;\n\tcamera.updateProjectionMatrix();\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n}", "function onWindowResize() {\n\tcamera.aspect = window.innerWidth / window.innerHeight;\n\tcamera.updateProjectionMatrix();\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n}", "function updateCanvasSize() {\n canvasContainer.style.width = \"100vw\";\n var size = getCanvasSize();\n if (fullscreenCheckbox.checked) {\n canvasContainer.style.height = \"100%\";\n canvasContainer.style.maxWidth = \"\";\n canvasContainer.style.maxHeight = \"\";\n }\n else {\n size[1] = size[0] * maxHeight / maxWidth;\n canvasContainer.style.height = inPx(size[1]);\n canvasContainer.style.maxWidth = inPx(maxWidth);\n canvasContainer.style.maxHeight = inPx(maxHeight);\n }\n if (size[0] !== lastCanvasSize[0] || size[1] !== lastCanvasSize[1]) {\n lastCanvasSize = getCanvasSize();\n for (var _i = 0, canvasResizeObservers_1 = canvasResizeObservers; _i < canvasResizeObservers_1.length; _i++) {\n var observer = canvasResizeObservers_1[_i];\n observer(lastCanvasSize[0], lastCanvasSize[1]);\n }\n }\n }", "function resizeCanvas() {\n canvas.height = window.innerHeight * 0.95;\n canvas.width = window.innerWidth * 0.95;\n stage.update();\n }", "onWindowResize () {\n\t\tthis.camera.aspect = window.innerWidth / window.innerHeight;\n\t\tthis.camera.updateProjectionMatrix();\n\t\tthis.renderer.setSize(window.innerWidth, window.innerHeight);\n\t}", "function onWindowResize()\r\n{\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n renderer.setSize( window.innerWidth, window.innerHeight );\r\n}", "function resizeCanvas() {\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n }", "scaleCanvas() {\n this.canvas.setWidth(this.width);\n this.canvas.setHeight(this.height);\n this.canvas.renderAll();\n }", "function onWindowResize() {\r\n\r\n windowHalfX = window.innerWidth / 2;\r\n windowHalfY = window.innerHeight / 2;\r\n\r\n width = $('#target').width();\r\n height = $('#target').height();\r\n\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize( width, height );\r\n postprocessing.composer.setSize( width, height );\r\n\r\n}", "_resize() {\n const ratio = window.devicePixelRatio || 1;\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n if (this.options.dpi) {\n this.width = width * ratio;\n this.height = height * ratio;\n } else {\n this.width = width;\n this.height = height;\n }\n\n this._canvas.width = this.width;\n this._canvas.height = this.height;\n\n this._canvas.style.width = width + 'px';\n this._canvas.style.height = height + 'px';\n }", "function onWindowResize() {\r\n\twindowHalfX = window.innerWidth / 2;\r\n\twindowHalfY = window.innerHeight / 2;\r\n\tcamera.aspect = window.innerWidth / window.innerHeight;\r\n\tcamera.updateProjectionMatrix();\r\n\trenderer.setSize( window.innerWidth, window.innerHeight );\r\n}", "function resizeCanvas() {\n\t\t// When zoomed out to less than 100%, for some very strange reason,\n\t\t// some browsers report devicePixelRatio as less than 1\n\t\t// and only part of the canvas is cleared then.\n\t\tvar ratio = Math.max(window.devicePixelRatio || 1, 1);\n\t\tcanvas.width = canvas.offsetWidth * ratio;\n\t\tcanvas.height = canvas.offsetHeight * ratio;\n\t\tcanvas.getContext(\"2d\").scale(ratio, ratio);\n\t}", "function onResize() {\n canvas.width = window.innerWidth / 2;\n canvas.height = window.innerHeight;\n }", "function respondCanvas()\n{\n\tvar canvas = $('#canvas');\n\tvar container = $(canvas).parent();\n\tcanvas.attr('width', $(container).width() ); // Max width\n\t//canvas.attr('height', $(container).height() ); // Max height\n}", "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n scaleMaximums();\n}", "function resizeCanvas () {\n canvasWidth = canvas.offsetWidth;\n canvasHeight = canvas.offsetHeight;\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n pixelsPerUnit = canvasWidth / 10;\n}", "function onWindowResize() {\n\trenderer.setSize( containerDiv.offsetWidth +32, 600 );\n\t camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n}" ]
[ "0.7195864", "0.70655566", "0.6999726", "0.6969948", "0.6908046", "0.6898273", "0.6883981", "0.6883981", "0.6883981", "0.6874813", "0.6862567", "0.6803807", "0.6799166", "0.6738441", "0.67171466", "0.6690709", "0.66885686", "0.66601175", "0.66293794", "0.6617392", "0.6540151", "0.65198845", "0.65198845", "0.6493008", "0.6493008", "0.6493008", "0.64865935", "0.6481012", "0.647603", "0.6468986", "0.6468986", "0.6458148", "0.6448847", "0.64422643", "0.6427604", "0.64251906", "0.64251906", "0.63981605", "0.63981605", "0.6381319", "0.6379505", "0.6370817", "0.6368965", "0.63492", "0.6342347", "0.63407546", "0.63236505", "0.6303302", "0.62994206", "0.6290286", "0.6275748", "0.6275468", "0.62753266", "0.6271551", "0.6270194", "0.62666124", "0.6265516", "0.6264315", "0.6251493", "0.6240184", "0.6237881", "0.62309223", "0.6222924", "0.6221935", "0.62181795", "0.62114894", "0.62087303", "0.62065256", "0.6206179", "0.6196198", "0.6192735", "0.6191416", "0.61894894", "0.6181212", "0.61811966", "0.6179104", "0.61704683", "0.616664", "0.6162087", "0.61618674", "0.61558515", "0.6152864", "0.6152864", "0.6140841", "0.6140841", "0.614058", "0.6132067", "0.6128692", "0.61277616", "0.61221623", "0.61162084", "0.61129946", "0.6107503", "0.6104108", "0.6102484", "0.60973686", "0.6096874", "0.6093949", "0.6092711", "0.6089388" ]
0.7074093
1
var isFunction = require('ampisfunction'); var isString = require('ampisstring'); Operations Validates blank values using ampisempty.
function _validateIsNotBlank(def){ return !isEmpty(def.attrValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_Blank(input) {\n return input === \"\";\n}", "function isemptyornull(value)\n {\n return !(typeof value === \"string\" && value.length > 0);\n }", "function isBlank(a) {\n\n var result;\n\n if(typeof a !== \"string\"){\n\n result = \"Input in not a string\";\n }\n else{\n result = a.length === 0;\n }\n return result;\n}", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\t\treturn !value || !value.trim()\n\t}", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "_isEmpty(value) {\n return _.isNil(value) || (_.isString(value) && value.trim().length === 0);\n }", "function is_Blank(input){\n if (input.length === 0)\n return true;\n else \n return false;\n}", "isValueEmpty(input) {\n return input ? true : false\n }", "function isNoteEmptyStringInput(input) {\n return input.value != \"\";\n}", "function isBlank(a) {\n    if(a === \"\") {\n        return true;\n    }\n    else {\n        return false;\n    }\n}", "function isBlank (input) {\n if (input === \"\" ) {\n return true\n } \n return false \n}", "function isEmpty(value) {\n return value === \"\";\n}", "function isEmpty(value) {\n return value === \"\";\n}", "function validBlank(value) {\n if (value != \"\") return true;\n else return \"This section can not be left blank.\";\n}", "function isBlank (thing) {\n return (!thing || thing.length === 0)\n}", "function isBlank( element, index, array) {\n return (element === \"\" || undefined); \n }", "function isEmpty(elem)\n {\n /* getting the text */\n var str = elem.value;\n\n /* defining a regular expression for non-empty string */\n var regExp = /.+/;\n return !regExp.test(str);\n }", "function FieldIsEmpty(strInput) {\n\treturn TrimString(strInput).length == 0;\n}", "function notEmpty(value) {\n\treturn isDefined(value) && value.toString().trim().length > 0;\n}", "function notEmpty(value) {\n return isDefined(value) && value.toString().trim().length > 0;\n}", "isEmpty(value) {\n return value == '' ? true : false;\n }", "emptyField(string) {\n if (string === \"\" || string === null || string === undefined) {\n return true;\n }\n return false;\n }", "function isNotNull(f,noalert) {\n if (f.value.length ==0) {\n return false;\n }\n return true;\n}", "function stringNotEmpty (type, elementname) {\n var element = type + '[name=\"' + elementname + '\"]'\n var value = $(element).val()\n if (value.length > 0) {\n resetinput(element)\n return false\n } else {\n inputerror(element)\n return true\n }\n }", "function is_Blank(str) {\n if (str === '') return true;\n else return false;\n}", "function isEmpty(){\n\n}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null;\n\t}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null;\n\t}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null;\n\t}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null;\n\t}", "function isEmpty(value) {\n return value === '' || value === null || value === undefined;\n}", "function isEmpty(value)\r\n\t{\r\n\t\tif(value!=\"\" && value!=null && value!=undefined)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "validateEmptyFields(firstName,lastName,address,city,state,property,description,pricing){\n if (validator.isEmpty(firstName,lastName,address,city,state,property,description,pricing)){\n return 'This field is required';\n }\n return false;\n }", "function is_field_empty(field) {\n if (field == undefined || field == '')\n return true;\n else\n return false;\n}", "function __isEmpty($str) {\r\n return __trim($str).length==0;\r\n}", "hasInput_(value) {\n return value.length > 0;\n }", "function chmIsAllEmpty(arrFields,msg)\r\n {\r\n // set this flag to true if you want this function to validate\r\n var bValidate = true; \r\n var len = arrFields.length;\r\n var iIndex = 0;\r\n\r\n if(!bValidate)\r\n {\r\n return false;\r\n }\r\n\r\n for(iIndex = 0; iIndex < len; iIndex++)\r\n {\r\n if(eval(arrFields[iIndex]))\r\n {\r\n if(!isEmpty(eval(arrFields[iIndex])))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n alert(msg);\r\n return true;\r\n }", "function isEmpty(value) {\n\treturn typeof value == 'string' && !value.trim() || typeof value == 'undefined' || value === null;\n}", "isNotBlank(val) {\n return val !== '';\n }", "function isValid(element){\n return element !== \"\"? true : false ;\n }", "function isEmpty(value) {\n return value === '' ? true : false;\n}", "function isEmpty(input) {\n if ( null === input || \"\" === input ) { \n return true; \n } \n return false; \n }", "function isEmpty() {\r\n\r\n if (nameInput.value == \"\" || emailInput.value == \"\" || passInput.value == \"\"|| repassInput.value == \"\"|| phoneInput.value.value == \"\"|| ageInput.value == \"\") {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function notEmpty(value){\n\t\treturn value && value != \"\";\n\t}", "function isEmpty(value) {\n return value === undefined || value === null ||\n (typeof value === 'object' && Object.keys(value).length === 0) ||\n (typeof value === 'string' && value.trim().length === 0);;\n}", "function bs_isEmpty(theVar) {\n\tif (bs_isNull(theVar)) return true;\n\tif (theVar == '') return true;\n\treturn false;\n}", "isValid(input) {\n if (input == null || input == \"\") {\n return false;\n } else {\n return true;\n }\n }", "function emptyOrNot(input) {\n\n if (input) {\n return true\n } else {\n return false\n }\n \n }", "isLikeEmpty(inputVar) {\n if (typeof inputVar !== 'undefined' && inputVar !== null) {\n let strTemp = JSON.stringify(inputVar);\n strTemp = strTemp.replace(/\\s+/g, ''); // remove all whitespaces\n strTemp = strTemp.replace(/\\\"+/g, \"\"); // remove all >\"<\n strTemp = strTemp.replace(/\\'+/g, \"\"); // remove all >'<\n strTemp = strTemp.replace(/\\[+/g, \"\"); // remove all >[<\n strTemp = strTemp.replace(/\\]+/g, \"\"); // remove all >]<\n if (strTemp !== '') {\n return false;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0);\n\t}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0);\n\t}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0);\n\t}", "function isValid(value) {\n\t return value !== '' && value !== undefined && value !== null && !(Array.isArray(value) && value.length === 0);\n\t}", "function isEmpty(s)\n{ return ((s == null) || (s.length == 0))\n}", "function checkForEmptyInputs(){\n let firstname=document.getElementById(\"firstname\");\n let lastname=document.getElementById(\"lastname\");\n let email=document.getElementById(\"email\");\n return firstname.value===\"\" || lastname.value===\"\" || email.value===\"\";\n}", "function isDefinedAndNotNull(input)\r\n{\r\n if (isDefined(input))\r\n return ((input != null) && !isNaN(input));\r\n else\r\n return false;\r\n}", "function checkString (theField, s, emptyOK)\r\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\r\n // in equality comparison below.\r\n if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n if (isWhitespace(theField.value))\r\n return warnEmpty (theField, s);\r\n else return true;\r\n}", "function checkString (theField, s, emptyOK)\r\n{ // Next line is needed on NN3 to avoid \"undefined is not a number\" error\r\n // in equality comparison below.\r\n if (checkString.arguments.length == 2) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n if (isWhitespace(theField.value))\r\n return warnEmpty (theField, s);\r\n else return true;\r\n}", "is_empty(value) {\n return (\n (value == undefined) ||\n (value == null) ||\n (value.hasOwnProperty('length') && value.length === 0) ||\n (value.constructor === Object && Object.keys(value).length === 0)\n )\n }", "function isEmpty(){console.log(\"ERROR\");return (wordLen === 0)}", "function noempty(input_value, default_value)\n{\n if (!input_value)\n {\n return default_value;\n }\n if (input_value.length==0)\n {\n return default_value;\n }\n return input_value;\n}", "function isNotEmpty(elem) {\n var x = elem.val();\n return (x != null && x.trim() != '');\n}", "function isEmpty(value) {\n if (value === '') return true;\n return false;\n}", "function isEmpty(value) {\n if (value === '') return true;\n return false;\n}", "function stringBlankCheck(input_string) {\n var temp = trimBlank(input_string);\n var temp1 = checkBlank(temp);\n return temp1;\n}", "function isEmpty(value) {\n if (value === '') return true;\n return false;\n}", "function validateNotEmpty(data){\n if (data == ''){\n return true;\n }else{\n return false;\n }\n}", "function isEmpty(field){\n id = document.getElementById(`${field}`);\n err = document.getElementById(`${field+'_error'}`);\n\n if(id.value == \"\")\n {\n err.style=\"display:block\"; \n return true;\n }\n else {\n err.style=\"display:none\"; \n switch(field){\n case 'name':\n convertUpperCase(id);\n removeWhiteSpaces(id);\n break;\n case 'address1': \n case 'city':\n removeWhiteSpaces(id);\n convertFist2CapitalLetter(id); \n break;\n default:\n break;\n } \n \n return false;\n }\n}", "function isValid(value) {\n return value !== '' && value !== undefined && value !== null;\n}", "function isValid(value) {\n return value !== '' && value !== undefined && value !== null;\n}", "function isValid(value) {\n return value !== '' && value !== undefined && value !== null;\n}", "function check_empty(student) {\r\n if ((student.roll_no === '') || (student.Course_enrolled === '') || (student.project === '') || (student.Specialized_skills === '')) {\r\n return true;\r\n }\r\n return false;\r\n}", "function empty(mixValue)\n{\n return ((mixValue === undefined) || (mixValue === null) || (mixValue === false) || (mixValue === '') || (mixValue === 0));\n}", "function isEmpty(s)\r\n{ return ((s == null) || (s.length == 0))\r\n}", "function isEmpty(s)\r\n{ return ((s == null) || (s.length == 0))\r\n}", "function isEmpty(s)\r\n{ return ((s == null) || (s.length == 0))\r\n}", "function validatePresenceOf(value) {\r\n return value && value.length;\r\n }", "function isBlank(str){\n\treturn isNull(str) || str.toString().isBlank();\n}", "function validatePresenceOf(value) {\n return value && value.length;\n }", "function check_emptyInput(){\n\tvar result = \"\";\n\t\n\tvar check_edit_name = document.getElementById(\"edit_name\");\n\tvar check_edit_type = document.getElementById(\"edit_type\");\n\tvar check_edit_brand = document.getElementById(\"edit_brand\");\n\tvar check_edit_price = document.getElementById(\"edit_price\");\n\tvar check_edit_desc = document.getElementById(\"edit_desc\");\n\tvar form_update = document.getElementById(\"form_update\");\n\t\n\t/*testing*/\n\t/*if(matches = check_edit_name.value.match(/[a-z0-9-_]+/gi)){\n\t\tconsole.log(\"whitespace: \" + matches);\n\t}else{\n\t\tconsole.log(\"invalid\");\n\t}*/\n\t\n\t/*testing*/\n\t//matches = check_edit_name.value.match(/\\S+/g) \n\t//^-- matches is not defined(means it is null). if match cannot find the value of whitespace(right side equation value is null).\n\t//null=null returns true !(null=null) returns false and vice-versa !(null='whitespace found') returns true\n\t\n\t/*testing*/\n\t//matches = check_edit_name.value.split(/\\s+/g) \n\t//^-- means you split the content each time whitespace is found (including empty string)\n\t//try matches.length and console.log(matches).Since empty string is counted, it represents a value in an array as well\n\t\n\t/*testing*/\n\t/*if((matches = check_edit_name.value.match(/\\S+/g))!=null){\n\t\tconsole.log(\"NOT whitespace: \" + matches + \"\\nlength: \" + matches.length);\n\t}else{\n\t\tconsole.log(\"Invalid\");\n\t}*/\n\t\n\t\n\t/*!(...) similar as ==null. The result is false if the argument is the empty String \n\t (its length is zero), otherwise the result is true*/\n\tif((check_edit_name.value.length<=0) || !(matches=check_edit_name.value.match(/\\S+/g)))\n\t\tresult += \"Product Name is Required!<br>\";\n\tif((check_edit_type.value.length<=0) || !(matches=check_edit_type.value.match(/\\S+/g)))\n\t\tresult += \"Product Type is Required!<br>\";\n\tif((check_edit_brand.value.length<=0) || !(matches=check_edit_brand.value.match(/\\S+/g)))\n\t\tresult += \"Product Brand is Required!<br>\";\n\tif((check_edit_price.value.length<=0) || !(matches_digit=check_edit_price.value.match(/\\d+/))) // similar to [0-9]+\n\t\tresult += \"Product Price is Required!<br>\";\n\tif((check_edit_desc.value.length<=0) || !(matches=check_edit_desc.value.match(/\\S+/g))) \n\t\tresult += \"Product Description is Required!\";\n\t\n\tconsole.log(matches_digit[0].length);\n\tconsole.log(matches_digit);\t\n\tif(result.length>0){\n\t\tif(form_update.parentNode.getElementsByClassName(\"divMessage\").length<=0){\n\t\t\tvar div_message = document.createElement(\"div\");\n\t\t\tdiv_message.className = \"divMessage\";\n\t\t\tdiv_message.innerHTML = result;\n\t\t\tform_update.parentNode.appendChild(div_message);\n\t\t}else{\n\t\t\tvar div_message = document.getElementsByClassName(\"divMessage\");\n\t\t\tdiv_message[0].innerHTML = result;\n\t\t}\n\t\t\n\t\treturn false;\n\t}else{\n\t\t\n\t\tif(form_update.parentNode.getElementsByClassName(\"divMessage\").length>0){\n\t\t\tvar last_childNode_divMessage = form_update.parentNode.childNodes.length-1;\n\t\t\tform_update.parentNode.removeChild(form_update.parentNode.childNodes[last_childNode_divMessage]);\n\t\t}\n\t\t\n\t\treturn true;\n\t}\n\t\n}", "function isEmpty (binding) {\n return binding.value === '' || binding.value === undefined || binding.value === null\n}", "function checkData(value) {\n var result = true;\n if (value === undefined || value === null || value === '') {\n result = false;\n } else if (_.isObject(value) && _.isEmpty(value)) {\n result = false;\n }\n return result;\n}", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\n\t\t// `0` is not an empty value\n\t\tif (typeof value === 'number' && value === 0)\n\t\t{\n\t\t\treturn false\n\t\t}\n\n\t\t// An empty string, `undefined`, `null` –\n\t\t// all those are an empty value.\n\t\tif (!value)\n\t\t{\n\t\t\treturn true\n\t\t}\n\n\t\t// Whitespace string is also considered empty\n\t\tif (typeof value === 'string' && !value.trim())\n\t\t{\n\t\t\treturn true\n\t\t}\n\n\t\t// Not empty\n\t\treturn false\n\t}", "function isEmpty(element){\n\tvar is_empty = false;\n\n\tif (element.val() == '' || element.val() == null || element.val() == undefined){\n\t\tis_empty = true;\n\t}\n\n\treturn is_empty;\n}", "function isEmpty(inputStr) {\n return (inputStr == null || inputStr == \"\");\n}", "function empty(S) {\n return refinement(S, `${S.type} & Empty`, value => {\n return value.length === 0;\n });\n}", "function empty(S) {\n return refinement(S, `${S.type} & Empty`, value => {\n return value.length === 0;\n });\n}", "function isNullOrEmpty(value) {\n return value == null || value === '';\n }", "function isNotEmpty() {\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tif (arguments[i].value === \"\" || arguments[i].value === null) {\n\t\t\t\t//if empty\n\t\t\t\terrors += 1;\n\t\t\t\targuments[i].placeholder = \"Fill in this feild!\";\n\t\t\t\targuments[i].classList.add(\"error-placeholder\");\n\t\t\t} else if (arguments[i].value.length < 3) {\n\t\t\t\t//if too short\n\t\t\t\terrors += 1;\n\t\t\t\targuments[i].placeholder = \"Enter a valid input!\";\n\t\t\t\targuments[i].value = \"\";\n\t\t\t\targuments[i].classList.add(\"error-placeholder\");\n\t\t\t}\n\t\t}\n\n\t}", "function areAllElementsValueFilled(elements) {\n let results = getElementsValues(elements);\n if (results === false) {\n return false;\n }\n for (let result of results) {\n if (result == \"\") {\n return false;\n }\n }\n return true\n\n}", "function valiNotEmpty (text) {\n\t\t\treturn /\\S/.test(text);\n\t\t}", "function checkEmptyInput() {\r\n let isEmpty = false;\r\n const CheckFullName = document.querySelector(\"#fname\").value;\r\n const CheckEmail = document.querySelector(\"#email\").value;\r\n const CheckAge = document.querySelector(\"#age\").value;\r\n // remember about empty input\r\n if (CheckFullName === \"\") {\r\n alert(\"Full Name Connot Be Empty\");\r\n isEmpty = true;\r\n } else if (CheckEmail === \"\") {\r\n alert(\"Email Connot Be Empty\");\r\n isEmpty = true;\r\n } else if (CheckAge === \"\") {\r\n alert(\"Age Connot Be Empty\");\r\n isEmpty = true;\r\n }\r\n return isEmpty;\r\n}", "function isEmpty(s) {\n return s === \"\";\n }", "function isEmptyOrAllWhitespace(str) {\n\tvar re = /^\\s*$/;\n\t\n\tif (str === undefined || typeof str === undefined) {\n\t\treturn true;\n } else if(str === null) {\n\t\treturn true;\n\t} else if (re.test(str)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function isEmpty(_param) {\n return (_param === 'undefined' || _param === undefined || _param === '' || _param === null);\n}", "function isEmpty(input){\r\n //console.log(input.val());\r\n if(input.val().length==0){\r\n return true;\r\n }\r\n return false;\r\n}", "function String_IsNullOrWhiteSpace(str)\n{\n\t//by default the string is invalid\n\tvar bRes = true;\n\t//first get it as string\n\tstr = Get_String(str, null);\n\t//has a value?\n\tif (str && str.Trim && str.length > 0)\n\t{\n\t\t//only valid if the trimmed length is greater than 0\n\t\tbRes = str.Trim().length == 0;\n\t}\n\t//return the result\n\treturn bRes;\n}", "function isNonEmptyString(val) { \r\n\treturn new FunctionalAssertionResult(\r\n\t\tfunction(v) { return v != null && typeof v == \"string\"; },\r\n\t\t[val],\r\n\t\t\"non-null string\"\r\n\t)\r\n}", "function isNotEmpty(value) {\n return value !== '' && value !== null && value !== undefined;\n}" ]
[ "0.68257105", "0.67737716", "0.6753433", "0.65869224", "0.6528154", "0.6528154", "0.6528154", "0.64979964", "0.64329606", "0.64114463", "0.6363601", "0.6285536", "0.62772655", "0.62772655", "0.6268604", "0.6246536", "0.62436664", "0.624187", "0.62308824", "0.6197532", "0.61875165", "0.61837196", "0.6169148", "0.61665684", "0.61596566", "0.61592776", "0.61545044", "0.6149598", "0.6149598", "0.6149598", "0.6149598", "0.6126991", "0.6126832", "0.61216825", "0.6120357", "0.61009675", "0.6094422", "0.6091159", "0.60876137", "0.60828567", "0.6079536", "0.6073707", "0.60386974", "0.6036311", "0.6036019", "0.6035679", "0.60240555", "0.60074764", "0.6006374", "0.59803426", "0.5966792", "0.5966792", "0.5966792", "0.5966792", "0.5954838", "0.5943214", "0.5935831", "0.5932179", "0.5932179", "0.5930747", "0.5927492", "0.5924118", "0.59178305", "0.59085625", "0.59085625", "0.59077656", "0.59065574", "0.59030277", "0.5897857", "0.58957225", "0.58957225", "0.58957225", "0.58942604", "0.5891299", "0.5890571", "0.5890571", "0.5890571", "0.5879738", "0.58734334", "0.5872082", "0.5871709", "0.5868347", "0.58663577", "0.5865774", "0.58612484", "0.5861152", "0.5858859", "0.5858859", "0.58583814", "0.5855541", "0.58555347", "0.58427364", "0.58417726", "0.5839149", "0.58387524", "0.5831102", "0.5823913", "0.58229506", "0.58183914", "0.5809728" ]
0.6212462
19
Validates email types using regex.
function _validateIsEmail(def){ var emailRegEx = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/i; return emailRegEx.test(def.attrValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validate(email) {\n const expression = /(?!.*\\.{2})^([a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+(\\.[a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+)*|\"((([ \\t]*\\r\\n)?[ \\t]+)?([\\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]))*(([ \\t]*\\r\\n)?[ \\t]+)?\")@(([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\n return expression.test(String(email).toLowerCase());\n }", "validate(email) {\n const expression = /(?!.*\\.{2})^([a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+(\\.[a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+)*|\"((([ \\t]*\\r\\n)?[ \\t]+)?([\\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]))*(([ \\t]*\\r\\n)?[ \\t]+)?\")@(([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\n return expression.test(String(email).toLowerCase());\n }", "function validarEmail(email){\n var regex = /^\\w+([\\.\\+\\-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/.test(email); \n return regex;\n }", "function email_regex(email) {\n\tvar regex = /^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\treturn regex.test(email);\n}", "function validEmail(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 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 check_email(email) {\r\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);\r\n if (pattern.test(email) === false) {\r\n return '0';\r\n } else {\r\n return '1';\r\n }\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}", "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 regexValidateEmail($email) {\r\n var emailReg = /^([\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4})?$/;\r\n return emailReg.test($email);\r\n }", "function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "isEmailValid(email){\n \n // Long and scary RegExp. Didn't come up with it, found in the net\n // Seems to work!\n let regExpEmail = /^(([^<>()\\[\\]\\\\.,;:\\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(email.match(regExpEmail)){\n return true;\n } else {\n return false;\n };\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() {\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 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 emailValidation(email){\n const regEx = /\\S+@\\S+\\.\\S+/;\n const patternMatch = regEx.test(email);\n return patternMatch;\n}", "function validateEmail(mail)\n{\n return (/^\\w+([.-]?\\w+)*@\\w+([.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail))\n}", "function emailIsValid (email) {\r\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)\r\n}", "function validateEmail(email) {\n\tconst regEX = /\\S+@\\S+\\.\\S+/;\n\tconst patternMatches = regEX.test(email);\n\treturn patternMatches;\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 }", "_emailValidation(emailString) {\n console.log(emailString)\n if (/(.+)@(.+){2,}\\.(.+){2,}/.test(emailString)) {\n return true\n } else {\n return false\n }\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 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}", "validateEmail(email) {\n // Regex Ripped from stack overflow\n const pattern = /^(([^<>()\\[\\]\\\\.,;:\\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 // Returns true for match false for none match.\n return pattern.test(email);\n }", "function validEmailFormat(email) { \n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n}", "function validEmailRegexInput(input) {\n return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(input.value);\n}", "function isEmailValid(email) {\r\n // var expr = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\r\n var expr = /^([a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+(\\.[a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+)*|\"((([ \\t]*\\r\\n)?[ \\t]+)?([\\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]))*(([ \\t]*\\r\\n)?[ \\t]+)?\")@(([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;\r\n return expr.test(email);\r\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}", "function isValidEmailAddress(email) {\n return emailFormat.test(email);\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 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 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 validateEmail(email) \r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function validEmailRegex(value) {\n return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(value);\n}", "function validateEmail(email){\n\n\t// TODO:\n\t// string@string.string. Very basic regex, not perfect.\n\tvar regex = /\\S+@\\S+\\.\\S+/;\n\treturn regex.test(email);\n}", "function emailIsValid() {\n\n var myPattern = /^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;\n var emailValue = $mail.val();\n\n var isValid = emailValue.search(myPattern) >= 0;\n return (isValid);\n }", "function validEmail(email){\r\n // const re = /\\S+@\\S+\\.\\S+/; \r\n //const re2= /^(([^<>()\\[\\]\\\\.,;:\\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,1}))$/;\r\n\r\n\r\n return re2.test(string(email).toLowerCase());\r\n}", "isEmail(value) {\n return new RegExp(\"^\\\\S+@\\\\S+[\\\\.][0-9a-z]+$\").test(\n String(value).toLowerCase()\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 validEmail(str){ \n\tvar filter= new RegExp(/^.+@.+\\..{2,3}$/);\n\tif (!filter.test(str)){\n\t\treturn false;\n\t}\n\treturn true;\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 emailIsValid (email) {\n\treturn /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)\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 isValidEmail(email){\n\t/*the part befor @ can't have <>()....*/\n\t/*and the email need to have format of something@somthing.somthing*/\n \tvar re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,})$/;\n \treturn re.test(email);\n}", "function validateEmail (email) {\n return /\\S+@\\S+\\.\\S+/.test(email)\n}", "function validateEmail(){\r\n\t\tvar x = document.survey_form.email.value; //get the value\r\n\t\tvar emailPattern = /^[a-zA-Z._-]{1,25}[@][a-zA-Z]{1,25}[.][a-zA-Z]{3}$/; //variable storing the pattern\r\n\t\tvar emailPattern2 = /^[a-zA-Z._-]{1,25}[@][a-zA-Z]{1,25}[.][a-zA-Z]{1,25}[.][a-zA-Z]{3}$/; //variable storing the pattern\r\n\t\tif(emailPattern.test(x) ||emailPattern2.test(x)){;}\r\n\t\telse{alert(\"Please enter an email address. For example: name@email.com\")}\r\n\t}", "function validaEmail(email) {\n let 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(email);\n}", "function validateEmailFormat(email,text) {\n email = Trim(email);\n if( email == \"\" ) {\n throw new Error(\"Please enter an email address for \" + text);\n }\n \n var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\n if( emailPattern.test(email) == false ) {\n throw new Error(\"E-mail format for \" + text + \" is invalid; Email:\" + email);\n } \n}", "function validateEmail(email)\r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function checkEmail ( str ) {\n var myreg2 = /^[a-zA-Z]+[@]{1}[a-zA-Z]+[\\.]{1}[a-zA-Z]{2,3}$/;\n return myreg2.test(str);\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 validar_email(email) {\r\n var patron = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n return patron.test(email) ? true : false;\r\n }", "function isValidEmail(email) {\n\n var emailReg = 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);\n var valid = emailReg.test(email);\n\n if (!valid) {\n return false;\n } else {\n return true;\n }\n\n}", "function isValidEmailAddress(emailAddress) {\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(emailAddress);\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 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 validateEmail(email)\n{\n var emailText;\n if(typeof email != \"string\") {\n return false;\n } else {\n emailText = email;\n }\n validEmailRE = /^([a-zA-Z0-9._][a-zA-Z0-9._\\-]+@([a-zA-Z0-9]+(.[a-zA-Z0-9\\-]+){0,4})|[a-zA-Z0-9_]+@([1-9][0-9]{0,2}(.[1-9][0-9]{0,2}){3}))$/;\n return validEmailRE.test(emailText); \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 isValidEmail(emailAddress) {\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(emailAddress);\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 isValidEmailAddress(emailAddress) {\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(emailAddress);\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)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\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 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 validateEmail(input) {\r\n var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\\.([a-zA-Z])+([a-zA-Z])+/;\r\n\r\n return pattern.test(input);\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 IsEmail(email){\nreturn /^(([^<>()\\[\\]\\\\.,;:\\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,}))$/.test(email);\n}", "function isValidEmailAddress(emailAddress) {\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(emailAddress);\n }", "function isValidEmailAddress(emailAddress) {\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(emailAddress);\n }", "function isValidEmailAddress(emailAddress) {\r\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);\r\n return pattern.test(emailAddress);\r\n }", "function checkEmail(email) {\n\n if (!email.match(emailRegex)) {\n emailError.textContent = 'Veuillez entrer une adresse mail valide.';\n formSub.email.classList.add('invalid');\n emailValid = false;\n } else {\n emailError.textContent = '';\n formSub.email.classList.remove('invalid');\n formSub.email.classList.add('valid');\n emailValid = true;\n }\n}", "function emailFormatCheck(input) {\r\n var i = 0;\r\n do {\r\n if (i === input.length) {\r\n return false;\r\n }\r\n i++;\r\n } while (input.charAt(i) != '@');\r\n do {\r\n i++;\r\n if (i === input.length) {\r\n return false;\r\n }\r\n } while (input.charAt(i) != '.');\r\n return true;\r\n}", "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 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}", "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 var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "validateEmail(email) {\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email.toLowerCase());\n }", "function validateEmail(elementsInputs, intCounter)\n{\n var emailFilter=/^.+@.+\\..{2,3}$/;\n if (!emailFilter.test(elementsInputs[intCounter].value)) \n { \n return true; \n } \n}", "function isValidEmailAddress(emailAddress) {\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(emailAddress);\n }", "function validar_email(email) {\n var regex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n return regex.test(email) ? true : false;\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 validateEmail(email) { \n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n}", "function validateEmail(input) {\r\n\r\n const email = input.value.trim();\r\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,}))$/;\r\n\r\n const result = re.test(String(email).toLowerCase());\r\n console.log(re.test(String(email).toLowerCase()));\r\n\r\n if (!result) {\r\n showError(input, `Email is not valid`)\r\n }\r\n\r\n}", "function validateEmail(email) {\r\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\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 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 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}", "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 validateEmail(email){\n var emailReg = 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);\n var valid = emailReg.test(email);\n\n if(!valid) {\n return false;\n } else {\n return true;\n }\n }", "function checkEmail(email) \n{ \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/; \n if(email.match(mailformat)) \n return true; \n else \n return false;\n}", "function checkEmail() {\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 checkE(email) {\r\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(String(email).toLowerCase());\r\n}", "function 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 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(email) {\r\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email);\r\n}", "function mightBeEmail(s) {\n // There's no point trying to validate rfc822 fully, just look for ...@...\n return typeof s === 'string' && s.indexOf('@') !== -1;\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 validateEmail(email) {\n var filter = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\n if (filter.test(email)) {\n return true;\n } else {\n return false;\n }\n}", "function validateEmail(email) {\r\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,}))$/;\r\n if(re.test(String(email).toLowerCase())){\r\n //alert(\"Validacija email adrese izvrsena\" + email)\r\n \r\n } else {\r\n alert(\"Niste unijeli validan email, molimo pokušajte ponovo!\");\r\n }\r\n}", "function validarEmail(txtMail) {\n patron = /^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/;\n return patron.test(txtMail);\n}" ]
[ "0.7049878", "0.7049878", "0.69638234", "0.6949918", "0.6941737", "0.68965524", "0.68579966", "0.68572617", "0.68569", "0.6833825", "0.6832657", "0.6811848", "0.67991656", "0.6786166", "0.67670184", "0.67631036", "0.6736413", "0.6732129", "0.672803", "0.6708648", "0.670558", "0.67004824", "0.6691421", "0.6689861", "0.6688757", "0.66883016", "0.6685291", "0.6675805", "0.6672957", "0.6670001", "0.6664675", "0.6664422", "0.66610825", "0.66578835", "0.66539335", "0.6653757", "0.66536075", "0.6640016", "0.6635642", "0.66349936", "0.66328394", "0.66278833", "0.66268045", "0.66260797", "0.66248083", "0.6609961", "0.6608839", "0.6598947", "0.6596062", "0.6595171", "0.659412", "0.65938497", "0.6586409", "0.658452", "0.6580864", "0.6579802", "0.65760523", "0.65754604", "0.65675044", "0.6567319", "0.6560074", "0.65555257", "0.6555236", "0.6546493", "0.65397316", "0.6529636", "0.6527724", "0.65274805", "0.6527225", "0.65217954", "0.65180826", "0.65166265", "0.65118164", "0.650772", "0.65058005", "0.6504511", "0.65012485", "0.64993995", "0.64981747", "0.6496305", "0.64958924", "0.6487372", "0.6486151", "0.6483221", "0.6480515", "0.64672244", "0.64668846", "0.6465982", "0.64622575", "0.646082", "0.6456634", "0.6454574", "0.6452557", "0.6452216", "0.6450649", "0.6446649", "0.64457226", "0.6443089", "0.64426786", "0.64418554", "0.6432463" ]
0.0
-1
2) Get even 1000 Write a function that would get the sum of all the even numbers from 1 to 1000. You may use a modulus operator for this exercise.
function p2(){ var sum = 2; for (var i = 0; i <= 1000; i += 2) { sum += i } console.log(sum) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEvenTo1000(){\n var sum = 0;\n for (let i = 0; i < 1001; i++) {\n if (i % 2 === 0) {\n sum = sum + i;\n }\n else { }\n }\n return sum;\n}", "function even(){\n\n var sum=0;\n for (var i=1;i<=1000;i++){\n if(i%2===0){\n sum = sum + i;\n }\n\n }\n\n return sum;\n}", "function sum_even_numbers(){\n var sum = 0;\n for(var i = 1; i <= 1000; i++) {\n if (i % 2 === 0)\n sum += i;\n }\n return sum; \n}", "function sumEven() {\n var sum = 0;\n \n for (var i = 1; i <= 1000; i++) {\n if (i % 2 == 0) {\n sum += i;\n }\n }\n\n return sum;\n}", "function getEven1000(x) {\n sum = 0;\n for (i=1; i<=x; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function getEven1000(){\n var output = 0;\n for(var i=2; i <= 1000; i = i+2){\n output += i;\n }\n return output;\n}", "function sumEven(){\n var sum= 0;\n for(var i=1;i<1001;i++){\n if(i%2==0){\n sum+=i;\n }\n }\n return sum;\n}", "function evens()\r\n\r\n{\tvar sum=0;\r\n\tfor(var i=1;i<=1000;i++)\r\n\t{\r\n\t\tif(i%2===0)\r\n\t\t{\r\n\t\t\tsum=sum+1;\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.log(\"Sum of even numbers\",sum);\r\n}", "function sumOfEvenNumbers() {\n var sum = 0;\n for (var i = 0; i <= 1000; i += 2) {\n sum = sum + i;\n // console.log(x);\n }\n return sum;\n}", "function getSum(){\n var sum = 0;\n for (var i = 1; i <= 1000; i++){\n if (i % 2 == 0){\n sum = sum + i;\n } \n }\n return sum;\n}", "function sumEven(){\n let sum=0;\n for(let i=0;i<=100;i++){\n if(i%2===0){\nsum+=i;\n }\n} \nconsole.log(\" sum of even numbers from 1-100 = \"+sum);\n\n}", "function getEvens1000(){\n var summ = 0;\n for(var i=0; i<=1000; i++){\n if(i%2==0){\n summ+=i;\n } // if EVEN\n }\n return summ;\n}", "function odd(){\n var sum = 0;\n\n for (var i=1; i<=5000; i++){\n if(i%2===1){\n sum += i;\n }\n }\n\n return sum;\n}", "function abc () {\n var sum = 0;\n for( i =0; i <= 1000; i++) {\n if(i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function getSum() {\n var sum = 0;\n for (var i = 1; i <= 1000; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sum_odd_5000() {\n var sum = 0;\n for(var i = 1; i <= 5000; i++) {\n if (i % 2 === 1)\n sum += i;\n }\n return sum; \n}", "function two(){\n var sum = 0;\n for(var i = 0; i <= 1000; i+=2){\n sum+=i; \n }\n return sum; \n}", "function odds()\r\n\r\n{\tvar sum=0;\r\n\tfor(var i=1;i<=5000;i++)\r\n\t{\r\n\t\tif(i%2!==0)\r\n\t\t{\r\n\t\t\tsum=sum+1;\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.log(\"Sum of odds numbers\",sum);\r\n}", "function sumOdd5000(){\n var summ = 1;\n for(var i=1; i<=5000; i++){\n if(i%2 != 0){\n summ+=i;\n }\n }\n return summ;\n}", "function sumOdd5000(){\n var output = 0;\n for(var i = 1; i <= 5000; i=i+2){\n output += i;\n }\n return output;\n}", "function sumOfOddNumbers() {\n var sum = 0;\n for (var i = 1; i <= 5000; i += 2) {\n sum = sum + i;\n }\n return sum;\n}", "function sumOdd5000(){\n var sum = 0;\n for (let i = 0; i < 5001; i++) {\n if ( i % 2 ==! 0){\n sum = sum + i;\n }\n else{}\n }\n return sum;\n}", "function sumOdd(){\n var sum=0;\n for(var i=1;i<5001;i++){\n if(i%2!==0);\n sum+=i;\n }\n return sum;\n}", "function getSumOdd(){\n var sum = 0;\n for (var i = 1; i <= 5000; i+=2){\n if (i % 2 == 1){\n sum = sum + i;\n console.log(i);\n }\n }\n return sum;\n}", "function sumOdd() {\n var sum = 0;\n\n for (var i = 1; i <= 5000; i+=2) {\n sum += i;\n }\n\n return sum;\n}", "function getSumEvens() {\n var sum = 0;\n for (var i = 1; i < 1001; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumOdd() {\n var sum = 0;\n for (var i = 1; i <= 5000; i++) {\n if (i % 2 != 0) {\n sum = sum + i;\n }\n }\n return (sum)\n}", "function even(){\n for(var cont=2;cont<=1000;cont+=2){\n console.log(cont);\n //for(var i=1;i<1001;i++){\n // if(i%2===0){\n // console.log(i);\n // }\n //}\n\n }\n}", "function getSumOdd() {\n var sum = 0;\n for (var i = 1; i <= 5000; i++) {\n if (i % 2 == 1) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function getSumOdds() {\n var sum = 0;\n for (var i = 1; i < 5000; i++) {\n if (i % 2 !== 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumOdd5000() {\n var sum = 0;\n for (var i=1; i < 5001; i += 2) {\n sum += i;\n }\n return sum;\n}", "function abc() {\n var sum = 0,\n for (var i = 1; i < 1001; i++) {\n if (i % 2 === 0) {\n sum += i;\n }\n }\n return sum;\n}", "function evenOddCalculated () {\n var sumeE = 0;\n var sumeO = 0;\n for (var i = 1; i <=1000; i++) {\n if (i % 2 == 0) {\n sumeE += i;\n } else if (i <= 500) {\n sumeO += i;\n }\n }\n console.log ((sumeE - sumeO)*12.5);\n}", "function abc () {\n var sum = 0;\n for( i =0; i <= 5000; i++) {\n if(i % 2 == 1) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sumOdds() {\n var sumOf = 0;\n for (var i=1; i<=5000; i++) {\n if (i%2!=0) {\n sumOf += i;\n }\n }\n return sumOf;\n}", "function simpleEvenAdding(num){\n\tvar answer=0;\n\tfor (var s=0; s<=num; s++){\n\t\tif (s % 2 === 0) {\n\t\t\tanswer+=s;\t\n\t\t}\n\t}\n\tconsole.log(answer);\n}", "function evenOddSums() {}", "function oddNum() {\n for (var i = 1; i <= 1000; i++) {\n if (i % 2 != 0) {\n console.log(i)\n }\n }\n}", "function evenNumbers () {\n for (i= 0; i <= 100; i++) {\n if (i % 2 === 0) {\n console.log(i);\n }\n }\n}", "function simpleEvenAdding(num) {\n var counter = 0;\n for (var i = 1; i <= num; i++) {\n if (i % 2 === 0) {\n counter += i;\n }\n }\n return counter;\n}", "function solutionTwo(){\n var last = 0;\n var current = 1;\n var next = 0;\n var evenSum = 0;\n while((next = current + last)<4000000){\n if(next%2==0){\n evenSum += next;\n }\n last = current;\n current = next;\n }\n return evenSum;\n}", "function sumOdds(){\n var sum=0;\n for(var cont=1;cont<=5000;cont+=2){\n sum=sum+cont;\n }\n console.log(sum);\n}", "function abc() {\n var sum = 0;\n for (var i = 1; i < 5000; i++) {\n if (i % 2 === 1) {\n sum += i;\n }\n }\n return sum;\n}", "function sumOfEven(number) {\n let sum = 0\n for (let i = 0; i <= number; i++) {\n if(i % 2 == 0){\n sum += i;\n }\n }\n console.log(`Sum Of All even Numbers: ${sum}`);\n }", "function divisibleByTwo(number) {\n return number + (number % 2);\n}", "function even(){\n\tfor(let i = 0; i <= 200; i++){\n\t\tif(i % 2 === 0){\n\t\t\tconsole.log(i);\n\t\t}\n\t}\n}", "function sumOfEvenNumber(num) {\n var sum = 0;\n for(var i = 1; i <= num; i++) {\n if(i % 2 === 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumOfEven(num) {\n let sumEven = 0;\n\n for (let i = 0; i <= num; i++) {\n if (i % 2 === 0) sumEven += i;\n }\n return sumEven;\n}", "function evenNumber(){\n for(i=0;i<=100;i++){\n if(i%2==0){\n console.log(i);\n }\n }\n}", "function sumEvenNumbers(input) {\n return input.filter(value => value % 2 === 0).reduce((counter, value) => counter + value );\n}", "function sumEvenNumbers(n){\n let sum = 0;\n for(let i=1; i<=2*n-1; i+=2)\n {\n sum+=i;\n }\n return sum; \n}", "function sumOdd5000(x) {\n var sum = 0;\n for (i=1; i<=x; i++) {\n if (i % 2 != 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function calculate(){\n var sum = 0;\n for(var i = 1; i <= 1000; i++){\n if(i % 2 === 0){\n sum += i;\n }else{\n if(i <= 500 ){\n sum -= i;\n }\n }\n } \n sum *= 12.5;\n return sum;\n}", "function evenNumerics(numbers) {\n\n }", "function evenSum(values){\n var sum = 0;\n for (var i = 0; i < values.length; i++) {\n if (values[i] % 2 === 0) {\n sum += values[i];\n }\n } \n return sum; \n }", "function oddNumbers () {\n for (i= 0; i <= 100; i++) {\n if (i % 2 !== 0) {\n console.log(i);\n }\n }\n}", "function multipliedSum (even, odd) {\n var sum1 = 0;\n var sum2 = 0;\n var result = 0;\n for (var i = 1; i <= even; i++) {\n if(i % 2 === 0) {\n sum1 += i;\n }\n if (i % 2 === 1 && i <= odd) {\n sum2 += i;\n }\n }\n result = (sum1 - sum2) * 12.5;\n return result;\n}", "function evens() {\n for (let i = 0; i < 101; i++) {\n if ((i % 2) === 0) {\n console.log(i); \n } \n }\n}", "function sumatoria (){\n var suma = 0;\n for (var i = 0; i <= 1000; i+=2){\n suma = suma + i;\n }\n return suma;\n}", "function whoa(){\n var sum = 0;\n for(var i = -300000; i < 300001; i++){\n if(i % 2 === 1){\n sum = sum+i;\n }\n }\n console.log(sum);\n}", "function evenFib() {\n let sum = 0;\n let temp = 0;\n let prev = 1;\n let next = 2;\n const MAX = 4000000;\n\n while (next < MAX) {\n if (next % 2 == 0) sum += next;\n temp = next;\n next = prev + next;\n prev = temp;\n }\n return sum;\n}", "function sumEvenss(n){\n var count = 0;\n if (n%2 !== 0){\n n-=1;\n }\n while(n > 0){\n count+=n;\n n-=2;\n }\n return count;\n}", "function even (n) {\n\tvar m = 0 ;\n while ( n >= m ) {\n if ( m % 2 === 0 ) { \n console.log( m +' is even');\n }\n else { \n console.log( m +' is odd' );\n }\n m++;\n }\n}", "function evenSum(n,m){\n if(n>m){\n return 0\n }\n else{\n return n+evenSum(n+2,m)\n }\n}", "function evenNumbers(num1, num2) {\r\n\r\nfor (var i = 0; i<=num2; i++) {\r\n if (num1<=i && i%2==0) {\r\nvar exist = false;\r\n var newDigit = i%10;\r\n var newNum = (i-newDigit)/10;\r\n var str = \"\" + newNum;\r\n var length = str.length;\r\n for (var f=0; f<=length; f++) {\r\n if ((newNum%10)%2===0) {\r\n exist = false;\r\n break;\r\n }\r\n var newDigit2 = newNum%10;\r\n newNum = (newNum-newDigit2)/10;\r\n console.log(i);\r\n }\r\n }\r\n }\r\n}", "function getEvenNumbers(start, end) {\n // Пиши код ниже этой строки\n\nlet evenNumbers = [];\n for (let i = start; i <= end; i += 1){\n \n if (i % 2 === 0) {\n evenNumbers.push(i);\n }\n }\n\nreturn evenNumbers;\n \n // Пиши код выше этой строки\n}", "function sumOdd(n) {\n // let firstDigit= (n*n)-(n-1);\n // let result = 0, count = 0;\n\n // while (count<n) {\n // if (firstDigit%2 !== 0) {\n // result+=firstDigit;\n // count++;\n // }\n // firstDigit++;\n // }\n // return result;\n\n return Math.pow(n,3);\n}", "function sumOfTwoNumbers() {}", "function sumOfOddNumber(num) {\n var sum = 0;\n for(var i = 1; i <= num; i++) {\n if(i % 2 !== 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function printEven4to22(){\n for (var i=4; i < 23; i++){\n if (i % 2 == 0){\n console.log(i)\n }\n }\n}", "function sumFibs(num) {\n var oddSum =2;\n var Var1 =1;\n var Var2 = 2;\n var nextTerm = 0;\n while (nextTerm<num) {\n console.log(\"Var1: \"+Var1+\" and Var2: \"+Var2);\n nextTerm = Var1+Var2;\n console.log(\"nextTerm: \"+nextTerm);\n Var1=Var2;\n if (nextTerm % 2 !== 0 && nextTerm<=num) {\n oddSum+=nextTerm;\n }\n Var2=nextTerm;\n }\n return oddSum;\n}", "function three(){\n var sum = 0;\n for(var i = 1; i <= 5000; i+=2){\n sum+=i; \n }\n return sum; \n}", "function ex_2_I(n) {\n var sum = 0;\n var i=0;\n var j=0;\n while (i!=n){\n if(j%2==1){\n sum+=j;\n i++;\n j+=2;\n }\n else{j++;}\n }\n\n return sum;\n}", "function sumOdd(n) {\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot += 1 + 2 *i;\n }\n return tot;\n}", "function even(element5){\n if(element5 % 2 === 0){\n return element5;\n }\n else{\n return 0;\n }\n}", "function sumOfOdds(number) {\n let sum = 0\n for (let i = 0; i <= number; i++) {\n if(i % 2 === 1){\n sum += i;\n }\n }\n console.log(`Sum Of All odd Numbers: ${sum}`);\n }", "function p3(){\n var sum = 0;\n for (var i = 1; i <= 5000; i += 2) {\n sum += i\n console.log(sum)\n }\n}", "function EvenNum (){ \n for (let i = 0; i <= 10; i++){\n if (i % 2 === 0){\n console.log(i)\n }\n } \n return 'Done!'\n}", "function check_Even_or_Odd(n){\n\nif (n%2==0)\n{\nreturn false\n}\nelse \nsum_even_numbers(n)\nreturn \n}", "function sum_even_numbers(){\n\tvar sum = 0;\n\tfor(var i = 1, i < 1001; i++){\n\t\tif (i % 2 == 0){\n\t\t\tsum = sum + i;\n\t\t}\n\t}\n\treturn sum;\n}\n\n//Sum Odd 5000: Write a function that returns the sum of all the odd numbers from 1 to 5000.\nfunction sum_odd_5000() {\n var sum = 0;\n for(var i = 1; i < 5001; i++){\n \tif(i % 2 == 1){\n \t\tsum = sum + i;\n \t}\n }\n return sum;\n}\n\n//Iterate an Array: Write a function that returns the sum of all the values within an array.\nfunction iterArr(arr) {\n var sum = 0;\n for (var i = 0; i < arr.length; i++){\n \tsum = sum + arr[i];\n }\n return sum;\n}\n\n//Find Max: Given an array with multiple values, write a function that returns the maximum number in the array.\nfunction findMax(arr) {\n var max = 0;\n for (var i = 0; i < arr.length; i++){\n \tif(arr[i] > max){\n \t\tmax = arr[i];\n \t}\n }\n return max;\n}\n\n//Find Average: Given an array with multiple values, write a function that returns the average of the values in the array.\nfunction findAvg(arr) {\n\tvar avg = 0;\n\tfor(var i = 0; i < arr.length; i++){\n\t\tavg = arr[i] + avg;\n\t}\n\treturn avg/arr.length;\n}\n\n//Array Odd: Write a function that would return an array of all the odd numbers between 1 to 50\nfunction oddNumbers() {\n var arr = [];\n for(var i = 1; i < 50; i++){\n\t if(i % 2 == 1){\n\t\tarr.push(i);\n\t }\n }\n return arr;\n}\n\n//Greater than Y: Given value of Y, write a function that takes an array and returns the number of values that are greater than Y. For example if arr = [1, 3, 5, 7] and Y = 3, your function will return 2. (There are two values in the array greater than 3, which are 5, 7).\nfunction greaterY(arr, Y) {\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n\t if(arr[i] > Y){\n\t\tcount = count + 1;\n\t }\n }\n return count;\n}\n\n//Squares: Given an array with multiple values, write a function that replaces each value in the array with the product of the original value squared by itself. (e.g. [1,5,10,-2] will become [1,25,100,4])\nfunction squareVal(arr) {\n for(var i = 0; i < arr.length; i++){\n\t arr[i] = arr[i] * arr[i];\n }\n return arr;\n}\n\n//Negatives: Given an array with multiple values, write a function that replaces any negative numbers within the array with the value of 0. When the program is done the array should contain no negative values. (e.g. [1,5,10,-2] will become [1,5,10,0])\nfunction noNeg(arr) {\n for(var i = 0; i < arr.length; i++){\n\t if(arr[i] < 0){\n\t\t arr[i] = 0;\n\t }\n }\n return arr;\n}\n\n//Max/Min/Avg: Given an array with multiple values, write a function that returns a new array that only contains the maximum, minimum, and average values of the original array. (e.g. [1,5,10,-2] will return [10,-2,3.5])\nfunction maxMinAvg(arr) {\n\tvar max = arr[0];\n\tvar min = arr[0];\n\tvar sum = arr[0];\n\n\tfor(var i = 1; i < arr.length; i++){\n\t\tif (arr[i] > max){\n\t\t\tmax = arr[i];\n\t\t}\n\t\tif (arr[i] < min) {\n\t\t\tmin = arr[i];\n\t\t}\n\t\tsum = sum + arr[i];\n\t}\n\tvar avg = sum/arr.length;\n\tvar arrnew = [max, min, avg];\n\treturn arrnew;\n}\n//Swap values: Write a function that will swap the first and last values of any given array. The default minimum length of the array is 2. (e.g. [1,5,10,-2] will become [-2,5,10,1]).\nfunction swap(arr) {\n //your code here\n return arrnew;\n}\n\n//Number to string: Write a function that takes an array of numbers and replaces any negative values within the array with the string 'Dojo'. For example if array = [-1,-3,2], your function will return ['Dojo','Dojo',2].\nfunction numToStr(arr) {\n //your code here\n return arr;\n}", "function func3(){\n var result=0;\n for(var i=1; i<=5000; i++){\n if(i%2===1){\n result+=i;\n }\n }\n return result;\n}", "function oddNumsToN(n) {\n for (let i = 1; i <= n; i += 2) {\n if (i % 2 !== 0) {\n console.log(i);\n }\n }\n}", "function sumTellEven (num1, num2) {\r\n var sum = parseInt(num1 + num2);\r\n console.log(\"la somma dei due numeri è \" + sum);\r\n if (sum % 2 == 0) {\r\n return true;\r\n }\r\n return false;\r\n}", "function add(numbers) {\n var sum = 0;\n for (var i = 0; i < numbers.length; i++) {\n if ( numbers[i] % 2 == 0) {\n sum = sum + numbers[i];\n \n }\n \n }\n return sum;\n}", "function getEvens() {\n var sumOf = 0;\n for (var i=2; i<=1000; i+=2) {\n sumOf+=i;\n }\n \n return sumOf;\n}", "function Even() {\n for (var i = 0; i <=10; i++){ // \n if ((i % 2) == 0) // if remainder of i % 2 = 0 then its even\n console.log(i + \" Even \\n\");\n }\n }", "function oddSum() {\n let n = parseInt(document.getElementById(\"n\").value);\n\n//PROCESSING calculate the user number and find all odd numbers less than user number. If number is more than 100, send alert to user. Create a counting loop and Add odd numbers and \t\tuser number together for sum or total.\t\n let sum = 0;\n for(let i = 1; i <= n; i += 2) {\n sum += i;\n }\n //OUTPUT display total number for user.\ndocument.getElementById(\"output\").innerHTML = sum;\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function nthEven(n) {\n\treturn n*2-2;\n}", "function f(array){\n let sum = 0;\n for(let i = 0; i < array.length;i++){\n if(array[i]%2 === 0){\n sum+= array[i];\n }}\n return sum;\n}", "function fiboEvenSum(n) {\n // You can do it!\n let prevNum = 1;\n let currentNum = 1;\n let nextNum = 0;\n let evenSum = 0;\n \n for(let i = 0; i <= n; i++){\n if(nextNum %2 === 0)\n evenSum += nextNum\n nextNum = prevNum + currentNum;\n prevNum = currentNum;\n currentNum = nextNum;\n }\n return evenSum;\n }", "function evenFilter(number) {\n return number % 2 == 0\n }", "function onlyEvens(){\n let sum = 0;\n for(let i = 0; i <= 10; i++){\n if(i %2==0 ){\n sum = sum + i;\n }\n }\n return sum;\n}", "function evenNum(n) {\n var i = 0;\n\n while (i <= n) {\n console.log(i);\n i += 2;\n }\n}", "function sumEvenArguments(...args) {\n\tvar sum = 0;\n\tfor (var i = 0; i < args.length; i++) {\n\t\tif (args[i] % 2 === 0) {\n\t\t\tsum += args[i]\n\t\t}\n\t}\n\treturn sum;\n}", "function countDescEven () {\n for (i= 100; i >= 0; i--) {\n if (i % 2 === 0) {\n console.log(i);\n }\n }\n}", "function showNumbers(limit) {\r\n for (i = 0; i < limit + 1; i++) {\r\n if (i % 2 === 0) console.log(i , \"EVEN\")\r\n else console.log(i , \"ODD\")\r\n }\r\n}", "function sumOfEvensAndOdds(number) {\n let sumOfEvens = 0;\n let sumOfOdds = 0;\n for (let i = 0; i <= number; i++) {\n if (i % 2 == 0) {\n sumOfEvens += i;\n } else {\n sumOfOdds += i;\n }\n }\n console.log(\n `The sum of all evens from 0 to ${number} is ${sumOfEvens}. And the sum of all odds from 0 to ${number} is ${sumOfOdds}`\n );\n}", "function even(n) {\n return n % 2 === 0;\n }" ]
[ "0.8794161", "0.8728479", "0.8694277", "0.85407156", "0.85249156", "0.84369636", "0.84103787", "0.83410627", "0.82883567", "0.8211501", "0.80717033", "0.80698", "0.8033441", "0.80173373", "0.79497075", "0.7912", "0.7905024", "0.784779", "0.7805671", "0.77900153", "0.7786158", "0.7768631", "0.7750871", "0.7748954", "0.774857", "0.7735082", "0.77224946", "0.771083", "0.77103126", "0.77045643", "0.76901835", "0.76650965", "0.76418203", "0.76218754", "0.76119757", "0.7605125", "0.7560631", "0.7552885", "0.7551743", "0.75294846", "0.7490927", "0.7477138", "0.7459179", "0.7455157", "0.7451284", "0.744394", "0.7439767", "0.74333966", "0.74330276", "0.73633385", "0.73307043", "0.7278683", "0.7217148", "0.71581626", "0.7107604", "0.71009755", "0.70831335", "0.7062292", "0.704708", "0.7045857", "0.70133466", "0.70064604", "0.69375235", "0.69349146", "0.6932694", "0.6909236", "0.6908277", "0.6904355", "0.6895113", "0.6894574", "0.6882824", "0.6870899", "0.68683887", "0.6868145", "0.6863685", "0.6862204", "0.6861661", "0.68567514", "0.68387", "0.6832777", "0.6832003", "0.6819071", "0.68182343", "0.6815644", "0.68017346", "0.6800614", "0.6784758", "0.67787004", "0.67787004", "0.67772883", "0.67624265", "0.6750833", "0.674577", "0.67444795", "0.67399055", "0.67395926", "0.67384493", "0.67372346", "0.6728639", "0.6717888" ]
0.71928567
53
3) Sum odd 5000 Write a function that returns the sum of all the odd numbers from 1 to 5000. (e.g. 1+3+5+...+4997+4999).
function p3(){ var sum = 0; for (var i = 1; i <= 5000; i += 2) { sum += i console.log(sum) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sum_odd_5000() {\n var sum = 0;\n for(var i = 1; i <= 5000; i++) {\n if (i % 2 === 1)\n sum += i;\n }\n return sum; \n}", "function sumOdd5000() {\n var sum = 0;\n for (var i=1; i < 5001; i += 2) {\n sum += i;\n }\n return sum;\n}", "function sumOdd5000(){\n var output = 0;\n for(var i = 1; i <= 5000; i=i+2){\n output += i;\n }\n return output;\n}", "function sumOfOddNumbers() {\n var sum = 0;\n for (var i = 1; i <= 5000; i += 2) {\n sum = sum + i;\n }\n return sum;\n}", "function sumOdd5000(){\n var summ = 1;\n for(var i=1; i<=5000; i++){\n if(i%2 != 0){\n summ+=i;\n }\n }\n return summ;\n}", "function getSumOdd() {\n var sum = 0;\n for (var i = 1; i <= 5000; i++) {\n if (i % 2 == 1) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sumOdd() {\n var sum = 0;\n\n for (var i = 1; i <= 5000; i+=2) {\n sum += i;\n }\n\n return sum;\n}", "function sumOdd() {\n var sum = 0;\n for (var i = 1; i <= 5000; i++) {\n if (i % 2 != 0) {\n sum = sum + i;\n }\n }\n return (sum)\n}", "function sumOdd5000(){\n var sum = 0;\n for (let i = 0; i < 5001; i++) {\n if ( i % 2 ==! 0){\n sum = sum + i;\n }\n else{}\n }\n return sum;\n}", "function sumOdd5000(x) {\n var sum = 0;\n for (i=1; i<=x; i++) {\n if (i % 2 != 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sumOdds() {\n var sumOf = 0;\n for (var i=1; i<=5000; i++) {\n if (i%2!=0) {\n sumOf += i;\n }\n }\n return sumOf;\n}", "function sumOdds(){\n var sum=0;\n for(var cont=1;cont<=5000;cont+=2){\n sum=sum+cont;\n }\n console.log(sum);\n}", "function odd(){\n var sum = 0;\n\n for (var i=1; i<=5000; i++){\n if(i%2===1){\n sum += i;\n }\n }\n\n return sum;\n}", "function getSumOdds() {\n var sum = 0;\n for (var i = 1; i < 5000; i++) {\n if (i % 2 !== 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function getSumOdd(){\n var sum = 0;\n for (var i = 1; i <= 5000; i+=2){\n if (i % 2 == 1){\n sum = sum + i;\n console.log(i);\n }\n }\n return sum;\n}", "function odds()\r\n\r\n{\tvar sum=0;\r\n\tfor(var i=1;i<=5000;i++)\r\n\t{\r\n\t\tif(i%2!==0)\r\n\t\t{\r\n\t\t\tsum=sum+1;\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.log(\"Sum of odds numbers\",sum);\r\n}", "function sumOdd(){\n var sum=0;\n for(var i=1;i<5001;i++){\n if(i%2!==0);\n sum+=i;\n }\n return sum;\n}", "function abc () {\n var sum = 0;\n for( i =0; i <= 5000; i++) {\n if(i % 2 == 1) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sum_even_numbers(){\n var sum = 0;\n for(var i = 1; i <= 1000; i++) {\n if (i % 2 === 0)\n sum += i;\n }\n return sum; \n}", "function getSum() {\n var sum = 0;\n for (var i = 1; i <= 1000; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function getSum(){\n var sum = 0;\n for (var i = 1; i <= 1000; i++){\n if (i % 2 == 0){\n sum = sum + i;\n } \n }\n return sum;\n}", "function sumEven() {\n var sum = 0;\n \n for (var i = 1; i <= 1000; i++) {\n if (i % 2 == 0) {\n sum += i;\n }\n }\n\n return sum;\n}", "function sumOfEvenNumbers() {\n var sum = 0;\n for (var i = 0; i <= 1000; i += 2) {\n sum = sum + i;\n // console.log(x);\n }\n return sum;\n}", "function abc() {\n var sum = 0;\n for (var i = 1; i < 5000; i++) {\n if (i % 2 === 1) {\n sum += i;\n }\n }\n return sum;\n}", "function even(){\n\n var sum=0;\n for (var i=1;i<=1000;i++){\n if(i%2===0){\n sum = sum + i;\n }\n\n }\n\n return sum;\n}", "function three(){\n var sum = 0;\n for(var i = 1; i <= 5000; i+=2){\n sum+=i; \n }\n return sum; \n}", "function getEven1000(x) {\n sum = 0;\n for (i=1; i<=x; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function getEvenTo1000(){\n var sum = 0;\n for (let i = 0; i < 1001; i++) {\n if (i % 2 === 0) {\n sum = sum + i;\n }\n else { }\n }\n return sum;\n}", "function sumEven(){\n var sum= 0;\n for(var i=1;i<1001;i++){\n if(i%2==0){\n sum+=i;\n }\n }\n return sum;\n}", "function evens()\r\n\r\n{\tvar sum=0;\r\n\tfor(var i=1;i<=1000;i++)\r\n\t{\r\n\t\tif(i%2===0)\r\n\t\t{\r\n\t\t\tsum=sum+1;\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.log(\"Sum of even numbers\",sum);\r\n}", "function printSum5000(){\n var sum = 0;\n for(var i = 1; i <= 5000; i++){\n sum = sum + i; //or write sum += i;\n }\n console.log(sum); //or: return sum;\n}", "function evenOddSums() {}", "function getSumEvens() {\n var sum = 0;\n for (var i = 1; i < 1001; i++) {\n if (i % 2 == 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumOdd(n) {\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot += 1 + 2 *i;\n }\n return tot;\n}", "function getEvens1000(){\n var summ = 0;\n for(var i=0; i<=1000; i++){\n if(i%2==0){\n summ+=i;\n } // if EVEN\n }\n return summ;\n}", "function abc () {\n var sum = 0;\n for( i =0; i <= 1000; i++) {\n if(i % 2 == 0) {\n sum = sum + i;\n }\n }\n return sum;\n}", "function sum_even_numbers(){\n\tvar sum = 0;\n\tfor(var i = 1, i < 1001; i++){\n\t\tif (i % 2 == 0){\n\t\t\tsum = sum + i;\n\t\t}\n\t}\n\treturn sum;\n}\n\n//Sum Odd 5000: Write a function that returns the sum of all the odd numbers from 1 to 5000.\nfunction sum_odd_5000() {\n var sum = 0;\n for(var i = 1; i < 5001; i++){\n \tif(i % 2 == 1){\n \t\tsum = sum + i;\n \t}\n }\n return sum;\n}\n\n//Iterate an Array: Write a function that returns the sum of all the values within an array.\nfunction iterArr(arr) {\n var sum = 0;\n for (var i = 0; i < arr.length; i++){\n \tsum = sum + arr[i];\n }\n return sum;\n}\n\n//Find Max: Given an array with multiple values, write a function that returns the maximum number in the array.\nfunction findMax(arr) {\n var max = 0;\n for (var i = 0; i < arr.length; i++){\n \tif(arr[i] > max){\n \t\tmax = arr[i];\n \t}\n }\n return max;\n}\n\n//Find Average: Given an array with multiple values, write a function that returns the average of the values in the array.\nfunction findAvg(arr) {\n\tvar avg = 0;\n\tfor(var i = 0; i < arr.length; i++){\n\t\tavg = arr[i] + avg;\n\t}\n\treturn avg/arr.length;\n}\n\n//Array Odd: Write a function that would return an array of all the odd numbers between 1 to 50\nfunction oddNumbers() {\n var arr = [];\n for(var i = 1; i < 50; i++){\n\t if(i % 2 == 1){\n\t\tarr.push(i);\n\t }\n }\n return arr;\n}\n\n//Greater than Y: Given value of Y, write a function that takes an array and returns the number of values that are greater than Y. For example if arr = [1, 3, 5, 7] and Y = 3, your function will return 2. (There are two values in the array greater than 3, which are 5, 7).\nfunction greaterY(arr, Y) {\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n\t if(arr[i] > Y){\n\t\tcount = count + 1;\n\t }\n }\n return count;\n}\n\n//Squares: Given an array with multiple values, write a function that replaces each value in the array with the product of the original value squared by itself. (e.g. [1,5,10,-2] will become [1,25,100,4])\nfunction squareVal(arr) {\n for(var i = 0; i < arr.length; i++){\n\t arr[i] = arr[i] * arr[i];\n }\n return arr;\n}\n\n//Negatives: Given an array with multiple values, write a function that replaces any negative numbers within the array with the value of 0. When the program is done the array should contain no negative values. (e.g. [1,5,10,-2] will become [1,5,10,0])\nfunction noNeg(arr) {\n for(var i = 0; i < arr.length; i++){\n\t if(arr[i] < 0){\n\t\t arr[i] = 0;\n\t }\n }\n return arr;\n}\n\n//Max/Min/Avg: Given an array with multiple values, write a function that returns a new array that only contains the maximum, minimum, and average values of the original array. (e.g. [1,5,10,-2] will return [10,-2,3.5])\nfunction maxMinAvg(arr) {\n\tvar max = arr[0];\n\tvar min = arr[0];\n\tvar sum = arr[0];\n\n\tfor(var i = 1; i < arr.length; i++){\n\t\tif (arr[i] > max){\n\t\t\tmax = arr[i];\n\t\t}\n\t\tif (arr[i] < min) {\n\t\t\tmin = arr[i];\n\t\t}\n\t\tsum = sum + arr[i];\n\t}\n\tvar avg = sum/arr.length;\n\tvar arrnew = [max, min, avg];\n\treturn arrnew;\n}\n//Swap values: Write a function that will swap the first and last values of any given array. The default minimum length of the array is 2. (e.g. [1,5,10,-2] will become [-2,5,10,1]).\nfunction swap(arr) {\n //your code here\n return arrnew;\n}\n\n//Number to string: Write a function that takes an array of numbers and replaces any negative values within the array with the string 'Dojo'. For example if array = [-1,-3,2], your function will return ['Dojo','Dojo',2].\nfunction numToStr(arr) {\n //your code here\n return arr;\n}", "function sumOfOdds(number) {\n let sum = 0\n for (let i = 0; i <= number; i++) {\n if(i % 2 === 1){\n sum += i;\n }\n }\n console.log(`Sum Of All odd Numbers: ${sum}`);\n }", "function sum(limit) {\n let sum = 0;\n\n for (let i = 0; i <= limit; i++) if (i % 3 === 0 || i % 5 === 0) sum += i;\n\n return sum;\n}", "function two(){\n var sum = 0;\n for(var i = 0; i <= 1000; i+=2){\n sum+=i; \n }\n return sum; \n}", "function sumEvenNumbers(input) {\n return input.filter(value => value % 2 === 0).reduce((counter, value) => counter + value );\n}", "function sumOfOdds(num) {\n let sumOdds = 0;\n\n for (let i = 0; i <= num; i++) {\n if (i % 2 !== 0) sumOdds += i;\n }\n return sumOdds;\n}", "function sumOfOddNumber(num) {\n var sum = 0;\n for(var i = 1; i <= num; i++) {\n if(i % 2 !== 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function solutionOne(){\n return loopSum(0, 1000, (i, sum)=>{\n if(i % 3 === 0 || i % 5 === 0){\n sum += i;\n }\n return sum;\n });\n}", "function getEven1000(){\n var output = 0;\n for(var i=2; i <= 1000; i = i+2){\n output += i;\n }\n return output;\n}", "function sumEvenNumbers(n){\n let sum = 0;\n for(let i=1; i<=2*n-1; i+=2)\n {\n sum+=i;\n }\n return sum; \n}", "function sumOdds(numbers) {\n\tlet odds = filterOdds(numbers);\n\tlet sum = 0;\n\todds.forEach(num => {\n\t\tsum += num;\n\t})\n\treturn sum;\n}", "function abc() {\n var sum = 0,\n for (var i = 1; i < 1001; i++) {\n if (i % 2 === 0) {\n sum += i;\n }\n }\n return sum;\n}", "function sumEven(){\n let sum=0;\n for(let i=0;i<=100;i++){\n if(i%2===0){\nsum+=i;\n }\n} \nconsole.log(\" sum of even numbers from 1-100 = \"+sum);\n\n}", "function sum(limit) {\n let sum = 0;\n\n for (i = 0; i <= limit; i++)\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n\n console.log(sum);\n}", "function evenOddCalculated () {\n var sumeE = 0;\n var sumeO = 0;\n for (var i = 1; i <=1000; i++) {\n if (i % 2 == 0) {\n sumeE += i;\n } else if (i <= 500) {\n sumeO += i;\n }\n }\n console.log ((sumeE - sumeO)*12.5);\n}", "function findSumOfNaturalNumbers() {\n var limit = 1000;\n var sum = 0;\n for (var i = 1; i < limit; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n return sum;\n}", "function func3(){\n var result=0;\n for(var i=1; i<=5000; i++){\n if(i%2===1){\n result+=i;\n }\n }\n return result;\n}", "function sumThreeFive(n) {\n if (n < 0) {\n return 0;\n } else {\n let nums = [0];\n for (let i = 0; i < n; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n nums.push(i);\n }\n }\n return nums.reduce((sum, num) => sum + num);\n }\n}", "function sum(limit) {\n\t// find all multiples of 3 under limit\n let result = 0;\n \n\tfor (let i = 0; i < limit; i++) \n\t\tif (i % 3 === 0 || i % 5 === 0) \n result += i;\n \n return result;\n}", "function sumOdd(n) {\n // let firstDigit= (n*n)-(n-1);\n // let result = 0, count = 0;\n\n // while (count<n) {\n // if (firstDigit%2 !== 0) {\n // result+=firstDigit;\n // count++;\n // }\n // firstDigit++;\n // }\n // return result;\n\n return Math.pow(n,3);\n}", "function whoa(){\n var sum = 0;\n for(var i = -300000; i < 300001; i++){\n if(i % 2 === 1){\n sum = sum+i;\n }\n }\n console.log(sum);\n}", "function sum_1to500() {\n\t\tvar sum = 0;\n\t\tfor (var i = 1; i <= 500; i++) {\n\t\t\tsum += i;\n\t\t}\n\t\treturn sum;\n\t}", "function sumatoria (){\n var suma = 0;\n for (var i = 0; i <= 1000; i+=2){\n suma = suma + i;\n }\n return suma;\n}", "function sum(limit) {\n let sum = 0;\n\n for (let i=0; i<=limit; i++) {\n if (i % 3 == 0) {\n sum += i;\n console.log(i);\n }\n if (i % 5==0) {\n sum += i;\n console.log(i);\n }\n }\n\n return sum;\n}", "function solutionTwo(){\n var last = 0;\n var current = 1;\n var next = 0;\n var evenSum = 0;\n while((next = current + last)<4000000){\n if(next%2==0){\n evenSum += next;\n }\n last = current;\n current = next;\n }\n return evenSum;\n}", "function sumOfOdd(sum, num) {\n if (num % 2 !== 0) {\n sum = sum + num;\n }\n return sum;\n}", "function sumMultiples(limit) {\n let sum = 0;\n\n for (let i = 0; i <= limit; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n\n return sum;\n}", "function sumFibs(num) {\n let sequence = [0, 1];\n let sumOdds = 0;\n for (let i = 2; i <= num; i++) {\n sequence.push(sequence[i - 1] + sequence[i - 2]);\n }\n let sum = sequence.filter(number => \n number <= num && number % 2 !== 0 ? sumOdds += number : false)\n .reduce((a, b) => a + b);\n return sum\n}", "function Sum3s5s(num) {\n\t//Use input 'num' as the upper limit, below which to find your multiples of 3's and 5's\n\tvar numArr = [];\n\n\tfor (var i = 0; i < num; i++) {\n\t\tif (i % 3 === 0 || i % 5 === 0) {\n\t\t\tnumArr.push(i);\n\t\t}\n\t}\n\n\treturn numArr.reduce(function(a,b) {return a+b;});\n}", "function createArray() {     \n var sum = 0; \n var i = 1     \n    for (i = 1; i <= 5000; i+=2) {        \n     sum+=i;     \n }     \n return sum; \n }", "function findSum(n) {\n var final = 0;\n for (var i=3; i<=n; i++) {\n if (i%3==0||i%5===0) {\n final+=i;\n }\n }\n return final;\n}", "function findSum(n) {\n var sum = 0;\n var newArr = [];\n for(var i = 0; i <= n; i++){\n \tif(i % 3 === 0 || i % 5 === 0){\n \t\tnewArr.push(i);\n \t}\n }\n for(var j = 0; j < newArr.length; j++){\n \t\tsum += newArr[j];\n \t}\n return sum;\n}", "function sumOfEven(num) {\n let sumEven = 0;\n\n for (let i = 0; i <= num; i++) {\n if (i % 2 === 0) sumEven += i;\n }\n return sumEven;\n}", "function rowSumOddNumbers(n) {\n // TODO\n let value = 1;\n for(let x=0; x<n; x++) {\n value +=2*x\n }\n value= value*n\n for(let x=0; x<n; x++){\n value += 2*x}\n return value\n}", "function sumOfEven(number) {\n let sum = 0\n for (let i = 0; i <= number; i++) {\n if(i % 2 == 0){\n sum += i;\n }\n }\n console.log(`Sum Of All even Numbers: ${sum}`);\n }", "function calculate(){\n var sum = 0;\n for(var i = 1; i <= 1000; i++){\n if(i % 2 === 0){\n sum += i;\n }else{\n if(i <= 500 ){\n sum -= i;\n }\n }\n } \n sum *= 12.5;\n return sum;\n}", "function sumOfNumbers(number) {\r\n var sum = 0;\r\n\r\n for (var i = 1; i <= number; i++) {\r\n if (i % 5 === 0 || i % 3 === 0) {\r\n sum += i;\r\n }\r\n }\r\n\r\n return sum;\r\n }", "function sumOfEvenNumber(num) {\n var sum = 0;\n for(var i = 1; i <= num; i++) {\n if(i % 2 === 0) {\n sum = sum + i;\n }\n }\n console.log(sum);\n}", "function sumOddFibonacciNumbers( num ) {\n let curr = 1;\n let prev = 1;\n let oddSum = curr;\n \n while( curr <= num ) {\n if( curr%2 != 0) {\n oddSum += curr;\n }\n const temp = curr;\n curr += prev;\n prev = temp;\n }\n \n return oddSum;\n}", "function multi35() {\n var sum = 0;\n for(var i = 0; i < 1000; i++) {\n if ( ( (i % 3) == 0) || ( (i % 5) == 0) )\n sum += i;\n }\n console.log(sum);\n}", "function problem1(){\n var numArr = [];\n for(var x=0; x<1000; x++){\n if (x%3==0 || x%5==0){\n numArr.push(x);\n }\n }\n return numArr.reduce(function(a,b){\n return a + b;\n });\n}", "function sumOfMultiples (limit) {\n let total = 0;\n for(var i=0; i<limit; i++) {\n if (i%3===0 || i%5===0) {\n total+=i;\n }\n }\n return total;\n}", "function rowSumOddNumbers(n) {\n let sum = 0,\n startNum = (n - 1) * n + 1;\n\n for (let i = 0; i < n; i++) {\n sum += startNum + 2*i;\n }\n\n console.log(sum);\n}", "function oddSum(values){\n var sum = 0;\n for (var i = 0; i < values.length; i++) {\n if (values[i] % 2 === 1) {\n sum += values[i];\n }\n }\n return sum;\n }", "function problem2(){\n var numArr = [1,2];\n while(numArr[numArr.length-1]<4000000){\n numArr.push( numArr[numArr.length - 2] + numArr[numArr.length - 1] );\n }\n numArr = numArr.filter(function(a){ return a%2===0});\n return numArr.reduce(function(a,b){ return a+b; });\n}", "function sumOfTheOddNumbers(arrayNr) {\n\tvar sum=0;\n\tfor(let i=0; i<arrayNr.length; ++i) {\n\t\tif(arrayNr[i]%2!=0) sum=sum+arrayNr[i];\n\t}\n\treturn sum;\n}", "function simpleEvenAdding(num){\n\tvar answer=0;\n\tfor (var s=0; s<=num; s++){\n\t\tif (s % 2 === 0) {\n\t\t\tanswer+=s;\t\n\t\t}\n\t}\n\tconsole.log(answer);\n}", "function rowSumOddNumbers(n) {\n let i = 0;\n let startingNumber = 1;\n let sum = 0;\n let sumOfTwos = 0;\n \n while (i < n) {\n startingNumber += (i * 2);\n sumOfTwos += (i * 2);\n i++;\n }\n\n sum = (startingNumber * n) + sumOfTwos;\n return sum;\n}", "function rowSumOddNumbers(n) {\n return n * n * n;\n}", "function threeFives(){\n var sum = 0;\n for(var i = 100; i < 4000001; i++){\n if(i % 3 === 0 || i % 5 === 0){\n sum += i;\n }\n }\n console.log(sum);\n return sum;\n}", "function rowSumOddNumbers(n) {\n return n * n * n;\n}", "function under() {\r\n var tot3 = 0;\r\n var tot5 = 0;\r\n for (var i = 0; i < 1000; i++) {\r\n if (i % 3 == 0) {\r\n tot3 += i;\r\n } else if (i % 5 == 0) {\r\n tot5 += i;\r\n }\r\n }\r\n return tot3 + tot5;\r\n}", "static sumOfOddFibs(num) {\n \n let previousFib = 0;\n let currentFib = 1;\n let sum = 0;\n\n while(currentFib <= num) {\n if(currentFib % 2 == 1) {\n sum += currentFib;\n }\n [currentFib, previousFib] = [currentFib + previousFib, currentFib];\n }\n\n return sum;\n }", "function simpleEvenAdding(num) {\n var counter = 0;\n for (var i = 1; i <= num; i++) {\n if (i % 2 === 0) {\n counter += i;\n }\n }\n return counter;\n}", "function firstOdd(n) {\n var tot = 0;\n for(i = 0; i < n; ++i) {\n tot += 1 + 2 * i;\n }\n return tot;\n}", "function evenSum(values){\n var sum = 0;\n for (var i = 0; i < values.length; i++) {\n if (values[i] % 2 === 0) {\n sum += values[i];\n }\n } \n return sum; \n }", "function p2(){\n var sum = 2;\n for (var i = 0; i <= 1000; i += 2) {\n sum += i\n }\n console.log(sum)\n}", "function oddSum() {\n let n = parseInt(document.getElementById(\"n\").value);\n\n//PROCESSING calculate the user number and find all odd numbers less than user number. If number is more than 100, send alert to user. Create a counting loop and Add odd numbers and \t\tuser number together for sum or total.\t\n let sum = 0;\n for(let i = 1; i <= n; i += 2) {\n sum += i;\n }\n //OUTPUT display total number for user.\ndocument.getElementById(\"output\").innerHTML = sum;\n}", "function sum1ToN(n){\n\n}", "function sumOfEvensAndOdds(number) {\n let sumOfEvens = 0;\n let sumOfOdds = 0;\n for (let i = 0; i <= number; i++) {\n if (i % 2 == 0) {\n sumOfEvens += i;\n } else {\n sumOfOdds += i;\n }\n }\n console.log(\n `The sum of all evens from 0 to ${number} is ${sumOfEvens}. And the sum of all odds from 0 to ${number} is ${sumOfOdds}`\n );\n}", "function sumFibs(num) {\n\n //gets all Odd Fibonacci numbers and sums them. \n let oddFibArr = Fib(num).filter(x => x % 2 != 0);\n return oddFibArr.reduce((accumulator, currentValue) => {return accumulator + currentValue});\n\n}", "function sum(n) {\n\tlet s = 0\n\tfor(let i = 0; i <= n; i++) {\n\t\ts += i\n\t}\n\treturn s\n}", "function sum(n) {\n return (n * (n + 1)) / 2;\n}", "function Sum1toN(n){\n var x=0 \n for(i=0; i<= n; i++){\n x+=i\n }\n return x\n}" ]
[ "0.9221249", "0.9126858", "0.9107496", "0.9077863", "0.89906025", "0.8914302", "0.88922673", "0.8888605", "0.88254225", "0.8723807", "0.86246985", "0.85700715", "0.8545162", "0.8492023", "0.843178", "0.8409407", "0.83609897", "0.80882657", "0.7953452", "0.794784", "0.7937302", "0.7928262", "0.78304166", "0.7800693", "0.7787711", "0.7782754", "0.7711583", "0.7694171", "0.76623803", "0.755156", "0.7549393", "0.7486857", "0.74668247", "0.7385726", "0.7382358", "0.73546284", "0.7238882", "0.71684736", "0.71675843", "0.71511686", "0.71305245", "0.7129827", "0.71187", "0.7112346", "0.7046311", "0.70436865", "0.7038277", "0.70233846", "0.70189893", "0.7014862", "0.70061386", "0.6994604", "0.6991368", "0.69813395", "0.6965338", "0.6948588", "0.6946397", "0.69378793", "0.6920055", "0.6905122", "0.68810165", "0.68756706", "0.6851265", "0.68473613", "0.6847035", "0.6839654", "0.6832167", "0.6831119", "0.682666", "0.68245924", "0.6812531", "0.68065584", "0.67974657", "0.6792281", "0.67886806", "0.6787544", "0.67868114", "0.6776723", "0.6758889", "0.6745523", "0.67398006", "0.67290574", "0.6725337", "0.6721919", "0.6700998", "0.6686464", "0.6684624", "0.66661847", "0.6665199", "0.6664776", "0.6648373", "0.6644175", "0.6638432", "0.6612582", "0.65969324", "0.65954953", "0.6574124", "0.6571139", "0.65681976", "0.65657127" ]
0.7573506
29
4) Iterate an array Write a function that returns the sum of all the values within an array. (e.g. [1,2,5] returns 8. [5,2,5,12] returns 14).
function p4(){ var arr = [1,3,2,4,36,43,6,5,98] var sum = 0 for(var i =0; i < arr.length; i++){ sum += arr[i] } console.log("The sum of all values within the array is: " + sum) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iterArray(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum += arr[i];\n }\n return sum;\n}", "function sumArray(array){\n var total = 0;\n array.forEach(function(element){\n total += element;\n });\n return total;\n}", "function sum(array) {\n let total = 0;\n\n for (const value of arrayValues) {\n total = total + value;\n }\n\n return total;\n}", "function iterArr(arr) {\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum; \n}", "function arraySum(array) {\n var total = 0;\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function sumOfArray(iterArray) {\n var sumOf = 0;\n for (var i=0; i < iterArray.length; i++) {\n sumOf += iterArray[i];\n }\n return sumOf;\n}", "function sumArrayfor(array){\n let sum =0;\n for(let i=0; i<array.length;i++){\n sum += array[i];\n }\n return sum;\n}", "function iterateArray(arr) {\n var sum = arr[0];\n for (var i=1; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}", "function sum(array) {\n var total = 0;\n for (var i = 0; i < array.length; i ++)\n {total += array[i];}\n return total\n}", "function sumArray(array_input) {\n var total = 0\n array_input.forEach(function(x){\n total += x\n })\n return total\n}", "function sumArray(arr) {\n var total = 0;\n arr.forEach(function (element) {\n total += element;\n });\n return total;\n}", "function sumArray(array){\n\tvar total = 0;\n\tarray.forEach(function(element){\n\t\ttotal += element;\n\t\n\t});\n\treturn total;\n}", "function sumArray(array) {\n\tvar result = 0\n\tarray.forEach(function(element) {\n\t\tresult += element;\n\t});\n\treturn result \n}", "function sum(array) {\r\n var sum = 0;\r\n for (var i = 0; i < array.length; i++) {\r\n sum += array[i];\r\n }\r\n return sum;\r\n}", "function sumArray(arr){\n var tot = 0;\n arr.forEach(num => {\n tot += num;\n });\n return tot;\n}", "function summArray(array){\n var tot = 0;\n for(var i = 0; i < array.length; i++){\n tot += array[i]\n }\n return tot\n}", "function sum(array) {\n let sum = 0;\n for (let i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum;\n}", "function sumArray(arr){\n var total = 0;\n arr.forEach(function(element){\n total += elemtnl;\n });\n return total;\n}", "function sumArray(arr) {\n let sum = 0;\n arr.forEach((e) => {\n sum += e;\n });\n return sum;\n}", "function sumArray(array) {\n total = 0;\n for (i = 0; i < array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function sumArray(array) {\n var total = 0;\n array.forEach(function(element) {\n total += element;\n });\n console.log(total);\n}", "function sum(array) {\n var total = 0;\n for (var i=0; i<array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function sumArray(array) {\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum;\n}", "function sum(array){\n var arraySum=0;\n for(var i=0; i <array.length; i++){\n arraySum += array[i];\n }\n return arraySum;\n}", "function sumAll(array) {\n let sum = 0;\n // TODO: loop to add items\n\n for(i in array) { //logic failed with a for of loop, curious as to why\n sum += array[i];\n }\n\n return sum;\n}", "function iterray(arr){\n var summ = 0;\n for(var i = 0; i < arr.length; i++){\n summ+=arr[i];\n }\n return summ;\n}", "function arraySum(arr){\n let sum = 0;\n for(let i = 0; i < arr.length; i++){\n sum+=arr[i]\n }\n return sum;\n}", "function sumArray(arr) {\n var result = 0;\n arr.forEach(function(numb) {\n result += numb;\n \n });\n return result;\n }", "function sumElementArray(array) {\n var sumTotal = 0;\n for (var count = 0; count < array.length; count++) {\n sumTotal += array[count];\n }\n return sumTotal;\n}", "function sumArray(arr) {\n var sum = 0;\n for (var i = 0; i < arr.length; i++){\n sum += arr[i];\n }\n return sum;\n}", "function sumArray (input) {\n var sum = 0\n input.forEach(function (num) {\n sum += num\n })\n return sum\n}", "function sumArr(array){\n\n}", "function sum(arr) {\n let total = 0;\n for (let i = 0; i < arr.length; i++) {\n total += arr[i];\n }\n return total;\n}", "function sumArrayItems(arr) {\n let sum = 0;\n\n for (let i = 0; i < arr.length; i++) {\n sum = sum + arr[i];\n }\n\n return sum;\n}", "function sum(arr){\n return arr.reduce(function(d, i){ return i + d; });\n }", "function sumArray(arr) {\n var acc = 0,\n i;\n for (i = 0; i < arr.length; ++i) {\n acc += arr[i];\n }\n return acc;\n }", "function sum(arr) {\n let total = 0\n for (let i = 0; i < arr.length; i++) {\n total += arr[i]\n }\n return total\n}", "function sumArray(arr){\n\tvar sum = 0;\n\tarr.forEach(function(data){\n\t\tsum=sum+data;\n\t});\n\treturn sum;\n}", "function sumOfArray(array) {\r\n var sum = 0;\r\n\r\n for (var i = 0; i < array.length; i++) {\r\n sum += array[i];\r\n }\r\n\r\n return sum;\r\n }", "function sum(array) {\n let totalSum = 0\n\n for(const number of array) {\n totalSum += number\n }\n\n return totalSum\n}", "function sum(array) {\n var total = 0;\n\n for (i=0; i < array.length; i++) {\n total += array[i];\n }\n console.log(total);\n}", "function sumArray(arr){\n var sum = 0;\n for(var i = 0; i<arr.length; i++){\n sum += arr[i];\n }\n return sum;\n }", "function sumArray(arr) {\n var sum = 0;\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n}", "function sum(array) {\n // create a variable 'total' to store the sum . init to 0\n var total = 0;\n // run for-loop to access & add each element to the total\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function sumArray(arr) {\n sum = 0;\n \n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n\n return sum;\n}", "function sum(arr) {\n let result = 0;\n for (const num of arr) {\n result += num;\n }\n return result;\n}", "function arraySum(x) {\n var sum=0;\n for (i=0; i<x.length; i++) {\n sum = sum + x[i];\n }\n return sum;\n}", "function sum(array){\n\tlet somme = 0;\n\tarray.forEach( (element) => { somme+=element;})\n\treturn somme;\n}", "function sum(arr) {\n let total = 0;\n for(let i = 0; i < arr.length; i++) {\n total += arr[i];\n }\n return total;\n}", "function sumOfAllNumbers(array) {\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n sum += array[i];\n }\n\n return sum;\n}", "function computeSumOfAllElements(arr) {\n var sumArray = 0;\n\n for (var i = 0; i < arr.length; i++) {\n sumArray += arr[i];\n }\n\n return sumArray;\n}", "function sumArray(arr) {\r\n var sum = 0;\r\n for (var i = 0; i < arr.length; i++) {\r\n sum = sum + arr[i];\r\n }\r\n return sum;\r\n}", "function sumOfArray(arr){\n var arr = [1,2,3,4];\n var sum = 0\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum;\n }", "function sum(arr) {\n\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n\n return sum;\n}", "function sumArray(arr) {\n let sum = 0;\n\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n\n return sum;\n}", "function sum (array) {\n\tvar total = 0 ;\n\tfor (var i=0 ; i<array.length ; i++) {\n\t\ttotal += array[i]\n\t}\n\treturn total ;\n}", "function getArraySum(arr) {\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n var element = nums[i];\n sum = sum + element;\n }\n return sum;\n}", "function sumArray(arr) {\n var sum = 0;\n for (var i = 0; i < arr.length; i++) {\n sum = sum + arr[i];\n }\n return sum;\n}", "function sumArray(numArray) {\n var total = 0;\n\n numArray.forEach(function(num) {\n total += num;\n });\n\n return total;\n}", "function sumArray(arr) {\n // let total =0;\n // for(let i=0; i < arr.length; ++i){\n // total += arr[i]\n // }\n\n // return total\n\n return arr.reduce((accumulator, currentValue) => accumulator + currentValue)\n\n\n\n\n\n}", "function sumArray(arr){\n var sum=0 ;\n for(i=0 ; i<arr.length ; i++){\n sum += arr[i];\n } return sum;\n}", "function sum(array) {\n return array.reduce((total, value) => total + value)\n}", "function sumOfArray(arr) {\n var sumOfArr = 0;\n for (var i = 0; i < arr.length; i++) {\n sumOfArr += arr[i];\n }\n return sumOfArr;\n}", "function simpleArraySum(ar) {\r\n /*\r\n * Write your code here.\r\n */\r\n let sum = 0;\r\n for (let value of ar) {\r\n sum+=value;\r\n }\r\n \r\n return sum\r\n}", "function arrSum(arr) {\n let sum = 0;\n arr.forEach(num => sum += num);\n //With for loop\n //---------------------------------------\n // for (let i = 0; i < arr.length; i++) {\n // sum += arr[i];\n // }\n //---------------------------------------\n return sum;\n }", "function sumOfSums(arr) {\n var reducer = (sum, currentEl) => sum + currentEl;\n var newArrSum = 0;\n for (var i = 0; i < arr.length; i++) {\n var currentArr = arr.slice(0, i+1);\n newArrSum += currentArr.reduce(reducer);\n };\n return newArrSum;\n}", "function iterate(numArr){\n var sum = 0;\n for (var i = 0; i < numArr.length; i++){\n sum = sum + numArr[i];\n }\n return sum;\n}", "function iterate(numArr) {\n var sum = 0;\n for (var i = 0; i < numArr.length; i++) {\n sum = sum + numArr[i];\n }\n return sum;\n}", "function sum_forEach(array) {\r\n var total = 0;\r\n array.forEach(function(item){\r\n total+= item\r\n });\r\n return total;\r\n}", "function sumArray(numbers) {\n let total = 0;\n\tfor (let i = 0; i < numbers.length; i++) {\n\t\ttotal += numbers[i];\n\t}\n\treturn total;\n}", "function sumArray(numbers) {\n let sum = 0\n for (let i = 0; i < numbers.length; i++)\n sum += numbers[i];\n return sum;\n}", "function arraySum(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum = sum + arr[i];\n }\n console.log(sum); // or: return sum;\n}", "function sum(arr){\r\n var total = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n total= total + arr[i];\r\n }\r\n return total;\r\n}", "function arrSum(array){\n return array.reduce(function(a, b){\n return a + b;\n }, 0);\n}", "function sumArray(arr) {\n return arr.reduce((total,num) => total + num);\n}", "function arraySum(array) {\n return array.reduce(function(a,b) {\n return a + b;\n });\n}", "function sum(array){\n\tvar result= 0;\n\tfor (var i= 0; i<array.length; i++){\n\t\tresult+= array[i];\n\t}\n\treturn result;\n}", "function sumArray(arr) {\n var sum = 0;\n // for (let i = 0; i < arr.length; i++) {\n // sum += arr[i];\n // }\n // console.log(sum);\n \n arr.forEach(function (element) {\n sum += element;\n });\n return sum;\n}", "function sumArray(numbers) {\n let sum = 0;\n for (let i = 0; i < numbers.length; i++) {\n sum += numbers[i];\n }\n return sum;\n }", "function sum(arr) {\n \tconst len = arr.length;\n \tlet result = 0;\n \tfor (let i = 0; i < len; i++) {\n \t\tresult += arr[i];\n \t}\n \treturn result;\n }", "function sumArray(arr)\n{ // for loop that iterates through array\n for(var i=0; i<arr.length; i++){\n // add numbers to previous sum\n sum = sum + arr[i];\n }\n// return the sum\nreturn sum;\n}", "function sum(array) {\n return array.reduce((total, current) => total + current, 0);\n}", "function sumAll(a) {\n var c = 0\n for (var i = 0; i < a.length; i++) {\n var v = a[i];\n c += v\n }\n return c\n}", "function sumArray(numbers) {\n let sum = 0;\n numbers.forEach(number => {\n sum += number;\n });\n return sum;\n //\n}", "function sumArray(arrayNums) {\n let sum = 0;\n arrayNums.forEach(function(num) {\n sum += num;\n })\n return sum;\n}", "function sumArray(arr) {\n let total=0;\n for (let i=0;i<arr.length;i++){\n total+=arr[i];\n }\n return total;\n }", "function sum( arr ){\n\tvar total = 0;\n\t\n\tfor( var i in arr )\n\t\ttotal += arr[i];\n\t\n\treturn total\n}", "function sumNumbers (arr){\n let sum = 0;\n for (let i in arr){\n sum += arr[i]\n }\n return sum\n}", "function sumArray(a) {\n\tvar n = 0;\n\ta.forEach(function(el, ind, arr) {\n\t\tn += el;\n\t});\n\treturn n;\n}", "function sumArray(arr){\r\n\tvar sum=0;\r\n\tfor(i=0;i<arr.length;i++){\r\n\t\tsum+=arr[i]\r\n\t}\r\n\treturn sum\r\n}", "function sumArr(x) {\n var sum = 0;\n for (let i = 0; i < x.length; i++) {\n sum= sum + x[i];\n \n }\n return sum;\n }", "function sumFunc(arr) {\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n\n return sum;\n}", "function getArrOfSums(arr){\r\n\t\r\n\tlet sumArr = [];\r\n\t\r\n\tfor (let i = 0; i < arr.length; i++){\r\n\t\t\r\n\t\tsumArr.push(arr[i].reduce((t, el) => t + el));\r\n\t\r\n\t}\r\n\t\r\n\treturn sumArr;\r\n}", "function sumArray(arr){\n var sum = 0;\n for(var z=0;z<arr.length;z++){\n sum+=arr[z];\n }\n return sum;\n}", "function sumArray(x) {\n\tvar sum = 0;\n\tfor (var i = 0; i < x.length; i++) {\n \t\tsum += x[i];\n\t}\n \treturn sum;\n }", "function sumArray(arr){\n var total = 0;\n arr.forEach(function(num){\n total = total + num\n });\n return total;\n console.log(total);\n}", "function arraySum(arr){\n\n // code goes here\n\n}", "function sumArr(arr){\n var sum=0;\n for(var i=0; i<arr.length;i++){\n sum+=arr[i];\n }\n return sum;\n}", "function sumNumbers(arr) {\n let a = 0;\n for (i = 0; i < arr.length; i++)\n a += arr[i];\n return a;\n}", "function sumArray(numbers) {\n// numbers.reduce((accumulator, currentValue) => accumulator + currentValue)\n// }\nlet sum = 0;\nif (numbers.length==0){\n return 0\n}\nfor (let i = 0; i < numbers.length; i++){\n sum += numbers[i];\n\n}\nreturn sum;\n\n}" ]
[ "0.837891", "0.82869095", "0.82690966", "0.824598", "0.82402873", "0.823698", "0.82215154", "0.82206374", "0.8201376", "0.81974834", "0.819674", "0.8194736", "0.8177565", "0.81337255", "0.813273", "0.8130468", "0.8127297", "0.812674", "0.8126363", "0.81220233", "0.81188697", "0.81188226", "0.811102", "0.809741", "0.80926555", "0.80829585", "0.80731493", "0.8064445", "0.8040147", "0.8030038", "0.80134386", "0.80062217", "0.80039734", "0.8000085", "0.7996656", "0.7996423", "0.79958963", "0.7980769", "0.7980042", "0.797961", "0.7977392", "0.7973516", "0.7972006", "0.79698026", "0.7968421", "0.7966593", "0.79664856", "0.79652256", "0.7965122", "0.796438", "0.7959624", "0.79589814", "0.7956198", "0.7954618", "0.79483414", "0.7947802", "0.79418534", "0.7941841", "0.79355836", "0.7933103", "0.79280347", "0.7917604", "0.7890357", "0.78892213", "0.7888928", "0.78800505", "0.7877372", "0.7868776", "0.78683513", "0.78618217", "0.7859837", "0.78589433", "0.7855442", "0.7854971", "0.7854143", "0.78502303", "0.7850148", "0.78476804", "0.7843964", "0.78360164", "0.78345865", "0.78306335", "0.78283143", "0.7820694", "0.78184426", "0.7818392", "0.78140426", "0.78108776", "0.7810283", "0.7805433", "0.7793244", "0.77899253", "0.7788841", "0.7770595", "0.7764355", "0.77609104", "0.7749346", "0.774872", "0.77450246", "0.77417046" ]
0.8223445
6
5) Find max Given an array with multiple values, write a function that returns the maximum number in the array. (e.g. for [3,3,5,7] max is 7)
function p5(){ var arr = [1,3,22,43,65,103,1002,1738,1990,1776] var sum = 0 for(var i = 0; i < arr.length; i++){ if(arr[i] > sum){ sum = arr[i] } } console.log("The largest number in the array is: " + sum) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxNumber (arr)\n{\n var maximum = arr.reduce((max, x) => {\n if (x>max)\n { max =x;}\n return max\n } )\n return maximum\n}", "function findMax(arr){\n //sort the array\n //Math.max\n //array.reduce\n //use for loops and if statements\n //return Math.max(...arr);\n return arr.reduce(function(val, current){\n return Math.max(val, current);\n })\n\n}", "function maxNumber(array = []) {\n const max = Math.max(...array)\n return max\n}", "function maxNumber(array = []){\n const max = Math.max(...array);\n return max;\n}", "function findMax(array) {\n}", "function maxNumber(array = []) {\n const max = Math.max(...array);\n return max;\n}", "function maxNumber(array = []) {\n const max = Math.max(...array);\n return max;\n}", "function getMax(array) {\n if (array.length === 0) return undefined;\n\n // let max = array[0];\n\n // for (let i = 1; i < array.length; i++) {\n // if (array[i] > max) {\n // max = array[i];\n // }\n // }\n // return max;\n\n return array.reduce((a, c) => (a > c ? a : c));\n}", "function getMaxValue(array){\n return Math.max.apply(null, array);\n}", "function max(array){\n\tvar number= array[0];\n\tvar num1;\n\tfor (var i=0; i < array.length; i++){\n\t\tnum1= array[i];\n\t\tnumber = Math.max(number, num1);\n\t}\n\treturn number;\n}", "function maxNumber(array) {\n return Math.max.apply(null, array);\n}", "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "function array_max_value(array) {\n\t\treturn Math.max.apply(Math, array);\n\t}", "static getMax(array) {\n \n // todo: do stuff here\n let arrayMax = array[0]\n for (let i = 0; i < array.length; i++) {\n if (array[i] > arrayMax) {\n arrayMax = array[i]\n }\n }\n return arrayMax;\n }", "function findMax(array) {\n maxValue = Math.max.apply(null, array);\n console.log(maxValue);\n}", "function highestNumber(array) {\n return Math.max.apply(null, array);\n}", "function maxValueOfArray(array) {\n\treturn Math.max.apply(Math, array);\n}", "function getMaxNumber(arr){\n return Math.max.apply(null, arr); \n}", "function getHighest($array){\n var biggest = Math.max.apply( null, $array );\n return biggest;\n}", "function maxOf(array){\n if(array.length === 1){\n return array[0]\n } else{\n return Math.max(array.pop(), maxOf(array))\n }\n}", "function maximum( array ) {\n\t\tvar m = 0;\n\t\tfor (var i=0; i<array.length; i++) m = Math.max(m, array[i]);\n\t\t\n\t\treturn m;\n\t}", "function getMaxOfArray(numArray) {\n console.log(Math.max.apply(null, numArray));\n\n }", "function max(array) {\r\n\tvar max = array[0];\r\n\tfor(var i = 1; i < array.length; i++) {\r\n\t\tif(array[i] > max)\r\n\t\t\tmax = array[i];\r\n\t}\r\n\t\treturn max;\r\n\t}", "function maxOf(arr) {\n // return Math.max(...arr)\n if (arr.length === 1) {\n return arr[0];\n } else {\n return Math.max(arr.pop(), maxOf(arr));\n }\n}", "function max(arr){\n\tvar max=0;\n\t\n\t// Also works\n\t/*for(var i=0; i < arr.length-1; i++){\n\t\tif(arr[i+1] > arr[i])\n\t\t\tmax=arr[i+1];\n\t}*/\n\n\tarr.forEach(function(data){\n\t\tif(data > max)\n\t\t\tmax = data;\n\t});\n\n\treturn max;\n}", "function maxOfArray(numbers) {\n console.log(Math.max(...array));\n \n return array.length -1\n // \n}", "function maximum(array, max = Number.MIN_SAFE_INTEGER){\n if(array.length === 0)\n return max;\n else{\n let x = array.pop();\n if(x > max) max = x;\n return maximum(array, max);\n }\n}", "function max(array) {\n var maxNum = array[0];\n for (var i = 0; i < array.length; i++) {\n if (maxNum < array[i]) {\n maxNum = array[i];\n }\n }\n return maxNum;\n}", "function max(arr){\n var max_num = 0;\n arr.forEach(num => {\n if (num>max_num){\n max_num=num;\n }\n });\n return max_num;\n}", "function calculateMax(array) {\n return array.reduce(function(max, elem) {\n return (elem > max) ? elem : max;\n }, array[0]);\n}", "function maxNumbers(array) {\n\n return Math.max(...array);\n}", "function findMax(arr) {\n // store the max number in a var called maximum\n // we don't know what is the max number untill we see the array. let's assume 1st number of array is maximum number\n var maximum = arr[0];\n for(var i = 1; i < arr.length; i++) {\n if(arr[i] > maximum) {\n maximum = arr[i];\n }\n }\n return maximum;\n}", "function getMaxOfArray(numArray){\n return Math.max.apply(null,numArray);\n}", "function max(array) {\n // TODO: return the largest number in the given array\n\n highestNumber = 0;\n array.forEach(function(currentValue, index) {\n if (currentValue > highestNumber) {\n highestNumber = currentValue;\n //console.log(\"currentValue: \" + currentValue);\n //console.log(\"highestNumber: \" + highestNumber);\n }\n });\n return highestNumber;\n}", "function array_max(a) {\r\n var max = null;\r\n if (!a) return max;\r\n for (i=0;i<a.length;i++) {\r\n var int_val = parseInt(a[i]);\r\n max = (max == null) ? int_val : Math.max[int_val,max];\r\n }\r\n return max;\r\n}", "function largest(array){\r\n\treturn Math.max.apply(Math,array);\r\n}", "static getMax(array) {\n return Math.max(...array)\n }", "function max(array) {\r\n if (array.length == 0) return 0;\r\n\r\n return array.reduce((a, v) => Math.max(a, v));\r\n}", "function max(array){\n\tvar max = array[0];\n\tfor(var i = 1; i < array.length; i++){\n\t\tif(array[i] > max){\n\t\t\tmax = array[i]\n\t\t}\n\t} \n\treturn max;\n}", "function findMax(ar)\r\n{\r\n\tvar maxnum = ar.reduce((cur,item) =>{\r\n\t\tif(item > cur)\r\n\t\t\treturn item;\r\n\t\treturn cur;\r\n\t},0)\r\n\treturn maxnum;\r\n}", "function return_max(arr){\n max = arr[0];\n for(var i=1; i<arr.length; i++){\n if(arr[i]> max){\n max = arr[i];\n }\n }\n return max\n}", "function arrMaxNum(arr) {\n var max = Math.max.apply(...arr)\n return max;\n}", "function maxOfArray(numbers) {\n let biggestNumber = 0;\n numbers.forEach(number => {\n if (number > biggestNumber) {\n biggestNumber = number;\n }\n });\n return biggestNumber;\n //\n}", "function max(arrOfNumbers){\n var largestNumber = [];\n arrOfNumbers.forEach(function (singleNumber){\n if (largestNumber === undefined){\n largestNumber = singleNumber;\n }\n if (singleNumber > largestNumber){\n largestNumber = singleNumber;\n }\n })\n return largestNumber;\n } // (OPTION 3) should return 54.5", "function max(array) {\n\tvar currentmax = array[0];\n\tarray.forEach(function(element) {\n\t\tif(element > currentmax) {\n\t\t\tcurrentmax = element;\n\t\t}\n\t});\n\treturn currentmax;\n}", "function max(array){\n var maxNumber = array[0];\n for (var index = 1; index < array.length; index++) {\n if (maxNumber < array[i]){\n maxNumber = array[i];\n }\n }\n return maxNumber;\n}", "function max(arr) {\n // let maxnum = 0;\n // for (let i = 0; i < arr.length; i++) {\n // if (arr[i] > maxnum) {\n // maxnum = arr[i]\n // }\n // }\n // return maxnum\n\n // return arr.sort((a,b) => a - b).pop()\n\n return Math.max(...arr)\n}", "function findMax(array){\r\n let max=array[0]\r\n array.forEach(element => {\r\n if (element > max) {\r\n max = element \r\n }\r\n });\r\n return max\r\n }", "function max(arr){\n var max = 0;\n if (arr.length == 0){\n return -Infinity;\n }else{\n var max = Math.max.apply(null, arr);\n return max;\n}\n}", "function max(a){\n\n var max = a[0];\n for(let i=1;i<a.length;i++){\n\n if(max<a[i]){\n max = a[i];\n }\n\n }\n return max;\n }", "function max(array){\n\n let maximum = array[0]; \n\n for(let i = 0 ; i < array.length ; i++)\n {\n\n if(array[i] > maximum)\n maximum = array[i];\n }\n\n return maximum ; \n}", "function getMax(array) {\r\n let larger = 0;\r\n\r\n if (array.length === 0) return undefined;\r\n\r\n //Version 1 - Simple\r\n for (const item of array) {\r\n larger = item > larger ? item : larger;\r\n }\r\n //return larger;\r\n\r\n //Version 2 - Reduce:\r\n return array.reduce((accumulator, current) => {\r\n const max = current > accumulator ? current : accumulator;\r\n return max;\r\n });\r\n}", "function arrayMax(arr) {\n arr = [-3,3,5,7]\n var max = arr[0];\n for(var x = 0; x < arr.length; x++){\n if(max < arr[x]){\n max = arr[x]\n }\n }\n return max;\n // console.log(`Max value:`, max);\n}", "static getMax2(array) {\n let max = -Infinity;\n for (let i = 0; i < array.length; i++) {\n if (array[i] > max) {\n max = array[i]\n }\n }\n return max\n }", "function max(myArr) {\n var maximum = myArr[0];\n myArr.forEach(function(num) {\n if (num > maximum) {\n maximum = num;\n }\n })\n return maximum;\n}", "function max(array) {\r\n var max = 0;\r\n\r\n for (var i = 0; i < array.length; i++) {\r\n if(array[i] > max) {\r\n max = array[i];\r\n }\r\n }\r\n\r\n return max;\r\n }", "function max(arr){\n return sortNumbers(arr)[arr.length - 1];\n }", "function findMax(numArr) {\n var max = numArr[0];\n for (var i = 0; i < numArr.length; i++) {\n if (numArr[i] > max) {\n max = numArr[i];\n }\n }\n return max;\n}", "function getMaxOfArray(numArray) {\n return Math.max.apply(null, numArray);\n}", "function findMax(array) {\n var highNum= 0; \n for (let i = 0; i < array.length; i++) {\n if (array[i] > highNum) {\n highNum = array[i];\n \n }\n \n }\n return highNum;\n }", "function Max(array) {\n var max = -Infinity;\n for ( var i = 0; i < array.length; i++) {\n if (isFinite(array[i]) && array[i] > max) {\n max = array[i];\n } \n }\n return max;\n }", "function myMax(array) {\n for (i = 0; i < array.length; i++) {\n if (array[i] > max) {\n max = array[i];\n }\n }\n return max;\n}", "function max(arr){\n\tvar max = arr[0];\n\tfor (var i =0 ; i < arr.length-1 ; i++){\n\t\tif (maxNum < arr[i]){\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn maxNum;\n}", "function findMax(array) {\n\t\tvar max = array[0];\n\t\tfor (var i = 1; i < array.length; i++) {\n\t\t\tif(max < array[i]){\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t};\t\n\t\treturn max;\n\t}", "function maxOfArray(array) {\n const reduced = array.reduce(function (max, num) {\n return num > max ? num : max;\n }, 0);\n console.log(reduced);\n return reduced;\n}", "function max (array) {\n\tvar a = 0;\n\tfor (var i = 0 ; i < array.length ; i++) {\n\t\tif (array[i] > a) {\n\t\t\ta = array[i] ;\n\t\t}\n\t}\n\treturn a ;\n}", "function maxOfArray(numbers) {\n return Math.max(...numbers)\n}", "function maxOfArray(numbers) {\n return Math.max(...numbers)\n \n}", "function maxNumber(arr){\n var max = arr[0]\n for(var i = 0 ; i < arr.length ;i++){\n if (arr[i]>max) {\n max = arr[i]\n }\n }\n return(max)\n}", "function maxArray(numArray) {\n var max = numArray[0];\n\n numArray.forEach(function(num, index) {\n if (index === 0){\n // Skip the first one, we already stored it in the max variable so no need to compare\n return;\n } else {\n // If the array value is greater than the current known max, record it as the new max\n if (num > max) {\n max = num;\n }\n }\n });\n\n return max;\n}", "static getMax2(array) {\n // todo: 🙌 do magic !\n let arrayMax = array[0]\n array.forEach(element => {\n if (element > arrayMax) {\n arrayMax = element\n }\n });\n return arrayMax;\n }", "function max(arr) {\n var max = arr[0];\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n return max;\n}", "function arrayMaxValue(x) {\n var max = x[0];\n console.log(x);\n for (var i=0; i < x.length; i++) {\n if (x[i] >= max) {\n max = x[i];\n };\n } \n return max;\n}", "function maximum (arr){\n var max = 0\n for ( let i = 0 ; i < arr.length ; i++){\n const firstItem = arr[i]\n if (firstItem > max){ \n max = firstItem \n }\n }\n return max\n}", "function findMax(theArray) {\n var maxInArray = Math.max.apply(Math, theArray);\n console.log(maxInArray);\n return maxInArray;\n}", "function getMaxOfArray(numArray) {\r\n\t return Math.max.apply(null, numArray);\r\n\t}", "function findMax(array){\n var max = -Infinity;\n for (var i = 0; i < array.length; i++){\n if (array[i] > max){\n max = array[i];\n }\n }\n return max; \n}", "function array_max(arr)\n{\n var max = null;\n \n for (i in arr) {\n max = (max ? Math.max(max, arguments[1] ? Math.abs(arr[i]) : arr[i]) : arr[i]);\n }\n \n return max;\n}", "function findMax(arr){\n\n var max = arr[0];\n\n for (var i=0; i=arr.length; i++){\n if(arr[i]>max){\n max=arr[i];\n }\n }\n return arr[i];\n\n}", "function max(arr, fn){\n\tif (fn){\n\t\tarr.forEach(fn());\n\t\treturn Math.max(arr)\n\t}\n\treturn Math.max(arr)\n}", "function maxArr( inputArr ){\n var maxNumber = -Infinity;\n minArr.forEach(element => {\n if(element > maxNumber)\n maxNumber = element;\n });\n return maxNumber;\n}", "function largestOfArray(myArray) {\n \n return Math.max.apply(Math, myArray);\n}", "function max(arr) {\n var max = arr[0];\n for(var i = 1; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n }\n }\n return max;\n}", "function maxNum(numArray) {\n return Math.max.apply(null, numArray);\n }", "function max(array){\n var tmp = array[0];\n for(var i = 0; i < array.length; i++){\n if (array[i] > tmp){\n tmp = array[i]\n }\n }\n return tmp\n}", "function findMax(array) {\n var i;\n var maxElement = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i] > maxElement && typeof array[i] == 'number') {\n maxElement = array[i]\n }\n\n\n }\n return maxElement;\n}", "function findMax(array) {\n let maxIs = array[0];\n\n for (val of array) {\n if (val > maxIs) {\n maxIs = val\n }\n }\n\n return maxIs;\n\n}", "function max(arr) {\n var m = -Infinity;\n\n for(var i=0; i< arr.length; i++)\n if(arr[i] > m) m = arr[i];\n return m;\n}", "function maxOf(nums){\n var max = 0;\n for(var i = 0; i < nums.length; i++){\n if(nums[i] > max) max = nums[i];\n }\n return max;\n}", "function findMax(numArr){\n var max = numArr[0]; // sets the maximum to the first value in the array\n for (var i = 0; i < numArr.length; i++){ // for loop to examine each value in the array\n // see if the next value is bigger than the maximum\n if (numArr[i] > max){\n // if it is, make it the new max\n max = numArr[i];\n }\n }\n return max;\n}", "function max(arr){\n var max = arr[0];\n for(var i = 1; i < arr.length; 1++){\n if(arr[i] > max) {\n max = arr[i];\n }\n }\n return max;\n}", "function findMax(arr) {\n var max = 0;\n for(var i = 0; i < arr.length; i++) {\n if (arr[i] > max)\n max = arr[i];\n }\n return max; \n}", "function findMax(arr){\n var max=0;\n for(var i=0;i<arr.length;i++){\n if(arr[0]<arr[i]){\n max=arr[i];\n }\n }\n return max;\n}", "function max(array) {\n if (array.length === 0) {\n return null;\n }\n\n let currentMax = array[0];\n for (let i = 1; i < array.length; i++) {\n const item = array[i];\n if (item > currentMax) {\n currentMax = item;\n }\n }\n return currentMax;\n}", "function findMax(array){\n if(array.length === 1) {\n return array[0];\n }\n var lastValue = array.pop();\n var currentMax = findMax(array);\n if(currentMax < lastValue){\n return lastValue;\n } else {\n return currentMax;\n }\n // if(findMax(array) < lastValue){\n // return lastValue;\n // } else {\n // return findMax(array);\n // }\n}", "function findMax(arr){\n var max = arr[0];\n for(var i=0; i<arr.length; i++){\n if(max < arr[i]){\n max = arr[i];\n }\n }\n return max;\n}", "function maxValue (arr) {\r\n// liefert die indexnummer des elmentes im array 'arr' mit dem groessten wert\r\n var maxV;\r\n if (arr.length > 0) { // wenn das array ueberhaupt elemente enthaelt\r\n maxV = 0;\r\n for (i = 1; i < arr.length; i++) {\r\n if (arr[i]>arr[maxV]) { maxV = i; }\r\n }\r\n } else {\r\n maxV = null\r\n }\r\n return maxV; \r\n}", "function returnMaxFromArr(data){\n var length = data[0].values.length;\n //var arr = data[0].values[11];\n\n var max = 0;\n for (i = 0; i < length; i++) {\n var arr = data[0].values[i];\n\n if (Math.max.apply(null, arr) > max) {\n max = Math.max.apply(null, arr);\n }\n }\n return max;\n}", "maximum() {\n // Write your code here\n\tvar max = this.arr[0];\n\tfor(var i=0;i<this.arr.length;i++){\n\t\tif(max>this.arr[i]){\n\t\t max = max;\n\t\t}else{\n\t\t\tmax = this.arr[i];\n\t\t}\n\t}\n\treturn max;\n }", "function largest_e(array){\n // Create a function that returns the largest element in a given array.\n // For example largestElement( [1,30,5,7] ) should return 30.\n var max = array[0];\n for(var i=1; i< array.length; i++){\n if (array[i]> max){\n max = array[i];\n }\n }\n return max\n\n}", "function maxItems(arr){\n arr = arr || [];\n var max = arr[0];\n arr.forEach(element => {\n if(element>max)\n max = element; \n })\n return max;\n}" ]
[ "0.85597146", "0.8540721", "0.8534123", "0.8513138", "0.85048735", "0.8481239", "0.8481239", "0.84763986", "0.8434584", "0.8398678", "0.8386918", "0.8371824", "0.83488256", "0.83172756", "0.8315867", "0.83098435", "0.82916373", "0.8289263", "0.82834613", "0.8275617", "0.825719", "0.8254992", "0.8242586", "0.8241522", "0.82333595", "0.8230632", "0.82305413", "0.8226832", "0.82250845", "0.8222523", "0.82200706", "0.8219758", "0.82154566", "0.82130975", "0.82056576", "0.81990707", "0.81950206", "0.8190632", "0.818169", "0.8144775", "0.8133027", "0.81270206", "0.8118799", "0.81184274", "0.8117375", "0.8108556", "0.8099966", "0.80925226", "0.80916244", "0.8089077", "0.80888164", "0.808476", "0.80677336", "0.8060584", "0.80597615", "0.8047093", "0.80397254", "0.80335057", "0.8032076", "0.80313396", "0.80247235", "0.802395", "0.8002068", "0.800159", "0.7999387", "0.79943854", "0.79860955", "0.7984498", "0.7982093", "0.7977051", "0.7976736", "0.79696137", "0.7961061", "0.79572123", "0.7947345", "0.7943851", "0.7943403", "0.79389036", "0.79337656", "0.793248", "0.79315984", "0.7929587", "0.7926057", "0.79256666", "0.7923039", "0.7921953", "0.7918996", "0.79123074", "0.7905159", "0.79038554", "0.78940564", "0.7877522", "0.78751963", "0.78635186", "0.78405255", "0.7835403", "0.78243446", "0.7823998", "0.7822999", "0.7818824", "0.78040934" ]
0.0
-1
6) Find average Given an array with multiple values, write a function that returns the average of the values in the array. (e.g. for [1,3,5,7,20] average is 7.2)
function p6(){ var arr = [1,2,3,5,8,13,21,34,55,89,144] var sum = 0 for(var i = 0; i < arr.length; i++){ sum += arr[i] } console.log(sum/(arr.length)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function average(array){\n function plus(a, b){return a + b;}\n return array.reduce(plus) / array.length;\n}", "function average(array){\n function plus(a,b){return a+b}\n return array.reduce(plus)/array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n }", "function avgValue(array) {\n let total = 0;\n\n for (let i = 0; i < array.length; i += 1) {\n let num = array[i];\n total += num;\n }\n let avg = total / array.length;\n return avg;\n}", "function avg( arr ){\n\treturn sum( arr ) / arr.length\n}", "function avg(array) {\r\n\tvar sum = array.reduce(function(prev,current){\r\n\t\treturn prev + current;\r\n\t});\r\n\treturn sum/array.length;\r\n}", "function average(arr){\n return sum(arr) / arr.length;\n }", "function calcAVG(array) {\n var total = 0;\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n var avg = total / array.length;\n return (avg);\n}", "function avg_array(arr) {\n var sum = 0\n for( var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n return sum / arr.length;\n}", "function find_average(array) {\n var sum = array.reduce((a, b) => a + b, 0);\n return sum/array.length;\n}", "function avg(values){\n var sum = 0;\n for (var i = 0; i < values.length; i++){\n sum += values[i];\n }\n return sum/values.length;\n}", "function find_average(array) {\n var average = 0\n array.forEach(x => average += x)\n return average/array.length\n}", "function calcAverage(array){\n let reducer = (prevValue, currentValue) => prevValue + currentValue;\n return array.reduce(reducer)/array.length;\n \n}", "function arrayAverage(arr) {\n var sum = 0;\n\n arr.forEach(function(x){\n sum += x;\n });\n\n return Math.round(sum / arr.length);\n }", "function getAverage(arr){\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n avg += arr[i];\n }\n avg = avg/arr.length;\n return avg;\n}", "function find_average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "function avg(arr) {\n const total = arr.reduce((sum, b) => (sum + b));\n return (total / arr.length);\n}", "function getAvg(array) {\n return array.reduce(function (p, c) {\n return p + c;\n }) / array.length;\n}", "function findAVG(arr){\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n avg += arr[i];\n }\n return avg/arr.length;\n}", "function average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "function calcAverage(array) {\n let sum = 0;\n for (let i=0;i<array.length;i++){\n sum += array[i]; \n };\n avg = sum/array.length;\n return avg;\n }", "function average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "function getOneAverage(array){\n // console.log(array);\n var sum = array.reduce(getSum); // sum of all nums in array\n var avg = sum / array.length;\n // console.log(avg);\n return avg;\n}", "function find_avg(arr) {\n\t\tvar sum = 0, avg;\n\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\tsum += arr[i];\n\t\t}\n\t\tavg = sum / arr.length;\n\t\treturn avg;\n\t}", "function getAverage(array) {\n return (array.reduce((total, element) => {\n return total + element;\n }) / array.length)\n}", "function avg(arr) {\n return arr.reduce((a,b) => +a + +b) / arr.length;\n }", "function arrayAverage(arr) {\n return arr.reduce(function(val1, val2) {\n return val1 + val2;\n }, 0) / arr.length;\n}", "function findAvg(arr) {\n var sum = 0;\n var avg = 0;\n for(var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n avg = sum / arr.length;\n return avg; \n}", "function average(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum += arr[i];\n }\n return sum / arr.length;\n}", "function find_average(array) {\n // your code here\n var sum = 0;\n array.forEach( element => sum += element); \n return sum / array.length;\n}", "function average(array) {\n var sum = 0;\n var i;\n\n for (i = -2; i < array.length; i += 1) {\n sum += array[i];\n }\n\n return sum / array.length;\n}", "function avg(arr){\n return arr.reduce((a,b) => a + b, 0) / arr.length\n }", "function average(array) {\n var count = 0;\n var averageSum = 0;\n var result = 0;\n for (var i = 0; i < array.length; i++) {\n count++;\n averageSum += array[i];\n }\n var resultOfAverageSum = averageSum / count;\n return resultOfAverageSum;\n}", "function averageFinder(arr) {\n var average = 0;\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum+= arr[i]\n } \n average = (sum / arr.length);\n return average; \n }", "function average (array) {\n\tvar n = array.length ;\n\tvar a = 0 ;\n\tfor (var i=0 ; i<n ; i++) {\n\t\ta+= array[i]\n\t}\n\treturn a/n ;\n}", "function avg(arr){\n var sum =0;\n \n for(var i=0; i<arr.length; i++){\n sum+=arr[i]\n \n }\n return sum/arr.length;\n}", "function arrayAvg(x) {\n var avg=0;\n for (i=0; i<x.length; i++) {\n avg = avg + x[i];\n }\n avg = avg/x.length;\n return avg;\n}", "function average(numbers) {\n // process array of numbers\n return sum(numbers) / numbers.length;\n}", "function average (array) {\n\tvar total = 0;\nfor(var i = 0; i < array.length; i++){\n\t\ttotal = sum (array) / array.length;\n }return total;\n}", "function average(array) {\n var counter = 0;\n var averageSum = 0;\n var result = 0\n for (var i = 0; i < array.length; i++) {\n counter++;\n averageSum += array[i]\n }\n resultOfAverageSum = averageSum / counter;\n return resultOfAverageSum;\n}", "function arrAvg(a){\n\tvar sum = 0;\n\tfor( var i = 0; i < a.length; i++ ){\n\t\t\tsum += a[i]\n\t}\n\n\tvar avg = sum/a.length;\n\treturn avg;\n}", "function averageNumbers(array) {\n var average = 0;\n for (var i = 0; i < array.length; i++) {\n average += array[i];\n }\n return average / array.length;\n}", "function avg(arr) {\n\tvar sum = 0;\n\tfor (var i = arr.length - 1; i >= 0; i--) {\n\t\tsum += arr[i]\n\t}\n\treturn sum / arr.length\n}", "function find_average(array) {\n\tlet sum = array.reduce((prev, next) => prev + next, 0);\n\treturn Math.floor(sum / array.length);\n}", "function average(array) {\n var sum = 0;\n var i;\n\n for (i = -2; i < array.length; i += 1) {\n sum += array[i];\n }\n\n return sum / Object.keys(array).length;\n}", "function calcAverage (arr){\n // needs to initialize\n var sum = 0;\n for ( var i = 0 ; i < arr .length; i ++ ){\n sum += arr [ i ];\n }\n // must divide by the length\n return sum/arr.length;\n}", "function avg(arr) {\n\tlet total = 0;\n\t//loop over each num\n\tfor (let num of arr) {\n\t\t//add them together\n\t\ttotal += num;\n\t}\n\t//divide by number of nums\n\treturn total / arr.length;\n}", "function aveArray(arr){\r\n\t\tvar sum=0\r\n\t\tfor (i=0;i<arr.length;i++) {\r\n\t\t\tsum+=arr[i]\r\n\t\t}\r\n\t\tvar avg=sum/arr.length;\r\n\t\treturn avg;\r\n\t}", "function average(array) {\n if (array.length === 0) {\n return Number.NaN;\n }\n\n const result = Math.floor(totalled(array) / array.length);\n\n if (!Number.isFinite(result)) {\n return Number.NaN;\n }\n\n return result;\n}", "function average(array){\n\tvar result= 0;\n\tvar total= 0;\n\tfor (var i= 0; i<array.length; i++){\n\t\tresult+= array[i];\n\t\ttotal= result / array.length;\n\t} \n\treturn total; \t\n}", "function average(arr) {\n return _.reduce(arr, function (memo, num) {\n return memo + num;\n }, 0) / arr.length;\n }", "function averageArray(array){\n\n var sum1 = 0;\n for(var i=0; i<array.length; i++){\n sum1 += array[i]\n }\n array = sum1/array.length;\n return array;\n\n}", "function average (arr) {\n let total = 0\n for (num of arr) {\n total += num\n }\n return total / arr.length\n}", "function aveArray(arr){\n\tvar sum1=0;\n\tvar avg=0;\n for(i=0 ; i<arr.length ; i++){\n sum1 += arr[i];\n avg= sum1/arr.length;\n }return avg;\n}", "function calcuateAverage(arr) {\n let n = arr.length\n let sum = 0\n for (const element of arr) {\n sum = sum + element\n }\n return sum / n\n}", "function getAverage(array) {\n let total = 0;\n\n for (let i = 0; i < array.length; i++) {\n total += array[i];\n }\n let avg = total / array.length;\n\n return Math.round(avg * 100) / 100;\n}", "avg(arr) {\r\n let sum = 0;\r\n for(let i = 0; i < arr.length; i++){\r\n sum += parseFloat(arr[i]);\r\n }\r\n return sum / arr.length;\r\n }", "function average(array){\n //함수를 완성하세요\n var result = 0;\n for (var i = 0; i < array.length; i++) {\n result = result + array[i]\n }\n return result/array.length ;\n}", "function avgAll(myarray) {\n var tot = 0;\n for(var i = 0; i < myarray.length; i++) {\n tot += myarray[i];\n }\n return tot / myarray.length;\n}", "function findAvg(numArr) {\n var sum = 0;\n for (var i = 0; i < numArr.length; i++) {\n sum = sum + numArr[i];\n }\n avg = sum / numArr.length;\n return avg;\n}", "function average(numArray) {\n return numArray.reduce((total, value) => total + value, 0) / numArray.length;\n}", "function mean(array) {\n var average = 0;\n for (var i = 0; i < array.length; i ++)\n {average += array[i];}\n return (average/array.length)\n}", "function mean(array) {\n return sum(array) / array.length;\n}", "function mean(array) {\n return sum(array) / array.length;\n}", "function mean(array) {\n return sum(array) / array.length;\n}", "function average(inputArray)\n{\n\tvar sum = 0;\n\tvar numItems = inputArray.length;\n\tfor(var i = 0; i < numItems; i++)\n\t{\n\t\tsum +=inputArray[i];\n\t}\n\treturn (Math.round(sum / numItems));\n}", "function avg(arr){\n let denom = arr.length;\n let numerator = sum(arr);\n \n return numerator / denom;\n}", "function Average(arr){\n var av = 0;\n for(var i = 0 ; i < arr.length ;i++){\n av += arr[i]\n }\n av = av/arr.length\n return(av)\n}", "function avgNumber(array) {\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n sum += parseInt(array[i]);\n }\n return Math.round(sum / array.length);\n}", "function getMean(array){\n return getSum(array)/array.length;\n}", "function meanArray (array) {\n var sum=0;\n for(let i =0; i<array.length;i++) {\n sum = sum + array[i];\n } return sum/array.length\n}", "function averageValue(arr) {\n var arrSum = arr[0];\n for (var i = 0; i <= arr.length - 1; i++) {\n\n arrSum += arr[i];\n };\n var arrAverage = arrSum / arr.length;\n return arrAverage;\n}", "function average(array) {\n\tvar sum = _.reduce(array, function(a, b, seq) { \n\t\tconsole.log(\"a : \" + a + \" , b : \" + b + \" , seq : \" + seq);\n\t\treturn a + b; \n\t});\n\treturn sum / _.size(array);\n}", "function findAvg(numArr){\n var sum = 0;\n var avg = 0;\n for (var i = 0; i < numArr.length; i++){\n sum = sum + numArr[i];\n }\n avg = sum / numArr.length;\n return avg;\n}", "function average (arr){\n var sum = 0;\n for (var i= 0;i<arr.length;i++){\n\n sum = sum + arr[i];\n\n }\n\n return sum/arr.length\n}", "function average(arr){\n let total = 0;\n\n //for the length of the given array, we will count up the given amount and devide it by the length.\n for(var i = 0; i < arr.length; i++){\n total += arr[i];\n }\n\n return total/arr.length;\n}", "function averageFinder2(arr) {\n var average = 0;\n var sum = 0;\n for(var i = 0; i < arr.length; i++) {\n sum+= arr[i]\n } \n return Math.ceil(sum / arr.length); \n }", "function mean(arr) {\r\n let total = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n total += arr[i];\r\n }\r\n let meanValue = total / arr.length;\r\n\r\n return meanValue;\r\n}", "function findAverage(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum = sum + arr[i]; //or: sum += arr[i]\n }\n var avg = sum / arr.length;\n console.log(avg); //or: return avg;\n}", "function find_average(array) {\n // your code here\n if (array.length === 0) {\n return 0;\n }\n const average =\n array.reduce(function (acc, cur, i, arr) {\n return acc + cur;\n }, 0) / array.length;\n return average;\n}", "function average (array) {\n\tif (sum(array) === 0) {\n\treturn 0;\n\t}\n\telse {\n\ta = (sum(array)) / (array.length);\n\treturn a;\n\t}\n}", "function calculateAvg(array) {\n var sum = array.reduce(function(sum, elem) {\n return sum + elem;\n }, 0);\n\n return parseFloat((sum / array.length).toFixed(4));\n}", "function findAverage(array) {\n const sumElementsAgesArray = (accumulator, currentValue) => accumulator + currentValue;\n const averageAge = array.reduce(sumElementsAgesArray, 0) / array.length;\n return averageAge;\n}", "function avgarray(arr)\r\n{\r\n\tvar avg=0;\r\n\tvar sum=0;\r\n\tfor(var i=0;i<arr.length;i++)\t\r\n{\r\n\tsum =sum+arr[i];\r\n}\r\navg=sum/arr.length;\r\nconsole.log(\"Averageg of the array:\",avg);\r\n}", "function avgF(myArray) {\n var sum = myArray.reduce(function(acc, x){return acc + x}, 0);\n var avg = sum / myArray.length;\n return avg;\n}", "function avgF(myArray) {\n var sum = myArray.reduce(function(acc, x){return acc + x}, 0);\n var avg = sum / myArray.length;\n return avg;\n}", "function avgMultipleNumbers(arrayNr) {\n\tvar sum=0;\n\tfor(let i=0; i<arrayNr.length; ++i) {\n\t\tsum=sum+arrayNr[i];\n\t}\n\treturn sum/arrayNr.length;\n}", "function mean(int_array){\n var total = sum(int_array);\n return average = total/(int_array.length)\n}", "function average(numbers) {\n let sum = 0;\n numbers.forEach(function(arrNum) {\n sum = arrNum += sum;\n }); \n let arrAvg = sum/numbers.length;\n return arrAvg; \n}", "function printAverageOfArray(array) {\n if (arr.length === 0) {\n console.log('[], no avg val.');\n return;\n}\n\n var sum = 0;\n for (var idx = 1; idx < arr.length; idx++) {\n sum += arr[idx];\n }\n console.log('Avg val:', sum / arr.length);\n}", "function avg_array(arr) {\n\n var sum = 0;\n for (var i = 0; i < arr.length; i++) {\n sum = arr[i] + sum;\n\n }\n console.log(sum / arr.length);\n}", "function averageNumber(arr){\n let total= arr.reduce((item,acc)=>acc + item,0);\n return total/arr.length;\n}" ]
[ "0.87091875", "0.86927575", "0.86758924", "0.86673576", "0.86673576", "0.86673576", "0.86673576", "0.86673576", "0.86673576", "0.8662099", "0.86403024", "0.85842294", "0.8576306", "0.8544517", "0.8512853", "0.84769696", "0.84722537", "0.8397271", "0.8371834", "0.8366835", "0.8353647", "0.8343969", "0.834078", "0.8328589", "0.8323344", "0.83179605", "0.8313691", "0.8309151", "0.8304735", "0.8297945", "0.82927495", "0.8292205", "0.8281901", "0.82741535", "0.8264239", "0.82585937", "0.8241826", "0.8241183", "0.82236296", "0.8213393", "0.8189289", "0.8185896", "0.8183773", "0.81807643", "0.81806844", "0.81651735", "0.81629455", "0.81602", "0.8154167", "0.81475526", "0.8141719", "0.8139958", "0.8136072", "0.81293744", "0.81185466", "0.81160045", "0.8103195", "0.8101844", "0.81006724", "0.8091411", "0.80862206", "0.8082194", "0.80760443", "0.8066214", "0.806487", "0.805841", "0.8051013", "0.80456406", "0.8041815", "0.803699", "0.803398", "0.8032232", "0.8032232", "0.8032232", "0.8029642", "0.8024989", "0.8023342", "0.8008883", "0.80050117", "0.80042773", "0.80015963", "0.79881334", "0.79837567", "0.79800326", "0.79691076", "0.7960992", "0.7956276", "0.7953342", "0.79359025", "0.7930523", "0.79109687", "0.7906638", "0.7898772", "0.7893342", "0.7893342", "0.7880886", "0.787061", "0.7846527", "0.78367585", "0.78310746", "0.7826084" ]
0.0
-1
7) Array odd Write a function that would return an array of all the odd numbers between 1 to 50. (ex. [1,3,5, .... , 47,49]). Hint: Use 'push' method.
function p7(){ var arr = [] for(var i = 1; i <= 50; i+=2){ arr.push(i) } console.log(arr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayOdd() {\n var oddArray = [];\n for (var i = 1; i <= 50; i+=2) {\n oddArray.push(i);\n }\n return oddArray;\n}", "function oddArray() {\n var arr = [];\n for (var x = 1; x < 50; x += 2) {\n arr.push(x);\n }\n return arr;\n}", "function oddArray(){\n var arr = [];\n for (var x = 1; x < 50; x+=2){\n arr.push(x);\n }\n return arr;\n}", "function arrOdd(){\n var output = [];\n for(var i = 1; i <= 50; i = i+2){\n output.push(i);\n }\n return output;\n}", "function oddNumbers() {\n var arr = [];\n for(var i = 0; i <= 50; i++) {\n if (i % 2 == 1)\n arr.push(i);\n }\n return arr; \n}", "function arrayOdd(){\n var odds = [];\n for(var i = 0; i < 50; i++){\n if(i%2 != 0){\n odds.push(i);\n }\n }\n return odds;\n}", "function oddNumbers(){\n var newArray=[];\n for (var i=1;i<50;i++){\n if(i%2===1){\n newArray.push(i);\n }\n }\n return newArray;\n}", "function arrOdds50(x) {\n arr=[];\n for (var i=1; i<=x; i++){\n if (i%2 !=0) {\n arr.push(i)\n }\n }\n return arr;\n\n}", "function oddArray() {\n var newARR = [];\n for (let i = 0; i < 51; i++) {\n if (i % 2 ==! 0){\n newARR.push(i);\n }\n \n }\n return newARR;\n}", "function allOdd(arr){\n var num=[]\n for(var i=1; i<51; i++){\n if(i%2==1){\n num.push(i);\n }\n \n }\n return num;\n }", "function oddarr(arr)\r\n{ var arr=[];\r\n\tfor(var i=1;i<=50;i++)\r\n\t{\r\n\t\t\tif(i%2!==0)\r\n\t\t{\r\n\t\t\tarr.push(i);\t\r\n\t\t}\r\n\t}\r\nconsole.log(\"Odd numbers\",arr);\r\n}", "function oddArray2(){\n var arr = [];\n for (var i=1; i<=255; i++){\n if (i%2 === 1){\n arr.push(i);\n }\n }\n return arr;\n}", "function oddNumbers(array) {\n var array = [];\n for(var i = 1; i < array.length; i++){\n if(i % 2 !== 0){\n array.push(i);\n }\n }\n return array;\n}", "function returnOdds(arr) {\n var oddArr = [];\n for (var i = 1; i <= arr; i += 2) {\n oddArr.push(i)\n };\n return oddArr\n}", "function oddArray(arr){\r\n\tvar arr2=[];\r\n\tfor (i = 0; i < arr.length; i++) {\r\n\t\tif(arr[i]%2==1){\r\n\t\t\tarr2.push(arr[i])\r\n\t\t}\r\n\t}\r\n\treturn arr2;\r\n}", "function oddArray(arr){\n var odd =[];\n for(var z=0;z<arr.length;z++){\n if(z%2!==0)\n {\n odd.push(arr[z]);\n }\n }\n return odd;\n}", "function oddNumArray(arr) {\n var oddArray = [];\n for (var i = 0; i <= arr.length; i++) {\n if (i % 2 == 1) {\n oddArray.push(i);\n }\n }\n return oddArray;\n}", "function oddArray(){\n var arr = [];\n for (var i=1; i<=255; i+=2){\n arr.push(i);\n }\n return arr;\n}", "function returnOddArray(){\n // your code here\n var arr=[];\n for(var i=1; i<256; i+=2){\n arr.push(i);\n }\n return arr\n }", "function oddNumbers(){\n var odd = [];\n for (i=0; i<numbers.length; i++){\n if (numbers[i] % 2 !== 0){\n odd.push(numbers[i]);\n }\n }return odd;\n}", "function oddNum (numbers) {\n var arr = [];\n for(var i = 0; i < numbers.length; i++) {\n if(numbers[i] % 2 !== 0) {\n arr.push(numbers[i]); //.push(); - pushes a number to the top of an array\n }\n }\n return arr;\n}", "function odds(numbers){\n //create oddArray\n var oddArray = [];\n //iterate over the array of numbers using each()\n each(numbers, function(el){\n //if the element in array is odd\n if(el % 2 !== 0){\n //push element into oddArray\n oddArray.push(el);\n }\n });\n //return oddArray\n return oddArray;\n}", "function getOdds(){\n var odds = [];\n for (var i = 0; i < numbers.length; i ++){\n if (numbers[i] % 2 === 1){\n odds = odds.concat(numbers[i]);\n }\n }\n return odds;\n}", "function arrayOddNumbers(oddArray) {\r\n for (var i = 0; i <= 256; i++) {\r\n if (i % 2 == 1) {\r\n oddArray.push(i);\r\n }\r\n }\r\n console.log(\"\\n\\nBuild Array with Odds between 1 and 255\")\r\n console.log(oddArray)\r\n}", "function onlyOdd(arr){\n //declare new var within function of empty array\n var newArray = []\n //create a loop for argument array\n for(let i=0;i<arr.length;i++){\n //if else to find odd numbers in array\n if(arr[i]%2!==0){\n newArray.push(arr[i])\n }\n }\n //returns NEW array w only odd numbers\n return newArray\n}", "function returnOddsArray1to255() {\n var oddArray = [];\n for (var num = 1; num <= 255; num += 2) {\n oddArray.push(num);\n }\n}", "function returnOddsArray1To255(){\n var array = []\n for(var i = 1; i <= 255; i+=2){\n array.push(i)\n }\n return array\n}", "function oddElementsOf(arr) {\n var newArray = [];\n for (var i = 1; i < arr.length; i += 2) {\n newArray.push(arr[i]);\n }\n \n return newArray;\n}", "function getOdds(array){\n var oddArray = [];\n array.forEach(function (element) {\n if (element % 2 != 0){\n oddArray.push(element);\n }\n });\n return oddArray;\n}", "function Odds1To20(){\n var odds = []\n for(var i = 1; i<= 20; i++){\n if(i % 2 == 1){\n odds.push(i)\n }\n }\nconsole.log(odds)\n}", "function returnOddsArray1to255() {\n var oddArray = [];\n for (var num = 1; num <= 255; num += 2) {\n oddArray.push(num);\n }\n return oddArray;\n}", "function createOddArray(n) {\n var oddArr = [];\n for (var i = 1; i <= n; i += 2) {\n oddArr.push(i)\n }\n return oddArr\n}", "function arrayWithOdds(){\n let oddArr = [];\n for(let i=1;i<=255;i+=2){\n // console.log(i);\n oddArr.push(i);\n }\n console.log(oddArr);\n}", "function oddElements(array) {\n let newArray = []\n for (i=0; i<array.length; i++) {\n if (array[i]*10 % 2 !==0) {\n newArray.push(array[i])\n }\n }\n return newArray;\n}", "function oddValues(arr){\n let newArr = [];\n for(let i = 0; i < arr.length; i++){\n if(arr[i] %2!==0){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function collectOddValues2(arr){\n let newArr = []\n if (arr.length === 0) {\n return newArr\n }\n if (arr[0] % 2 !== 0){\n newArr.push(arr[0])\n }\n newArr = newArr.concat(collectOddValues2(arr.slice(1)));\n return newArr\n}", "function even(arr){\n newArray=[]\n for (val of arr ){\n if(val % 2 === 0 ){\n newArray.push(val) \n }\n return newArray\n }\n}", "function evenNumbers (arr) {\n var newArr = [];\n \n for(var i = 0; i < arr.length; i++){\n if(arr[i] % 2 === 0) {\n newArr.push(arr[i]);\n }\n }\n return newArr;\n }", "function findOdd () {\n var odd = [];\n for (var i = 0; i < numbers.length; i++) {\n if (numbers[i] % 2 != 0) {\n odd.push(numbers[i]);\n }\n } return odd;\n}", "function veryOdd(arrayOfNums) {\n let oddArray = [];\n\n for (let i = 0; i < arrayOfNums.length; i++){\n\n if(arrayOfNums[i] % 2){ // ODD b/c copiedArray[i] % 2 == 1, ie. TRUE\n oddArray.push(arrayOfNums[i]);\n }\n }\n \n return oddArray;\n}", "function getOdds(array) {\n var returnOdds = [];\n\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 == 1) {\n returnOdds.push(array[i]);\n }\n }\n return returnOdds;\n}", "function collectOdds(arr) {\n let newArr = []\n\n if (arr.length === 0) {\n return newArr\n }\n\n if (arr[0] % 2 !== 0) {\n newArr.push(arr[0])\n }\n newArr = newArr.concat(collectOdds(arr.slice(1)))\n}", "function oddRange(end) {\n let arr = [];\n\n for (let i = 1; i <= end; i += 2) {\n arr.push(i);\n }\n\n return arr;\n}", "function collectOddValues(arr) {\n oddArr = []\n function oddValues(numarr) {\n\n if(numarr.length == 0){\n return\n }\n\n if(numarr[0]%2 != 0) {\n oddArr.push(numarr[0])\n }\n\n oddValues(numarr.slice(1))\n }\n oddValues(arr)\n\n return oddArr\n}", "function oddValues(arr){\n let result = []\n function helper(helperInput){\n if (helperInput.length === 0){\n return \n }\n if (helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1))\n }\n helper(arr)\n return result\n}", "function collectOddValues(arr){\n let newArr = [];\n \n if(arr.length === 0) {\n return newArr;\n }\n \n if(arr[0] % 2 !== 0){\n newArr.push(arr[0]);\n }\n \n newArr = newArr.concat(collectOddValues(arr.slice(1)));\n return newArr;\n}", "function onlyOddNumbers(arrayOfOddNumbers){\n var oddNumbers = [];\n for (let i = 0; i < arrayOfOddNumbers.length; i++) {\n if (isOdd(arrayOfOddNumbers[i])){\n // initial if argument arrayOfOddNumbers[i]%2 === 1, think it can work but have to figure it out this way\n oddNumbers.push(arrayOfOddNumbers[i]);\n }\n }\n return oddNumbers;\n}", "function oddNums(numArray) {\n var odds = [];\n for (var i = 0; i < numArray.length; i++) {\n if(numArray[i]%2!==0){\n odds.push(numArray[i]);\n }\n }\n return odds;\n}", "function collectOddValues(arr) {\n let result = [];\n\n function helper(helperArr) {\n if(helperArr.length === 0) return;\n if(helperArr[0] % 2 !== 0) {\n result.push(helperArr[0]);\n }\n helper(helperArr.slice(1));\n }\n helper(arr);\n return result;\n}", "function collectOddValues(arr) {\n let newArr = []\n\n if (arr.length === 0) {\n return newArr\n }\n\n if (arr[0] % 2 !== 0) {\n newArr.push(arr[0])\n }\n\n return newArr\n}", "function odd(){\r\n\r\nvar oddArray = array.filter(ele=>ele%2===1);\r\nconsole.log(oddArray)\r\n}", "function collectOddValuesPR(arr) {\n let result = [];\n\n if(!arr.length)return result;\n if(arr[0] % 2 !== 0) result.push(arr[0]);\n result = [...result,...(collectOddValuesPR(arr.slice(1)))]; \n // result = result.concat(collectOddValuesPR(arr.slice(1)));\n\n return result;\n \n}", "function collectOddValues(arr) {\n let result = [];\n function helper(helperInput) {\n if(helperInput.length === 0) {\n return;\n } \n if(helperInput[0] % 2 !== 0) {\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1));\n }\n helper(arr);\n return result;\n}", "function oddValues(arr) {\n const newArr = arr.filter(function (item, index) {\n return item % 2 != 0;\n });\n return newArr;\n}", "function returnOdds(array) {\n}", "function collectOddValuesPure(arr) {\n let newArr = []; // this will be defined as a new array each time through which is ok here due to concatenating the arrays at the end\n if(arr.length === 0) return newArr;\n if(arr[0] % 2 !== 0){\n newArr.push(arr[0])\n }\n newArr = newArr.concat(collectOddValuesPure(arr.slice(1))); // every recursion will concat all the arrays with only odds\n return newArr;\n}", "function doubleOddNumbers(arr){\n let newValue = []\n let oddNums = []\n return arr.filter( (number, index) => {\n return index % 2 !== 0;\n })\n .map((value) => {\n return value * 2\n })\n // return newValue\n}", "function evenNumbers(){\n var even = [];\n for (i=0; i<numbers.length; i++){\n if (numbers[i] % 2 === 0){\n even.push(numbers[i]);\n }\n }return even;\n}", "function oddArray(arr){\n for(i=0 ; i<arr.length; i++){\n \tif (arr[i] % 2 == 0){\n arr.splice(i,1);\n \t}\n }\t\treturn arr;\n}", "function evenNum (numbers) {\n var arr = [];\n for(var i = 0; i < numbers.length; i++) {\n if(numbers[i] % 2 === 0) {\n arr.push(numbers[i]); //.push(); - pushes a number to the top of an array\n }\n }\n return arr;\n}", "function oddNumbers(l, r) {\n let arr = []\n while (l <= r) {\n arr.push(l)\n l += 1\n }\n return arr.filter(n => n % 2)\n}", "function oddities(array) {\r\n const oddElements = [];\r\n\r\n for (let i = 0; i < array.length; i += 2) {\r\n oddElements.push(array[i]);\r\n }\r\n\r\n return oddElements;\r\n}", "function findOddNumber(inputArr){\n let arr = []\n for (const interator of inputArr){\n //console.log(interator);\n if (interator % 2 !== 00) {\n arr.push (interator)\n }\n }\n return arr\n}", "function collectOddValues(arr){\n \n let result = []\n\n function helper(helperInput){\n if(helperInput.length === 0) {\n return;\n }\n \n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n \n helper(helperInput.slice(1))\n }\n \n helper(arr)\n\n return result;\n\n}", "function collectOddValues(arr){\n \n let result = [];\n\n function helper(helperInput){\n if(helperInput.length === 0) {\n return;\n }\n \n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n \n helper(helperInput.slice(1))\n }\n \n helper(arr)\n\n return result;\n}", "function evenNumbers (arr) {\n var evenArray = arr.filter((el) => el % 2 === 0);\n return evenArray;\n }", "function odd(arr) {\n return filter(arr, function(x) {\n return x % 2 !== 0;\n });\n}", "function filterOddElements(arr) {\n var tempArray = [];\n\n for (i = 0; i < arr.length; i++) {\n if (arr[i] % 2 !== 0) {\n tempArray.push(arr[i]);\n }\n }\n\n arr = tempArray;\n return tempArray;\n}", "function collectOddValues(arr) {\n if(arr.length == 0){\n return []\n }\n\n let oddArr = [];\n\n if(arr[0]%2 != 0){\n oddArr.push(arr[0])\n }\n\n return oddArr.concat(collectOddValues(arr.splice(1)))\n}", "function getEvenNumbers() {\r\n const numbers = [21, 42, 62, 65, 76, 87, 108];\r\n const evenNumbers = [];\r\n for (i = 0; i < numbers.length; i++) {\r\n if (numbers[i] % 2 == 0) {\r\n evenNumbers.push(numbers[i]);\r\n }\r\n }\r\n \r\n return evenNumbers;\r\n }", "function collectOddValues(arr) {\n let result = [];\n\n function helper(helperInput) {\n if (helperInput.length === 0) {\n return;\n }\n\n if (helperInput[0] % 2 !== 0) {\n result.push(helperInput[0]);\n }\n // calling recursively with an array with every item but the one we just tested\n helper(helperInput.slice(1));\n }\n\n helper(arr);\n\n return result;\n}", "function doubleOddNumbers(arr) {\n\treturn arr.filter(function(val){\n\t\treturn val % 2 !== 0;\n\t}).map(function(val){\n\t\treturn val * 2;\n\t})\n}", "function randomOdd () {\n var aRandom = []\n\n var getRandom = function () {\n return Math.floor(Math.random() * (100 - 0)) + 0\n }\n\n var currentNum = getRandom()\n var fillArray = function () {\n for (var i = 0; i <= currentNum; i++) {\n if (isOdd(i)) aRandom.push(i)\n }\n return aRandom\n }\n\n var isOdd = function (num) {\n return num % 2 === 1\n }\n\n if (currentNum > 40) {\n fillArray()\n return aRandom\n } else {\n return 'The number is smaller than 40'\n }\n}", "function doubleOddNumbers(arr) {\n return arr.filter(function(val) {\n return val % 2 !== 0;\n }).map(function(val) {\n return val * 2;\n });\n }", "function doubleOddNumbers(arr){\n return arr.filter(curVal => curVal%2 !==0).map(curVal => curVal*2);\n}", "function ReturnOddsArray1To255(){\n}", "function odd(l, r) {\n let oddNumbers = [];\n\n for (var i = l; i < r + 1; i++) {\n if (i % 2 != 0) {\n oddNumbers.push(i);\n }\n }\n\n return oddNumbers;\n}", "function collectOdds(arr) {\n let odds = [];\n\n function collector(nums) {\n // edge cases first\n if (nums.length === 0) return;\n // check if first number in array is odd if yes add it to the outer variable\n if (nums[0] % 2 !== 0) {\n odds.push(nums[0]);\n }\n // now cause the recursion to go through every number in the array\n // by slicing out the first number that had already been checked\n collector(nums.slice(1));\n }\n\n // call the recursion function\n collector(arr);\n\n // return the result\n return odds;\n}", "function allOdd(numberList){\n allOdd = []\n for(i = 0 ; i < numberList.length; i ++ ){\n if(numberList[i] % 2 != 0){\n allOdd.push(numberList[i])\n }\n }\n return allOdd \n}", "function doubleOddNumbers(arr) {\n\n var oddNumbers = arr.filter(function (value) {\n return value % 2 !== 0;\n });\n\n return oddNumbers.map(function (value) {\n return value * 2;\n });\n}", "function collectOddValue(arr){\n let result = [];\n\n function helper(helperInput){\n if(helperInput.length === 0) return;\n\n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0]);\n }\n\n helper(helperInput.slice(1));\n \n\n }\n\n helper(arr);\n\n}", "function doubleOddNumbers(arr) {\n return arr\n .filter(function(val) {\n return val % 2 !== 0;\n }) \n .map(function(val) {\n return val * 2;\n }); \n}", "function oddArr(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (i % 2 == 1) {\n arr[i] += 1;\n console.log(arr[i]);\n }\n }\n return arr;\n}", "function getEvenNumber(array) {\n var newArray = [];\n for(var i = 0; i <= array.length - 1; i++) {\n if(array[i] % 2 === 0) {\n newArray.push(array[i]);\n }\n }\n return newArray;\n}", "function getEvenNumbers(arr){\n return arr.filter(e => e % 2 === 0)\n}", "function even (array) {\n\tvar arr = [] ;\n\tvar j = 0 ;\n\tfor (var i = 1 ; i < array.length ; i++) {\n\t\tif (array[i] % 2 === 0) {\n\t\t\tarr [j] = array [i] ;\n j++;\n\t\t}\n\t}\n\treturn arr ;\n}", "function arrayEven(arr){\n let results = [];\n\n arr.forEach(function (num) {\n if(num % 2 === 0){\n results.push(num);\n }\n });\n\n return results;\n}", "function solution_1 (A) {\n const even = A.filter(n => !(n % 2));\n const odd = A.filter(n => n % 2);\n return [...even, ...odd];\n}", "function seven(){\n var newArray = [];\n for(var i = 1; i < 50; i+=2){\n newArray.push(i);\n }\n return newArray;\n}", "function evenNums(number) {\n const result = [];\n for (let i = 2; i <= number; i += 2) { // 1 is odd, we can save one iteration\n /* if (i % 2 === 0) {\n result.push(i);\n //console.log(result);\n } */\n result.push(i);\n }\n return result;\n}", "function evenOdd(val){\n var myArray = []\n for (var i = 0; i < val.length; i++){\n if (val[i] % 2 === 0){\n myArray.unshift(\"even\");\n } else{\n myArray.unshift(\"odd\");\n }\n }\nreturn myArray;\n}", "function getEvens(array) {\n var returnOdds = [];\n\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 == 0) {\n returnOdds.push(array[i]);\n }\n }\n return returnOdds;\n}", "function doubleOddNumbers(arr) {}", "function evenNumbersOnly(array) {\n // create an empty array to store the even number later.\n var evenArray = []\n // use for-loop to run through the list in array\n for (var i = 0; i < array.length; i++) {\n // use if condition to determine if element is even\n if (array[i] % 2 == 0) {\n // use <push> method to add the element at the end of 'evenArray'\n evenArray.push(array[i]);\n }\n }\n return evenArray;\n}", "function odds(values){\n return values.filter(function(num){ if( num % 2 ) return num;});\n}", "function func7(){\n var result=[];\n for(var i=1; i<=50; i++){\n if(i%2===1){\n result.push(i);\n }\n }\n return result;\n}", "function evensAndOdds(number) {\n let even = [];\n let odd = [];\n for (let i = 0; i <= number; i++) {\n if(i % 2 == 0){\n even.push(i);\n }\n else{\n odd.push(i);\n }\n }\n console.log(`even Numbers: ${even.length}`);\n console.log(`odd Numbers: ${odd.length}`);\n }", "function even(arr){\n\nnewArr = arr.filter((elem)=>{\n return elem % 2 === 0;\n })\n return newArr\n}", "function evenNumbers(numbers) {\n const evenNums = [];\n for (let num of numbers) {\n if (num % 2 === 0) {\n evenNums.push(num);\n } \n }\n return evenNums;\n}", "function evenElementsList(arr){\r\n newArr = [];\r\n for(var i=0; i<arr.length; i++){\r\n if(arr[i]%2===0){\r\n newArr.push(arr[i]);\r\n }\r\n }\r\n return newArr;\r\n}" ]
[ "0.8912246", "0.8872447", "0.88683295", "0.88320094", "0.8778048", "0.8737963", "0.8583755", "0.8543643", "0.8535137", "0.82505554", "0.8235098", "0.8173817", "0.816292", "0.8135569", "0.807366", "0.8066324", "0.80208826", "0.79693913", "0.79565895", "0.7951082", "0.7949407", "0.7945834", "0.7906084", "0.78951627", "0.78812003", "0.78360045", "0.7783393", "0.7782259", "0.77601224", "0.7739969", "0.7738327", "0.7705057", "0.77023757", "0.7697384", "0.76915693", "0.7659255", "0.76568866", "0.764543", "0.7643711", "0.76364744", "0.7622652", "0.76201904", "0.75970554", "0.7571176", "0.755617", "0.7552625", "0.75412285", "0.7532344", "0.7529942", "0.749121", "0.7473321", "0.7467891", "0.74577796", "0.745389", "0.74495244", "0.7422875", "0.7408106", "0.73907095", "0.73867494", "0.7378684", "0.7376439", "0.7357612", "0.7337252", "0.73282677", "0.7324606", "0.73237664", "0.7305544", "0.7283831", "0.7281432", "0.72598076", "0.7259697", "0.72537434", "0.7249172", "0.72349775", "0.7232649", "0.72158074", "0.72125363", "0.7210742", "0.72071385", "0.72002083", "0.7195623", "0.7141819", "0.7139957", "0.71279365", "0.7122201", "0.71020794", "0.7095895", "0.70939386", "0.70934045", "0.70901465", "0.70825106", "0.7079397", "0.70758426", "0.7061029", "0.7051821", "0.70417464", "0.70398736", "0.7036113", "0.703051", "0.70070356" ]
0.7002591
100
8) Greater than Y Given value of Y, write a function that takes an array and returns the number of values that are greater than Y. For example if arr = [1, 3, 5, 7] and Y = 3, your function will return 2. (There are two values in the array greater than 3, which are 5, 7).
function p8(){ var arr = [17, 38, 19, 20, 32, 43, 2, 11, 4, 5] var Y = 12 var larger_than = [] for(var i = 0; i < arr.length; i++){ if(arr[i] > Y){ larger_than.push(arr[i]) } } console.log("Numbers larger than " + Y + " within the array are: " + larger_than) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countGreaterThanY(arr, y) {\n var numGreater = 0;\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] > y) {\n numGreater++;\n }\n }\n return numGreater;\n}", "function greaterThanY(Y, arr){\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i]>Y){\n count++;\n }\n }\n return count;\n}", "function countGreaterThanY(arr, y) {\n var numGreater = 0;\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] > y) {\n numGreater++;\n }\n }\n return arr[y]l\n}", "function greaterThanY(arr, Y){\n var count = 0;\n for(var i=0; i<arr.length; i++){\n if(arr[i]>Y){\n count++;\n }\n }\n return count;\n}", "function ReturnArrayCountGreaterThanY(arr, y) {\n var count = 0;\n for(i = 0; i < arr.length; i++) {\n if(arr[i] > y) {\n count++;\n }\n }\n console.log(count);\n}", "function ReturnArrayCountGreaterThanY(arr, y){\n}", "function returnArrayCountGreaterThanY(arr, y){\n var count = 0;\n for (var i=0; i<arr.length; i++){\n if (arr[i]>y){\n count ++;\n }\n }\nreturn count;\n}", "function returnArrayCountGreaterThanY(arr, y){\n var count = 0\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > y)\n count++\n }\n console.log(count)\n}", "function greaterY(arr, Y) {\n var count = 0;\n for(var i = 0; i < arr.length; i++) {\n if (arr[i] > Y)\n count += 1;\n }\n return count; \n}", "function greaterThanY(arr, Y){\n var n = 0\n for(index = 0; index <= arr.length; index++){\n if(arr[index] > Y){\n n++\n }\n }\n return(n)\n}", "function greaterThanY(arr, y) {\n // YOUR CODE HERE\n var count = 0;\n\n for (i = 0; i < arr.length; i++) {\n if (y < arr[i]) {\n count = count + 1;\n }\n }\n return count;\n}", "function greater (arr,y) {\n\n var count=0;\n\n for (var i=0; i<arr.length; i++){\n\n if(arr[i]>y){\n count++;\n }\n }\n\n return count;\n\n}", "function greaterThanY(arr,y){\n var count=0;\n for(var i=0;i<arr.length; i++){\n if(arr[i]>y){\n count++\n }\n }\n return count;\n }", "function greaterThanY(arr, y){\n var counter=0;\n for (var i=0; i<arr.length; i++){\n if(arr[i]>y){\n counter ++;\n }\n }\n return counter;\n}", "function greaterY(arr, Y) {\n //your code here\n var count = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > Y) {\n count = count + 1;\n }\n }\n return count;\n}", "function greaterThanY(array, y) {\nvar count = 0;\n \n for (let i = 0; i < array.length; i++) {\n if(array[i] > y){\n count++;\n }\n \n }\n return count;\n}", "function greaterThanY(arr, y) {\n var y;\n var numGreaterThan = [];\n for (var i = 0; i <= arr.length; i++) {\n if (y < arr[i]) {\n numGreaterThan.push(i);\n }\n }\n return numGreaterThan.length;\n\n}", "function greaterThanY(arr, y){\n var counter = 0;\n // iterate through the array\n for (var idx = 0; idx < arr.length; idx++){\n // check if value in array is greater than y\n if (arr[idx] > y){\n // if it is, counter goes up\n counter++;\n }\n }\n return counter;\n}", "function greaterThanY(arr, y){\n var count = 0;\n for(var i = 0; i< arr.length - 1; i++){\n if(arr[i] > 4){\n count =(count + 1);\n }\n }\n return count\n}", "function greaterThanY(arr, y) {\n var counter = 0;\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] > y) {\n counter++;\n }\n }\n return counter;\n}", "function greaterThan(arr, Y) {\n var sum = 0;\n for (var i = 0; i < arr.length; i += 1) {\n if (arr[i] > Y) {\n sum = sum + 1;\n }\n }\n console.log(sum);\n return sum;\n}", "function greaterThanY(arr, num){\n let count = 0;\n for (let i=0; i <arr.length; i++){\n if (arr[i] > num ) {\n count++;\n }\n }\n console.log(count);\n}", "function greaterThan(Y, arr) {\n var newArr = [];\n \n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > Y) {\n newArr.push(arr[i]);\n }\n }\n\n return newArr.length;\n}", "function func8(inputArray, y){\n var result=0;\n for(var i=0; i<inputArray.length; i++){\n if(inputArray[i]>y){\n result++;\n }\n }\n return result;\n}", "function greaterThanY(xarr,y) {\n x=0;\n for (var i=0; i<=xarr.length; i++){\n if (xarr[i] > y) {\n x ++;\n }\n }\n return x;\n}", "function eight(arr, y){\n var counter = 0; \n for(var i = 0; i < arr.length; i++){\n if(arr[i] > y){\n counter++;\n }\n }\n return counter;\n}", "function greaterThanY(arrayGTY, y) {\r\n var temp = 0;\r\n var length = arrayGTY.length;\r\n for (var i = 0; i < length; i++) {\r\n if (arrayGTY[i] > y) {\r\n temp++;\r\n }\r\n }\r\n console.log(\"\\n\\nGreater than Y: [1, 3, 5, 7], 3\");\r\n console.log(temp);\r\n}", "function findGreaterNumbers(arr){\n var ctr = 0;\n for (var i = 0; i < arr.length; i++) {\n for (var j = i + 1; j < arr.length; j++) {\n if (arr[j] > arr[i]) {\n ctr++;\n }\n }\n }\n return ctr;\n}", "function greaterThanCount(testVal, testArray) {\n var amtGreaterThan = 0;\n for (var i = 0; i < testArray.length; i++) {\n if (testArray[i] > testVal) {\n amtGreaterThan++;\n }\n }\n return amtGreaterThan;\n}", "function greatervalue(arr,y)\r\n{\r\n\tfor(var i=0;i<arr.length;i++)\t\r\n\t{\r\n\t\tif(arr[i]>y)\r\n\r\n\t\t{\r\n\t\t\tconsole.log(\"Value greater than\",y, arr[i]);\r\n\t\t}\r\n\t}\r\n\r\n}", "function greaterThanY(arr, Y){\n let newArr = [];\n for(let i = 0; i < arr.length; i++){\n if(arr[i] > Y){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function greaterThan(arr){\n var total = 0\n for(var i = 0; i < arr.length; i +=1){\n if(arr[i] > arr[1]){\n console.log(arr[i])\n total += 1\n }\n }\n return \"Value greater than 2nd value \" + total + \" times.\"\n}", "function func_junc() {\n\nvar array = Array.from(arguments);\nvar y = array[1];\nvar new_array = [];\nvar count = 0;\nfor (var i = 0; i < array.length; i++){\n if (array[i] > y) {\n new_array.push(array[i]);\n }\n }\nconsole.log(new_array.length);\nreturn new_array;\n}", "function greaterThanSecond(arr){\n\nif(arr.length<=1){\n return \"Enter an array with 2 or more values\";\n}\n\nvar arrcount = 0;\n for(var i=0;i<arr.length;i++){\n if(arr[i]>arr[1]){\n console.log(arr[i]+' is greater than '+arr[1] );\n arrcount++;\n }\n\n }\n\n return \"total numbers greater than the 2nd value: \" + arrcount;\n}", "function ValGreatThanSecond(arr){\n var count = 0;\n var arr = [1,3,5,7,9,13];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > arr[1]){\n console.log(arr[i]);\n count++;\n }\n }\n console.log(count);\n}", "function valueGreaterThanSecond(arr) {\n var secondValue = arr[1];\n var count = 0;\n for(var i = 0); i < arr.length; i ++){\n if(arr[i] > secondValue){\n console.log(arr[i]);\n count ++;\n }\n }\n return count\n\n}", "function greaterThanSecond(arr){\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > arr[1]){\n console.log(arr[i]);\n count++;\n }\n }\n return count;\n}", "function valueGreaterThanSecondGeneralized(){\n var result = []\n var secondValue = arr[1]\n if(arr.length < 1){\n return null;\n }\n for(var i = 0); i < arr.length; i ++){\n if(arr[i] > secondValue){\n console.log(arr[i]);\n count ++;\n }\n }\n console.log(count);\n return result\n\n }", "function GtSG(arr){\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > arr[1]){\n console.log(arr[i]);\n count++;\n }\n }\n console.log(count);\n}", "function greaterThanSecond(arr)\n{\n var count = 0;\n for(let i = 0; i < arr.length; i++)\n {\n if(arr[i] > arr[1])\n {\n console.log(arr[i])\n count ++;\n }\n }\n return count;\n}", "function betterGreaterThanSecond(arr){\n let count = 0\n if (arr.length == 1){\n console.log(\"There is only one value in this array\")\n }\n else{\n for (let i = 0; i < arr.length; i++){\n if (arr[i] > arr[1]){\n console.log(arr[i])\n count++\n }\n }\n }\n return count\n}", "function greaterThanSecond(arr){\n let count = 0\n for (let i = 0; i < arr.length; i++){\n if (arr[i] > arr[1]){\n console.log(arr[i])\n count++\n }\n }\n return count\n}", "function greaterThanSecond(){\n\tvar gtsArray = [1,3,5,7,9,13];\n\tvar num = 0;\n\tvar count = 0;\n\n\twhile (num <= gtsArray.length){\n\t\tif (gtsArray[num] > gtsArray[1]){\n\t\t\tconsole.log(gtsArray[num]);\n\t\t\tcount++;\n\t\t\tnum++;\n\t\t}\n\n\t\telse{\n\t\t\tnum++;\n\t\t}\n\t}\n\tconsole.log(\"Number of values greater than 2nd value: \" +count);\n\n}", "function countInArray(array, value) {return array.reduce(function(n, x){ return n + (x === value)}, 0);}", "function countInArray(array, value) {return array.reduce(function(n, x){ return n + (x === value)}, 0);}", "function lar(arr){\n\tvar x=0;\n\n\tfor(var i = 0; i <= arr.length; i++){\n\t\tif (arr[i]>x){\n\t\t\tvar x = arr[i];\n\t\t}\n\t}\n\treturn x\n}", "function gTS(arr)\n{\n var newArr= [];\n for(let i=0; i<arr.length; i++)\n {\n if(arr[i]> arr[1])\n {\n newArr.push(arr[i])\n }\n }\n console.log(newArr.length)\n return newArr\n}", "function fiveAndGreaterOnly(arr) {\n // your code here\n}", "function greaterThanSecond(arr){\n var sum = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > arr[1]){\n console.log (arr[i]);\n sum ++;\n }\n }\n return sum;\n}", "function getMissedNumCnt(arr){\r\n\t\r\n\tarr.sort((a, b) => a - b);\r\n\t\r\n\treturn (arr[arr.length-1] - arr[0] + 1 - arr.length);\r\n\t\r\n}", "function betterThanAverage(arr) {\n var sum = 0;\n // calculate the average\n for(var i=0; i<arr.length;i++){\n sum+=arr[i];\n }\n var average=sum/arr.length;\n var count = 0;\n // count how many values are greated than the average\n for(var j=0; j<arr.length;j++){\n if(arr[j]>average){\n count++;\n }\n }\n return count;\n}", "function cakeCandles(arr) {\n const tallestCandle = Math.max(...arr); \n let count = 0; \n\n for (let i = 0; i < arr.length; i++) {\n if(arr[i] === tallestCandle) {\n count += 1; \n }\n }\n\n return count; \n }", "function func5(inputArray){\n if(inputArray===[]){\n return 0;\n }\n var result=inputArray[0];\n for(var i=1; i<inputArray.length; i++){\n if(inputArray[i]>result){\n result=inputArray[i];\n }\n }\n return result;\n}", "function highestCount(numbersArray) {\n let higherPopularity = 0;\n let higher = highestFinder(numbersArray);\n for (let index = 0; index < numbersArray.length; index += 1) {\n if (numbersArray[index] === higher) {\n higherPopularity += 1;\n }\n }\n return higherPopularity;\n}", "function greaterThan2nd(arr) {\n var sum = 0;\n var newArr = [];\n for (var i = 0; i <= arr.length + 1; i++) {\n if (arr[i] > arr[1]) {\n newArr.push(arr[i]);\n sum++;\n }\n }\n console.log(sum);\n return newArr;\n}", "function countInArray(array, what) {\n let count = 0\n for (let i = 0; i < array.length; i++) {\n if (array[i] === what) {\n count++\n }\n }\n return count\n}", "function longerThan (arr, num)\n{\n\nvar output = arr.filter( x => x.length > num )\n\nreturn output\n}", "function birthdayCakeCandles(ar) {\n\tvar maximum = 0;\n\tvar length = ar.length;\n\n\tfor(let i=0 ; i<length; i++){\n\t\tif(ar[i] > maximum){\n\t\t\tmaximum = ar[i];\n\t\t}\n\t}\n\n\t// console.log(maximum);\n\n\tvar count = ar.filter(function(number){\n\t\treturn number == maximum;\n\t});\n\n\tlet answer = count.length;\n\treturn answer;\n\n}", "function getUserCount(arr) {\n var userCount = arr.length;\n return userCount;\n}", "function greaterThanSecondG(arr){\n\tvar gtsgArray = arr;\n\tvar num = 0;\n\tvar count = 0;\n\n\tif (gtsgArray.length < 2){\n\t\tconsole.log(\"The array is too short!\");\n\t}\n\n\telse{\n\t\twhile (num <= gtsgArray.length){\n\t\t\tif (gtsgArray[num] > gtsgArray[1]){\n\t\t\t\tconsole.log(gtsgArray[num]);\n\t\t\t\tcount++;\n\t\t\t\tnum++;\n\t\t\t}\n\n\t\t\telse{\n\t\t\t\tnum++;\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"Number of values greater than 2nd value: \" +count);\n\t}\n}", "function ocurrences (array,num) {\n var count = 0;\n for (let i =0; i<array.length; i++) {\n if(array[i]===num) {\n count++\n } \n } return count;\n}", "function five(arr){\n var max = 0; \n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i]; \n }\n }\n return max;\n}", "function countInRange(arr, min, max){\n let count = 0;\n for(let num of arr){\n if(num >= min && num <= max){\n count++;\n }\n }\n return count;\n}", "countSkyscrapers(array, clue) {\n let lowestBuilding = 0;\n let count = 0;\n for (let i = 0; i < this.size; i++) {\n const el = array[i];\n if (el > lowestBuilding) {\n lowestBuilding = el;\n count++;\n if (count > clue) return count;\n }\n }\n return count;\n }", "function countPositive(arr){\n var count = 0\n for (var i = 0; i < arr.length; i++){\n if(arr[i] > 0){\n count++\n }\n }\n arr[arr.length - 1] = count\n return arr\n}", "function upperBound(value, arr) {\n var i = 0;\n var j = arr.length - 1;\n while (i < j) {\n var m = (i + j) >> 1;\n if (arr[m] > value) {\n j = m;\n } else {\n i = m + 1;\n }\n }\n return arr[i];\n}", "function getIndexToIns(arr, num) {\n let count = 0;\n for (let x=0; x<arr.length; x++){\n if (arr[x] < num) {\n count++;\n }\n }\n return count;\n}", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n\n return i;\n }", "function betterThanAverage(arr) {\n var sum = 0;\n for(i=0;i<arr.length;i++){\n sum+=arr[i];\n }\n var average=sum/arr.length\n // calculate the average\n var count = 0\n for(i=0;i<arr.length;i++){\n if(average<arr[i]){\n count++;\n }\n }\n // count how many values are greated than the average\n return count;\n}", "function countPosi(x) {\n var count = 0\n for ( var i = 0 ; i<x.length ; i++ ) {\n if (x[i]>0) {\n count++\n }\n } return count\n}", "function countArray(squares, what)\n{\n\tvar count = 0;\n for (var i = 0; i < 9; i++) {\n if (squares[i] === what) {\n count++;\n }\n }\n return count;\n}", "function countTrue(arr) {\n\t let i=0, nbr=0;\n while(i<arr.length){\n if(arr[i] == true) nbr++;\n i++;\n }\n return nbr;\n}", "function getElementCount(array) {\n return array.length;\n}//helper function for number of elements in array", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function upperBound(array, func) {\n var diff, len, i, current;\n\n len = array.length;\n i = 0;\n\n while (len) {\n diff = len >>> 1;\n current = i + diff;\n if (func(array[current])) {\n len = diff;\n } else {\n i = current + 1;\n len -= diff + 1;\n }\n }\n return i;\n }", "function betterThanAverage(arr) {\n var sum = 0;\n var count = 0\n var average = 0;\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i]; \n }\n average = sum/arr.length;\n for (var i = 0; i < arr.length; i++) {\n if (average < arr[i]) {\n count++;\n } \n }\n // count how many values are greated than the average\n return count;\n}", "function countTrue(array) {\n let count = 0;\n for (let element of array) {\n if (element) {\n count++;\n }\n }\n return count;\n}", "function howMany(array) {\n return array.length;\n}", "function where(arr, val) {\n var x = arr.length;\n for (var i=0; i<arr.length; i++) {\n if (val < arr[i]) { \n x = i;\n break;\n } \n }\n return x;\n}", "function getMissedNumsLength(arr) {\n arr.sort((a,b) => a - b);\n return arr[arr.length - 1] - arr[0] + 1 - arr.length; \n}", "getMax(arr) {\n let max = 0;\n for (let num of arr) {\n this.comparisons++;\n if (max < num.toString().length) {\n max = num.toString().length\n }\n }\n return max\n }", "function countInArray(array, what) {\n var count = 0;\n for (var i = 0; i < array.length; i++) {\n if (array[i] === what) {\n count++;\n }\n }\n return count;\n }", "function countInArray(array, what) {\n return array.filter(item => item === what).length;\n }", "function greaterThanSecondGen(arr){\n var count = 0;\n var arr1 = []\n\n if (arr.length > 2){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > arr[1]){\n arr1.push(arr[i]);\n count++;\n }\n }\n\n console.log(count);\n return arr1;\n\n } else {\n console.log(\"The array isn't long enough to run 'greaterThanSecondGen().'\")\n return arr;\n }\n \n}", "function solve(args){\n let N = args.shift(),\n array = args.map(Number),\n counter = 1,\n maxCounter=1;\n // console.log(array);\n // console.log(N);\n for (let i=0; i<N-1; i+=1){\n if(array[i+1] > array[i]){\n counter+=1;\n }\n \n if (array [i+1] <= array[i] && counter>1 ){\n if(counter>maxCounter){\n maxCounter=counter;\n }\n counter=1;\n }\n\n\n }\n if(counter>maxCounter){\n maxCounter=counter;\n }\n console.log(maxCounter);\n}", "function max(array) {\r\n let count = array[0]\r\n for (i = 0; i < array.length; i++) {\r\n if (count < array[i]) {\r\n count = array[i]\r\n }\r\n }\r\n console.log(count)\r\n}", "function birthdayCakeCandles(ar) {\n let highestEl = Number.NEGATIVE_INFINITY;\n let count = 0;\n\n for (let i = 0; i < ar.length; i++) {\n if (ar[i] > highestEl) {\n count = 1; highestEl = ar[i];\n } else {\n if (ar[i] === highestEl) count++;\n }\n }\n return count;\n}", "function length(arr) {\n // code\n var lengthCount = arr.length;\n return lengthCount;\n}", "function arrayNum(array) {\n for(i = 0; i <= array.length; i++) {\n //console.log(i);\n if( array[i] > 10) {\n console.log(array[i]);\n } \n } \n }" ]
[ "0.88155645", "0.87742877", "0.8772824", "0.87362367", "0.8684592", "0.86790687", "0.8675227", "0.8670105", "0.862979", "0.8606897", "0.85405385", "0.853396", "0.8526716", "0.8523648", "0.8507895", "0.84632224", "0.8434777", "0.83644706", "0.83351195", "0.8299406", "0.829411", "0.82814676", "0.81760496", "0.79303646", "0.79288554", "0.7812399", "0.75365406", "0.7261847", "0.72229993", "0.7061233", "0.68386567", "0.68380755", "0.68085337", "0.67669976", "0.6699681", "0.66208184", "0.6601885", "0.6590788", "0.657525", "0.65448385", "0.6540325", "0.64857846", "0.64564717", "0.6409362", "0.6409362", "0.63998765", "0.63760084", "0.63704693", "0.6345693", "0.62952566", "0.62609875", "0.6241656", "0.6224595", "0.61486745", "0.6121153", "0.6098298", "0.6093195", "0.6087399", "0.608536", "0.6084702", "0.6082531", "0.6080705", "0.6080574", "0.60600114", "0.604984", "0.60364735", "0.6033102", "0.6032893", "0.603042", "0.60304046", "0.60277575", "0.6018521", "0.5998155", "0.59942806", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.59902054", "0.598442", "0.5975298", "0.5971131", "0.5967839", "0.5963112", "0.59625584", "0.5962542", "0.5960268", "0.5953556", "0.5950493", "0.5936592", "0.5930407", "0.59299266", "0.59288114" ]
0.708276
29
9) Squares Given an array with multiple values, write a function that replaces each value in the array with the value squared by itself. (e.g. [1,5,10,2] will become [1,25,100,4])
function p9(){ var arr = [1,2,4,7,33,55,66,88] for(var i = 0; i < arr.length; i++){ arr[i] = arr[i]*arr[i] } console.log(arr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SQuaresSquared(arr){\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i]*arr[i];\n }\n return arr;\n}", "function squareArrayVals(arr){\n for(var i = 0; i < arr.length; i++){\n arr[i] = (arr[i] * arr[i])\n }\n return arr\n}", "function squares(arr){\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i]*arr[i];\n }\n return arr;\n}", "function squareTheValues(arr){\n for (let i=0;i<arr.length;i++){\n arr[i] = arr[i] * arr[i];\n }\n return arr;\n}", "function squares(array) {\n for (let i = 0; i < array.length; i++) {\n array[i] = array[i] * array[i];\n \n }\n return array;\n}", "function squareVal(arr) {\n for(var i = 0; i < arr.length; i++) {\n arr[i] = arr[i] * arr[i];\n }\n return arr; \n}", "function squareArrVals(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n arr[idx] = arr[idx] * arr[idx];\n }\n return arr;\n}", "function squareArrVals(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n arr[idx] = arr[idx] + arr[idx];\n }\n}", "function squaresarr(arr)\r\n{\r\n\tfor(var i=0;i<arr.length;i++)\r\n\t{\r\n\t\tarr[i]=arr[i]*arr[i];\r\n\r\n\t}\r\n\r\n\tconsole.log(\"Squaing values\",arr);\r\n}", "function square(arr){\n for(let i = 0; i < arr.length; i++){\n arr[i] *= arr[i]\n }\n}", "function squareNumbers(array) {\n\n // 3. Go over each value, squaring each value with my square function, and mapping it into a new array.\n \nconst squares = arr.map(square => Math.sqrt(square));\n return squares;\n}", "function SquareArrayVals(arr){\n}", "function squares(array) {\n return array.map(num => num ** 2);\n}", "function square(arr){\n for(var i=0; i<arr.length;i++){ \n arr[i]=arr[i]*arr[i]; \n } \n return arr;\n}", "function squareVal(arr){\n var squaredArr = []\n\n for ( var i=0; i< arr.length; i++){\n var newIndx = arr[i] * arr[i];\n \n squaredArr.push(newIndx)\n }\n \n return squaredArr \n}", "function squares(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n arr[idx] = arr[idx] * arr[idx];\n }\n console.log(arr);\n}", "function squareIt() {\n\tfor (i = 0; i < oldArray.length; i++) {\n\t\tnewArray.push(oldArray[i] * oldArray[i]);\n\t}\n}", "function arrSquare(x) {\n for (var i=0; i<x.length; i++) {\n x[i]= Math.pow(x[i],2);\n }\n return x;\n}", "function square(array){\n for (var i = 0; i < 3; i++){ // 3 or constant\n array[i] = array[i] * array[i]; // 1\n }\n return array; // 1\n}", "function squareNums(array){\r\n return array.map(toSquare);\r\n}", "function squareDance (arr) {\n var newArr = []\n for (var i = 0; i < arr.length; i++) {\n newArr[i] = arr[i] * arr[i]\n }\n return newArr\n}", "function squareTheValues(inputArray) {\n\tinputArray.map(element => {\n\t\tconsole.log(element * element);\n\t});\n}", "function squareValue(x){\n // your code here\n for(var i=1; i<x.length; i++){\n x[i]=x[i]*x[i];\n }\n return x;\n }", "function arraySquare(arr) {\n arr = [1,1,117]\n for(var x = 0; x < arr.length; x++){\n arr[x] = arr[x] * arr[x];\n }\n return arr;\n // console.log(arr);\n}", "function squareArray(iterArray) {\n for (var i = 0; i < iterArray.length; i++) {\n iterArray[i] = Math.pow(iterArray[i],2);\n }\n return iterArray;\n}", "function makeSquare(arr) {\n const squared = Array(arr.length);\n let currentSquareIndex = arr.length - 1;\n let leftPointer = 0;\n let rightPointer = arr.length - 1;\n\n while (leftPointer < rightPointer) {\n let rightSquare = arr[rightPointer] ** 2;\n let leftSquare = arr[leftPointer] ** 2;\n if (currentSquareIndex === 1) {\n squared[1] = Math.max(rightSquare, leftSquare);\n squared[0] = Math.min(rightSquare, leftSquare);\n return squared;\n }\n\n let currentSquare = Math.max(rightSquare, leftSquare)\n squared[currentSquareIndex] = currentSquare;\n if (currentSquare === rightSquare) {\n rightPointer--;\n } else {\n leftPointer++;\n }\n\n currentSquareIndex--;\n }\n}", "function squareEach(array) {\n var sum = 0;\n array.forEach(function(element) {\n var square = element * element;\n sum += square;\n });\n return sum;\n}", "function scalethearray(arr,y){\n for(var i=0;i<arr.length;i++){\n arr[i]=arr[i]*y\n }\n return arr;\n}", "function squareValues(squareArray) {\r\n var length = squareArray.length;\r\n for (var i = 0; i < length; i++) {\r\n squareArray[i] *= squareArray[i];\r\n }\r\n console.log(\"\\n\\nSquare the Values: [1, 5, 10, -2]\")\r\n console.log((squareArray))\r\n}", "function sumsq(array) {\n return array.reduce((acc, cur) => {\n return acc + cur ** 2;\n }, 0);\n}", "function squaredItself(arr) {\n var squaredIndex = [];\n for (var i = 0; i <= arr.length; i++) {\n squaredIndex = arr.map(i => i * i);\n }\n return squaredIndex;\n}", "function squareNums(numbers) {\n\n numbers = numbers.map(num => num * num);\n return numbers;\n}", "function squareSum(arr){\n var squared = arr.map(function(x){return x*x;});\n var sum = 0;\n for(var i=0; i<squared.length; i++){\n sum = sum+squared[i]; \n }\n return sum;\n}", "function computeSumOfSquares(arr) {\n\n // let sum = 0;\n // arr.forEach(function (item) {\n // sum += Math.pow(item, 2);\n // })\n // return sum;\n\n return arr.map(n => n * n).reduce((r1, r2) => r1 + r2)\n}", "square(arr) {\n let ret = [];\n\n for (var i = 0, len = arr.length; i < len; i++) {\n ret.push(arr[i] * arr[i]);\n }\n\n return ret;\n }", "function squareOrSquareRoot(array) {\n return array.map(x => Math.pow(x, 1/2) % 1 ? Math.pow(x, 2) : Math.pow(x, 1/2)); \n}", "function sumsq(arr) {\n var arr = [2,4,5,7,10];\n var sum = 0;\n var i, iLen;\n \n for (i = 0, iLen = arr.length; i < iLen; i++) {\n sum += arr[i] * arr[i];\n }\n document.getElementById(\"ans4\").innerHTML = \"The sum of squares of the elements of array is...\" +sum;\n}", "function squareArr(arr){\n var newarr = [];\n for(var i = 0; i < arr.length; i++){\n newarr.push(arr[i]*arr[i]);\n }\n console.log(newarr);\n}", "function double(array) {\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tarray[i] *= 2;\r\n\t}\r\n}", "function squareSum(numbers) {\n\t// return numbers.map((element) => element ** 2).reduce((prev, next) => prev + next, 0);\n\treturn numbers.reduce((prev, next) => prev + next ** 2, 0);\n}", "function arrNumSq() {\n const arr = [1, 2, 3, 4, 5];\n return arr.map((val) => {return Math.pow(val, 2)});\n}", "function squareSum(numbers) {\n\tvar i = 0;\n\tvar sum = 0;\n\twhile(i < numbers.length) {\n\t\tsum = sum + (numbers[i] * numbers[i]);\n\t\ti++;\n\t}\n\treturn sum;\n}", "function squareDance (arr){\n var squared = []\n for ( let i in arr){\n squared.push(Math.pow(arr[i], 2))\n }\n return squared\n}", "function double(arr){\n for (i=0; i<arr.length; i++){\n arr[i] = arr[i]*2\n }\n return arr\n}", "function mapNumsToSquares(num) {\n let squaredArray = [];\n\n for (let index = 0; index < num.length; index += 1) {\n squaredArray.push(num[index] * num[index]);\n }\n\n return squaredArray;\n}", "function squareSum(numbers){\n let sum = 0,\n i = numbers.length;\n while (i--) \n sum += Math.pow(numbers[i], 2);\n return sum;\n}", "function squareSum(numbers) {\n\treturn numbers.map((ele) => ele ** 2).reduce((prev, next) => prev + next, 0);\n}", "function squareEvenNumbers(array) {\n // TODO: Use at least 1 .reduce,\n // square ONLY the even numbers\n // & push the results into the return array\n return array.reduce(function(arr, num) {\n if (num % 2 == 0) arr.push(num * num);\n return arr;\n }, []);\n}", "function nine(arr){\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i] * arr[i]; \n }\n return arr;\n}", "function doubleArrayValues(array) {\n for (let i = 0; i < array.length; i++) {\n array[i] *= 2;\n }\n return array;\n}", "function double(arr) {\n\n for (var i=0;i<arr.length;i++) {\n arr[i] = arr[i]*2;\n }\n return arr;\n }", "function squareSum(numbers){\n var result = 0;\n for (var i = 0; i < numbers.length; i++) {\n var n = numbers[i];\n result = result + (n * n);\n }\n return result;\n}", "function scale(arr, num){\n for (var i = 0; i < arr.length; i++){\n arr[i] *= num;\n }\n return arr;\n}", "function scaleArr(arr, num){\n for(var i = 0; i < arr.length; i++)\n arr[i] *= num;\n return arr;\n}", "function scaleArray(arr, num){\n for(var i = 0; i < arr.length; i++){\n arr[i] *= num\n }\n return arr\n}", "function scaleArr(arr) {\n\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i] * num;\n }\n return arr;\n}", "function squareSum(numbers){\n let sum = 0;\n for(let i = 0; i < numbers.length; i++) {\n sum += numbers[i] ** 2;\n }\n return sum;\n}", "function multiplyByTwo(arr) {\n arr = arr.map(function (a) {\n return a*2;\n })\n return arr;\n}", "function ScaleA(arr, num){\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i] * num;\n }\n console.log(arr);\n}", "function doubleArrayValues(array) {\n for (let i = 0; i < array.length; i++) {\n array[i] *= 2;\n }\n return array;\n}", "function sumOfSquares(numbers) {\n return numbers.reduce(function(accumulator, number) {\n return accumulator + number * number;\n }, 0);\n}", "function squareSum(numbers){\n let arr =[];\n for (let i = 0; i < numbers.length; i++) {\n arr.push(numbers[i] * numbers[i])\n }\n return arr.length > 1 ? arr.reduce((a, b) => a + b) : 0\n}", "function square(numbersq) {\n return numbersq * numbersq;\n}", "function double(arr){\n var newArr = [];\n for(var i = 0; i < arr.length; i ++){\n newArr.push(arr[i]*2);\n }\n return newArr;\n}", "function multiplyValues(array) {\n var result=1;\n for (let value of array) {\n result *= value;\n }\n return result;\n}", "function scaleArr(arr, num){\n return arr.map(x => x * num)\n}", "function doubleArrayValues(array) {\n for (let i = 0; i < array.length; i++) {\n array[i] *= 2;\n }\n return array;\n}", "function doubleArrayValues(array) {\n for (let i=0; i<array.length; i++) {\n array[i] *= 2;\n }\n return array;\n}", "function doubleArrayValues(array) {\n for (let i=0; i<array.length; i++) {\n array[i] *= 2;\n }\n return array;\n}", "function scale(arr,num){\n for(var i = 0; i < arr.length; i++){\n arr[i] = arr[i] * num\n }\n console.log(arr)\n}", "function double(arr){\n newArr = []\n for (let i = 0; i < arr.length; i++){\n newArr.push(arr[i]*2)\n }\n return newArr\n}", "function squareSum(numArr){\n let squareArr = numArr.map(x => x ** 2)\n let sum = squareArr.reduce(function(a, b) {\n return a + b\n }, 0)\n return sum\n }", "function squareSum(numbers){\n return numbers.reduce((s, e) => s + Math.pow(e, 2), 0)\n}", "function scaleTheArray(arr, num) {\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i] * num;\n }\n return arr;\n}", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function multiplyAll(array) {\n var result = 1;\n for (var i = 0; i < array.length; i++) {\n result *= array[i];\n }\n return result;\n}", "function squaresOnly(arr) {\n return arr.filter(num => Number.isInteger(Math.sqrt(num)));\n}", "function scaleArray(arr, num){\n for(let i = 0; i<arr.length; i++){\n arr[i] = arr[i]*num\n }\n return arr\n}", "function squareTheNumbers(numbers) {\n const squares = [];\n for (let num of numbers) {\n square = num ** 2;\n squares.push(square)\n }\n return squares;\n}", "function doubleArrayValues(array) {\n for (let i = 0; i < array.length; i++) {\n array[i] *= 2;\n }\n return array;\n }", "function square(array) {\n //Write your code here\n}", "function scaleArray(arr,num){\n for( var i=0;i<arr.length;i++){\n arr[i]=arr[i]*num;\n }\n return arr;\n}", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function sumsqr(values) {\n var _sumsqr = 0;\n for (var i = 0, len = values.length; i < len; i++) {\n var num = values[i];\n _sumsqr += (num * num);\n }\n return _sumsqr;\n }", "function multTwo(array){\n return array.map((value) => value *2)\n }", "function sumOfSquares(numbers) {\n return numbers.reduce((accumulator, number) => {\n return accumulator + number * number;\n }, 0);\n}", "function getmultiplied(arr)\r\n{\r\n for (let i = 0; i < arr.length; i++)\r\n arr[i]=arr[i]*2\r\n return arr;\r\n}", "function sumsqr(values) {\n\t var _sumsqr = 0;\n\t for (var i = 0, len = values.length; i < len; i++) {\n\t var num = values[i];\n\t _sumsqr += (num * num);\n\t }\n\t return _sumsqr;\n\t }", "function sumsqr(values) {\n\t var _sumsqr = 0;\n\t for (var i = 0, len = values.length; i < len; i++) {\n\t var num = values[i];\n\t _sumsqr += (num * num);\n\t }\n\t return _sumsqr;\n\t }", "function double(arrayx) {\n arrayx = arrayx.map(x => x * 2 );\n return arrayx;\n }", "function sqNum(number){\n let arr = number;\n const square_it = (element) => element ** 2;\n arr = number.map(square_it);\n console.log(arr);\n //console.log(number);\n }", "function double(array) {\n var returnArray;\n for (index = 0; index < a.length; ++index) {\n returnArray[0] = array[0]*2;\n }\n return returnArray;\n}" ]
[ "0.8130761", "0.78821343", "0.7824325", "0.7817531", "0.77919346", "0.77744603", "0.7734327", "0.7673395", "0.7530698", "0.7527638", "0.7424121", "0.7419324", "0.7408079", "0.7399192", "0.7378144", "0.735342", "0.7272865", "0.72574", "0.7237682", "0.7193447", "0.7173531", "0.7172548", "0.71594834", "0.71472454", "0.701564", "0.6946938", "0.6909122", "0.6906532", "0.687978", "0.68360305", "0.68354744", "0.6817556", "0.6778769", "0.6777654", "0.6730523", "0.67137915", "0.6701215", "0.6645085", "0.6602737", "0.66025954", "0.66012126", "0.6579237", "0.6559041", "0.6538792", "0.6497299", "0.6482135", "0.6451623", "0.6427096", "0.64168257", "0.63843435", "0.6384045", "0.6382032", "0.6380425", "0.63604414", "0.63528067", "0.63450897", "0.6338168", "0.633544", "0.6324805", "0.6323556", "0.6313034", "0.63028264", "0.6292689", "0.62729585", "0.62713355", "0.62613136", "0.6259135", "0.6254304", "0.6254304", "0.6251696", "0.62443066", "0.62414736", "0.62386733", "0.62168795", "0.62168086", "0.62167513", "0.6216739", "0.62112087", "0.6207417", "0.62035316", "0.6196953", "0.61841863", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61825573", "0.61823446", "0.61705947", "0.6165373", "0.6157084", "0.6157084", "0.61455274", "0.61372644", "0.61345655" ]
0.0
-1
10) Negatives Given an array with multiple values, write a function that replaces any negative numbers within the array with the value of 0. When the program is done the array should contain no negative values. (e.g. [1,5,10,2] will become [1,5,10,0])
function p10(){ var arr = [-9,-10,12,3,-32,100,-1998] for(var i = 0; i < arr.length; i++){ if(arr[i] < 0){ arr[i] = 0 } } console.log(arr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function negatives(array) {\n for (let i = 0; i < array.length; i++) {\n if(array[i] < 0) { \n array[i] = 0;\n }\n }\n return array;\n}", "function replaceNeg(arr){\n for(var i=0; i<arr.length; i++){\n if(arr[i]<0){\n arr[i]=0\n }\n }return arr\n}", "function negatives(arr) {\n for (var i=0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n }\n return arr;\n}", "function zeroOutNegativeNums(arr){\n for (let i =0; i<arr.length;i++){\n if (arr[i] < 0) {\n arr[i] = 0; \n }\n }\n return arr;\n}", "function noNeg(arr) {\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] < 0)\n arr[i] = 0;\n }\n return arr; \n}", "function neg(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr;\n}", "function negativevalues(arr)\r\n{\r\n\tfor(var i=0;i<arr.length;i++)\r\n\t{\r\n\t\tif (arr[i]<0)\r\n\t\t{\r\n\t\t\tarr[i]=0;\r\n\t\t}\r\n\t}\r\n\r\n\t\tconsole.log (\"Removing negatives\",arr);\r\n}", "function replaceWithZero(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr;\n}", "function zeroNegVals(arr){\n for(var i = 0; i < arr.length; i++){\n if (arr[i] < 0){\n arr[i] = 0\n }\n }\n return arr\n}", "function zeroOutArrayNegativeVals(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0\n }\n }\n return arr\n}", "function negativeNumbers (arr){\n for (var i=0; i<arr.length; i++){\n if(arr[i]<0){\n arr[i]=0;\n }\n }\n\n return arr;\n}", "function zeroOutNegativeNumbers(inputArray) {\n\tfor (let i = 0; i < inputArray.length; i++) {\n\t\tif (inputArray[i] < 0) {\n\t\t\tinputArray[i] = 0;\n\t\t}\n\t}\n\tconsole.log(inputArray);\n}", "function noNegatives(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < 0) {\n arr[idx] = 0;\n }\n }\n console.log(arr);\n}", "function zeroOutArrayNegativeVals(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < 0) {\n arr[idx] = 0;\n }\n }\n return arr;\n}", "function negToZero(iterArray) {\n for (var i = 0; i < iterArray.length; i++) {\n if (iterArray[i] < 0 ) {\n iterArray[i] = 0;\n }\n }\n return iterArray;\n}", "function replaceNegNum(arr) {\n var negNum = arr.map(function(elem){\n if (elem<0){\n elem = 0;\n }\n return elem;\n });\n return negNum; \n}", "function ZeroOutArrayNegativeVals(arr){\n}", "function negativeValues(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n console.log(arr); //or: return arr;\n}", "function arraynegativo(x){\n for(var i=0; i<x.length ; i++){\n if(x[i] >0 ){\n x[i] = x[i] * -1;\n }\n }\n return x\n}", "function removeNegatives (array) {\n if(!(array instanceof Array)) {return 'Please pass an array.'};\n let copyTo;\n let negativeCount = 0;\n for (var i = 0; i < array.length; i++) {\n if (array[i] < 0) {\n negativeCount++;\n copyTo = i;\n break;\n };\n };\n if (negativeCount > 0) {\n for (let j = i + 1; j < array.length; j++) {\n if (array[j] < 0) {\n negativeCount++;\n } else {\n array[copyTo] = array[j];\n copyTo++;\n };\n };\n array.length -= negativeCount;\n };\n return array;\n}", "function func10(inputArray){\n for(var i=0; i<inputArray.length; i++){\n if(inputArray[i]<0){\n inputArray[i]=0;\n }\n }\n return inputArray;\n}", "function negNone(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n document.getElementById(\"1\").innerHTML = arr;\n return arr;\n}", "function replaceNegative(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Negative\"\n }\n }\n console.log(arr);\n}", "function negative(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] *= -1;\n }\n }\n return arr\n}", "function delNegativeNumbers(zeroArr) {\r\n var length = zeroArr.length;\r\n for (var i = 0; i < length; i++) {\r\n if (zeroArr[i] < 0) {\r\n zeroArr[i] = 0\r\n }\r\n }\r\n console.log(\"\\n\\nZero Out Negatives: [1, 5, 10, -2]\")\r\n console.log((zeroArr))\r\n}", "function noNeg(arr){\n var positiveArr = []\n\nfor ( var i=0; i< arr.length; i++){\n if(arr[i] < 0){\n var newInd = arr[i] * 0;\n \n positiveArr.push(newInd);\n } else {\n positiveArr.push(arr[i]) \n }\n }\n \nreturn positiveArr\n}", "function zeroOutNegArrayVals(arr) {\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr.length; j++) {\n if (arr[i][j] < 0) {\n arr[i][j] = 0\n }\n }\n }\n console.log(arr)\n}", "function outlookNegative(array){\n let newArray = [];\n for(let i = 0; i < array.length; i++){\n // if(array[i] > 0){\n // newArray.push(array[i] * -1);\n // } else {\n // newArray.push(array[i]);\n // }\n newArray.push(array[i] > 0 ? -array[i] : array[i]);\n }\n return newArray;\n}", "function Negativa(x) {\n for (i = 0; i < x.length; i++) {\n x[i] = x[i] * -1;\n if (x[i] > 0) {\n x[i] = x[i] * -1;\n }\n }\n return (x);\n\n}", "function zeroOut(arr) {\n var newArray2 = [];\n for (var i = 0; i <= arr.length - 1; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n newArray2.push(arr[i]);\n\n }\n return newArray2;\n\n}", "function outlookNegative(arr){\n var newArr = []\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > 0){\n newArr.push(arr[i] * -1)\n }else{\n newArr.push(arr[i])\n }\n }\n return newArr\n}", "function mapToNegativize(arr){\n return arr.map(x => x * -1)\n\n}", "function ten(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr; \n}", "function arrNegative(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n var a = 2 * arr[i];\n arr[i] -= a;\n }\n }\n return arr;\n}", "function negative(arr){\n let newArr=[]\n for (let i = 0; i < arr.length; i++){\n if (arr[i] > 0){\n newArr.push(arr[i]*-1)\n }\n else {\n newArr.push(arr[i])\n }\n }\n return newArr\n}", "function negativeArray(arr){\n var newarr = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > 0){\n arr[i] = arr[i] - arr[i] * 2;\n newarr.push(arr[i]);\n }\n else{\n arrnew.push(arr[i]);\n }\n }\n return newarr;\n}", "function negativos(array) {\n var newArray = [];\n for (var i = 0; i < array.length; i++) { \n if(array[i] > 0){\n newArray.push(array[i]*-1);\n }\n else{\n newArray.push(array[i]);\n }\n }\n\n return newArray;\n}", "function negative(arr) {\n var newArr = [];\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] > 0) {\n newArr[i] = arr[i] - arr[i] * 2;\n }else{\n newArr[i] = arr[i];\n }\n \n }\n return newArr;\n}", "function mapToNegativize(sourceArray) {\n\n // return sourceArray.map(el =>\n // el * -1\n // )\n let newArray=[]\n sourceArray.forEach (el =>\n\n newArray.push(el * -1)\n )\nreturn newArray\n}", "function noNegs(x) {\n for (var i=0; i<x.length; i++) {\n if (x[i]<0) {\n x[i]=0;\n }\n }\n return x;\n}", "function multiplyPositiveElementsInArray(arr) {\n \n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n arr[i] = arr[i] * 2;\n }\n }\n return arr;\n}", "function noNegativesDojo(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < 0) {\n arr[idx] = \"Dojo\";\n }\n }\n console.log(arr);\n}", "function outlookNetative(array) {\n var allNegative = [];\n\n for (var i in array) {\n if (array[i] > 0) {\n allNegative[i] = array[i] * -1;\n } else {\n allNegative[i] = array[i];\n }\n }\n return allNegative;\n}", "function makeNegative(numbers) {\n // numbers.map(function(num, index, array){ });\n // don't need index or array. \n // numbers.map(function(num){ });\n //map will return a new array. That's the end goal. So we don't need the variable \n return numbers.map(function(num){\n // if(num > 0){\n // num *= -1;\n // // same as num = num * -1;\n // }\n // return num; \n // or we can\n return Math.abs(num) * -1; \n });\n\n}", "function outlookNegative(arr) {\n\tvar newArr = [];\n\tnum = 0;\n\n\tfor (var num = 0; num < arr.length; num++) {\n\t\tif (arr[num] > 0) {\n\t\t\tnewArr.push(arr[num] * -1);\n\t\t} \n\t\telse {\n\t\t\tnewArr.push(arr[num]);\n\t\t}\n\t}\n\n\tconsole.log(newArr);\n\treturn newArr;\n}", "function removeZeros(array) {\n\tfor (let i = 0; i <array.length-1; i++) {\n if (array[i] == 0) {\n array.splice(i, 1);\n //josharray[i] = '*';\n }\n\t\n}\nfor (let i = 0; i < array.length;i++) {\n if (array[i] === 0) {\n array[i] = '*';\n }\n}\nreturn array;\n}", "function bePositive(arr){\nvar positiveArr = []\n\nfor ( var i=0; i< arr.length; i++){\n if(arr[i] < 0){\n var newInd = arr[i] * -1;\n \n positiveArr.push(newInd);\n } else {\n positiveArr.push(arr[i]) \n }\n }\n \nreturn positiveArr\n}", "function SwapStringForNegativesValues(arr){\n for(let i=0;i<arr.length;i++){\n if (arr[i] <= 0){\n arr[i] = \"Dojo\";\n }\n }\n console.log(arr)\n}", "function OutNeg(arr){\n var newarr = [];\n var temp = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n temp = -Math.abs(arr[i]);\n newarr.push(temp);\n } else newarr.push(arr[i])\n }\n console.log(newarr);\n}", "function makePositive(array) {\n\tfunction positive(n){\n\t\tif(typeof n===\"number\"){\n\t\t\tif(n<0){\n\t\t\t\tn=-n;\n\t\t\t}\n\t\t}\n\t\treturn n;\n\t}\n\treturn array.map(positive);\n}", "function swapStringForNegativeArrayValues(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\"\n }\n }\n return arr\n}", "function realRemoveZeros(array) {\n const head = [];\n const tail = [];\n for (const e of array) {\n if (e === 0 || e === \"0\") {\n tail[tail.length] = e;\n } else {\n head[head.length] = e;\n }\n }\n return [...head, ...tail];\n}", "function invert(array) {\n\t//return array.map((element) => (element === 0 ? element : -element));\n\treturn array.map((element) => -element);\n}", "function zero_negativity(arr){\n for (let i = 0; i < arr.length; i++) {\n if(arr[i] < 0){\n return false;\n }\n }\n return true;\n}", "function zeroArray(arr) {\n\tarr.forEach(function(v) {\n\t\tv = 0;\n\t});\n}", "function removeZeros(arr) {\n return arr.filter((x) => x);\n}", "function negit(arr){\n newArr = [];\n for(e in arr){\n if(arr[e] <= 0){\n newArr[e] = arr[e];\n } else{\n newArr[e] = arr[e]*-1;\n }\n }\n return newArr;\n}", "function removeZeros(array) {\n\tlet flag=[]\n\tlet i;\n\tfor(i=0;i<array.length;i++){\n\t\tif(array[i]!==0){\n\t\t\tflag.push(array[i]);\n\t\t\t\n\t\t}\telse if(flag[(flag.length-1)]!==\"*\"){\n\t\t\tflag.push(\"*\");\n\t\t}\n\t\t\n\t\t}\t\n\t\treturn flag;\n\t}", "function zero_negativity(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n return false;\n }\n }\n return true;\n}", "function makePositive(array) {\n let temparr =[]; // My container array\n for (let element of array) {\n\t\t\n \n\t if(typeof element!=='number'){\n\t\ttemparr.push(element);\n\t} else {\n\t\ttemparr.push(Math.abs(element));\n\t}\n\t\t}\n \n \n return temparr;\n}", "function multiplies(array) {\n var newArray = []\n for (var i = 0; i < array.length; i++) {\n if (array[i] <= 0) {\n newArray[i] = array[i]\n } else {\n newArray[i] = array[i] * 2\n }\n }\n return newArray\n}", "function onlyNegativeNumbers(arrayOfNegative){\n // returns the positive numbers in an array\n var onlyNeg = [];\n for (let i = 0; i < arrayOfNegative.length; i++) {\n if (arrayOfNegative[i] < 0){\n onlyNeg.push(arrayOfNegative[i]);\n }\n }\n return onlyNeg;\n}", "function arrayNo(arr) {\n let positive = [];\n for (let i = 0; i < arr.length; i++) {\n let no = arr[i];\n if (no < 0) {\n break;\n }\n else {\n positive.push(no);\n }\n\n }\n return positive;\n\n}", "function zero_negativity(arr) {\n ret = true;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n ret = false;\n break;\n }\n }\n return ret;\n}", "function countPositivesAndReplace(array) {\n var positivesCounter = 0;\n\n for (var num in array) {\n if (array[num] > 0) {\n positivesCounter++;\n }\n }\n \n array[array.length - 1] = positivesCounter;\n return array;\n}", "function moveZeroes(array){\n let temp;\n for(let i = array.length - 1; i>=0; i--){\n if(array[i] != 0){\n temp = array[i];\n array[i] = array[0];\n array[0] = temp; \n }\n }\n return array;\n}", "function multPositive(array){\n newArray = [];\n for( i=0; i<array.length; i++){\n if (array[i] > 0) {\n newArray[i] = array[i]*2\n }\n else {\n newArray[i] = array[i];\n }\n }return newArray\n}", "function perspectiva(arrayNegativo) {\n for (let i = 0; i < arrayNegativo.length; i++) {\n if ( arrayNegativo[i] < 0 ) {\n console.log(\"Encontrado Negativo: \", arrayNegativo[i])\n } else {\n console.log(\"Encontrado Positivo: \", arrayNegativo[i])\n arrayNegativo[i] = arrayNegativo[i] * -1\n }\n }\n for (let x = 0; x < arrayNegativo.length; x++) {\n console.log(\"Posicion en el Array #[\"+(x)+\"]: \", arrayNegativo[x]) \n }\n return arrayNegativo\n}", "function positive(arr) {\n var pos = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n pos++;\n }\n (arr[arr.length - 1]) = pos;\n }\n return arr;\n}", "function positives(arr) {\n let result = [];\n each(arr, function(num) {\n Math.sign(num) ? result.push(num) : undefined;\n })\n return result;\n}", "function makeNegative(numbers) {\n var negs = []; \n for (var i = 0; i < numbers.length; i++) {\n var neg = Math.abs(numbers[i]) * -1; \n negs.push(neg);\n }\n return negs; \n}", "function numberToString(array) {\n for (let i = 0; i < array.length; i++) {\n if(array[i] < 0){\n array[i] =\"DOJO\";\n }\n \n }\n return array;\n}", "function moveZeros(arr){\n for (var i = 0; i < arr.length; i++){\n if (arr[i]===0){\n arr.splice(i,1);\n arr.push(0)\n }\n }\n return arr;\n}", "function getPositiveNum(array) {\n return array.filter(num => num >= 0)\n}", "function swapString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Negative Value'\n }\n }\n return arr\n}", "function zero_negativity(arrIn){\n let returnBool = true;\n for (var i = 0; i < arrIn.length; i ++){\n if (arrIn[i] < 0) { returnBool = false};\n }\n return returnBool;\n}", "function moveZeros(array){\n var newArray = [];\n\n for(let i = 0; i<array.length; i++){\n if(array[i] === 0){\n array.splice(i,1)\n newArray.push(0)\n i--\n } \n }\n return array.concat(newArray);\n}", "function removeZeroValues() {\n\t\n\n\tvar removeItem = 0;\n\n\tinputDigits = jQuery.grep(inputDigits, function(value) {\n\t return value != removeItem;\n\t});\n}", "function sumPositive(array) {\n let array2 = [];\n for(val of array) {\n if(val > 0) {\n array2.push(val);\n }\n }\n return array2;\n}", "function swapNegativeWithString(arr) {\n for (var k = 0; k < arr.length; k++) { // Loop through each element in the array\n if (arr[k] < 0) { // If this current element is negative, replace with string\n arr[k] = 'Dojo';\n }\n }\n}", "static allowNegative(array) {\n // From https://github.com/sindresorhus/negative-array\n return new Proxy(array, {\n get(target, name, receiver) {\n if (typeof name !== 'string') {\n return Reflect.get(target, name, receiver);\n }\n\n const index = Number(name);\n\n if (Number.isNaN(index)) {\n return Reflect.get(target, name, receiver);\n }\n\n return target[index < 0 ? target.length + index : index];\n },\n\n set(target, name, value, receiver) {\n if (typeof name !== 'string') {\n return Reflect.set(target, name, value, receiver);\n }\n\n const index = Number(name);\n\n if (Number.isNaN(index)) {\n return Reflect.set(target, name, value, receiver);\n }\n\n target[index < 0 ? target.length + index : index] = value;\n return true;\n }\n\n });\n }", "static allowNegative(array) {\n // From https://github.com/sindresorhus/negative-array\n return new Proxy(array, {\n get(target, name, receiver) {\n if (typeof name !== 'string') {\n return Reflect.get(target, name, receiver);\n }\n\n const index = Number(name);\n\n if (Number.isNaN(index)) {\n return Reflect.get(target, name, receiver);\n }\n\n return target[index < 0 ? target.length + index : index];\n },\n set(target, name, value, receiver) {\n if (typeof name !== 'string') {\n return Reflect.set(target, name, value, receiver);\n }\n\n const index = Number(name);\n\n if (Number.isNaN(index)) {\n return Reflect.set(target, name, value, receiver);\n }\n\n target[index < 0 ? target.length + index : index] = value;\n\n return true;\n }\n });\n }", "function reArrange(arr) {\n let neg = [],\n pos = []\n for (let num of arr) {\n if (num < 0) {\n neg.push(num)\n } else {\n pos.push(num)\n }\n }\n return [...neg, ...pos];\n}", "function zero_negativity(arr){\n if(Array.isArray(arr)){\n for(let i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n console.log(\"Your input is an array, but there is a negative with index \" + i + \", and it has a value of \" + arr[i] + \".\");\n return false;\n }\n }\n console.log(\"Your input is an array and no negatives were found.\");\n return true;\n }\n else{\n console.log(\"Your arguement is not an array. Please only use an array.\");\n };\n return false;\n}", "function swapStrNegatives(strArr) {\r\n var length = strArr.length;\r\n for (var i = 0; i < length; i++) {\r\n if (strArr[i] < 0) {\r\n strArr[i] = \"Dojo\"\r\n }\r\n }\r\n console.log(\"\\n\\nSwap String for Negatives: [1, -5, 10, -2]\")\r\n console.log((strArr))\r\n}", "function negate(arrayEntered) {\n let result = [];\n for (let i = 0; i < arrayEntered.length; i++) {\n result.push(arrayEntered[i] * -1);\n }\n return result;\n}", "function countPositives(array){\n let positiveCount = 0;\n for(var i = 0; i < array.length; i++){\n if(array[i] > 0){\n positiveCount++;\n }\n array[array.length - 1] = positiveCount;\n }\n return array;\n}", "function p13(){\n var arr = [-9,-10,12,3,-32,100,-1998]\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\"\n }\n }\n console.log(arr)\n}", "function wipe(array) {\n // Right now it's similar to array.fill(0). If it turns\n // out that runtimes optimize this call away, maybe\n // we can try something else.\n for (let i = 0; i < array.length; i++) {\n array[i] = 0;\n }\n return array;\n}", "function moveNegToLeft(arr){\n\n let j=0\n let temp;\n for(let i=0;i<arr.length;i++){\n if(arr[i]<0){\n temp = arr[i];\n arr[i]= arr[j];\n arr[j]= temp;\n j++;\n \n }\n }\n \n return j;\n}", "function sortPosKeepNeg(array){\n var index = []\n var posNum = []\n for (var i = 0; i <array.length; i++){\n if (array[i] >= 0){\n index.push(i)\n posNum.push(array[i])\n }\n }\n posNum = posNum.sort()\n for (var j = 0; j < index.length; j++){\n array[index[j]] = posNum[j]\n }\n return array\n}", "function moveZeroes(nums) {\n let current = 0;\n for (let i = 0; i < nums.length; i++) {\n if (nums[i] !== 0) {\n nums[current] = nums[i];\n current++;\n }\n }\n\n for (let j = current; j < nums.length; j++) {\n nums[j] = 0;\n }\n return nums;\n}", "function filterNegativeNum(nums) {\n return nums.filter(function(num) {\n //=== return nums.filter((number) => {\n return num < 0; //=== return nums.filter(num => num < 0);\n });\n}", "function multiplies_positive_elements(a) {\n var res = [];\n var i;\n\n for (i = 0; i < a.length; i++) {\n if (a[i] > 0) {\n res[i] = a[i] * 2\n } else {\n res[i] = a[i]\n }\n }\n\n return res;\n}", "function negativeOrPositiveNumbers(arr) {\n\tres = [];\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] < 0) {\n\t\t\tres.unshift(arr[i]);\n\t\t} else {\n\t\t\tres.push(arr[i]);\n\t\t}\n\t}\n\treturn res;\n}", "function positiveNumbers(posArray) {\n\n}", "missingNumber(arr, n) {\n //Move all negative to left side of the array\n let k = 0;\n for (let i = 0; i < n; i++) {\n if (arr[i] <= 0) {\n [arr[k], arr[i]] = [arr[i], arr[k]];\n k++;\n }\n }\n }", "function removeNegativeValues(data) {\n x = data.x;\n y = data.y;\n\n for (let x_index = 0; x_index < x.length; x_index++) {\n if (y[x_index] < 0) {\n data.x.splice(x_index, 1);\n data.y.splice(x_index, 1);\n x_index--\n }\n }\n\n return data\n}", "function validValues(arr) {\r\n var newArr = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (arr[i] < 0 || arr[i] > 0) {\r\n newArr.push(arr[i]);\r\n }\r\n }\r\n return newArr;\r\n}", "function moveZeros(arr) {\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (arr[i] === 0) {\n\t\t\tarr.push(arr[i]);\n\t\t\tarr.splice(i, 1);\n\t\t}\n\t}\n\treturn arr;\n}" ]
[ "0.86403114", "0.86280984", "0.8492917", "0.84445477", "0.840872", "0.83871174", "0.83700716", "0.836258", "0.8332362", "0.83158", "0.8283551", "0.82716215", "0.8217308", "0.81506956", "0.8114748", "0.8097823", "0.79903525", "0.79620814", "0.79329264", "0.79055554", "0.7835043", "0.7710429", "0.768562", "0.7637832", "0.7621783", "0.7606687", "0.7534713", "0.74613774", "0.745525", "0.7410922", "0.73549074", "0.73458624", "0.7333285", "0.721471", "0.7212945", "0.7192869", "0.7177429", "0.7156882", "0.7128692", "0.7109863", "0.70775855", "0.70762795", "0.6989843", "0.6984297", "0.6969108", "0.6929312", "0.69195193", "0.6869267", "0.68263584", "0.6817936", "0.6814256", "0.67793036", "0.6731575", "0.6723438", "0.6718201", "0.67176306", "0.66884696", "0.6683082", "0.6679874", "0.665949", "0.6643704", "0.6605927", "0.65862197", "0.65747666", "0.65734833", "0.6560843", "0.6554353", "0.6530578", "0.65205145", "0.65080154", "0.65000254", "0.64606386", "0.6413699", "0.6409203", "0.6403835", "0.63987607", "0.63943183", "0.63882935", "0.6362915", "0.63462657", "0.6333849", "0.63301647", "0.63222945", "0.6305555", "0.6301397", "0.6293305", "0.62739986", "0.62722516", "0.6262599", "0.6246909", "0.62376904", "0.6228712", "0.6222653", "0.621665", "0.6184585", "0.6175348", "0.6166173", "0.6163557", "0.61615056", "0.6159082" ]
0.76180744
25
11) Max/Min/Avg Given an array with multiple values, write a function that returns a new array that only contains the maximum, minimum, and average values of the original array. (e.g. [1,5,10,2] will return [10,2,3.5])
function p11(){ var arr = [1,3,2,-4,3,5,4,6,-5,7,6,88,77,-99,88,90,-10]; var max = 0; var min = arr[0] var avg = 0; for(var i = 0; i < arr.length; i++){ if(arr[i] > max){ max = arr[i] } if(arr[i] < min){ min = arr[i] } avg += arr[i] } avg = avg/arr.length var newArr = [max, min, avg] console.log("Original Array: [" + arr + "]") console.log("Max/Min/Avg: [" + newArr + "]") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxMinAvg(arr) {\n var max = arr[0];\n var min = arr[0];\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n if (arr[i] < min) {\n min = arr[i];\n }\n sum = sum + arr[i];\n }\n var avg = sum / arr.length;\n var arrnew = [max, min, avg];\n return arrnew;\n}", "function maxMinAvg(arr) {\n var newArr = [];\n var sum = 0;\n arr.map(function (elem) {\n sum = sum + elem;\n });\n newArr.push(Math.max.apply(null, arr));\n newArr.push(Math.min.apply(null, arr));\n newArr.push(sum / arr.length);\n return newArr;\n}", "function maxMinAvg(arr) {\n var sum = 0;\n var max = arr[0];\n var min = arr[0];\n for (var idx = 0; idx < arr.length; idx++) {\n sum = sum + arr[idx];\n if (arr[idx] > max) {\n max = arr[idx];\n } else if (arr[idx] < min) {\n min = arr[idx];\n }\n }\n var newArr = [];\n newArr.push(max);\n newArr.push(min);\n var avg = sum / arr.length;\n newArr.push(avg);\n\n return newArr;\n}", "function maxMinAvg(arr) {\n var max = arr[0];\n var min = arr[0];\n var sum = arr[0];\n var result = [];\n for (var i=1; i < arr.length; i++) {\n sum += arr[i];\n if (arr[i] > max) {\n max = arr[i];\n } else if (arr[i] < min){\n min = arr[i];\n }\n }\n result.push(max);\n result.push(min);\n result.push(sum / arr.length);\n return result;\n}", "function maxMinAvg(arr){\n var max = arr[0];\n var min = arr[0];\n var avg = 0;\n var output = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n }\n if(arr[i] < min){\n min = arr[i];\n }\n avg += arr[i];\n }\n output.push(max);\n output.push(min);\n output.push(avg/arr.length);\n return output;\n}", "function minMaxAvg(arr){\n var avg=0;\n var min=arr[0];\n var max=arr[0];\n for(var i=0;i<arr.length;i++){\n avg+=arr[i];\n if (arr[i]>max){\n max=arr[i];\n }\n else if(min>arr[i]){\n min=arr[i]\n }\n }\n return [min,max,avg/arr.length];\n}", "function maxMinAvg(arr){\n var max = arr[0];\n var minim = arr[0];\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n avg += arr[i];\n if(max < arr[i]){\n max = arr[i];\n }\n else{\n minim = arr[i];\n }\n }\n var combined = [max,minim,avg];\n return combined;\n}", "function maxMinAvg(array) {\n var min = 99;\n var max = 0;\n var sum =0;\n var count = array.length;\n var newArr =[];\n for (let i = 0; i < array.length; i++) {\n sum += array[i];\n if (array[i] < min) {\n min = array[i];\n } else if (array[i] > max) {\n max = array[i];\n }\n \n }\n newArr.push(max);\n newArr.push(min);\n newArr.push(sum/count);\n\n return newArr;\n\n}", "function arrMinMaxAvg(x) {\n var min, max;\n min = max = x[0];\n y=[];\n var avg=0;\n for (var i=0; i < x.length; i++) {\n if (x[i] < min ) {\n min = x[i];\n }\n if (x[i] > max) {\n max = x[i];\n }\n avg = avg + x[i];\n }\n avg = avg/x.length;\n y[0] = max;\n y[1] = min;\n y[2] = avg;\n return y;\n}", "function maxMinAvg(arr){\n var newarr = [];\n var sum = 0;\n var max = arr[0];\n var min = arr[0];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n if (arr[i] < min){\n min = arr[i];\n }\n }\n sum = sum + arr[i]\n }\n var avg = sum / arr.length;\n newarr.push(max, min, avg);\n console.log(newarr);\n}", "function maxMinAvg(arr) {\n var arrnew = [];\n var avg = 0;\n for(var i = 0; i < arr.length; i++) {\n avg += arr[i];\n if(arr[i] >= 0)\n arrnew[0] = arr[i];\n }\n for(var f = 0; f < arr.length; f++) {\n if(arr[f] <= 0)\n arrnew[1] = arr[f];\n }\n arrnew[2] = avg / arr.length;\n return arrnew; \n}", "function maxMinAverage(arr) {\n var max = arr[0];\n\n for (var i=1; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n}", "function PrintMaxMinAverageArrayVals(arr){\n}", "function printMaxMinAverage(arr) {\n if (arr.length === 0) {\n return;\n }\n var min = arr[0];\n var max = arr[0];\n var sum = 0;\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < min) {\n min = arr[idx];\n }\n if (arr[idx] > max) {\n max = arr[idx];\n }\n sum += arr[idx];\n }\n return {\n min,\n max,\n avg: sum / arr.length\n };\n}", "function maxMinAvg (arr){\n var max = arr[0]\n var min = arr[0]\n var sum = 0\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i] \n }\n if(arr[i] < min){\n min = arr[i]\n }\n sum += arr[i]\n }\n average = sum / arr.length\n console.log(max, min, average)\n}", "function minMaxAvrg(array) {\n let avrgNum = 0;\n let max = array[0];\n let min = array[0];\n for(let i=0;i<array.length;i++) {\n if(array[i] > max) {\n max = array[i]\n } else if(array[i] < min) {\n min = array[i]\n }\n avrgNum += array[i] / array.length;\n }\n return `Minimum number is ${min}, Maximum number is ${max} and average number is ${avrgNum}`\n}", "function maxMinAvg(arr){\n let totalSum = 0;\n let max = arr[0];\n let min = arr[0];\n for (let i=1; i<arr.length;i++){\n if (min > arr[i]) {\n min = arr[i];\n }\n }\n for (let i=1; i<arr.length;i++){\n if (max < arr[i]) {\n max = arr[i];\n }\n }\n for (let i=0; i<arr.length;i++){\n totalSum += i; \n }\n average = totalSum / arr.length;\n console.log(\"max: \" + max);\n console.log(\"min: \" + min);\n console.log(\"average: \" + average);\n}", "function minMaxAvg (arr){\n var max = arr[0];\n var min = arr[0];\n var sum = arr[0];\n for (var i=1;i<arr.length;i++){\n sum= sum + arr[i];\n\n //find maximum\n if(arr[i]>max){\n max=arr[i];\n }\n //find minimum\n else if (arr[i]<min){\n min=arr[i];\n }\n \n\n }\n console.log(\"Max: \"+ max+ \" Min: \" + min + \" Avg: \" + sum/arr.length);\n\n}", "function maxMinAve(arrX) {\r\n var length = arrX.length\r\n var avg = 0\r\n var min = arrX[0]\r\n var max = arrX[0]\r\n for (var i = 0; i < length; i++) {\r\n if (arrX[i] < min) {\r\n min = arrX[i];\r\n }\r\n else if (arrX[i] > max) {\r\n max = arrX[i];\r\n }\r\n avg += arrX[i]\r\n }\r\n console.log(\"\\n\\nMin: \" + min, \"/ Max: \" + max, \"/ Average: \" + avg / arrX.length)\r\n}", "function getMinMaxAvg(data) {\n // Note: sign of data is ignored, so -5 is treated the same as 5.\n let max = Number.MIN_SAFE_INTEGER;\n let min = Number.MAX_SAFE_INTEGER;\n let total = 0.0;\n for (var i = 0; i < data.length; i++) {\n let d = Math.abs(data[i]);\n max = Math.max(max, d);\n min = Math.min(min, d);\n total += d;\n }\n\n return {\n min: min,\n max: max,\n avg: total / data.length\n }\n}", "function printMaxMinAverage(arr) {\n if (arr.length === 0) {\n return;\n }\n var min = arr[0];\n var max = arr[0];\n var sum = arr[0];\n for (var idx = 1; idx <= arr.length; idx++) {\n if (arr[idx] < min) {\n min = arr[idx];\n }\n if (arr[idx] > max) {\n max = arr[idx];\n }\n sum += arr[idx];\n }\n return min;\n return max;\n return avg;\n}", "function PrintMaxMinAvg(myArr) {\n var max = min = sum = myArr[0];\n var avg;\n for (var i = 1; i < myArr.length; i++) {\n if (max < myArr[i]) {\n max = myArr[i];\n }\n\n if (min > myArr[i]) {\n min = myArr[i];\n }\n sum += myArr[i];\n avg = sum / myArr.length;\n }\n console.log(\"Max:\", max, \" Min:\", min, \" Average:\", avg);\n}", "function minMax(arr){\n var max = arr[0];\n var min = arr[0];\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n }\n else if(arr[i] < min){\n min = arr[i];\n }\n sum += arr[i];\n }\n console.log(\"max: \" + max);\n console.log(\"min: \" + min);\n console.log(\"avg: \" + (sum/arr.length));\n}", "function printMaxMinAverage(inputArray) {\n\tlet max = inputArray[0],\n\t\tmin = inputArray[0],\n\t\tsum = 0;\n\tinputArray.forEach((element) => {\n\t\tif (element > max) max = element;\n\t\tif (element < min) min = element;\n\t\tsum += element;\n\t});\n\tconsole.log(\"Max:\", max);\n\tconsole.log(\"Min:\", min);\n\tconsole.log(\"Average:\", sum / (inputArray.length - 1));\n}", "function minAndMax (array) {\n var min = Infinity;\n var max = -Infinity;\n var output = [];\n for ( var i = 0; i < array.length; i++) {\n if (array[i] > max) {\n max = array[i];\n } else if(array[i] < min) {\n min = array[i]; \n } \n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] === min) {\n output[output.length] = max;\n } else if (array[i] === max) {\n output[output.length] = min;\n } else {\n output[output.length] = array[i];\n }\n }\n return output\n}", "function maxMin(array) {\n return [Math.max.apply(Math, array), Math.min.apply(Math, array)];\n}", "function minAndMax (array) {\n var min = Infinity;\n var max = -Infinity;\n var output = [];\n for ( var i = 0; i < array.length; i++) {\n \n if (array[i] > max) {\n max = array[i];\n \n } \n if(array[i] < min) {\n min = array[i]; \n } \n \n }\n output[output.length] = min;\n output[output.length] = max;\n return output;\n}", "function maxOrMin (dataArray) {\n var maxX = dataArray[0].x; \n var minX = dataArray[0].x;\n\n for (var i = 0; i < dataArray.length ; i++) {\n if (dataArray[i].x >= maxX) {\n maxX = Math.round(dataArray[i].x);\n }\n if (dataArray[i].x <= minX) {\n minX = Math.round(dataArray[i].x);\n }\n }\n var maxAndMin = {\"max\": maxX, \"min\": minX};\n return maxAndMin; \n }", "function minAdnMax(array) {\n var max = [];\n var min = [];\n var minAdnMax = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] !== false || array[i] !== undefined || array[i] !== NaN) {\n max = array[i];\n min = array[i];\n break;\n }\n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] > max && typeof array[i] === \"number\") {\n max = array[i];\n }\n if (array[i] < min && typeof array[i] === \"number\") {\n min = array[i];\n }\n }\n minAdnMax = [min, max];\n return minAdnMax;\n}", "function minAdnMax(array) {\n var max = [];\n var min = [];\n var minAdnMax = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] !== false || array[i] !== undefined || array[i] !== NaN) {\n max = array[i];\n min = array[i];\n break;\n }\n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] > max && typeof array[i] === \"number\") {\n max = array[i];\n }\n if (array[i] < min && typeof array[i] === \"number\") {\n min = array[i];\n }\n }\n minAdnMax = [min, max];\n return minAdnMax;\n}", "function max(...numbers){\n// your code here, for-loop method preferred\n\tvar arr = [...numbers];\n\tvar min = arr[0];\n\tvar max = arr[0];\n\tvar average = 0;\n\nfor(var i = 0; i < arr.length; i++) {\n if(arr[i] > max) max = arr[i];\n}\n\nreturn max;\n}", "function findMaxAndMin(array) {\n var i;\n var maxElement = 0;\n var minElement = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i] > maxElement && typeof array[i] == 'number') {\n maxElement = array[i]\n }\n if (array[i] < minElement && typeof array[i] == 'number') {\n minElement = array[i]\n\n\n }\n result = [minElement, maxElement];\n\n }\n return result;\n\n}", "function min_max_av(dates, datas){\n var avr = datas.reduce((cur,acc) => {return cur+acc})/datas.length;\n var min = datas[0];\n var max = datas[0];\n var maxIndex = 0;\n var minIndex = 0\n //find the min of the column and its index\n for(var i = 0; i < datas.length; i++){\n if(datas[i] < min){\n min = datas[i]\n minIndex = i;\n }\n }\n //find the max of the column and its index\n for(var i = 0; i < datas.length; i++){\n if(datas[i] > max){\n max = datas[i];\n maxIndex = i;\n }\n }\n return {average: avr, min: [min, dates[minIndex]], max: [max, dates[maxIndex]] }\n }", "function minAndMax(array) {\n const newArray = [];\n let min = array[0];\n let max = array[0];\n for (let i = 0; i < array.length; i++) {\n if (array[i] < min) {\n min = array[i];\n }\n if (array[i] > max) {\n max = array[i];\n }\n }\n newArray.push(min, max);\n return newArray;\n}", "function eleven(arr){\n var min = 0;\n var max = 0;\n var sum = 0;\n var avg = 0;\n var newArray = []; \n for(var i = 0; i < arr.length; i++){\n if(arr[i] < min){\n min = arr[i]; \n }\n if(arr[i] > max){\n max = arr[i]; \n }\n sum+=arr[i]; \n }\n avg = arr.length / sum; \n newArray = [max, min, avg];\n return newArray; \n}", "function minMax(arr) {\r\n\tvar minMax =[Math.min(...arr), Math.max(...arr)]\r\n\treturn minMax;\r\n}", "function searchMaxAndMin(array){\n var max = array[0];\n var min = array[0];\n for (var i = 1; i < array.length; i++){\n if(array[i] > max){\n max = array[i];\n }else if(array[i] < min){\n min = array[i];\n }\n }\n return [min, max]\n }", "function getMinMax(arr) {\n let min = arr[0]\n let max = arr[0]\n for (let i = 1; i <= arr.length; i++) {\n if (arr[i] < min) {\n min = arr[i]\n }\n\n if (arr[i] > max) {\n max = arr[i]\n }\n }\n\n return [min, max]\n}", "function minMax(arr) {\n return [Math.min(...arr), Math.max(...arr)];\n}", "function minMax(arr) {\n let result = []\n result.push(Math.min.apply(null, arr)) //apply accepts a context (null takes 'context' position and is arbitrary in this use case)\n result.push(Math.max.apply(null, arr)) //followed by an array of arguments to be used inside the Math function apply was called on \n\n //alt ES6 syntax is Math.min(...arr) and Math.max(...arr)\n return result\n}", "function minMaxLengthAverage(arr) {\n var total = 0;\n for(var i = 0; i < arr.length; i++){\n total += arr[i];\n }\n return [Math.min(...arr), Math.max(...arr), arr.length, total/arr.length];\n}", "function findMaxMin(array) {\n let min = Math.min(...array)\n //Math.min.apply(null, array)\n let max = Math.max(...array)\n //Math.max.apply(null, array)\n\n let arrSum = array.reduce((acc, item) => acc + item)\n let minSum = arrSum - max\n let maxSum = arrSum - min\n return `Max: ${maxSum} \\t Min: ${minSum}`\n}", "function calculate_minmax(data) {\n\n bound = [];\n bound.max = Math.max.apply(Math, data);\n bound.min = Math.min.apply(Math, data);\n return bound;\n\n}", "function findMaxAndMin(arrayInput) {\r\n let onlyNumbers = [];\r\n\r\n for (let i = 0; i < arrayInput.length; i++) {\r\n if (!isNaN(arrayInput[i])) {\r\n onlyNumbers.push(arrayInput[i]);\r\n }\r\n\r\n }\r\n onlyNumbers.sort();\r\n\r\n\r\n let max = onlyNumbers[onlyNumbers.length - 1];\r\n let min = onlyNumbers[0];\r\n\r\n console.log(`Max number: ${max} Min number: ${min} sumMaxAndMin: ${max + min}`);\r\n}", "function operationsarr(arr)\r\n{\r\n\tvar max=arr[0];\r\n\tvar min=arr[0];\r\n\tvar sum=0;\r\n\tvar avg=0;\r\n\tfor(var i=0;i<arr.length;i++)\r\n\t{\r\n\t\tif(arr[i]>max)\r\n\t\t{\r\n\t\tmax=arr[i];\r\n\t\t}\r\n\t\telse if(arr[i]<min)\r\n\t\t{\r\n\t\t\tmin=arr[i];\r\n\t\t}\r\n\t\tsum=sum+arr[i];\r\n\t\tavg=sum/arr.length;\r\n\t\t\r\n\t}\r\n\r\n\tconsole.log(\"Max,min ,and avg \",[max,min,avg]);\r\n\r\n}", "function getMinMax(arr) {\n const min = arr.sort((a, b) => a - b).slice(0, 1);\n const max = arr.sort((a, b) => a - b).slice(-1);\n\n return min.concat(max);\n}", "function getMinMax(array) {\n let max = 0;\n let min = array[0];\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] >= max)\n max = array[i];\n else if (array[i] < min)\n min = array[i];\n }\n\n return {\n min: convertKelvinToCelsius(min),\n max: convertKelvinToCelsius(max)\n };\n}", "function sol1(array) {\n\tlet minMax = []\n\tarray.forEach((ar,i)=>{\n\t\tlet arr1 = [...arr]\n\t\tarr1.splice(i, 1)\n\t\tminMax.push(arr1.reduce((acc,v)=> {\n\t\t\treturn acc + v\n\t\t}))\n\t\t\n\t})\n\tlet min = Math.min.apply(null, minMax)\n\tlet max = Math.max.apply(null, minMax)\n\tconsole.log({min:min, max:max, minMaxxArr: minMax})\n}", "function findMinAndMax(array) {\n var minValue = array[0];\n var maxValue = array[0];\n var = i;\n\n for (i = 1; i < array.length; i++) {\n currentElement = array[i];\n\n if (currentElement < minValue) {\n minValue = currentElement;\n\n }\n\n if (currentElement > maxValue) {\n maxValue = currentValue;\n\n }\n\n //i=1:minValue = 3, maxValue = 7\n } //i=2:minValue = 2, maxValue = 7\n //i=3:minValue = 1, maxValue = 7\n //i=4:minValue = 1 maxValue = 8\n //i=5:minValue = 1 maxValue = 8\n\n}", "function minAndMax(arr){\n var min = arr[0]\n var max = arr[0]\n arr.forEach( function(el){\n if (el > max) {\n max = el\n }\n if (el < min) {\n\t\t\tmin = el\n }\n })\n \n // console.log([min,max])\n return [min,max]\n}", "function arrMaxMin(arr) {\n\tlet min = +Infinity, max = -Infinity;\n\tlet statmin=0, statmax=0;\n\tfor(let i=0; i < arr.length; i++) {\n\t\tif(arr[i] < min) {\n\t\t\tmin = arr[i];\n\t\t\tstatmin++;\n\t\t}\n\t\tif(arr[i] > max) {\n\t\t\tmax = arr[i];\n\t\t\tstatmax++;\n\t\t}\n\t}\n\tconsole.log(max, min);\n}", "function avgValue(array) {\n let total = 0;\n\n for (let i = 0; i < array.length; i += 1) {\n let num = array[i];\n total += num;\n }\n let avg = total / array.length;\n return avg;\n}", "function infoTab(array) {\n var max = Math.max(...array);\n var sum = 0;\n for (i = 0; i < array.length; i++) {\n sum += parseInt(array[i]);\n }\n console.log(sum);\n var average = 0;\n average = parseInt(sum / array.length);\n alert(average);\n alert(max);\n}", "function getMinMax(arr) {\n let min = arr[0][\"price\"], max = arr[0][\"price\"];\n \n // For all values in resolution\n for (let i = 1, len=arr.length; i < len; i++) {\n // Check if current value is min or max\n let v = arr[i][\"price\"];\n min = (v < min) ? v : min;\n max = (v > max) ? v : max;\n }\n\n // Set the min for little more less than what is really is.\n min = Math.floor(min - max * 0.01)\n \n // But more than 0, set the max automaticlly.\n return [Math.max(0, min), \"auto\"];\n }", "function maxAndMin(arr) {\n let max = 0;\n let min = 0;\n for (let i = 0; i < arr.length; i++) {\n if (max < arr[i]) {\n max = arr[i];\n }\n if (min > arr[i]) {\n min = arr[i];\n }\n }\n return [max, min];\n}", "function getMinMaxSum(source) {\n let totalTicks = source.length;\n let maxValue = Number.MIN_SAFE_INTEGER;\n let minValue = Number.MAX_SAFE_INTEGER;\n let avgValue = 0;\n let sumValues = 0;\n\n for (let { value } of source) {\n maxValue = Math.max(value, maxValue);\n minValue = Math.min(value, minValue);\n sumValues += value;\n }\n avgValue = sumValues / totalTicks;\n\n return { minValue, maxValue, avgValue };\n}", "function minMax(arr) {\n\tlet min=1000, max=-1000;\n\tlet a = [];\n\tfor(let i=0; i<arr.length; i++){\n\t\tif(arr[i]<min){\n\t\t\tmin=arr[i];\n\t\t}\n\t\tif(arr[i]>max){\n\t\t\tmax=arr[i];\n\t\t}\n\t}\n a[0]=min;\n a[1]=max;\n\treturn a;\n}", "_averageClosesValues(array) {\n array.sort(function(a,b) {\n return a - b;\n });\n let min = 999999;\n let val = 0;\n array.map((value, index) => {\n var dif = array[index + 1] - value;\n if(dif < min) {\n val = index;\n min = dif;\n }\n return value;\n });\n\n array.splice(val, 2, (array[val] + array[parseInt(val, 10) + 1]) / 2);\n return array;\n }", "function average(array){\n function plus(a,b){return a+b}\n return array.reduce(plus)/array.length;\n}", "function average(array){\n function plus(a, b){return a + b;}\n return array.reduce(plus) / array.length;\n}", "function fnGetMinMaxValues(arrayname,searchStart,searchStop)\n{\n\tvar intMinimum = 10000;\n\tvar intMaximum = 0;\n\tvar intAverageSum = 0;\n\tvar intCounter = 0;\n\tvar arResults = new Array;\n\tvar intPingTime = 0;\n\n\tfor (i = searchStart; i >= searchStop; i--)\n\t{\n\t\tintPingTime = parseFloat(arrayname[i])\n\t\tif (intPingTime >= intMaximum)\n\t\t{ intMaximum = intPingTime; }\n\n\t\telse if ( ( intPingTime <= intMinimum) && ( intPingTime != 0) )\n\t\t{ intMinimum = arrayname[i]; }\n\n\t\tif ( (intPingTime != 0) && (intPingTime >= 0) )\n\t\t{\n\t\t\tintAverageSum = intAverageSum+intPingTime;\n\t\t\tintCounter++;\n\t\t}\n\n\t} // end for\n\n\tvar intAverage = Math.round(intAverageSum / intCounter *100)/100;\n\n\tarResults.push(intMinimum);\n\tarResults.push(intMaximum);\n\tarResults.push(intAverage);\n\treturn arResults;\n}", "function minMaxAvgRecursive(arr, i = 0, min = 0, max = 0, sum = 0) {\n if (arr.length == 0) {\n return `No min, max or average values`;\n }\n if (i == arr.length) {\n return `max: ${max}, min: ${min}, average: ${sum/(i)}`;\n }\n if (i == 0) {\n min = arr[0];\n max = arr[0];\n };\n if (min > arr[i]) {\n min = arr[i]\n } else if (max < arr[i]) {\n max = arr[i];\n }\n sum += arr[i]\n return minMaxAvgRecursive(arr, i += 1, min, max, sum)\n}", "function maxMin2(arr) {\n var maxIdx = arr.length - 1\n var minIdx = 0\n var maxElem = arr[maxIdx] + 1; // store any element that is greater than the maximum element in the array \n for (var i = 0; i < (arr.length); i++) {\n // at even indices we will store maximum elements\n if (i % 2 == 0) {\n arr[i] += Math.floor((arr[maxIdx] % maxElem) * maxElem)\n maxIdx -= 1\n }\n else { // at odd indices we will store minimum elements\n arr[i] += Math.floor((arr[minIdx] % maxElem) * maxElem)\n minIdx += 1\n }\n }\n // dividing with maxElem to get original values.\n for (var i = 0; i < (arr.length); i++) {\n arr[i] = Math.floor(arr[i] / maxElem)\n }\n return arr\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function find_average(array) {\n\tlet sum = array.reduce((prev, next) => prev + next, 0);\n\treturn Math.floor(sum / array.length);\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) { return a + b; }\n return array.reduce(plus) / array.length;\n }", "function ReturnArrayOf_MaxMin() {\r\n let numbers = EntryCheckForManyNumbers();\r\n let max = numbers [0]; \r\n let min = numbers [numbers.length-1] ;\r\n for (let i = 0; i < numbers.length; i++){\r\n if (max < numbers[i]) {\r\n max = numbers[i];\r\n }\r\n if ( min > numbers[i]) {\r\n min = numbers[i];\r\n }\r\n } \r\n let arrayFor_2_values = [];\r\n arrayFor_2_values.push(max);\r\n arrayFor_2_values.push(min);\r\n //console.log(numbers);\r\n //console.log(min, max);\r\n return arrayFor_2_values;\r\n }", "function calcAVG(array) {\n var total = 0;\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n var avg = total / array.length;\n return (avg);\n}", "function extent$6(array) {\n var i = 0, n, v, min, max;\n\n if (array && (n = array.length)) {\n // find first valid value\n for (v = array[i]; v == null || v !== v; v = array[++i]);\n min = max = v;\n\n // visit all other values\n for (; i<n; ++i) {\n v = array[i];\n // skip null/undefined; NaN will fail all comparisons\n if (v != null) {\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n }\n\n return [min, max];\n }", "function getAvg(array) {\n return array.reduce(function (p, c) {\n return p + c;\n }) / array.length;\n}", "function find_average(array) {\n var sum = array.reduce((a, b) => a + b, 0);\n return sum/array.length;\n}", "function getOneAverage(array){\n // console.log(array);\n var sum = array.reduce(getSum); // sum of all nums in array\n var avg = sum / array.length;\n // console.log(avg);\n return avg;\n}", "function getMean(array){\n return getSum(array)/array.length;\n}", "function average(array) {\n var sum = 0;\n var output = [];\n \n for (var i = 0; i < array.length; i++) {\n sum += array[i];\n }\n \n for (var j = 0; j < array.length; j++) {\n \n if (array[j] > sum / array.length) {\n output[output.length] = array[j];\n }\n }\n \n return output;\n}", "function getArrayBounds(arr) {\n var min = Infinity,\n max = -Infinity,\n nan = 0, val;\n for (var i=0, len=arr.length; i<len; i++) {\n val = arr[i];\n if (val !== val) nan++;\n if (val < min) min = val;\n if (val > max) max = val;\n }\n return {\n min: min,\n max: max,\n nan: nan\n };\n }", "function avg(array) {\r\n\tvar sum = array.reduce(function(prev,current){\r\n\t\treturn prev + current;\r\n\t});\r\n\treturn sum/array.length;\r\n}", "function find_average(array) {\n return array.reduce((a, b) => (a + b)) / array.length;\n}", "function maxMinusMin(arrayOfNumbers){\n //returns the difference of the maximum minus the minimum\n // create a max value, a min value and put into variable to rep max-min\n arrayOfNumbers.sort();// puts in order least to greatest\n var max = arrayOfNumbers[arrayOfNumbers.length-1];\n var min = arrayOfNumbers[0]\n var calcValue = max- min;\n return calcValue\n}", "function calcAverage(array){\n let reducer = (prevValue, currentValue) => prevValue + currentValue;\n return array.reduce(reducer)/array.length;\n \n}", "function getAverage(array) {\n let total = 0;\n\n for (let i = 0; i < array.length; i++) {\n total += array[i];\n }\n let avg = total / array.length;\n\n return Math.round(avg * 100) / 100;\n}", "function avg( arr ){\n\treturn sum( arr ) / arr.length\n}", "function minAvgTwoSlice(arr) {\n let index = null\n let arrAverage = [arr[0]]\n for (let i = 1; i < arr.length; i++) {\n\n }\n}", "function arrayAvg(x) {\n var avg=0;\n for (i=0; i<x.length; i++) {\n avg = avg + x[i];\n }\n avg = avg/x.length;\n return avg;\n}", "function getAverage(array) {\n return (array.reduce((total, element) => {\n return total + element;\n }) / array.length)\n}", "function findAverage(array) {\n const sumElementsAgesArray = (accumulator, currentValue) => accumulator + currentValue;\n const averageAge = array.reduce(sumElementsAgesArray, 0) / array.length;\n return averageAge;\n}", "function callAll(){\n console.log(arr);\n console.log(average(arr));\n console.log(min(arr));\n console.log(max(arr));\n}", "function arrayAverage(arr) {\n return arr.reduce(function(val1, val2) {\n return val1 + val2;\n }, 0) / arr.length;\n}", "function minAndMax(arr) {\n//declare max, min variables\n\tlet min = arr[0];\n let max = arr[0];\n let result = [1,2];\n let newArr = [];\n \n//for loop to iterate through given array\n for (let i = 0; i < arr.length; i++) {\n console.log(arr[i]);\n if (arr[i] < min) {\n min = arr[i];\n } else if (arr[i] > max) {\n max = arr[i];\n }\n \n } // end for loop\n result[0] = min;\n result[1] = max;\n return console.log(result);\n \n \n /*\n newArr.push(arr[i]);\n // console.log(newArr);\n if (arr[i] < arr[i + 1]) {\n min = arr[i];\n } else {\n \tmax = arr[i];\n }\n console.log(min);\n\t\t*/\n\n \n}", "function avg(myArray){\n sum = sumNeg(myArray);\n average = sum/myArray.length;\n return average;\n}", "function MinandMax(arr){\n \n const Unique = [...new Set(arr)];\n Unique.sort((a,b) => a-b);\n const min = Unique[0]\n const max = Unique[Unique.length-1]\n return {Values:{MaxValue:max,Min:min}}\n}", "function range(array){\n\n let maximum = max(array);\n\n let minimum = min(array) ; \n\n return maximum - minimum ; \n}", "function minMax(numbers) {\n return [Math.min.apply(null, numbers), Math.max.apply(null, numbers)];\n}" ]
[ "0.8295701", "0.82508343", "0.8150177", "0.8136577", "0.8135827", "0.8084319", "0.80052274", "0.798307", "0.79231626", "0.7884989", "0.77726084", "0.7715729", "0.7684641", "0.76652175", "0.7654247", "0.7458532", "0.74524087", "0.7428627", "0.74209917", "0.737351", "0.73169416", "0.73114127", "0.72823226", "0.72767705", "0.72090477", "0.71773434", "0.71716714", "0.7122484", "0.7013724", "0.7013724", "0.7013177", "0.7000209", "0.69979024", "0.6973428", "0.6902711", "0.68990004", "0.6881124", "0.6855684", "0.685299", "0.6835894", "0.67795736", "0.6764968", "0.67522043", "0.67201906", "0.6718636", "0.67072237", "0.67045015", "0.6689529", "0.6650459", "0.6616971", "0.6595639", "0.6593694", "0.65823114", "0.65724665", "0.65461594", "0.64843047", "0.64804506", "0.6471944", "0.6470461", "0.6462511", "0.64322925", "0.64243686", "0.642178", "0.642112", "0.6418945", "0.6408083", "0.6408083", "0.6408083", "0.6408083", "0.6408083", "0.6408083", "0.6394607", "0.63832474", "0.6356017", "0.63506633", "0.63475376", "0.6333468", "0.6308002", "0.62998265", "0.629731", "0.6296314", "0.6289802", "0.62887496", "0.6281633", "0.6272751", "0.627042", "0.6266884", "0.62589985", "0.6249785", "0.6214162", "0.6207847", "0.6199082", "0.61935323", "0.6186636", "0.617084", "0.6165644", "0.6163123", "0.61630404", "0.61492264", "0.61399746" ]
0.7792663
10
12) Swap Values Write a function that will swap the first and last values of any given array. The default minimum length of the array is 2. (e.g. [1,5,10,2] will become [2,5,10,1]).
function p12(){ var arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] var n1 = arr[0] var n2 = arr[arr.length-1] arr[0] = n2 arr[arr.length-1] = n1 console.log(arr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function swapVals(arr){\n var first = arr[0];\n arr[0] = arr[arr.length-1];\n arr[arr.length-1] = first;\n return arr;\n}", "function swapValues(array){\n debugger; // debugger command for stepping through code in Chrome\n // set the temp variable to the first value of the given array\n var temp = array[0];\n // now updated the array[0] value to array[array.length - 1]\n array[0] = array[array.length - 1];\n // now switch (reset) array[array.length - 1] to the value of the temp var\n array[array.length - 1] = temp;\n // return the new array\n return array;\n}", "function swap(arr) {\n var temp = arr[arr.length - 1];\n arr[arr.length - 1] = arr[0];\n arr[0] = temp;\n}", "function swap(arr) {\n\n var temp1 = arr[0];\n var temp2 = arr[2];\n\n arr[0] = arr[arr.length - 1];\n arr[2] = arr[arr.length - 3];\n arr[arr.length - 1] = temp1;\n arr[arr.length - 3] = temp2;\n return arr;\n}", "function swap(arr)\n{\n var temp;\n var end=arr.length-1;\n for(var i=0; i<arr.length/2; i+=2)\n {\n \n temp=arr[i];\n arr[i]=arr[end-i];\n arr[end-i]=temp;\n }\n return arr\n}", "function swapValues(array) {\n var firstNum = array[0];\n var lastNum = array[array.length -1];\n \n console.log(lastNum);\n array[0] = lastNum;\n array[array.length-1] = firstNum;\n return array;\n}", "function swap(arr){\n var temp = arr[0];\n arr[0] = arr[arr.length-1];\n arr[arr.length-1] = temp;\n return arr;\n}", "function swap(arr) {\n var temp = arr[0];\n arr[0] = arr[arr.length-1];\n arr[arr.length-1] = temp;\n return arr; \n}", "function swap (arr){\n //for (var i=0;i<arr.length;i++){\n [arr[0], arr[arr.length-1]] = [arr[arr.length-1], arr[0]];\n \n \n\n //}\n\n return arr;\n}", "function swap(arr){\n var num=arr[0];\n var num2=arr[arr.length-1];\n arr[0]=num2;\n arr[arr.length-1]=num; \n return arr; \n}", "function swap(before, after, array)\n{\n \n //swap the element:\n let temp = array[before]; \n array[before] = array[after];\n array[after] = temp;\n}//end of swap()", "function swap(arr,first,second){\n if(first == second){\n return;\n }\n var temp = arr[first];\n arr[first] = arr[second];\n arr[second] = temp;\n}", "function swap_value()\n{\n\tvar swap_arr = create_array();\n\tvar swap_num = swap_arr[0];\n\t\n\tswap_arr[0] = swap_arr[swap_arr.length-1];\n\tswap_arr[swap_arr.length-1] = swap_num;\n\t\n\tconsole.log(\"This is array 2 after the swap [\" + swap_arr + \"]\");\n}", "function swapValues(arr, idx1, idx2) {\n\n }", "function swap(arr) {\r\n var storage = arr[0];\r\n arr[0] = arr[arr.length - 1];\r\n arr[arr.length -1] = storage;\r\n return arr; \r\n}", "function swapValues(args) {\n var temp = args[0];\n args[0] = args[1];\n args[1] = temp;\n}", "function swapVal(array, a, b) {\n let temp = array[a];\n array[a] = array[b];\n array[b] = temp;\n}", "function swap(num) {\r\n [num[0], num[num.length - 1]] = [num[num.length - 1], num[0]];\r\n return num;\r\n}", "function swapPairs(arr){\n for (index = 0; index < arr.length-1; index+=2){\n var currentValue = arr[index];\n arr[index] = arr[index+1];\n arr[index+1] = currentValue;\n }\n return arr;\n}", "function swapArr(arr){\nreturn arr.reverse();\n}", "function swap(currentPosition,nextPosition,array){\n\t\tvar temp = array[currentPosition];\n\t\tarray[currentPosition] = array[nextPosition];\n\t\tarray[nextPosition] = temp;\n\t}", "function swapArr2(arr){\n\nfor(let i=0;i<arr.length/2;i++){\n [arr[i],arr[arr.length-1-i]]=[arr[arr.length-1-i],arr[i]];\n}\n return arr;\n}", "function swap(arr){\n for (i = 0; i < arr.length / 2; i++){\n if (i % 2 == 0){\n var temp = arr[i];\n arr[i] = arr[arr.length - (i + 1)];\n arr[arr.length - (i + 1)] - temp;\n }\n }\n return arr\n}", "function swap(arr, i1, i2) {\n var temp = arr[i1];\n arr[i1] = arr[i2];\n arr[i2] = temp;\n}", "function swap(array, a, b) {\n let temp = array[b];\n array[b] = array[a]\n array[a] = temp\n}", "function swapPairs(arr){\n for (var i = 0; i < arr.length-1; i+=2) { \n var temp = arr[i]\n arr[i] = arr[i+1]\n arr[i+1] = temp\n }\n}", "function swap(array, firstElement, secondElement){\n let temp = array[firstElement];\n array[firstElement] = array[secondElement];\n array[secondElement] = temp;\n}", "function swapPair(array) {\n for (let i = 0; i < array.length; i = i + 2) {\n let temp = array[i];\n array[i] = array[i + 1];\n array[i + 1] = temp;\n }\n return array\n}", "function swap(arr)\r\n{\t\r\n\r\n\tvar temp;\r\n\tvar c =arr.length;\r\n\tfor (var i = 0; i < arr.length; i++) \r\n\t{\r\n\t\t\ttemp = arr[c-1-i];\r\n\t arr[c-1-i]=arr[i];\r\n\t arr[i]=temp;\r\n\t \t\r\n\t\t\r\n\t}\r\n\t\r\n\tconsole.log(arr);\r\n}", "function swap(arr=[], a, b){\n\tlet temp = arr[a];\n\tarr[a] = arr[b];\n\tarr[b] = temp;\n\treturn;\n}", "function swap(numbers, i) {\n var left = numbers[i];\n var right = numbers[i+1];\n numbers[i] = right;\n numbers[i+1] = left;\n}", "function swapPairs(arr){\n \n for( var i = 0; i<=arr.length-2; i+=2){\n temp = arr[i+1];\n arr[i+1] = arr[i];\n arr[i] = temp;\n }\n return arr;\n \n}", "function swapPairs(arr){\n var temp;\n for (var i =0; i < arr.length; i+=2){\n if((arr.length-1) - i > 1){\n temp = arr[i];\n arr[i] = arr[i+1];\n arr[i+1]= temp;\n }\n }\n return arr;\n\n}", "function swap_pairs(arr) {\n\tfor(var i = 0; i < arr.length -1; i += 2) {\n\t\tx = arr[i]\n\t\tarr[i] = arr[i + 1]\n\t\tarr[i + 1] = x\n\t}\n\tconsole.log(arr);\n}", "function swap(arr, a, b) {\r\n let temp = arr[a];\r\n arr[a] = arr[b];\r\n arr[b] = temp;\r\n}", "function swap(array, index1, index2) {\n var aux = array[index1];\n array[index1] = array[index2];\n array[index2] = aux;\n}", "function swapArray(array, num1, num2){\n let temp = array[num1];\n array[num1] = array[num2];\n array[num2] = temp;\n}", "function swap (arr, i1, i2) {\n var tmp = arr[i1]\n arr[i1] = arr[i2]\n arr[i2] = tmp\n return arr\n}", "function swap(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "function swap(arr,xp, yp)\n{\n var temp = arr[xp];\n arr[xp] = arr[yp];\n arr[yp] = temp;\n}", "function swapPairs(arr){\n for(var i = 0; i < arr.length-1; i +=2){\n var temp = arr[i];\n arr[i] = arr[i+1];\n arr[i+1] = temp;\n }\n return arr\n}", "function swapValues() {\n return arguments[0].reverse();\n}", "function swapPair(arr){\n for(var i=0; i<arr.length/2; i+=2){\n if(i+1>arr.length){\n break\n }else{\n var temp = arr[i]\n arr[i] = arr[i+1]\n arr[i+1] = temp\n }\n }\n return arr\n}", "function swap(arr, i1, i2) {\n var temp = arr[i1];\n arr[i1] = arr[i2];\n arr[i2] = temp;\n }", "function rearrange(arr) {\n // if at even index we want this value at this index to be smaller than next (swapping as needed)\n // if at odd index we want this value to be bigger and swap if needed\n for (var i = 0; i < arr.length - 1; i++) {\n var a = arr[i], b = arr[i + 1];\n if (i % 2 === 0) { // this index has smaller number\n if (a > b) {\n [arr[i], arr[i + 1]] = [b, a];\n }\n } else {\n if (b > a) {\n [arr[i], arr[i + 1]] = [b,a];\n }\n }\n }\n return arr;\n}", "function swap(array, idx1, idx2) {\n var temp = array[idx1];\n array[idx1] = array[idx2];\n array[idx2] = temp;\n}", "function swap(arr, val1, val2)\n{\n let temp = arr[val2];\n arr[val2] = arr[val1];\n arr[val1] = temp;\n}", "function swap(arr, x, y) {\n var tmp = arr[x];\n arr[x] = arr[y];\n arr[y] = tmp;\n }", "function swaptocenter(arr){\n for(var i=0;i<arr.length/2;i+=2){\n var temp=arr[i];\n arr[i]=arr[arr.length-1-i];\n arr[arr.length-1-i]=temp;\n }\n return arr;\n}", "function swap(j, array) {\n var temp = array[j]\n array[j] = array[j + 1]\n array[j + 1] = temp\n\n return array\n\n}", "function swapEnds(arr) {\n var temp = arr[arr.length - 1];\n arr.pop();\n arr.push(arr[0]);\n arr[0] = temp;\n return arr;\n}", "function swap(arr, i, j) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n}", "function arrSwap(xarr) {\n for(var i=0; i < Math.ceil(xarr.length/2)-1; i++) {\n var x = xarr[i];\n xarr[i]= xarr[xarr.length-i-1];\n xarr[xarr.length-i-1] = x;\n // console.log(xarr[i]);\n // console.log(xarr[Math.ceil(xarr.length/2)-i-1])\n }\n return xarr;\n}", "function swap(arr, index1, index2){\n var temp = arr[index1];\n arr[index1] = arr[index2];\n arr[index2] = temp;\n}", "function swapValues(args) {\n return args.reverse()\n}", "function swap(array, posA, posB) {\n var temp = array[posA]; \n array[posA] = array[posB]; \n array[posB] = temp; \n }", "function swap(array, i , j){\n let temp = array[i]\n array[i] = array[j]\n array[j] = temp\n}", "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "function swapArr(arr, idx1, idx2) {\n var temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "function swap (arr, i, j){\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n}", "function swap(array){\n\n for(var i = 0 ; i < array.length/2 ; i++){\n var tmp = array[array.length - 1 - i];\n array[array.length -1 - i] = array[i];\n array[i] = tmp;\n }\n return array.join(\"\");\n\n }", "function swap(array){\n\n for(var i = 0 ; i < array.length/2 ; i++){\n var tmp = array[array.length - 1 - i];\n array[array.length -1 - i] = array[i];\n array[i] = tmp;\n }\n return array.join(\"\");\n\n }", "function arraySwapPairs(arr) {\n\tfor(var i = 0; i < arr.length -1; i += 2) {\n\t\tvar temp = arr[i];\n\t\tarr[i] = arr[i + 1];\n\t\tarr[i + 1] = temp;\n\t}\n\treturn arr;\n}", "function arraySwap(array) {\n\t\t\tif (!array || !array.length)\n\t\t\t\treturn array;\n\n\t\t\tvar left = 1;\n\t\t\tvar right = array.length - 1;\n\t\t\tfor (; left < right; left++, right--) {\n\t\t\t\tvar temporary = array[left];\n\t\t\t\tarray[left] = array[right];\n\t\t\t\tarray[right] = temporary;\n\t\t\t}\n\t\t\treturn array;\n\t\t}", "function swap(arr, index1, index2) {\n var temp = arr[index1]; // store value of arr[index1]\n arr[index1] = arr[index2]; // assign value of arr[index2] to arr[index1]\n arr[index2] = temp; // assign value of arr[index1] to arr[index2] from temp store\n}", "function swap (arr, pos1, pos2) {\n var arr = arr, pos1 = pos1, pos2 = pos2, temp;\n\n temp = arr[pos1];\n arr[pos1] = arr[pos2];\n arr[pos2] = temp;\n\n return arr;\n}", "function swap(array, i, j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n}", "function swap(array, i, j) {\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n}", "function swap(arr, i, j) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n}", "function swap(arr, index1, index2) {\n var temp = arr[index1]\n arr[index1] = arr[index2]\n arr[index2] = temp\n return arr\n}", "function swap(array, posA, posB) {\n var temp = array[posA]; \n array[posA] = array[posB]; \n array[posB] = temp; \n }", "function swap(array, a, b) {\n\t\t\tvar temp = array[a];\n\t\t\tarray.splice(a, 1, array[b]);\n\t\t\tarray.splice(b, 1, temp);\n\t\t}", "function swap(array, i, low) {\n var temp = array[i];\n array[i] = array[low];\n array[low] = temp;\n}", "function reverseBySwap(array, start, end) {\n while (start < end) {\n let temp = array[start];\n array[start] = array[end];\n array[end] = temp;\n start++;\n end--;\n }\n}", "function swap(arr, i, j) {\r\n let tmp = arr[i];\r\n arr[i] = arr[j]\r\n arr[j] = tmp\r\n\r\n}", "function swapElements(array, swapIndex) {\n const temp = array[swapIndex];\n array[swapIndex] = array[swapIndex - 1];\n array[swapIndex - 1] = temp;\n return array;\n}", "function swapTowardCenter(arr){\n for (let i = 0; i < arr.length/2; i++) {\n var temporaryVarForSwitchingIndex = arr[i]\n arr[i] = arr[arr.length - 1-i] \n arr[arr.length - 1-i] = temporaryVarForSwitchingIndex \n \n }\n return arr \n}", "function oddSwap(arr) {\n\ttemp = null;\n\n\tfor(var num = 0; num < Math.floor(arr.length/2); num++) {\n\t\tif (num % 2 == 0) {\n\t\t\ttemp = arr[num];\n\t\t\tarr[num] = arr[(arr.length) - 1 - num];\n\t\t\tarr[(arr.length) - 1 - num] = temp;\n\t\t}\n\t}\n\tconsole.log(arr);\n\treturn arr;\n}", "function swap(array, i, j){\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n}", "function swap(arr, index1, index2) {\n\tconst value1 = arr[index1],\n\t\tvalue2 = arr[index2]\n\tarr[index1] = value2\n\tarr[index2] = value1\n\t//![arr[index2], arr[index1]] = [arr[index1], arr[index2]] //! Why doesnt this work?\n}", "function swapItems(arr,index1,index2){\n temp=arr[index1];\n arr[index1]=arr[index2];\n arr[index2]=temp;\n return arr;\n}", "function swap(arr, idx1, idx2) {\n let temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "function swap (a, b) {\n let temp = sortedArray[a]\n sortedArray[a] = sortedArray[b]\n sortedArray[b] = temp\n }", "function swap(arr, idx1, idx2){\n // add whatever you parameters you deem necessary, good luck!\n [arr[idx1], arr[idx2]] = [arr[idx2],arr[idx1]]\n return arr;\n}", "function swap(i, unorderedArray) {\n [unorderedArray[i], unorderedArray[i + 1]] = [unorderedArray[i + 1], unorderedArray[i]];\n return unorderedArray;\n}", "function shiftArrayValues(arr){\n for (let i=1;i<arr.length;i++){\n arr[i-1] = arr[i];\n }\n arr[arr.length-1] = 0;\n return arr;\n}", "function swap(arr, idx1, idx2) {\n let temp = arr[idx1];\n arr[idx1] = arr[idx2];\n arr[idx2] = temp;\n}", "function swapTowardsTheCenter(arr) {\n var len = arr.length;\n var idx = 0;\n var lastIdx = arr.length - 1;\n while (idx <= len / 2 && lastIdx >= len / 2) {\n var temp = arr[idx];\n arr[idx] = arr[lastIdx];\n arr[lastIdx] = temp;\n idx = idx + 2;\n lastIdx = lastIdx - 2;\n }\n return arr;\n}", "function swap (arr, i, j) {\n const tmp = arr[i]\n arr[i] = arr[j]\n arr[j] = tmp\n}", "function swap(array, i, j) {\n\tlet temp = array[i];\n\tarray[i] = array[j];\n\tarray[j] = temp;\n}", "function swap(array, i, j) {\n\tlet temp = array[i];\n\tarray[i] = array[j];\n\tarray[j] = temp;\n}", "function swap (a, b) {\n [array[a], array[b]] = [array[b], array[a]];\n }", "function swap(array, i, j){\n [array[i], array[j]] = [array[j], array[i]]\n}", "function swap(array, i, j) {\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n}", "function swap(array, left, right){\n [array[left], array[right]]=[array[right], array[left]];\n return array;\n}", "function swapTowardCenter(arr) {\n for (var i = 0; i < arr.length / 2; i = i + 2) {\n var temp = arr[i];\n arr[i] = arr[arr.length - (i + 1)];\n arr[arr.length - (i + 1)] = temp;\n }\n console.log(arr);\n}", "function swap(array, i, j) {\n let tmp = array[j];\n array[j] = array[i];\n array[i] = tmp;\n}", "function skipSwap(array) {\n var skipTarget_L = 0\n var skipTarget_R = array.length-1\n for (var i = 0; i < array.length/2; i+=2){\n // if (array[skipTarget_L] < array[skipTarget_R]){\n temp = array[skipTarget_L]\n array[skipTarget_L] = array[skipTarget_R]\n array[skipTarget_R] = temp\n skipTarget_L +=2\n skipTarget_R = (array.length -1) - skipTarget_L\n // }\n }\n console.log(array);\n}", "function swapTowardsCenter(arr){\n for(var i = 0; i < arr.length/2; i+=2){\n var temp = arr[i]\n arr[i] = arr[arr.length - 1 - i]\n arr[arr.length - 1 - i] = temp\n }\n return arr\n}", "function swap(array, i, j) {\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n}" ]
[ "0.8122806", "0.8072072", "0.7945784", "0.7831593", "0.7822957", "0.77631676", "0.7743691", "0.7736898", "0.7690334", "0.7685119", "0.75811106", "0.74375814", "0.7416314", "0.7374409", "0.73619366", "0.73575324", "0.72803885", "0.7273154", "0.72586143", "0.72502023", "0.7219998", "0.72076756", "0.7206647", "0.71612847", "0.71314466", "0.7128359", "0.7119722", "0.7103706", "0.70918244", "0.7088456", "0.708448", "0.707733", "0.7072206", "0.70708674", "0.7065043", "0.70547307", "0.7049963", "0.7044179", "0.70407", "0.7031757", "0.7023795", "0.70220226", "0.70156837", "0.7014795", "0.7011534", "0.7000679", "0.6984582", "0.6984345", "0.6982152", "0.6967325", "0.6959659", "0.69573057", "0.69518024", "0.69511485", "0.694661", "0.6934484", "0.6922377", "0.6921488", "0.6921488", "0.6921488", "0.6915129", "0.6913081", "0.6913081", "0.6911376", "0.6908006", "0.6903807", "0.68972445", "0.68948615", "0.68948615", "0.68877256", "0.6886161", "0.6857429", "0.6845793", "0.68335843", "0.6820461", "0.68099415", "0.68016726", "0.67983985", "0.6795692", "0.6793653", "0.6787818", "0.6780948", "0.67773795", "0.67729723", "0.6755383", "0.67464316", "0.67401457", "0.67294115", "0.67274034", "0.6723339", "0.67205584", "0.67205584", "0.6712927", "0.6711042", "0.6709405", "0.6709125", "0.6694688", "0.6678042", "0.6673623", "0.66708535", "0.66700864" ]
0.0
-1
13) Number to String Write a function that takes an array of numbers and replaces any negative values within the array with the string 'Dojo'. For example if array = [1,3,2], your function will return ['Dojo','Dojo',2].
function p13(){ var arr = [-9,-10,12,3,-32,100,-1998] for(var i = 0; i < arr.length; i++){ if(arr[i] < 0){ arr[i] = "Dojo" } } console.log(arr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function num2Str(arr){\n var d = \"Dojo\";\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = d;\n }\n }\n return arr;\n}", "function numToString(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 'Dojo';\n }\n }\n return arr;\n}", "function numToString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if(arr[i] < 0) {\n arr[i] = \"Dojo\";\n }\n }\n return arr;\n}", "function numToStr(arr) {\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] < 0)\n arr[i] = 'Dojo';\n }\n return arr; \n}", "function numberToString(array) {\n for (let i = 0; i < array.length; i++) {\n if(array[i] < 0){\n array[i] =\"DOJO\";\n }\n \n }\n return array;\n}", "function arrNum2String(xarr){\n for (var i=0; i<xarr.length; i++) {\n if (xarr[i]<0) {\n xarr[i]=\"Dojo\"\n }\n }\n return xarr;\n}", "function numbstring(arr){\n\n for (i=0;i<arr.length;i++){\n if(arr[i]<0){\n arr[i]=\"Dojo\"\n }\n }\n\n return arr;\n\n}", "function numbertostring(arr)\r\n{\r\n\tfor(var i=0;i<arr.length;i++)\r\n\t{\r\n\t\tif(arr[i]<0)\r\n\t\t{\r\n\t\t\tarr[i]=\"Dojo\";\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"new arr\",arr);\r\n\t\r\n}", "function numStr(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Dojo';\n }\n }\n return arr;\n}", "function numToString(arr){\n var newArr = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] <= 0) {\n newArr.push(\"Dojo\");\n }\n else {\n newArr.push(i);\n }\n }\n return newArr;\n}", "function convertToString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = \"Dojo\"\n }\n }\n return arr;\n}", "function swapStringForArrNegs(arr) {\n for (var idx = 0; idx < arr.length; i++) {\n if (arr[idx] < 0) {\n arr[idx] = 'Dojo!';\n }\n }\n return arr;\n}", "function swapStringForNegativeArrayValues(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\"\n }\n }\n return arr\n}", "function swapNegativeWithString(arr) {\n for (var k = 0; k < arr.length; k++) { // Loop through each element in the array\n if (arr[k] < 0) { // If this current element is negative, replace with string\n arr[k] = 'Dojo';\n }\n }\n}", "function replaceNegs2Dojo(arr){\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Dojo';\n }\n }\n console.log(arr);\n return arr;\n}", "function stringItUp(arr){\n return arr.map(number => String(number))\n}", "function numToStrings(array) {\n return array.map(el => el + '')\n }", "function numberToString(arr) {\n const result = arr.map(String);\n return result;\n}", "function SwapStringForNegativesValues(arr){\n for(let i=0;i<arr.length;i++){\n if (arr[i] <= 0){\n arr[i] = \"Dojo\";\n }\n }\n console.log(arr)\n}", "function swapStrNegatives(strArr) {\r\n var length = strArr.length;\r\n for (var i = 0; i < length; i++) {\r\n if (strArr[i] < 0) {\r\n strArr[i] = \"Dojo\"\r\n }\r\n }\r\n console.log(\"\\n\\nSwap String for Negatives: [1, -5, 10, -2]\")\r\n console.log((strArr))\r\n}", "function stringItUp(arr){\r\n return arr.map(num => num.toString())\r\n }", "function func13(inputArray){\n for(var i=0; i<inputArray.length; i++){\n if(inputArray[i]<0){\n inputArray[i]='Dojo';\n }\n }\n return inputArray;\n}", "function swapString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Negative Value'\n }\n }\n return arr\n}", "function fromArrayToString(array, negArray){\n\tvar str = \"\";\n\tvar str2 = \"\";\n\tfor(var i=0; i<array.length; i++){\n\t\tif(array[i] == undefined){\n\t\t\tstr += '_';\n\t\t\tcontinue;\n\t\t}\n\t\tstr += array[i];\n\t}\n\tif(negArray !== undefined){\n\t\tfor(var i=negArray.length-1; i > -1; i--){\n\t\t\tif(negArray[i] == undefined){\n\t\t\tstr2 += '_';\n\t\t\tcontinue;\n\t\t}\n\t\tstr2 += negArray[i];\n\t\t}\n\t}\n\treturn (str2+str);\n}", "function SwapStringForArrayNegativeVals(arr){\n}", "function numberToString(array)\n{\n for(var i =0; i <array.length; i++)\n {\n if(array[i]>=10)\n {\n array[i]=\"Big\";\n }\n if(array[i]<=5)\n {\n array[i]=\"small\";\n }\n console.log(array[i]);\n }\n console.log(\"\");\n}", "function stringItUp(arr) {\n const result = arr.map(function(num){\n return num.toString();\n });\n return result;\n}", "function noNegativesDojo(arr) {\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < 0) {\n arr[idx] = \"Dojo\";\n }\n }\n console.log(arr);\n}", "function stringItUp(arr){\n stringArr = arr.map(function(num){\n return num.toString()\n })\n console.log(stringArr)\n}", "function formatPhoneNumber(array) {\n var newString = '';\n array.splice(0, 0, '(');\n array.splice(4, 0, ')');\n array.splice(5, 0, ' ');\n array.splice(9, 0, '-');\n for (var i = 0; i < array.length; i++) {\n newString += array[i];\n }\n return newString;\n}", "function stringify(arr) {\n\tarr.forEach(function(number){\n\t\toutputStr += number + '\\n'\n\t});\n}", "function replaceNum(num)\r\n{\r\n\tvar string = String(num);\r\n\tvar temp = \"\";\r\n\tvar lentxt = string.length - ((String(Math.abs(num))).length) ; // different length between String and number \r\n\t\r\n\tfor ( j=string.length ; j > lentxt; j = j-3)\r\n\t{\r\n\t\t\r\n\t\tif (j-3 <= lentxt ) temp = string.substring(0 , j) + temp;\r\n\t\telse\t\t\t\ttemp = \",\" + string.substr(j-3, 3) + temp;\r\n\t\t\r\n\t}\r\n\treturn temp;\r\n}", "function abcde(x) {\n for (var i = 0; i < x.length; i++) {\n if (x[i] > 5) {\n x[i] = \"Coding\";\n } else if (x[i] < 0) {\n x[i] = \"Dojo\";\n }\n }\n return x;\n}", "function formatPhoneNumber(numbers) {\n var phoneNumber = []\n phoneNumber.push('(', numbers[0], numbers[1], numbers[2], ')')\n phoneNumber.push(' ', numbers[3], numbers[4], numbers[5])\n phoneNumber.push('-', numbers[6], numbers[7], numbers[8], numbers[9])\n console.log(phoneNumber.join(''))\n return phoneNumber.join('')\n}", "function changeNumToStr(num){\n return num.toString()\n}", "function expandedForm(num) {\n let numArr = num.toString().split('')\n for (let i = 0; i<numArr.length; i++){\n for (let j = numArr.length - i; j > 1; j--){\n numArr[i] += '0'\n }\n }\n let result = numArr.filter( x => !x.startsWith(0))\n return result.join(' + ')\n }", "function replaceNegNum(arr) {\n var negNum = arr.map(function(elem){\n if (elem<0){\n elem = 0;\n }\n return elem;\n });\n return negNum; \n}", "function thirteen(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Dojo\"\n }\n }\n return arr;\n}", "function createString(numbers) {\n var string = \"\";\n for (var i = 0; i < 5; i += 1) {\n if (i > 0) string += \"-\";\n string += numbers[i];\n }\n string += \" \";\n string += numbers[5];\n return string;\n}", "function number_string(){\n\tvar numbers = [\"One\",\"Two\",\"Three\",\"Four\",\"Five\",\"Six\",\"Seven\",\"Eight\",\"Nine\"];\n\treturn numbers;\n}", "function formatPhoneNumber(numbers) {\n numbers.splice(6, 0, \"-\");\n numbers.splice(3, 0, \") \");\n numbers.splice(0, 0, \"(\");\n return numbers.join('');\n}", "function replaceNegative(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = \"Negative\"\n }\n }\n console.log(arr);\n}", "function stringItUp(arr){\n return arr.toString()\n}", "function replaceNum(num) // Parses an int of format 123456 to an string in format 123,456 \r\n{\r\n\tvar string = String(num);\r\n\tvar temp = \"\";\r\n\tvar lentxt = string.length - ((String(Math.abs(num))).length) ; // different length between String and number \r\n\t\r\n\tfor ( j=string.length ; j > lentxt; j = j-3)\r\n\t{\r\n\t\tif (j-3 <= lentxt ) {temp = string.substring(0 , j) + temp}\r\n\t\telse\t\t\t\t{temp = unitSeparator + string.substr(j-3, 3) + temp}\r\n\t}\r\n\treturn temp;\r\n}", "function stringItUp(arr){\n var newArr = arr.map(function(item){\n return item.toString()\n })\n console.log(newArr)\n}", "function toString(array) {\n var string = '';\n for (i = 0 ; i<array.length ; i++) {\n string = string + array[i] + ' ';\n }\n return string;\n}", "function stringItUp(arr){\r\n const result = arr.map(function(num){\r\n return num * 1;\r\n });\r\n return result;\r\n}", "function j(a){return a.map(function(a){return\" \"+a})}", "function joinAllElements(array) {\n var output = '';\n //var counter = 0;\n for (var i = 0; i < array.length; i++) {\n if (([array[i]] != undefined) && (array[i] != null) && (array[i] != Infinity) && (!isNaN(array[i]))) {\n output += array[i];\n\n }\n }\n return output;\n}", "function formatToList(arr){ //array to format number list\n\t//var arr = [1,2,3,4,8,15,16,17,20,21,30]\n\t//arr = arr.map(Number);\n\tarr = arr.sort(function(a, b){return a - b});\n\tvar start = arr[0];\n\tvar end = arr[0];\n\tvar result = \"\";\n\tfor(var i in arr){\n\t\ti = parseInt(i);\n\t\tif (arr[i] === arr[i+1]-1){\n\t\t\tend = arr[i+1];\n\t\t}\n\t\telse{\n\t\t\tif (start >= end){\n\t\t\t\tresult += start+\",\";\n\t\t\t}else{\n\t\t\t\tresult += start+\"-\"+end+\",\";\n\t\t\t}\n\t\t\tstart = arr[i+1];\n\t\t}\n\t}\n\tresult = result.slice(0, result.length-1)\n\tresult = result.split(\",\")\n\treturn result\n}", "function swap(arr){\n for(var i=0;i<arr.length;i++){\n if(arr[i]<0){\n arr[i]='Dojo'\n }\n }\n return arr;\n}", "function flipDigits(arr) {\n for (let i = 0; i < arr.length; ++i) {\n if (arr[i] === '1') arr[i] = '0';\n else if (arr[i] === '0') arr[i] = '1';\n else throw `ERROR: UNRECOGNIZED DIGIT: ${arr[i]}`;\n }\n return arr;\n }", "function stringy(number) {\n let result = \"\";\n for (let idx = 0; idx < number; idx += 1) {\n if (idx % 2 === 0) {\n result += \"1\";\n } else {\n result += \"0\";\n }\n }\n return result;\n}", "function numberToString(test) {\r\n return `${test}`; \r\n }", "function convertNumberToString(num, len) {\n var numStr=\"\";\n for(var i = 0; i< len; i++){\n numStr=numStr+ num.charAt(i);\n if(i!=len-1) {\n numStr=numStr+ \", \";\n }\n }\n console.log(\"numStr: \"+ numStr);\n return numStr;\n }", "function stringifyNumber(number) {\r\n\r\n var stringifiedNumber = \"\";\r\n if(number==0)\r\n {\r\n return digitToString[number];\r\n }\r\n while(number>0) {\r\n var remainder = number%10;\r\n var digitString = digitToString[remainder];\r\n stringifiedNumber = digitString+stringifiedNumber;\r\n number = number/10 | 0;\r\n }\r\n return stringifiedNumber;\r\n\r\n}", "function stringifyArray(x) {\r\n const alphabet = 'abcdefghijklmnopqrstuvwxyz';\r\n const reverseAlphabet = alphabet.split('').reverse();\r\n reverseAlphabet.push('!', '?', ' ');\r\n\r\n const stringified = x.map(number => {\r\n const letterObjects = reverseAlphabet.find(letter => reverseAlphabet.indexOf(letter) +1 == number);\r\n return letterObjects;\r\n })\r\n\r\n const phrase = stringified.join('');\r\n console.log(phrase);\r\n return phrase;\r\n}", "function numToString(arg){\n return '' + arg + ''\n}", "function concatSignWithNumber(arr) {\n console.log('arr: ',arr);\n\n for(let i = 0; i < arr.length; i++) {\n if( arr[i] === '-') {\n arr[i + 1] = - arr[i + 1];\n arr.splice(i,2, arr[i + 1]);\n console.log('arr[i] === \\'-\\': ',arr);\n i = 0;\n }\n\n if( arr[i] === '.') {\n arr[i - 1] = parseFloat(arr[i - 1] + arr[i] + arr[i + 1]);\n arr.splice(i - 1,3, arr[i - 1]);\n console.log('arr[i] === \\'.\\': ',arr);\n i = 0;\n }\n\n if( arr[i] === '+') {\n arr.splice(i,2, arr[i + 1]);\n i = 0;\n }\n }\n console.log('concatSignWithNumber:', arr);\n return arr;\n}", "function dash (numString) {\n // define your function here\n var numStr = numString\nvar numStrArrMinus = []\n\nfor (var i = 0; i < numStr.length ; i++)\nif (numStr[i]%2===0 && numStr[i+1]%2 ===0 ){\nnumStrArrMinus.push(numStr[i]+\"-\")\n}\nelse {\nnumStrArrMinus.push(numStr[i])\n}\n\nreturn(numStrArrMinus.join(''))\n}", "function reverseMinus(array){\n\n}", "function addSign(array) {\n var index = 0; //the start of the number the sign will be added to\n var number;\n\n //find the start of the number that the sign should be added to\n for(var i = array.length-1; i >= 0; i--) {\n if(!array[i].match(/[\\d\\.]/g)) {\n index = i+1;\n break;\n }\n }\n\n //check to see if a sign has already been applied to the number\n if(index == 0) {\n //if no index then add a minus sign\n array.splice(0,0,\"-\");\n return array;\n } else {\n //if the index is 1 then there is a plus sign, get rid of plus sign\n if(index == 1) {\n array.shift();\n return array;\n } else if(array[index-2].match(/\\d\\.?/g) && index > 1) {\n number = array.slice(index).join(\"\");\n } else {\n number = array.slice(index-1).join(\"\");\n index = index-1;\n }\n }\n\n //if no sign has been applied, work out what sign needs to be applied\n if(Math.sign(number) == 1) {\n array.splice(index, 0, \"-\");\n return array;\n } else {\n array.splice(index, 1);\n return array;\n }\n}", "function stringy(number) {\n let result = '';\n for (let i = 0; i < number; i += 1) {\n i % 2 === 0 ? result += '1' : result += '0'\n }\n return result;\n}", "function numToText(str) {\n\t\tvar numArr = str.match(/\\d/g),\n\t\tnumWords = [\n\t\t\"zero\",\n\t\t\"one\",\n\t\t\"two\",\n\t\t\"three\",\n\t\t\"four\",\n\t\t\"five\",\n\t\t\"six\",\n\t\t\"seven\",\n\t\t\"eight\",\n\t\t\"nine\"\n\t\t],\n\t\ti = 0;\n\t\t\n\t\tif (!numArr) {\n\t\t\treturn str;\n\t\t}\n\t\t\n\t\tfor (i = 0; i < numArr.length; i++) {\n\t\t\tregex = new RegExp(numArr[i], \"g\");\n\t\t\tstr = str.replace(regex, numWords[parseInt(numArr[i])]);\n\t\t}\n\t\t\n\t\treturn str;\n\t}", "stringThisArray(array){\n return array.join(\"\");\n }", "function createPhoneNum(nums) {\n let phoneNum = \"(XXX) XXX-XXXX\";\n if (nums.length < 10 || nums.lenght > 10) {\n return \"Not a Number\";\n } else {\n for (let i = 0; i < 10; i++) {\n phoneNum = phoneNum.replace(\"X\", nums[i]);\n }\n return phoneNum;\n }\n}", "function formatNum(num) {\n const number = num.toString(10).split('');\n for (let i = number.length - 3; i > 0; i -= 3) {\n number.splice(i, 0, '-')\n }\n return number.join('')\n }", "function numberToString(num) {\nreturn String(num)\n}", "numToStr(num) {\n if (num === \"-\") {\n return \"\";\n }\n var n = Number(num);\n return n.toLocaleString(\"en\"); // 8312456 --> \"8,312,456\"\n }", "function replaceNeg(arr){\n for(var i=0; i<arr.length; i++){\n if(arr[i]<0){\n arr[i]=0\n }\n }return arr\n}", "function substituir(n1) {\n let numeros = n1.split('');\n var result = [numeros[0]];\n\n for (let j = 1; j < numeros.length - 1; j++) {\n const element = numeros[j];\n if (parseInt(numeros[j-1]) % 2 === 0 && parseInt((numeros[j])) % 2 === 0) {\n result.push('-',numeros[j]);\n console.log(result);\n\n }\n else if (parseInt(numeros[j-1]) % 2 !== 0 && parseInt((numeros[j])) % 2 !== 0) {\n result.push('#',numeros[j]);\n console.log(result);\n }\n else {\n result.push(numeros[j]);\n }\n }\n\n if (parseInt(numeros[numeros.length - 2]) % 2 === 0 && parseInt((numeros[numeros.length - 1])) % 2 === 0) {\n result.push('-', numeros[numeros.length - 1]);\n console.log(result);\n\n }\n if (parseInt(numeros[numeros.length - 2]) % 2 !== 0 && parseInt((numeros[numeros.length - 1])) % 2 !== 0) {\n result.push('#', numeros[numeros.length - 1]);\n }\n\n\n\n return result.join('');\n}", "function convertToString()\t{\r\n\tarrayString = prefer.toString();\r\n\t\r\n}", "function createPhoneNumber(numbers){\n var format = \"(xxx) xxx-xxxx\";\n \n for(var i = 0; i < numbers.length; i++) {\n format = format.replace('x', numbers[i]);\n }\n \n return format;\n}", "function createPhoneNumber(numbers) {\n var format = '(xxx) xxx-xxxx'\n\n for (var i = 0; i < numbers.length; i++) {\n format = format.replace('x', numbers[i])\n }\n\n return format\n}", "function numberToString(num) {\n\t //your code is here\n\t var result=\"\";\n\t result=result+num;\n\t return result;\n\t}", "function arrayToString(arr) {\n var output = \"\"\n arr.forEach(function(i, index, array) {\n output += i + \" \"\n });\n return output\n}", "formatArray() {\n let formattedArray = this.manipulateString().map(y => {\n switch (y) {\n case '':\n return ''\n break;\n case ' ':\n return ' '\n break;\n case ',':\n return ','\n break;\n case \"!\":\n return y\n break;\n default:\n return `[${y}]`\n break;\n }\n }).join(' - ')\n\n return formattedArray\n }", "function stringy(number) {\n let result = '';\n for (let i = 0; i < number; i++) {\n if (i % 2 === 0) {\n result += '1';\n } else {\n result += '0';\n }\n }\n return result;\n}", "toListString(arr) {\n\t\tif (!arr.length) return '';\n\t\tif (arr.length === 1) return arr[0];\n\t\tif (arr.length === 2) return `${arr[0]} and ${arr[1]}`;\n\t\treturn `${arr.slice(0, -1).join(\", \")}, and ${arr.slice(-1)[0]}`;\n\t}", "function dash (numString) {\n // define your function here\n for (var i = 0; i < numString.length - 1; i++) {\n if (parseInt(numString[i]) % 2 === 0 && parseInt(numString[i + 1]) % 2 === 0) {\n numString = numString.replace(numString[i], numString[i] + '-')\n i += 1\n }\n }\n return numString\n}", "function f5(arr) {\n return +arr.join('');\n}", "function arrayToString(array) {\n return array.join('')\n }", "function arrToStrFormatted(a) {\n if (a != 0) {\n return a.toString().split(\",\").join(\", \");\n }\n return 0;\n }", "function transformStrArr(string){\nlet numArray = string.replace(/\\s+/g, \"\");\nlet numPieces = numArray.split(\"\").map(Number);\n //.map(Number)converts all items in the array to a number and returns a new array with those converted values.\nfor (let i = 0; i < numPieces.length; i++){\n result = numPieces;\n}\nreturn result;\n}", "function complementGiver (array, string) {\n\tvar complementArr = [];\n\tfor ( var i = 0; i < array.length; i++) {\n\t\tcomplementArr.push(array[i] + string);\n\t}\n\treturn complementArr;\n}", "function reverseNumber(number) {\n\tnumber = +number;\n\tvar isNegative = number < 0,\n\t\tnumber = number.toString().replace('-', '').split(''),\n\t\treversedNumber = [];\n\n\tif (isNegative) {\n\t\treversedNumber.push('-');\n\t}\n\n\tArray.prototype.push.apply(reversedNumber, number.reverse());\n\treturn +(reversedNumber.join(''));\n}", "function numbersToStrings(things) {\n const strings = things.map(\n thing => (typeof thing === \"number\" ? thing + \"\" : thing)\n );\n\n return strings;\n}", "function arrWithNoBrsAndSpacesToString(array) {\n\tlet arrSpaces = array.map((item) => {\n\t\treturn item.join(' ')\n\t})\n\tconsole.log(arrSpaces)\n\t// console.log(arrSpaces)\n\tlet strBrsSpaces = arrSpaces.join('<br>')\n\treturn strBrsSpaces\n}", "function makeNegative(numbers) {\n // numbers.map(function(num, index, array){ });\n // don't need index or array. \n // numbers.map(function(num){ });\n //map will return a new array. That's the end goal. So we don't need the variable \n return numbers.map(function(num){\n // if(num > 0){\n // num *= -1;\n // // same as num = num * -1;\n // }\n // return num; \n // or we can\n return Math.abs(num) * -1; \n });\n\n}", "function expandedForm(num) {\n\tconst degree = (num + '').length;\n\tlet arr = [];\n\tfor (let i = degree; i >= 0; i--) {\n\t\tlet number = Math.floor(num / Math.pow(10, i - 1)) * Math.pow(10, i - 1);\n\t\tif (number !== 0) {\n\t\t\tarr.push(number + '');\n\t\t\tnum -= number;\n\t\t}\n\t}\n\treturn arr.join(' + ');\n}", "function tidyNumber(n){\n return [...n+=\"\"].sort().join``==n\n}", "function expandedForm(num) {\n \n return (num).toString().split(\"\").map((a,i,arr) =>{\n return a*Math.pow(10, arr.length-i-1);\n }).filter(n => n>0).join(\" + \");\n\n}", "function convert(num) {\n var newArr = [];\n var ans = \"\";\n var newNum = num;\n while (newNum > 0) {\n if (newNum >= 50) {\n newArr.push(\"L\");\n newNum -= 50;\n } else if (newNum >= 40 && newNum < 50) {\n newArr.push(\"XL\");\n newNum -= 40;\n } else if (newNum >= 10 && newNum < 40) {\n newArr.push(\"X\");\n newNum -= 10;\n } else if (newNum == 9) {\n newArr.push(\"IX\");\n newNum -= 9;\n } else if (newNum > 4 && newNum < 10) {\n newArr.push(\"V\");\n newNum -= 5;\n } else if (newNum == 4) {\n newArr.push(\"IV\");\n newNum -= 4;\n } else if (newNum > 0 && newNum < 4) {\n newArr.push(\"I\");\n newNum--;\n }\n\n\n ans = newArr.join(\"\");\n }\n return ans;\n}", "function removeComma(arr){\n return arr.toString().replace(/\\,/g,'').replace(/\\-/g,' ');\n}", "function formatNumber(n) {\n\treturn n.replace(\",\", '.').replace(\" \", '');\n\t;\n}", "function insertDash(num) {\n // turns string into array\n var arr = num.toString().split(\"\")\n // for loop that iterates through the digits\n for(i=0; i<arr.length; i++) {\n // compares consecutive digits to see if both are odd\n if(parseInt(arr[i])%2===1 && parseInt(arr[i+1])%2===1)\n { // inserts dash between odd numbers\n arr.splice(i+1,0,\"-\");\n }\n }\n\n// turn array into a number\narr = arr.join(\"\");\n// return number\nreturn arr;\n}", "function toStr(n) {\n return n < 10 ? \"0\" + n.toString() : \"\" + n.toString();\n}", "function convertToString(n) {\n const answer = [];\n\n while (n > 0) {\n answer.unshift(n % 10);\n n = Math.floor(n / 10);\n }\n\n return answer.join('');\n}", "function arrayToString(array, parameter) {\n if (parameter == \"binary\") {\n return array.join(\" \");\n }\n else {\n return array.join(\".\");\n }\n }", "function arrToStr(arr) {\n var str = '';\n\n for (var i = 0; i < arr.length; i++) {\n str += arr[i].toString();\n }\n\n return str;\n}" ]
[ "0.7996186", "0.796169", "0.7887625", "0.7872084", "0.7707387", "0.7668621", "0.76547277", "0.75346446", "0.75113815", "0.74068165", "0.7074837", "0.7023538", "0.7022329", "0.69146156", "0.68901455", "0.6883047", "0.6878468", "0.68550646", "0.6763038", "0.66701037", "0.66505986", "0.66378826", "0.6630275", "0.6562008", "0.6538602", "0.65255934", "0.6445143", "0.64370924", "0.6350533", "0.6273563", "0.62640125", "0.6202706", "0.61932695", "0.61871773", "0.6165161", "0.6101435", "0.6095256", "0.60518205", "0.6050985", "0.60463476", "0.6030242", "0.60293144", "0.5933172", "0.58925974", "0.5865945", "0.58551925", "0.58500826", "0.58412975", "0.57910365", "0.5789695", "0.57353914", "0.57309103", "0.5714077", "0.57080513", "0.5706354", "0.5693359", "0.56933", "0.5691742", "0.56872886", "0.56832653", "0.5677507", "0.5666222", "0.56643385", "0.5657641", "0.565377", "0.5631325", "0.5620858", "0.5619214", "0.56172746", "0.56172323", "0.5598569", "0.55947775", "0.5592657", "0.55764085", "0.5573473", "0.5573252", "0.5573063", "0.55717474", "0.5566821", "0.55577683", "0.55567354", "0.55546933", "0.5550835", "0.55503494", "0.5543866", "0.5534724", "0.55328166", "0.55274206", "0.55246437", "0.55222553", "0.55011666", "0.5497036", "0.54946256", "0.54941195", "0.5491427", "0.5490311", "0.54866767", "0.54767555", "0.5476552", "0.54698104" ]
0.6330898
29
properties available to the custom element for data binding
static get properties() { return {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get properties() {\n return {\n label: { type: String },\n value: { type: String },\n disabled: { type: Boolean, reflect: true },\n elevation: { type: Number },\n active: { type: Boolean, reflect: true },\n comingSoon: { type: Boolean, reflect: true, attribute: \"coming-soon\" },\n };\n }", "static get observedAttributes(){\n return ['nombre', 'apellido'];//lista de los atributos que tiene el componente\n }", "static get properties() {\n return {\n value: {\n type: String,\n },\n fontSize: {\n type: Number,\n attribute: \"font-size\",\n },\n wordWrap: {\n type: Boolean,\n attribute: \"word-wrap\",\n },\n readOnly: {\n type: Boolean,\n attribute: \"read-only\",\n },\n /**\n * THIS MAKES MULTIPLES EDITORS WORK BECAUSE OF EVENTS\n * DO NOT MESS WITH THIS AND IT HAS TO BE SET\n */\n uniqueKey: {\n type: String,\n attribute: \"unique-key\",\n },\n eventTypes: {\n type: Object,\n },\n language: {\n type: String,\n },\n theme: {\n type: String,\n },\n libPath: {\n type: String,\n attribute: \"lib-path\",\n },\n editorReference: {\n type: String,\n reflect: true,\n attribute: \"editor-reference\",\n },\n /**\n * automatically set focus on the iframe\n */\n autofocus: {\n type: Boolean,\n reflect: true,\n },\n /**\n * hide line numbers\n */\n hideLineNumbers: {\n type: Boolean,\n attribute: \"hide-line-numbers\",\n },\n tabSize: {\n type: Number,\n attribute: \"tab-size\",\n },\n };\n }", "static get properties() {\n return {\n width: {\n name: \"width\",\n type: \"String\",\n value: \"300px\",\n reflectToAttribute: false,\n observer: false\n },\n height: {\n name: \"height\",\n type: \"String\",\n value: \"300px\",\n reflectToAttribute: false,\n observer: false\n }\n };\n }", "didReceiveAttrs() {\n this._super(...arguments);\n this._setupValue();\n }", "static get properties() {\n return {\n name: {\n type: String\n },\n selected: {\n type: String,\n value: 'Item One'\n },\n\n wideLayout: {\n type: Boolean,\n value: false,\n observer: 'onLayoutChange',\n },\n\n items: {\n type: Array,\n value: function() {\n return ['Item One', 'Item Two', 'Item Three', 'Item Four', 'Item Five'];\n }\n }\n }\n }", "static get properties() {\n return {\n toggleIcon: {\n type: String\n },\n\n /*\n Key information:\n * value specifies the property's default value.\n * notify tells Polymer to dispatch property change events when the property's value changes. This lets the change be observed by other nodes.\n * The reflectToAttribute property tells Polymer to update the corresponding attribute when the property changes. This lets you style the element using an attribute selector, like icon-toggle[pressed].\n */\n pressed: {\n type: Boolean,\n value: false,\n notify: true,\n reflectToAttribute: true\n }\n };\n }", "static get observedAttributes() {\n return ['name', 'listId', 'label', 'options'];\n }", "get attrs () { return this._attrs; }", "propertyChangedHandler(propertyName, oldValue, newValue) {\n const that = this;\n\n super.propertyChangedHandler(propertyName, oldValue, newValue);\n\n if (propertyName === 'hidden') {\n if (!newValue) {\n that.$.removeClass('jqx-hidden');\n }\n else {\n that.$.addClass('jqx-hidden');\n }\n }\n\n else if (propertyName === 'color') {\n that._setItemColor();\n }\n else if (propertyName === 'displayMode') {\n that._setDisplayMode(newValue);\n }\n else if (propertyName === 'label' || propertyName === 'value') {\n const context = that.context;\n that.context = document;\n\n if (propertyName === 'label') {\n that.innerHTML = newValue;\n }\n\n const listBox = that.getListBox();\n listBox._applyTemplate(that);\n listBox.onItemUpdated(that);\n that.context = context;\n }\n else if (propertyName === 'details') {\n const context = that.context;\n that.context = document;\n that.$.details.innerHTML = newValue;\n\n const listBox = that.getListBox();\n listBox.onItemUpdated(that);\n that.context = context;\n }\n else if (propertyName === 'innerHTML') {\n const listBox = that.getListBox();\n listBox.onItemUpdated(that);\n }\n }", "static get observedAttributes () {\n return ['data-values', 'data-color', 'data-display-style'];\n }", "static get observedAttributes() {\n return ['src', 'alt', 'title', 'price'];\n }", "static get properties(){return{source:{name:\"source\",type:\"String\",reflectToAttributes:!0,observer:\"_sourceChanged\"},caption:{name:\"caption\",type:\"String\",reflectToAttributes:!0}}}", "getAttrs(){return this.__attrs}", "get property() {\n return super.property;\n }", "static get observedAttributes() {\n return ['src', 'size', 'border']\n }", "static get observedAttributes() {\n return ['value'];\n }", "static get properties(){let props={items:{name:\"items\",type:\"Array\",value:\"[]\",reflectToAttribute:!1,observer:!1},source:{name:\"source\",type:\"String\",value:\"\",reflectToAttribute:!1,observer:!1}};if(super.properties){props=Object.assign(props,super.properties)}return props}", "static get properties() {\n return {\n /**\n * Can this button toggle?\n */\n toggled: {\n name: \"toggled\",\n type: Boolean,\n value: false,\n reflectToAttribute: true\n },\n /**\n * The maximum size where all of the buttons display\n */\n collapseMax: {\n name: \"collapseMax\",\n type: String,\n value: \"xs\",\n reflectToAttribute: true\n }\n };\n }", "static get properties() {\n return {\n derivation: {\n attribute: 'derivation',\n type: String\n }\n }\n }", "static get observedAttributes () {\r\n return ['size', 'type', 'plain', 'round', 'circle', 'disabled', 'theme']\r\n }", "function bindObjectProps(data,tag,value,asProp,isSync){if(value){if(!isObject(value)){\"development\"!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;var loop=function loop(key){if(key==='class'||key==='style'||isReservedAttribute(key)){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];if(isSync){var on=data.on||(data.on={});on[\"update:\"+key]=function($event){value[key]=$event;};}}};for(var key in value){loop(key);}}}return data;}", "function bindObjectProps(data,tag,value,asProp,isSync){if(value){if(!isObject(value)){\"development\"!=='production'&&warn('v-bind without argument expects an Object or Array value',this);}else{if(Array.isArray(value)){value=toObject(value);}var hash;var loop=function loop(key){if(key==='class'||key==='style'||isReservedAttribute(key)){hash=data;}else{var type=data.attrs&&data.attrs.type;hash=asProp||config.mustUseProp(tag,type,key)?data.domProps||(data.domProps={}):data.attrs||(data.attrs={});}if(!(key in hash)){hash[key]=value[key];if(isSync){var on=data.on||(data.on={});on[\"update:\"+key]=function($event){value[key]=$event;};}}};for(var key in value){loop(key);}}}return data;}", "static get observedAttributes() {\n return ['data'];\n }", "static get properties() {\n return {\n /**\n * Size of button, can be default or mini.\n */\n size: {\n type: String,\n value: 'default',\n reflectToAttribute: true,\n },\n /**\n * Type of button, can be default, primary, warn.\n */\n type: {\n type: String,\n value: 'default',\n reflectToAttribute: true,\n },\n /**\n * Disable\n */\n disabled: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n },\n plain: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n },\n loading: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n },\n formType: {\n type: String,\n value: '',\n },\n };\n }", "get attributes() {\n return this.$attributes;\n }", "static get properties() {\n return {\n 'decimalSeparator': {\n value: '.',\n type: 'string'\n },\n 'dropDownAppendTo': {\n value: null,\n type: 'any'\n },\n 'enableMouseWheelAction': {\n value: false,\n type: 'boolean'\n },\n 'inputFormat': {\n value: 'integer',\n allowedValues: ['integer', 'floatingPoint', 'complex'],\n type: 'string'\n },\n 'hint': {\n value: '',\n type: 'string'\n },\n 'label': {\n value: '',\n type: 'string'\n },\n 'leadingZeros': {\n value: false,\n type: 'boolean'\n },\n 'max': {\n value: null,\n type: 'any'\n },\n 'messages': {\n value: {\n 'en': {\n 'binary': 'BIN',\n 'octal': 'OCT',\n 'decimal': 'DEC',\n 'hexadecimal': 'HEX',\n 'integerOnly': 'jqxNumericTextBox: The property {{property}} can only be set when inputFormat is integer.',\n 'noInteger': 'jqxNumericTextBox: the property {{property}} cannot be set when inputFormat is integer.',\n 'significantPrecisionDigits': 'jqxNumericTextBox: the properties significantDigits and precisionDigits cannot be set at the same time.'\n }\n },\n type: 'object',\n extend: true\n },\n 'min': {\n value: null,\n type: 'any'\n },\n 'name': {\n value: '',\n type: 'string'\n },\n 'nullable': {\n value: false,\n type: 'boolean'\n },\n 'opened': {\n value: false,\n type: 'boolean'\n },\n 'outputFormatString': {\n value: null,\n type: 'string?'\n },\n 'placeholder': {\n value: '',\n type: 'string'\n },\n 'dropDownEnabled': {\n value: false,\n type: 'boolean'\n },\n 'precisionDigits': {\n value: null,\n type: 'number?'\n },\n 'radix': {\n value: 10,\n allowedValues: ['2', '8', '10', '16', 2, 8, 10, 16, 'binary', 'octal', 'decimal', 'hexadecimal'],\n type: 'any'\n },\n 'radixDisplay': {\n value: false,\n type: 'boolean'\n },\n 'radixDisplayPosition': {\n value: 'left',\n allowedValues: ['left', 'right'],\n type: 'string'\n },\n 'scientificNotation': {\n value: false,\n type: 'boolean'\n },\n 'showUnit': {\n value: false,\n type: 'boolean'\n },\n 'significantDigits': {\n value: null,\n type: 'number?'\n },\n 'spinButtons': {\n value: false,\n type: 'boolean'\n },\n 'spinButtonsDelay': {\n value: 75,\n type: 'number'\n },\n 'spinButtonsInitialDelay': {\n value: 0,\n type: 'number'\n },\n 'spinButtonsPosition': {\n value: 'right',\n allowedValues: ['left', 'right'],\n type: 'string'\n },\n 'spinButtonsStep': {\n value: '1',\n type: 'any'\n },\n 'type': {\n value: 'numeric',\n type: 'string',\n defaultReflectToAttribute: true,\n readonly: true\n },\n 'unit': {\n value: 'kg',\n type: 'string'\n },\n 'validation': {\n value: 'strict',\n allowedValues: ['strict', 'interaction'],\n type: 'string'\n },\n 'value': {\n value: '0',\n type: 'any?'\n },\n 'wordLength': {\n value: 'int32',\n allowedValues: ['int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'],\n type: 'string'\n }\n };\n }", "static get properties() {\n return {\n greeting: {\n type: String,\n notify: true,\n reflectToAttribute: true\n }\n };\n }", "get el() {\n return this.#el;\n }", "static get properties() {\n return {\n 'label': {\n value: '',\n type: 'string'\n },\n 'labelSize': {\n value: null,\n type: 'number?'\n }\n };\n }", "get properties() {\n return tag.configure(SharePointQueryableInstance(this, \"properties\"), \"f.properties\");\n }", "static get properties() {\n return {\n 'buttonsDataSource': {\n value: [],\n type: 'array'\n },\n 'dropDownOpenMode': {\n allowedValues: ['none', 'dropDownButton', 'auto'],\n value: 'dropDownButton',\n type: 'string'\n }\n };\n }", "static get observedAttributes() {\n return ['layout', 'order', 'text'];\n }", "static get properties() {\n return {\n title: {\n type: String\n },\n initialTool: {\n attribute: 'initialtool',\n type: String\n },\n }\n }", "static get observedAttributes() {\n return ['text'];\n }", "static get observedAttributes() {\n return ['text'];\n }", "static get observedAttributes() {\n return ['data-width'];\n }", "static get properties() {\n return {\n 'checkable': {\n value: false,\n type: 'boolean'\n },\n 'checked': {\n value: false,\n type: 'boolean'\n },\n 'checkMode': {\n value: 'checkbox',\n allowedValues: ['checkbox', 'radioButton'],\n type: 'string'\n },\n 'dropDownHeight': {\n value: null,\n type: 'number?'\n },\n 'expanded': {\n value: false,\n type: 'boolean'\n },\n 'label': {\n value: '',\n type: 'any'\n },\n 'level': {\n value: null,\n type: 'number?'\n },\n 'separator': {\n value: false,\n type: 'boolean'\n },\n 'value': {\n value: null,\n type: 'any'\n }\n };\n }", "static get properties() {\n return {\n content: {\n notify: true,\n type: String,\n },\n disabled: {\n reflectToAttribute: true,\n type: Boolean,\n value: false,\n },\n editing: {\n observer: '_editingChanged',\n type: Boolean,\n value: false,\n },\n removeZeroWidthSpace: Boolean,\n // If no storage key is provided, content is not stored.\n storageKey: String,\n _saveDisabled: {\n computed: '_computeSaveDisabled(disabled, content, _newContent)',\n type: Boolean,\n value: true,\n },\n _newContent: {\n type: String,\n observer: '_newContentChanged',\n },\n };\n }", "static get observedAttributes() {\n return ['color', 'size', 'background'];\n }", "static get observedAttributes() {\n return ['rounded', 'size', 'shadow', 'color', 'animated', 'circle'];\n }", "static get properties() {\n return {\n hasActiveEditingElement: {\n type: Boolean,\n },\n };\n }", "static get observedAttributes() {\n return [\"color\", 'size', \"background\"];\n }", "static get properties() {\n return {\n 'direction': {\n value: 'row',\n type: 'string',\n defaultReflectToAttribute: true\n },\n 'horizontalContentAlignment': {\n value: 'flex-start',\n type: 'string',\n defaultReflectToAttribute: true\n },\n 'verticalContentAlignment': {\n value: 'flex-start',\n type: 'string',\n defaultReflectToAttribute: true\n }\n };\n }", "static get properties() {\n return {\n 'selected': {\n value: false,\n type: 'boolean'\n }\n };\n }", "static get observedAttributes() {return ['name']; }", "static get observedAttributes() {return ['name']; }", "static get properties(){return{editor:{type:Object,value:null},hidden:{type:Boolean,value:!0,reflectToAttribute:!0},observer:{type:Object,value:null},range:{type:Object,value:null,observer:\"_updateToolbar\"},toolbar:{type:Object,value:null}}}", "constructor(props) { super(props); autoBind(this); }", "function ElementData(){}", "get dataset() {\n return this.#el?.dataset ?? this.#dataset;\n }", "get element(){\n\t\treturn this._element;\n\t}", "static get properties() {\n return {\n id: {\n attribute: \"searchid\",\n type: String,\n },\n defaultText: {\n attribute: \"defaulttext\",\n type: String,\n },\n searchMode: {\n attribute: \"searchmode\",\n type: String,\n },\n remoteUrl: {\n attribute: \"remoteurl\",\n type: String,\n },\n derivation: {\n attribute: \"derivation\",\n type: String,\n },\n };\n }", "static get properties() {\n return {\n ...super.properties,\n /**\n * The label for the breadcrums area.\n */\n breadcrumbsLabel: {\n name: \"breadcrumbsLabel\",\n type: String,\n attribute: \"breadcrumbs-label\",\n },\n /**\n * The label for the breadcrums area.\n */\n breadcrumbsSelectAllLabel: {\n name: \"breadcrumbsSelectAllLabel\",\n type: String,\n attribute: \"breadcrumbs-select-all-label\",\n },\n /**\n * `rich-text-editor` element that is currently in `editing` mode\n */\n target: {\n name: \"target\",\n type: Object,\n },\n /**\n * `rich-text-editor` unique id\n */\n id: {\n name: \"id\",\n type: String,\n attribute: \"id\",\n reflect: true,\n },\n /**\n * current text selected range.\n */\n savedSelection: {\n name: \"savedSelection\",\n type: Object,\n },\n /**\n * selection singleton\n */\n registered: {\n type: Boolean,\n },\n /**\n * currently selected node\n */\n selectedNode: {\n type: Object,\n },\n /**\n * array of ancestors of currently selected node\n */\n selectionAncestors: {\n type: Array,\n },\n /**\n * when to make toolbar visible:\n * \"always\" to keep it visible,\n * \"selection\" when there is an active selection,\n * or defaults to only when connected to a toolbar\n */\n show: {\n type: String,\n attribute: \"show\",\n reflect: true,\n },\n /**\n * Tracks inline widgets that require selection data\n */\n clickableElements: {\n name: \"clickableElements\",\n type: Object,\n },\n\n /**\n * contains cancelled edits\n */\n __canceledEdits: {\n type: Object,\n },\n /**\n * hides paste button in Firefox\n */\n __pasteDisabled: {\n name: \"__pasteDisabled\",\n type: Boolean,\n attribute: \"paste-disabled\",\n reflect: true,\n },\n __prompt: {\n type: Object,\n },\n /**\n * whether prompt is open\n */\n __promptOpen: {\n name: \"__promptOpen\",\n type: Boolean,\n },\n };\n }", "__defineAttributes() {\n let changeAttribute = (key, value, isDeleted = false) => {\n if(this.__disableAttributeSetter) {\n return;\n }\n\n let node = this.el.getAttributeNode(key);\n\n if(node) {\n if(node.__event) {\n node.__event.unbind();\n node.__event = null;\n node.__expression = value;\n }\n\n if(node.__hasBindings) {\n this.__parent && this.__parent.__akili.__evaluationComponent.__unbindByNodes([node]);\n node.__hasBindings = false;\n node.__expression = value;\n }\n }\n\n if(isDeleted) {\n this.el.removeAttribute(key);\n }\n else if(node) {\n node.value = value;\n }\n else {\n this.el.setAttribute(key, value);\n }\n };\n\n this.attrs = new Proxy(this.__attrs, {\n get: (target, key) => {\n if(key == '__isProxy') {\n return true;\n }\n\n return target[key];\n },\n set: (target, key, value) => {\n let attrKey = utils.toDashCase(key);\n\n if(this.booleanAttributes.indexOf(attrKey) != -1) {\n attrKey = `boolean-${attrKey}`;\n\n if(value) {\n this.el.setAttribute(key, value);\n }\n else {\n this.el.removeAttribute(key);\n }\n }\n\n target[key] = value;\n changeAttribute(attrKey, utils.makeAttributeValue(value));\n\n return true;\n },\n deleteProperty: (target, key, value) => {\n let attrKey = utils.toDashCase(key);\n\n changeAttribute(attrKey, utils.makeAttributeValue(value), true);\n delete target[key];\n\n return true;\n }\n });\n }", "static get properties() {\n return {\n \"cityProp\": {\n \"name\": \"cityProp\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflect\": true,\n \"attribute\": true,\n \"observer\": false\n },\n \"inputId\": {\n \"name\": \"inputId\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"width\": {\n \"name\": \"width\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n}\n;\n }", "getAttributes() {\r\n return this.atts;\r\n }", "function ElementData() { }", "function ElementData() { }", "getElement(){return this.__element}", "static get observedAttributes() {\n return ['xyz', ...super.observedAttributes];\n }", "_initBinder() {\n this.binder = new UniversalFieldNodeBinder(this);\n\n // set the attribute mappings\n this.binder.attributeMappings = {\n label: 'label',\n hint: 'hint',\n 'leading-icon': 'leadingIcon',\n 'trailing-icon': 'trailingIcon',\n errortext: 'errortext',\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n error: 'error',\n readonly: 'readonly',\n required: 'required',\n disabled: 'disabled',\n condensed: 'condensed',\n hidden: 'hidden',\n };\n\n this.binder.fatAttributesToConstraintsMappings = {\n required: 'value._constraints.required.is', // for the fieldnode constraint\n 'min-msg': 'value._constraints.min.message', // for the fieldnode constraint message\n 'max-msg': 'value._constraints.max.message', // for the fieldnode constraint message\n };\n\n this.binder.constraintsTofatAttributesMappings = {\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // the extended furo-text-input component uses _value\n this.binder.targetValueField = '_value';\n }", "function ElementData() {}", "function ElementData() {}", "function ElementData() {}", "static get properties() {\n return {\n ...super.properties,\n /**\n * heading / label of the modal\n */\n title: {\n type: String,\n },\n /**\n * open state\n */\n opened: {\n type: Boolean,\n reflect: true,\n },\n /**\n * Close label\n */\n closeLabel: {\n attribute: \"close-label\",\n type: String,\n },\n /**\n * Close icon\n */\n closeIcon: {\n type: String,\n attribute: \"close-icon\",\n },\n /**\n * The element that invoked this. This way we can track our way back accessibly\n */\n invokedBy: {\n type: Object,\n },\n /**\n * support for modal flag\n */\n modal: {\n type: Boolean,\n },\n /**\n * can add a custom string to style modal based on what is calling it\n */\n mode: {\n type: String,\n reflect: true,\n },\n };\n }", "static get observedAttributes(){\n return ['tooltiptext'];\n }", "renderFromAttr() {\n let me = $(this);\n me.empty();\n this.addEasyLine(this.value, me.attr(\"label\"), me.attr(\"color\"), me.attr(\"symbol\"), me.attr(\"size\"), me.attr(\"rounded\"), me.attr(\"hideValue\"));\n }", "function ModdleElement(attrs) {\n props.define(this, '$type', { value: name, enumerable: true });\n props.define(this, '$attrs', { value: {} });\n props.define(this, '$parent', { writable: true });\n Object(min_dash__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(attrs, Object(min_dash__WEBPACK_IMPORTED_MODULE_0__[\"bind\"])(function (val, key) {\n this.set(key, val);\n }, this));\n }", "get elementAttr() {\n return this._getOption('elementAttr');\n }", "get data() { return this.item.data; }", "static get observedAttributes() {\n return ['icon', 'page-name'];\n }", "get properties() { return this._properties; }", "get attributes () {\n return this._attributes;\n }", "getProps() {\n let result = super.getProps();\n result.label = result.label ? result.label : '';\n result.inputStyle = result.inputStyle ? result.inputStyle : {};\n result.containerStyle = result.containerStyle ? result.containerStyle: {};\n result.labelStyle = result.labelStyle ? result.labelStyle: {};\n result.inputClass = result.inputClass ? result.inputClass: 'form-control';\n result.labelClass = result.labelClass ? result.labelClass: 'control-label col-sm-2';\n result.containerClass = result.containerClass ? result.containerClass : ( result.label ? \"col-sm-10\" : \"col-sm-12\" );\n result.errorClass = result.errorClass ? result.errorClass: 'error';\n result.onChange = result.onChange ? result.onChange : result.ownerProps.changeItemField;\n result.value = result.value ? result.value : '';\n return result;\n }", "static get properties() {\n return {\n /** The ID of the item is the auth provider. i.e. 'google', 'facebook', etc */\n id: {\n type: String,\n value: \"\"\n },\n\n /** The text of the label to be displayed. */\n label: {\n type: String,\n value: \"\"\n },\n\n /** The icon to be displayed. */\n icon: {\n type: String,\n value: \"\"\n }\n };\n }", "static get properties() {\n return {\n icon: {\n type: String\n },\n trackIcon: {\n type: String,\n attribute: \"track-icon\"\n },\n title: {\n type: String\n },\n url: {\n type: String\n },\n icon: {\n type: String\n },\n id: {\n type: String,\n reflect: true\n },\n active: {\n type: Boolean\n },\n selected: {\n type: String\n }\n };\n }", "static get properties() {\n return {\n ...super.properties,\n glitch: {\n type: Boolean,\n },\n red: {\n type: Boolean,\n reflect: true,\n },\n fadein: {\n type: Boolean,\n reflect: true,\n },\n glitchMax: {\n type: Number,\n attribute: \"glitch-max\",\n },\n glitchDuration: {\n type: Number,\n attribute: \"glitch-duration\",\n },\n };\n }", "function descriminatingProperty() { }", "static get observedAttributes() {\n return [\"inputId\", \"label\", \"suggestionList\"]\n }", "get prop() {\n return this.config.prop;\n }", "function updateFromElement() {\n if ( !isRendered ) { return; }\n\n var chartOpts = element.renderer.chartOpts;\n\n var k;\n for ( k in BIND_ELEMENTS ) {\n if ( BIND_ELEMENTS.hasOwnProperty( k ) ) {\n jq[k].val( chartOpts[ BIND_ELEMENTS[k] ] );\n }\n }\n }", "get checkbox(){ return this.__checkbox; }", "_enableProperties() {\n if (!this.hasAttribute(DISABLED_ATTR)) {\n if (!this.__dataEnabled) {\n super._initializeProperties();\n }\n\n super._enableProperties();\n }\n }", "static get properties() {\n return {\n clase: { type: String },\n disabled: { type: Boolean },\n texto: { type: String },\n };\n }", "static get properties(){return{/**\n * Allow a null option to be selected?\n */allowNull:{name:\"allowNull\",type:Boolean,value:!1},/**\n * The command used for document.execCommand.\n */command:{name:\"command\",type:String,value:\"insertHTML\",readOnly:!0},/**\n * Optional icon for null value\n */icon:{name:\"icon\",type:String,value:null},/**\n * The command used for document.execCommand.\n */options:{name:\"options\",type:Array,value:[],notify:!0},/**\n * Renders html as title. (Good for titles with HTML in them.)\n */titleAsHtml:{name:\"titleAsHtml\",type:Boolean,value:!1},/**\n * The value\n */value:{name:\"value\",type:Object,value:null}}}", "static get properties() {\n return {\n title: { type: String },\n items: { type: Array },\n loading: { type: String },\n };\n }", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "static get properties () {\n return {\n fill: { defaultValue: Color.transparent },\n fontColor: { defaultValue: Color.blue },\n nativeCursor: { defaultValue: 'auto' },\n borderColor: { defaultValue: Color.transparent },\n borderStyle: { defaultValue: 'dashed' },\n borderRadius: { defaultValue: 4 },\n borderWidth: { defaultValue: 1 },\n padding: { defaultValue: rect(0, 0, 0, 0) },\n fixedWidth: { defaultValue: false },\n fixedHeight: { defaultValue: false },\n stringValue: {\n after: ['textString'],\n set (v) {\n this.setProperty('stringValue', v);\n this.textString = this.truncate(v);\n this.nativeCursor = this.stringTooLong ? 'pointer' : 'auto';\n }\n },\n stringTooLong: {\n readOnly: true,\n get () { return this.stringValue.includes('\\n'); }\n },\n isSelected: {\n defaultValue: 'false',\n set (v) {\n this.setProperty('isSelected', v);\n this.fontColor = v ? Color.white : Color.blue;\n }\n }\n };\n }", "get foo() {\n return this.getAttribute('foo'); \n }", "static get properties() {\n return {\n id: {\n attribute: \"mapid\",\n },\n derivation: {\n attribute: \"derivation\",\n type: String,\n },\n };\n }", "get innerElements() {\n return [this.setInputAttributes(this.inputElement)];\n }", "update() {\n this.bindings.forEach((binding) => {\n if (\n binding.element &&\n binding.attribute &&\n binding.element.hasOwnProperty(binding.attribute)\n ) {\n binding.element[binding.attribute] = this.value\n }\n })\n return this\n }", "static get observedAttributes() { return [\"name\"]; }", "_initBinder() {\n this.binder = new UniversalFieldNodeBinder(this);\n\n // set the attribute mappings\n this.binder.attributeMappings = {\n label: 'label',\n hint: 'hint',\n min_term_length: 'min-term-length',\n no_result_hint: 'no-result-hint',\n errortext: 'errortext',\n 'error-msg': 'errortext',\n };\n\n // set the label mappings\n this.binder.labelMappings = {\n error: 'error',\n readonly: 'readonly',\n required: 'required',\n disabled: 'disabled',\n condensed: 'condensed',\n hidden: 'hidden',\n };\n\n this.binder.fatAttributesToConstraintsMappings = {\n 'min-term-length': 'value._constraints.min_term_length.is', // for the fieldnode constraint\n 'no-result-hint': 'value._constraints.no_result_hint', // for the fieldnode constraint message\n };\n\n this.binder.constraintsTofatAttributesMappings = {\n required: 'required',\n };\n\n /**\n * check overrides from the used component, attributes set on the component itself overrides all\n */\n this.binder.checkLabelandAttributeOverrrides();\n\n // the extended furo-text-input component uses _value\n this.binder.targetValueField = '_value';\n }", "static get properties() {\n return {\n ...super.properties,\n /**\n * color\n */\n color: {\n type: String\n },\n /**\n * tiny, small, medium, large, epic sizing.\n */\n size: {\n type: String,\n reflect: true\n }\n };\n }", "bind(element, attribute) {\n attribute = attribute || 'innerHTML'\n this.bindings.push(new StrangeItemBinding(element, attribute))\n if (this.autoUpdate) {\n this.update() // initialize\n }\n return this // all jQuery style heck yeah\n }" ]
[ "0.668546", "0.64624363", "0.6427632", "0.6226598", "0.6086092", "0.60113764", "0.6001949", "0.59134644", "0.590591", "0.5884135", "0.5877634", "0.5873419", "0.5869708", "0.586739", "0.58648336", "0.5831849", "0.58224875", "0.5808076", "0.5805191", "0.58017135", "0.5791363", "0.57897305", "0.57897305", "0.5786768", "0.5777149", "0.5745927", "0.57432026", "0.57409555", "0.57202214", "0.5714763", "0.5684577", "0.56814873", "0.5677524", "0.5668583", "0.5667318", "0.5667318", "0.56596905", "0.56519234", "0.56459546", "0.5621804", "0.5617912", "0.5599758", "0.55943656", "0.5588215", "0.5587135", "0.55850476", "0.55850476", "0.5580309", "0.5567003", "0.5557181", "0.5557075", "0.55550444", "0.55494356", "0.5544523", "0.5529371", "0.55283266", "0.55193305", "0.5516295", "0.5516295", "0.55150235", "0.5507484", "0.55052644", "0.54974085", "0.54974085", "0.54974085", "0.54888016", "0.548403", "0.5477287", "0.5475061", "0.54748636", "0.5467912", "0.5463516", "0.5459075", "0.5447398", "0.54462266", "0.5440898", "0.54386324", "0.5426663", "0.5406302", "0.54043067", "0.5403166", "0.54017895", "0.53984374", "0.5397913", "0.53962094", "0.53916526", "0.53905076", "0.53883266", "0.53883266", "0.53883266", "0.53883266", "0.53883266", "0.5382923", "0.53809845", "0.5380265", "0.5377632", "0.53643894", "0.53593916", "0.53564054", "0.53546613", "0.53505325" ]
0.0
-1
Store the tag name to make it easier to obtain directly.
static get tag() { return "hax-text-editor-oer-schema"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTag(tagName) {\n const tag = {\n tag: tagName,\n value: this.__tags[tagName]\n };\n return tag;\n }", "function addTag (name) {\n $('#post_current_tags').val(function () {\n return $(this).val().concat(name, ',')\n })\n $('.current-tags').append(\"<span class='badge badge-pill badge-primary tag'>\" + name + '</span>')\n }", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "get tag() {}", "get tag() {}", "get tag() {}", "get tag() {}", "function addTagInternal( tag ) {\n if( typeof tag === 'string' && attrs.tagTitleField ) {\n var tmp = {};\n tmp[attrs.tagTitleField] = tag;\n tag = tmp;\n }\n\n scope.tags.push( tag );\n scope.inputText = '';\n scope.selection = -1;\n }", "getTagValue(tagName) {\n return this.__tags[tagName];\n }", "function updateTagNameDisplayer(element) {\n $(\"#tag-name\").text(\"<\" + element.tagName + \">\");\n}", "function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }", "getTag() {\n\t\treturn this.metadata.tag;\n\t}", "constructor(shownName) {\n\t\tsuper(shownName, 'tag')\n\t}", "function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }", "getTagged (tagName) {\n return Api().get(`tags/${tagName}`, tagName)\n }", "getCommonName(tag) {\n return this.tagMap[tag];\n }", "addTag(name) {\n const tag = this.tags.find((tag) => {\n return tag.name === name;\n });\n if (!tag) {\n this.tags = [\n ...this.tags,\n { id: this.getIdTags(), name: name, checked: false },\n ];\n } else {\n }\n }", "_$name() {\n super._$name();\n this._value.name = this._node.key.name;\n }", "get tagInput() {\n return this._tag;\n }", "function getTagName(event) {\n let sTag;\n const tag = event.ctx.tag;\n if (tag) {\n switch (typeof tag) {\n case 'string':\n sTag = tag;\n break;\n case 'number':\n if (Number.isFinite(tag)) {\n sTag = tag.toString();\n }\n break;\n case 'object':\n // A tag-object must have its own method toString(), in order to be converted automatically;\n if (hasOwnProperty(tag, 'toString') && typeof tag.toString === 'function') {\n sTag = tag.toString();\n }\n break;\n default:\n break;\n }\n }\n return sTag;\n}", "function construct_tag(tag_name){\n render_tag = '<li class=\"post__tag\"><a class=\"post__link post__tag_link\">' + tag_name + '</a> </li>'\n return render_tag\n}", "function getTag(tag)\n{\n var group = tag.substring(1,5);\n var element = tag.substring(5,9);\n var tagIndex = (\"(\"+group+\",\"+element+\")\").toUpperCase();\n var attr = dict.TAG_DICT[tagIndex];\n return attr;\n}", "get annotatedName() {\n if (this.annotation) {\n return this.annotation;\n }\n else {\n return `<${this.tagName}>`;\n }\n }", "getTag() {\n return this.find('Tag')[0];\n }", "get tagName() {\n return this.getAsElem(0).getIf(\"tagName\");\n }", "get tagName() {\n return this.getAsElem(0).getIf(\"tagName\");\n }", "function addTag(name) {\n sendAddTagRequest(name, taggableType, taggableId);\n}", "function emitTagName(name) {\n if (name.kind === 69 /* Identifier */ && ts.isIntrinsicJsxName(name.text)) {\n write('\"');\n emit(name);\n write('\"');\n }\n else {\n emit(name);\n }\n }", "function addTagLabel(name) {\n let tagList = document.getElementById(\"tag-line\");\n let newTag = document.createElement(\"span\");\n let newText = document.createElement(\"span\");\n let newRemove = document.createElement(\"a\");\n let newIcon = document.createElement(\"i\");\n let input = document.getElementById(\"tag-add\");\n\n input.value = \"\";\n\n newTag.className = \"tag-label tag\";\n newTag.id = name;\n\n let aElement = document.createElement('a');\n aElement.innerText = name;\n newText.appendChild(aElement);\n\n newIcon.className = \"remove glyphicon glyphicon-remove-sign glyphicon-white\";\n\n newRemove.onclick = function() {\n tagList.removeChild(newTag);\n toAddTagList.delete(name.toLowerCase());\n removeTagFromItem(name);\n };\n newText.onclick = function() {\n window.location.href = '/tags/display/' + encodeURIComponent(name.toLowerCase());\n };\n newRemove.appendChild(newIcon);\n newTag.appendChild(newText);\n newTag.appendChild(newRemove);\n\n if(!toAddTagList.has(name)) {\n toAddTagList.add(name);\n tagList.appendChild(newTag);\n }\n}", "function parseName(tag) {\n\tlet name = tag.name\n\tname = name.replace(/_/g, ' ');\n\tname = name.replace(/\\b\\w/g, l => l.toUpperCase());\n\treturn name;\n}", "additionalNametags(self) { return []; }", "function getName()\n\t{\n\t\treturn objThis.selectorElt.tagSuggest().getName();\n\t}", "function getTagIDByName(tagName) {\n let tagObject = hostModal.tagFilter.awesomepleteInstance._list.find(tag => {\n return tag.name === tagName;\n });\n if (tagObject !== undefined) {\n return tagObject.id;\n }\n return undefined;\n}", "set name(value) {\n\t\tthis._name = value;\n\t}", "function getTagTitleField( tag ) {\n return tag[attrs.tagTitleField] || tag;\n }", "tagId(state) {\n return state.tagId;\n }", "function stateTagName(char) {\n if (_regex_lib__WEBPACK_IMPORTED_MODULE_1__[\"whitespaceRe\"].test(char)) {\n currentTag = new CurrentTag(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, currentTag, { name: captureTagName() }));\n state = 4 /* BeforeAttributeName */;\n }\n else if (char === '<') {\n // start of another tag (ignore the previous, incomplete one)\n startNewTag();\n }\n else if (char === '/') {\n currentTag = new CurrentTag(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, currentTag, { name: captureTagName() }));\n state = 12 /* SelfClosingStartTag */;\n }\n else if (char === '>') {\n currentTag = new CurrentTag(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"]({}, currentTag, { name: captureTagName() }));\n emitTagAndPreviousTextNode(); // resets to Data state as well\n }\n else if (!_regex_lib__WEBPACK_IMPORTED_MODULE_1__[\"letterRe\"].test(char) && !_regex_lib__WEBPACK_IMPORTED_MODULE_1__[\"digitRe\"].test(char) && char !== ':') {\n // Anything else that does not form an html tag. Note: the colon \n // character is accepted for XML namespaced tags\n resetToDataState();\n }\n else {\n // continue reading tag name\n }\n }", "function popUName(uName) {\n var $tagline = $('.tagline');\n spanText = $tagline.text(); // cache tagline text\n spanText += ', ' + uName;\n $tagline.text(spanText);\n}", "function getTagId() {\n return properties.tag_id;\n }", "function Tag(name, count) {\n return {\n name: name,\n count: count\n };\n }", "function setMapTagName(tag, x, y) {\n\t\tthis.tagName = tag;\n\t\tthis.tagNameXPos = x == null ? 0 : eval(x);\n\t\tthis.tagNameYPos = y == null ? 0 : eval(y);\n\t}", "set name(x) { this._name = x; }", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "_$name() {\n super._$name();\n\n if (this._node.id) {\n this._value.name = this._node.id.name;\n } else {\n this._value.name = NamingUtil.filePathToName(this._pathResolver.filePath);\n }\n }", "function setTag(key, value) {\n\t getCurrentHub().setTag(key, value);\n\t}", "function onentertag() {\n currentTag = {\n type: 'mdxTag',\n name: null,\n close: false,\n selfClosing: false,\n attributes: []\n }\n }", "get name() {\r\n\t\treturn this._name;\r\n\t}", "get tagName(){\n return this.nodeName; \n }", "get tagName(){\n return this.nodeName; \n }", "function setName(name)\n\t{\n\t\tobjThis.selectorElt.tagSuggest().setName(name);\n\t}", "function onattributename(token) {\n currentTag.attributes.push({\n type: 'mdxAttribute',\n name: slice(token),\n value: null,\n position: position(token)\n })\n }", "get name() {\n\t return this._name;\n\t }", "function setTag(key, value) {\n hub.getCurrentHub().setTag(key, value);\n}", "['@_name']() {\n let value = this._findTagValue(['@_name', '@external']);\n if (!value) {\n logger.w(`can not resolve name.`);\n }\n\n this._value.name = value;\n\n let tags = this._findAll(['@_name', '@external']);\n if (!tags) {\n logger.w(`can not resolve name.`);\n return;\n }\n\n let name;\n for (let tag of tags) {\n let {tagName, tagValue} = tag;\n if (tagName === '@_name') {\n name = tagValue;\n } else if (tagName === '@external') {\n let {typeText, paramDesc} = ParamParser.parseParamValue(tagValue, true, false, true);\n name = typeText;\n this._value.externalLink = paramDesc;\n }\n }\n\n this._value.name = name;\n }", "tag(version) {// const snap = this.snap();\n // const tag = new Tag(version, snap);\n // this.tags.set(tag);\n }", "function stateTagName(char) {\n if (whitespaceRe.test(char)) {\n currentTag = new CurrentTag(__assign({}, currentTag, { name: captureTagName() }));\n state = 4 /* BeforeAttributeName */;\n }\n else if (char === '<') {\n // start of another tag (ignore the previous, incomplete one)\n startNewTag();\n }\n else if (char === '/') {\n currentTag = new CurrentTag(__assign({}, currentTag, { name: captureTagName() }));\n state = 12 /* SelfClosingStartTag */;\n }\n else if (char === '>') {\n currentTag = new CurrentTag(__assign({}, currentTag, { name: captureTagName() }));\n emitTagAndPreviousTextNode(); // resets to Data state as well\n }\n else if (!letterRe.test(char) && !digitRe.test(char) && char !== ':') {\n // Anything else that does not form an html tag. Note: the colon \n // character is accepted for XML namespaced tags\n resetToDataState();\n }\n }", "function getName() { return name; }", "function getName(elm){\n return elm.markupTag.name.toString();\n}", "setName(name) {\n\t\tthis.name = name;\n\t}", "['@_name']() {\n super['@_name']();\n if (this._value.name) return;\n\n this._value.name = this._node.declarations[0].id.name;\n }", "getName() {\n return _name.get(this);\n }", "function name(inName)\t{\n\t//\tclean up anything that might exist\n\tclean();\n\t\n\t//\tstore the var locally (need it for some 'set' msgs)\n\tmyName = inName;\n\t//\tpopulate the 'label' field (we'll re-populate it later if this isf has a valid label value)\n\tthis.patcher.getnamed(\"LABEL\").set(inName);\n}", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "onopentagname(name){\n\n // normalize tag names\n \tname = name.toLowerCase()\n\n // do not process any non-coldfusion tag\n if (!name.startsWith('cf'))\n return\n\n \tthis._tagname = name\n\n \tif(!this._options.xmlMode && name in openImpliesClose) {\n for(\n \t\t\tvar el;\n \t\t\t(el = this._stack[this._stack.length - 1]) in openImpliesClose[name];\n \t\t\tthis.onclosetag(el)\n \t\t);\n \t}\n\n \tif(this._options.xmlMode || !(name in voidElements)){\n \t\tthis._stack.push(name)\n \t}\n\n \tif(this._cbs.onopentagname) this._cbs.onopentagname(name);\n \tif(this._cbs.onopentag) this._attribs = {}\n }", "get name() {\n\t\treturn this._name;\n\t}", "get name() {\n\t\treturn this._name;\n\t}", "updateCurrentTag(newTag) {\n this.setState({ currentTag: newTag });\n }", "tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }", "function tagName(tag, options) {\n if (tag == null || tag === '') {\n tag = options.defaultTag || 'Api';\n }\n tag = toIdentifier(tag);\n return tag.charAt(0).toUpperCase() + (tag.length == 1 ? '' : tag.substr(1));\n}", "getName() {\n return this.getAttribute('name');\n }", "get name() {return this._name;}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "get name () {\n\t\treturn this._name;\n\t}", "tagName(source, onError) {\n if (source === '!')\n return '!'; // non-specific tag\n if (source[0] !== '!') {\n onError(`Not a valid tag: ${source}`);\n return null;\n }\n if (source[1] === '<') {\n const verbatim = source.slice(2, -1);\n if (verbatim === '!' || verbatim === '!!') {\n onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n return null;\n }\n if (source[source.length - 1] !== '>')\n onError('Verbatim tags must end with a >');\n return verbatim;\n }\n const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);\n if (!suffix)\n onError(`The ${source} tag has no suffix`);\n const prefix = this.tags[handle];\n if (prefix)\n return prefix + decodeURIComponent(suffix);\n if (handle === '!')\n return source; // local tag\n onError(`Could not resolve tag: ${source}`);\n return null;\n }", "get name() {\n return new ValueEmbedder(this.getAsElem(0).value, \"name\");\n }", "function name(name) {\n return name;\n }", "getByName(name) {\n return tag.configure(Folder(this).concat(`('${escapeQueryStrValue(name)}')`), \"fs.getByName\");\n }", "function getName() {\n\treturn name;\n}", "onTagClick(tag) {\n\t\tlet tags = storeActions.getTags();\n\n\t\tif (tags.includes(tag)) {\n\t\t\tstoreActions.deleteTag(tag);\n\t\t} else {\n\t\t\tstoreActions.addTag(tag)\n\t\t}\n\t}", "tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }", "openTag() {\n var _a;\n this.processAttribs();\n const { tags } = this;\n const tag = this.tag;\n tag.isSelfClosing = false;\n // There cannot be any pending text here due to the onopentagstart that was\n // necessarily emitted before we get here. So we do not check text.\n // eslint-disable-next-line no-unused-expressions\n (_a = this.openTagHandler) === null || _a === void 0 ? void 0 : _a.call(this, tag);\n tags.push(tag);\n this.state = S_TEXT;\n this.name = \"\";\n }", "addNewTag() {\n this.$emit('add-tag', this.newTag, this.listIndex, this.cardIndex);\n this.newTag = {\n name: \"\",\n color: \"\"\n };\n }", "setName(value){\n\t\tthis.name = value;\n\t}", "function renderTitle(tag) {\n $(\"#tagTitle\").text(tag);\n}", "setName(name) { }", "set keyname(keyname) {\n this.setAttribute('keyname', keyname);\n }", "get name() {\r\n return this._name;\r\n }" ]
[ "0.6634083", "0.66041034", "0.6557285", "0.6557285", "0.6557285", "0.6557285", "0.65389186", "0.65389186", "0.65389186", "0.65389186", "0.6377864", "0.6283098", "0.626847", "0.62257195", "0.6206882", "0.6186045", "0.6184868", "0.61273026", "0.6070542", "0.6002654", "0.5938993", "0.59188616", "0.59036314", "0.58918226", "0.58858126", "0.58503693", "0.5850109", "0.5837862", "0.5837862", "0.58314794", "0.58134204", "0.57957834", "0.5777452", "0.577341", "0.576743", "0.57475275", "0.57461244", "0.5739142", "0.5717865", "0.571667", "0.5714673", "0.57036847", "0.5702563", "0.5685346", "0.5671199", "0.566702", "0.56567377", "0.56466657", "0.56374717", "0.5633077", "0.56288207", "0.56288207", "0.5623", "0.5617524", "0.5603855", "0.5602598", "0.55954456", "0.55902517", "0.5577086", "0.55700654", "0.5566718", "0.55654436", "0.55636376", "0.55615634", "0.5558164", "0.5555382", "0.5555382", "0.5555382", "0.5555382", "0.5555382", "0.5555382", "0.5555382", "0.5555382", "0.55413336", "0.5537639", "0.5537639", "0.5530497", "0.55104256", "0.5504784", "0.54954547", "0.5490971", "0.5457687", "0.5457687", "0.5457687", "0.5457687", "0.5457687", "0.5457687", "0.54554", "0.54525626", "0.5441822", "0.5440353", "0.54391044", "0.5427367", "0.5414459", "0.5410765", "0.54066056", "0.53965956", "0.53950363", "0.5392157", "0.53899384", "0.5388217" ]
0.0
-1
On success, store the result and process the next query.
function handleResult(result) { results.push(result); doInsert(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query_promise_then(result) {\n my_query.done.query=true;\n submit_if_done();\n }", "async processResults(results, document, queryEngine) {\n const sparql = \"INSERT {\\n\".concat(results.map(r => r.insert).join(''), \"}\");\n await queryEngine.executeUpdate(sparql, document).next();\n return results.map(r => r.id);\n }", "function processQuery() {\n let queryDatum;\n\n if (queryData.length === 0) {\n defer.resolve(self._model);\n return;\n }\n\n queryDatum = queryData.shift();\n self.queryExecuter.insert(queryDatum.sql, queryDatum.params, processQueryResult);\n\n // Handle the query execution result by adding the new resource ID, if\n // present.\n function processQueryResult(err, result) {\n if (err) {\n defer.reject(err);\n return;\n }\n\n // If there is an auto-generated ID, set it on the model.\n if (result.insertId) {\n const tbl = self.database.getTableByMapping(queryDatum.modelMeta.tableMapping);\n const pkMap = tbl.primaryKey[0].mapTo;\n\n queryDatum.modelMeta.model[pkMap] = result.insertId;\n }\n\n processQuery();\n }\n }", "function processQueryResult(err, result) {\n if (err) {\n defer.reject(err);\n return;\n }\n\n // If there is an auto-generated ID, set it on the model.\n if (result.insertId) {\n const tbl = self.database.getTableByMapping(queryDatum.modelMeta.tableMapping);\n const pkMap = tbl.primaryKey[0].mapTo;\n\n queryDatum.modelMeta.model[pkMap] = result.insertId;\n }\n\n processQuery();\n }", "function querySuccess(tx, results) {\n\n var len = results.rows.length;\n\n for (var i=0; i<len; i++){\n\n\n misdatos = results.rows.item(i).misdatos;\n catalogo = results.rows.item(i).catalogo;\n entrevistas = results.rows.item(i).entrevistas;\n noasignadas = results.rows.item(i).noasignadas;\n fechaDB = results.rows.item(i).fecha;\n\n }\n}", "function query_promise_then(result) {\n\n\n }", "function query_promise_then(result) {\n\n\n }", "function completeQuery(id, data) {\n var query = queryQueue[id];\n if (query) {\n try {\n delete queryQueue[id];\n\n // Get transaction\n var tx = query.tx;\n\n // If transaction hasn't failed\n // Note: We ignore all query results if previous query\n // in the same transaction failed.\n if (tx && tx.queryList[id]) {\n\n // Save query results\n var r = new DroidDB_Result();\n r.rows.resultSet = data;\n r.rows.length = data.length;\n try {\n if (typeof query.successCallback === 'function') {\n query.successCallback(query.tx, r);\n }\n } catch (ex) {\n console.log(\"executeSql error calling user success callback: \"+ex);\n }\n\n tx.queryComplete(id);\n }\n } catch (e) {\n console.log(\"executeSql error: \"+e);\n }\n }\n}", "function lastquery(){\n\tGestion.methods.getResult().call(function(error, result){\n\t\tif(!error){\n\t\t\tconsole.log(result);\n\t\t\tsetTimeout(function(){ecrire()},120);\n\t\t}\n\t\telse\n\t\t\tconsole.error(error);\n\t});\n}", "function onSuccess(transaction, resultSet) {\n log('Query completed: ' + JSON.stringify(resultSet) + \", \" + JSON.stringify(resultSet.rows) + \",\" + resultSet.rows.length);\n }", "resolveQuery() {\n\t\tthis.resultData = this.query.run(this.collection, this.dataProvider.data());\n\t\tthis.resultValid = true;\n\t}", "function addResults(transport, next) {\n\t queryTransport(transport, function (err, result) {\n\t //\n\t // queryTransport could potentially invoke the callback\n\t // multiple times since Transport code can be unpredictable.\n\t //\n\t if (next) {\n\t result = err || result;\n\t if (result) {\n\t results[transport.name] = result;\n\t }\n\n\t next();\n\t }\n\n\t next = null;\n\t });\n\t }", "async function processResults(poolQuery, results) {\n for (let i = 0; i < results.length; i += rowSplit) {\n const insert = await createInsert(results, i, rowSplit, table, staticParam, poolQuery, existsAttr);\n console.log(insert);\n try {\n const records = await poolQuery(insert);\n console.dir(records);\n } catch (e) { console.log(e); }\n }\n }", "function innerSuccessCallback(sqlTransaction, results) {\n\n\n // CG - On some occasions, we do not want to call anything in particular on success (e.g. after we have completed a 'CREATE' query).\n if (successCallback) {\n\n // CG - Here we are only interested in passing back the collection of results.\n // This ensures the WebSQL API remains consist with IndexedDb in its return values.\n successCallback(results.rows);\n }\n\n }", "storeResult(result) {\n this.result = result;\n }", "function query_promise_then(result) {\n }", "function query_promise_then(result) {\n }", "function querySuccess(tx, results) {\n var len = results.rows.length;\n console.log(\"configuracion table: \" + len + \" rows found.\");\n for (var i=0; i<len; i++){\n console.log(\"Row = \" + i + \" ID = \" + results.rows.item(i).id + \" Data = \" + results.rows.item(i).data);\n }\n }", "function _successCb(err, result) {\n\n // use the revision to update the existing documents\n // NOTE: it is not impossible that the revision of this document\n // is modified by other operations right before updating, Couchpenter\n // will only try once to avoid any possibility of retrying infinitely.\n doc._rev = result._rev;\n self.couch.use(dbName).insert(doc, self._handle(cb, {\n dbName: dbName,\n docId: doc._id,\n message: 'updated'\n }));\n }", "function executeQuery(res, sql, inserts, mysql, complete, contentmod) {\n\t\tmysql.pool.query(sql, inserts, function (error, results, fields) {\n\t\t\tif (error) {\n\t\t\t\tres.write(JSON.stringify(error));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontentmod(results);\n\t\t\tcomplete();\n\t\t});\n\t}", "function addResults(transport, next) {\n queryTransport(transport, function (err, result) {\n //\n // queryTransport could potentially invoke the callback\n // multiple times since Transport code can be unpredictable.\n //\n if (next) {\n result = err || result;\n if (result) {\n results[transport.name] = result;\n }\n\n // eslint-disable-next-line callback-return\n next();\n }\n\n next = null;\n });\n }", "function addResults(transport, next) {\r\n queryTransport(transport, (err, result) => {\r\n // queryTransport could potentially invoke the callback multiple times\r\n // since Transport code can be unpredictable.\r\n if (next) {\r\n result = err || result;\r\n if (result) {\r\n results[transport.name] = result;\r\n }\r\n\r\n // eslint-disable-next-line callback-return\r\n next();\r\n }\r\n\r\n next = null;\r\n });\r\n }", "function querySuccess(tx, results) {\n //results of SELECT statement\n //var len = results.rows.length;\n //alert(\"DIARY table: \" + len + \" rows found.\");\n //for (var i=0; i<len; i++){\n //alert(\"Row = \" + i + \" ID = \" + results.rows.item(i).entry_id + \" Title = \" + results.rows.item(i).title);\n //}\n //results of INSERT statement\n //console.log(\"Insert ID = \" + results.insertId);\n //console.log(\"Rows Affected = \" + results.rowAffected);\n //console.log(\"Insert ID = \" + results.rows.length);\n $('#success').append(\"<br><h3>Successfully added to your diary!<h3><br>\");\n}", "function afterExecute(err, results) {\n debug(`executed(${query.database.uuid || 'default'}) : ${query.sql}`);\n\n if (benchmark) {\n query.sequelize.log('Executed (' + (query.database.uuid || 'default') + '): ' + query.sql, Date.now() - queryBegin, query.options);\n }\n\n if (err) {\n err.sql = query.sql;\n reject(query.formatError(err));\n } else {\n const metaData = this;\n let result = query.instance;\n\n // add the inserted row id to the instance\n if (query.isInsertQuery(results, metaData)) {\n query.handleInsertQuery(results, metaData);\n if (!query.instance) {\n // handle bulkCreate AI primary key\n if (\n metaData.constructor.name === 'Statement'\n && query.model\n && query.model.autoIncrementField\n && query.model.autoIncrementField === query.model.primaryKeyAttribute\n && query.model.rawAttributes[query.model.primaryKeyAttribute]\n ) {\n const startId = metaData[query.getInsertIdField()] - metaData.changes + 1;\n result = [];\n for (let i = startId; i < startId + metaData.changes; i++) {\n result.push({ [query.model.rawAttributes[query.model.primaryKeyAttribute].field]: i });\n }\n } else {\n result = metaData[query.getInsertIdField()];\n }\n }\n }\n\n if (query.sql.indexOf('sqlite_master') !== -1) {\n if (query.sql.indexOf('SELECT sql FROM sqlite_master WHERE tbl_name') !== -1) {\n result = results;\n if (result && result[0] && result[0].sql.indexOf('CONSTRAINT') !== -1) {\n result = query.parseConstraintsFromSql(results[0].sql);\n }\n } else {\n result = results.map(resultSet => resultSet.name);\n }\n } else if (query.isSelectQuery()) {\n if (!query.options.raw) {\n // This is a map of prefix strings to models, e.g. user.projects -> Project model\n const prefixes = query._collectModels(query.options.include);\n\n results = results.map(result => {\n return _.mapValues(result, (value, name) => {\n let model;\n if (name.indexOf('.') !== -1) {\n const lastind = name.lastIndexOf('.');\n\n model = prefixes[name.substr(0, lastind)];\n\n name = name.substr(lastind + 1);\n } else {\n model = query.options.model;\n }\n\n const tableName = model.getTableName().toString().replace(/`/g, '');\n const tableTypes = columnTypes[tableName] || {};\n\n if (tableTypes && !(name in tableTypes)) {\n // The column is aliased\n _.forOwn(model.rawAttributes, (attribute, key) => {\n if (name === key && attribute.field) {\n name = attribute.field;\n return false;\n }\n });\n }\n\n return tableTypes[name]\n ? query.applyParsers(tableTypes[name], value)\n : value;\n });\n });\n }\n\n result = query.handleSelectQuery(results);\n } else if (query.isShowOrDescribeQuery()) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA INDEX_LIST') !== -1) {\n result = query.handleShowIndexesQuery(results);\n } else if (query.sql.indexOf('PRAGMA INDEX_INFO') !== -1) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA TABLE_INFO') !== -1) {\n // this is the sqlite way of getting the metadata of a table\n result = {};\n\n let defaultValue;\n for (const _result of results) {\n if (_result.dflt_value === null) {\n // Column schema omits any \"DEFAULT ...\"\n defaultValue = undefined;\n } else if (_result.dflt_value === 'NULL') {\n // Column schema is a \"DEFAULT NULL\"\n defaultValue = null;\n } else {\n defaultValue = _result.dflt_value;\n }\n\n result[_result.name] = {\n type: _result.type,\n allowNull: _result.notnull === 0,\n defaultValue,\n primaryKey: _result.pk !== 0\n };\n\n if (result[_result.name].type === 'TINYINT(1)') {\n result[_result.name].defaultValue = { '0': false, '1': true }[result[_result.name].defaultValue];\n }\n\n if (typeof result[_result.name].defaultValue === 'string') {\n result[_result.name].defaultValue = result[_result.name].defaultValue.replace(/'/g, '');\n }\n }\n } else if (query.sql.indexOf('PRAGMA foreign_keys;') !== -1) {\n result = results[0];\n } else if (query.sql.indexOf('PRAGMA foreign_keys') !== -1) {\n result = results;\n } else if (query.sql.indexOf('PRAGMA foreign_key_list') !== -1) {\n result = results;\n } else if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].indexOf(query.options.type) !== -1) {\n result = metaData.changes;\n } else if (query.options.type === QueryTypes.UPSERT) {\n result = undefined;\n } else if (query.options.type === QueryTypes.VERSION) {\n result = results[0].version;\n } else if (query.options.type === QueryTypes.RAW) {\n result = [results, metaData];\n } else if (query.isUpdateQuery() || query.isInsertQuery()) {\n result = [result, metaData.changes];\n }\n\n resolve(result);\n }\n }", "function rghResult(result) {\n // send result back to app\n if (isEmptyObject(resultObject)) {\n resultObject = result;\n }\n else {\n resultObject = _.concat(resultObject, result); // concat/merge with existing group results\n }\n getGroupFiles(++groupIndex); // get next group template to merge\n }", "function storeResult(currentResult, collectedResult) {\n // count the API\n collectedApi++;\n // get the API's id from the result\n apiId = currentResult.api;\n delete currentResult.api;\n // store result\n collectedResult.tests = currentResult;\n results[apiId] = collectedResult; \n\n if (collectedApi === apis.length) {\n collection.sendResults(results);\n }\n }", "function querySuccess(tx, results) { \n\tvar len = results.rows.length;\n\n\tfor (var i=0; i<len; i++){\n\t\talert(\"Row = \" + i + \" ID = \" + results.rows.item(i).note_id + \" Name = \" + results.rows.item(i).name + \" Data = \" + results.rows.item(i).data + \" time = \" + results.rows.item(i).save_time);\n\t}\n}", "function add_result( value ) {\n r.push(value.data);\n next_question();\n}", "function querySucceeded(data) {\n return data.results;\n }", "function next(err, result) {\n if (err)\n return callback(err, results);\n results.push(result);\n if (fns.length)\n run(fns.shift());\n else\n callback(null, results);\n }", "function resultsCalculation(){\n console.log(`RESULTS CALCULATION AT: ${new Date().toLocaleString()}`); \n console.log(`Running: ${SELECT_PREV_CYCLE_VALUE}${parseInt(new Date().getHours())-1} limit 1;`);\n db.query(`${SELECT_PREV_CYCLE_VALUE}${parseInt(new Date().getHours())-1} limit 1;`)\n .then(prev_cycle => { // result from the SELECT_PREV_CYCLE_VALUE => getting the previous cycle_value\n prev_value = prev_cycle[0]['cycle_value'];\n // console.log(`Prev_value=${prev_value}`); \n console.log(`Retunring: ${SELECT_CURRENT_CYCLE_VALUE}${parseInt(new Date().getHours())} limit 1;`)\n return db.query(`${SELECT_CURRENT_CYCLE_VALUE}${parseInt(new Date().getHours())} limit 1;`) // and executing the next thing which its results will be used in the \"result\" in the next \"then\"\n })\n .then(curr_cycle => { // The results from the SELECT_CURRENT_CYCLE_VALUE => the current cycle_value\n curr_value = curr_cycle[0]['cycle_value'];\n console.log(`Curr_value=${curr_value}`);\n return { // Sending the results required for the next operation\n prev_value: prev_value,\n curr_value: curr_value\n }\n })\n .then(cycle_values => { // Checking who won: the 'up' or 'down' bet\n let {prev_value, curr_value} = cycle_values;\n // console.log(`${result['prev_value']} and ${result['curr_value']}`);\n // console.log(`${prev_value} and ${curr_value}`);\n\n if(curr_value > prev_value){\n // Mark all players with 'up' as winners\n console.log('UP WON');\n return 'Up' \n } else if(curr_value < prev_value) {\n // Mark all players with 'down' as winners\n console.log('DOWN WON');\n return 'Down' \n } else { // Meaning the values are equal\n // Mark all players in that cycle as Void => refund the points\n console.log('DRAW!!');\n return 'DRAW'\n }\n })\n .then(direction => { \n up_down = direction;\n // console.log(`dir1 = ${up_down}`);\n // console.log(`***************************`)\n // console.log(`${CALCULATE_LOOSING_AMOUNT}'${up_down}';`)\n db.query(`${CALCULATE_WIN_LOSE_AMOUNT}${parseInt(new Date().getHours())-1} and direction='${up_down}';`) //Calculating the winning mount\n .then(winnings => {\n winning_bets = winnings[0]['sum'];\n console.log(`Winnings amount is: ${winning_bets}`);\n return up_down\n })\n .then(up_down => {\n // console.log(`dir2 = ${up_down}`);\n db.query(`${CALCULATE_W_BETS_AMOUNT}${parseInt(new Date().getHours())-1} and direction='${up_down}';`) //Calculating the weighted bets amount\n .then(w_bets => {\n // console.log(`dir2.5 = ${up_down}`);\n weighted_bets = w_bets[0]['sum'];\n console.log(`Winnings weighted bets amount is: ${weighted_bets}`); \n return up_down\n })\n .then(up_down => {\n // console.log(`dir3 = ${up_down}`);\n db.query(`${CALCULATE_WIN_LOSE_AMOUNT}${parseInt(new Date().getHours())-1} and direction='${up_down === 'Down' ? 'Up':'Down'}';`) // Flipping logic to calculate the loosing amount\n .then(loosings => {\n loosing_bets = loosings[0]['sum'];\n // console.log(up_down)\n return up_down\n })\n .then(up_down => {\n // console.log(up_down)\n console.log(`***************************`);\n let payout = `update players_table set payout=(bet / ${winning_bets})*${BET_PORTION}*${loosing_bets}+ \n (w_bet / ${weighted_bets})*${BET_PORTION}*${loosing_bets}+bet, result=1 \n where direction='${up_down}' and bet_hour=${parseInt(new Date().getHours())-1}`;\n db.query(payout) // Calculating payout\n console.log(`loosings= ${loosing_bets} winnings = ${winning_bets} w_bets = ${weighted_bets}`)\n // return db.close()\n })\n });\n })\n // }, (err) => {\n // return db.close().then(() => {throw err;})\n })\n .catch((err) => {throw err});\n}", "function query_promise_then(result) {\n\n my_query.url=result;\n var promise=MTP.create_promise(my_query.url,find_logo,submit_if_done,function() {\n if(!my_query.failed_once&&my_query.old_url) {\n my_query.failed_once=true;\n const queryPromise = new Promise((resolve, reject) => {\n console.log(\"Beginning URL search\");\n query_search(my_query.name+\" real estate agent\" , resolve, reject, query_response,\"query\");\n });\n queryPromise.then(query_promise_then)\n .catch(function(val) {\n console.log(\"Failed at this queryPromise \" + val); GM_setValue(\"returnHit\",true); });\n return;\n }\n\n\n\n\n GM_setValue(\"returnHit\",true); });\n\n }", "function query_promise_then(result) {\n my_query.done.query=true;\n console.log(\"Found url=\"+result+\", calling\");\n if(!/http/.test(my_query.url)) {\n my_query.done.gov=false;\n my_query.url=result;\n call_contact_page(result,submit_if_done);\n var promise=MTP.create_promise(my_query.url,parse_none,gov_then,\n function() { my_query.done.gov=true;\n console.log(\"# Calling submit_if_done, query_promise_then->parse_none fail\");\n\n submit_if_done(); },{});\n }\n console.log(\"# Calling submit_if_done, query_promise_then\");\n\n submit_if_done();\n\n\n\n }", "computeResult(result) {\n }", "function addSongsResult (result, clear) {\n\n\t\tif (clear) {\n\t\t\tupNext = [];\n\t\t\tnowPlaying = 0;\n\t\t}\n\n\t\tfor (var row of result.rows) {\n\t\t\tdelete row.doc._rev;\n\t\t\tupNext.push(row.doc);\n\t\t}\n\n\t}", "function results(callback) {\n var db = new sql.Database(\"football.db\");\n console.log(\"populating the results table\");\n fluent.create({\n table:\"results\", fileName:\"results\", db:db\n }).async({\n checkTableExists:checkTableExists\n }, \"table\", \"db\").async({\n createResultsTable:createResultsTable\n }, \"checkTableExists\", \"db\").wait().sync({\n getJsonData:getJsonData\n }, \"fileName\").sync({\n addResults: addResults\n }, \"getJsonData\", \"db\").wait().sync({\n close:close\n }, \"db\").run(callback);\n}", "function querySuccess(tx, results) {\n\tvar len = results.rows.length;\n\tvar reports = [];\t\n\n\tif (len > 0) {\n\t\tfor ( var i = 0; i < len; i++) {\n\t\t\treports[i] = results.rows.item(i);\n\t\t}\n\t\tko.mapping.toJSON(reports);\n\t\tIndexer = results.rows.length;\t\t\n\t\t$(\"#noRecordsFound\").hide(\"fast\");\n\t} else {\n\t\t\n\t\t$(\"#noRecordsFound\").show(\"fast\");\n\t}\n\n\tviewModel = new reportsMasterModel(eval(reports));\n\tko.applyBindings(viewModel);\n\tif (Message != null && Message != \"\")\n\t{\t\t\n\t\twriteMessage(Message);\n\t}\n\telse\n\t\tMessage = null;\n}", "function successDB() { }", "function successDB() { }", "applyBackendResult(data) {\n this.setValues(data.new_values);\n data.errors.forEach(err =>\n this.setError(err.title, err.message)\n );\n if (data.dialog) {\n this.setDialog(FrontendDialog.fromBackendData(data.dialog));\n }\n if (data.wizard_progress) {\n this.wizardProgress = Immutable.fromJS(data.wizard_progress);\n this.result.wizard_progress = this.wizardProgress;\n }\n if (data.next_dialog_link_data) {\n return postJSON(data.next_dialog_link_data.link,\n {\n wizard_progress: this.wizardProgress,\n obj_values: this.newValues,\n operation_state: this.operationState})\n .then(next_dialog => this.setNextDialog(next_dialog,\n data.next_dialog_link_data.dialog_name,\n this.newValues));\n } else {\n return Promise.resolve();\n }\n }", "function finished(result) {\n\t\t\t--self.evaluating;\n\t\t\tself.off('Error', captureError);\n\t\t\tif (callback) callback(err, result);\n\t\t}", "function querySuccess(tx, results) {\n var len = results.rows.length;\n\n if (len > 0) {\n if (results.rows.item(0).Status == 'true') {\n utils.localStorage().set('user', results.rows.item(0));\n utils.localStorage().set('LangID', $('#language').val());\n utils.localStorage().set('loggedIn', true);\n\n AddLoginAnalytics(tx);\n var track = {\n Category: 'User', Action: 'Logged in user', Label: results.rows.item(0).userName, Value: 1\n };\n // if (utils.isMobile() && utils.IsOnline()) {\n utils.Analytics.trackEvent(track);\n // }\n window.location.href = 'welcome.html';\n }\n else {\n $('#returnMessage').append('There was a problem authenticating the User, contact Administrator');\n $('#returnMessage').show();\n }\n }\n else {\n $('#returnMessage').append('There was a problem authenticating the User, contact Administrator');\n $('#returnMessage').show();\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 }", "function db_query(query_string, next) {\r\n db_mutex.acquire().then((release) => {\r\n const conn = new sql.ConnectionPool(config)\r\n conn.connect().then((conn) => {\r\n conn.query(query_string).then((result) => {\r\n /* Below comment is duplicate of result preprocessing code in DirectQuery.js. \r\n * Thinking of a way to get that preprocessing done within the router */\r\n /*\r\n var data = result.recordset.\r\n data.forEach(element => {\r\n Object.keys(element).forEach(key => {\r\n if(element[key] == null) element[key]='-'\r\n else if(element[key] == true) element[key]='true'\r\n else if(element[key] == false) element[key]='false'\r\n });\r\n });*/\r\n next(null, result.recordset);\r\n release();\r\n }).catch(error => {\r\n next(error, null);\r\n release();\r\n });\r\n }).catch(error => {\r\n next(error, null);\r\n release();\r\n });\r\n });\r\n}", "handleResult(result) {\n return this.getResult(result);\n }", "function next(err, result) {\n console.log('**Run in next:' + typeof(result));\n// throw exception if task encounters an error.\n if (err) throw err;\n\n// Next task comes from array of task.\n var currentTask = tasks.shift();\n\n if (currentTask) {\n// Execute current task.\n currentTask(result);\n }\n}", "function processResult(req, res, next , query){\n return function(err, data){\n if (err) {\n console.log(err);\n res.status(404).send(\"Not Found\").end();\n }else{\n res.json(data).end();\n }\n };\n}", "function processResult(req, res, next , query){\n return function(err, data){\n if (err) {\n console.log(err);\n res.status(404).send(\"Not Found\").end();\n }else{\n res.json(data).end();\n }\n };\n}", "function cb(result) {\n this.results.push(result);\n this.emit('portFinished', result);\n\n if (this.state !== 2) return;\n\n const nextPort = this._nextPort;\n if (nextPort) {\n if (this.rateLimit) {\n this.timeouts.push(setTimeout(()=>{\n this[CHECK_PORT_METHOD](nextPort, cb.bind(this));\n }, this.rateLimit));\n } else {\n this[CHECK_PORT_METHOD](nextPort, cb.bind(this));\n }\n } else {\n if (this.results.length === this.portList.length) {\n this._state = 4;\n this.emit('complete', this.results);\n }\n }\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 }", "function done(err, result) {\n callback(err, result);\n }", "function done(err, result) {\n callback(err, result);\n }", "function buildResult( err, result ) {\n\n if( err ) { // don't care of steps is zero\n callback( err );\n return;\n }\n callback( null, result );\n }", "function runPreparedStatment( queryString, val, res){\r\n var resultSet_;\r\n var query = db.query( queryString, val, function(err, result){\r\n if(err){\r\n console.log('Error in prepared statement: ' + err);\r\n } else {\r\n sendJSON(result, res);\r\n }\r\n });\r\n}", "function addResult(trackid, userid, position, res) {\n connection.query(\n 'INSERT INTO `result` (`trackid`, `userid`, `position`) VALUES (?, ?, ?)',\n [trackid, userid, position],\n function (err) {\n if (err) {\n res.send({\"success\": false, \"data\": ['unexpected error']})\n }\n })\n}", "function processResults(err, results) {\n\n self.refillInProgress = false;\n self.emit('refill done', results);\n\n }", "function query_promise_then(result) {\n my_query.fields.website=result.replace(/(https:\\/\\/(?:[^\\/]*))\\/.*$/,\"$1\");\n my_query.done.query=true;\n submit_if_done();\n }", "function reply_processed( result ) {\n\n\t\t\tvar storename;\n\t\t\tvar name_map = {\n\t\t\t\t'goals_set_up' : 'test_goals',\n\t\t\t\t'goal_value' : 'test_goal_value',\n\t\t\t\t'demographic_data' : 'test_demographic',\n\t\t\t\t'events' : 'test_events',\n\t\t\t\t'enhanced_ecommerce' : 'test_ecom',\n\t\t\t\t'adwords_linked' : 'test_adwords',\n\t\t\t\t'channel_groups' : 'test_channelgroups',\n\t\t\t\t'content_groups' : 'test_contentgroups',\n\t\t\t\t'setup_correct' : 'test_setup',\n\t\t\t\t'filltering_spam' : 'test_spam',\n\t\t\t\t'raw_or_testing_view' : 'test_raw',\n\t\t\t\t'total_sessions' : 'test_sessions',\n\t\t\t\t'bounce_rate' : 'test_bouncerate',\n\t\t\t\t'top_hostname' : 'test_tophost',\n\t\t\t\t'channel' : 'test_majority_channel',\n\t\t\t\t'sessions' : 'test_majority_session',\n\t\t\t\t'percentage' : 'test_majority_percentage',\n\t\t\t}\n\t\t\tfor (var attrname in result) {\n\t\t\t\tconsole.log(attrname);\n\t\t\t\t// map results to storage format\n\t\t\t\tstorename = name_map[attrname];\n\t\t\t\tresults[storename] = result[attrname];\n\t\t\t}\n\n\t\t\treplies++;\n\t\t\tif ( 4 === replies ) {\n\t\t\t\tjQuery( '#analytucsaudit_message').hide();\n\t\t\t\tjQuery( '#analytucsaudit_results').show();\n\t\t\t\tequal_tests_height();\n\n\t\t\t\tvar data = {\n\t\t\t\t\t\t'action' : 'analyticsaudit_save',\n\t\t\t\t\t\t'website' : domain,\n\t\t\t\t\t\t'email' : jQuery('#analytucsaudit_email').attr('data-email'),\n\t\t\t\t\t\t'gtm' : jQuery('#analytucsaudit_gtm').is(\":checked\"),\n\t\t\t\t\t\t'tableau' : jQuery('#analytucsaudit_tableau').is(\":checked\"),\n\t\t\t\t\t\t'bigquery' : jQuery('#analytucsaudit_bigquery').is(\":checked\"),\n\t\t\t\t\t\t'datastudio' : jQuery('#analytucsaudit_datastudio').is(\":checked\"),\n\t\t\t\t\t\t'unsure' : jQuery('#analytucsaudit_unsure').is(\":checked\"),\n\t\t\t\t\t\t'ecom' : jQuery('#analytucsaudit_ecom').is(\":checked\"),\n\t\t\t\t\t\t'lead' : jQuery('#analytucsaudit_lead').is(\":checked\"),\n\t\t\t\t\t\t'publisher' : jQuery('#analytucsaudit_publisher').is(\":checked\"),\n\t\t\t\t};\n\t\t\t\tfor (var attrname in results) {\n\t\t\t\t\tdata[attrname] = results[attrname];\n\t\t\t\t}\n\n\t\t\t\tjQuery.post(analyticsaudit_vars.ajax_url, data, function(response) {\n\t\t\t\t});\n\n\t\t\t}\n\t\t}", "async exec() {\n try {\n // generate queryString\n this.buildQuery();\n // eslint-disable-next-line prefer-destructuring\n const values = this.values;\n // eslint-disable-next-line prefer-destructuring\n const queryString = this.queryString;\n\n // send query to database\n const { rows, rowCount } = await this.DB.query(queryString, values);\n\n // end the transaction!\n this.end(); // This resets all properties in this class (except `this.relation`);\n\n // send a response\n return {\n queryString,\n values,\n rows,\n rowCount,\n };\n } catch (error) {\n console.log(error.stack, error.message);\n return `Unable to complete this transaction: ${error}`;\n }\n }", "function query_promise_then(result) {\n my_query.fields.brandSite=result;\n var promise=MTP.create_promise(result,parse_website,parse_website_then,function() { GM_setValue(\"returnHit\",true); });\n var promise2=MTP.create_promise(result,Gov.init_Gov,parse_gov_then,function() { my_query.done.gov=true; submit_if_done(); },{dept_regex_lst:[/Staff/],title_regex_lst:[/Owner/,/Manager/]});\n }", "function executeQuery(selectedQuery, parameters) {\n const session = driver.session({ database: database });\n\n if (selectedQuery == \"HR\") {\n return session.readTransaction((tx) =>\n tx.run('MATCH (P1:Person)-[AR:APP_REGISTERED_CONTACT]-(P2:Person) WHERE P1.ssn = \\'' + parameters.ssn + '\\' AND P2.ssn<>P1.ssn AND duration.inDays(AR.date,date(\"' + parameters.swabDate + '\")).days <= 2 AND duration.inDays(AR.date,date(\"' + parameters.swabDate + '\")).days >= 0 RETURN P2 AS p')\n )\n .then(result => {\n // Each record will have a person associated, I'll get that person\n return result.records.map(recordFromDB => {\n return new Person(recordFromDB.get(\"p\"));\n });\n })\n .catch(error => {\n throw error;\n })\n .finally(() => {\n return session.close();\n });\n }\n else if (selectedQuery == \"SB\") {\n return session.writeTransaction((tx) => {\n tx.run('CREATE (S:Swab {date: date(\\'' + parameters.date + '\\'), outcome: \\'' + parameters.outcome + '\\', type: \\'' + parameters.type + '\\'}) WITH S MATCH (P:Person) WHERE P.ssn = \\'' + parameters.ssn + '\\' MERGE (P)<-[:TAKES]->(S)')\n })\n .then(result => {\n return \"Successfully added swab to ssn: \" + parameters.ssn;\n })\n .catch(error => {\n throw error;\n })\n .finally(() => {\n return session.close();\n });\n }\n else if (selectedQuery == \"ALL\") {\n return session.readTransaction((tx) =>\n tx.run('MATCH (p:Person)-[r:APP_REGISTERED_CONTACT]->(:Person) RETURN DISTINCT p LIMIT(100)')\n )\n .then(result => {\n // Each record will have a person associated, I'll get that person\n return result.records.map(recordFromDB => {\n return new Person(recordFromDB.get(\"p\"));\n });\n })\n .catch(error => {\n throw error;\n })\n .finally(() => {\n return session.close();\n });\n }\n}", "function next()\n {\n var params = queue[0];\n\n // Replace or add the handler\n if(params.hasOwnProperty(\"success\")) callback = params.success;\n else callback = null;\n\n params.success = success;\n\n // Manage request timeout\n timeoutId = setTimeout(timeoutHandler, TIMEOUT);\n\n // Now we can perform the request\n $.ajax(params);\n }", "function addResult(results) {\n console.log(\"db.js: Line 97 results addUserResult\", results);\n return $.ajax({\n url: `${firebase.getFBsettings().databaseURL}/results.json`,\n type: 'POST',\n data: JSON.stringify(results),\n dataType: 'json'\n }).done((results) => {\n console.log(\"*********** new-db-interaction line 98: what is addResult(results)? ***************\", results);\n return results;\n });\n}", "function processResponse(index, success, response) {\n var result = $scope.results[index];\n $scope.firstResult = $scope.firstResult || result;\n\n result.endTime = Date.now();\n result.completed = true;\n result.success = success;\n result.elapsed = result.endTime - result.startTime;\n result.responseData = JSON.stringify(response.data);\n\n if (index === 0) {\n result.cached = false;\n } else if (result.responseData === $scope.firstResult.responseData) {\n result.cached = true;\n } else {\n result.cached = false;\n }\n\n // Complete the run if we're done.\n if (!$scope.isRunning()) {\n $scope.runEnded();\n }\n }", "function writeResults ({ db, cache, term, results }, cb) {\n debug('writing results: %s', term)\n\n if (results.length) {\n put(db, term, results, (err) => {\n debug('submitting callback: ( %s, %s )', err, results.length)\n cb(err, results)\n })\n } else {\n del(db, term, (err) => {\n cache.set(term, true)\n debug('submitting callback: ( %s, %s )', err, results.length)\n cb(err, results)\n })\n }\n}", "function refreshResults() {\n\tif (_dataSource) {\n\t\t_pager.page(0);\n\t\t_dataSource.fetch(function(){\n\t\t // if callback is needed, place it here\n\t\t});\n\t}\t\n}", "function nextTransfer(result){\n inprogress--; // decrement counter to free up one space to start transfers again!\n popTransferQueue(); // check if there are any queued transfers\n return result;\n }", "function nextTransfer(result) {\n inprogress--; // decrement counter to free up one space to start transfers again!\n popTransferQueue(); // check if there are any queued transfers\n return result;\n }", "function notifyResults() {\n if (results.length > 0) {\n onIncrementalFulfilled(results);\n }\n firstResultTS = null;\n timeout = null;\n results = [];\n }", "function executeQuery(queries, cb) {\n\t\t\tif (queries.length === 0) {\n\t\t\t\tconsole.log('Loading ' + table_name +' completed.');\n\t\t\t\tcb();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar query = queries.pop();\n\t\t\t\t// Execute query.\n\t\t\t\tclient.query(query, function(error, result) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\tconsole.log('Fail: ' + query);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// console.log('Success: ' + query);\n\t\t\t\t\t}\n\t\t\t\t\texecuteQuery(queries, cb);\n\t\t\t\t});\t\t\t\t\n\t\t\t}\n\t\t}", "function record(result) {\n return db.lsetAsync(sessionStateKey, -1, JSON.stringify(result))\n .then(() => db.rpoplpushAsync(sessionStateKey, sessionResultKey))\n .then(() => db.delAsync(sessionStateKey))\n .then(() => db.expireAsync(sessionResultKey, expiration))\n .then(() => db.zincrbyAsync(sessionsKey, 1, session))\n .catch(() => gone(`Session ${session} has been killed`))\n }", "_processNextItem(previousResult = null, storePreviousResultAs = '') {\n if (previousResult && storePreviousResultAs) {\n this._stateContainer.store(storePreviousResultAs, previousResult);\n }\n\n if (isEmpty(this._queue)) {\n return this._stateContainer.resolve(previousResult);\n }\n\n const nextRoute = this._queue[0];\n const awaitForIt = nextRoute.awaitForHandler;\n const handlerArguments = [];\n const storedDependencies = this._loadDependenciesFor(nextRoute);\n for (const dependency of storedDependencies) {\n handlerArguments.push(dependency);\n }\n\n const passedHandlerArgs = this._passedHandlerArgs[0].args;\n for (const passedArgument of passedHandlerArgs) {\n handlerArguments.push(passedArgument);\n }\n\n const result = nextRoute.handler(...handlerArguments);\n if (result === 'hello everyone!') {\n console.log(handlerArguments);\n console.log('getting it!!');\n }\n\n this._queue.shift();\n this._passedHandlerArgs.shift();\n if (awaitForIt && (result instanceof Promise)) {\n result.then((resultAfterPromise) => {\n return this._processNextItem(resultAfterPromise, nextRoute.storeResultAs);\n });\n } else {\n return this._processNextItem(result, nextRoute.storeResultAs);\n }\n }", "complete(results, file) {\n const bytesUsed = results.meta.cursor;\n // Ensure any final (partial) batch gets emitted\n const batch = tableBatchBuilder.getBatch({bytesUsed});\n if (batch) {\n asyncQueue.enqueue(batch);\n }\n asyncQueue.close();\n }", "async function callDB(client, queryMessage) {\n\n var queryResult;\n await client.query(queryMessage)\n .then(\n (results) => {\n queryResult = results[0];\n //console.log(results[0]);\n return queryResult;\n })\n .then(\n (results) => {\n res = JSON.parse(JSON.stringify(results));\n return results\n })\n .catch(console.log)\n}", "function query_promise_then(result) {\n console.log(\"query_promise_then,url=\"+result);\n my_query.done.query=true;\n my_query.url=result;\n if(/facebook\\.com/.test(my_query.url)) {\n my_query.fields[my_query.fb]=my_query.url;\n my_query.fields[my_query.insta]=\"no link\";\n submit_if_done();\n return;\n }\n var promise=MTP.create_promise(my_query.url,find_social,find_social_then,function(response) {\n console.log(\"Failed \"+response);\n my_query.done.social=true;\n if(my_query.fields[my_query.fb]===\"\" && my_query.fields[my_query.insta]===\"\") {\n\n my_query.fields[my_query.fb]=my_query.fields[my_query.insta]=\"no link\"; }\n submit_if_done();\n });\n }", "function onProcessFinal() {\n chai_1.expect(loopResult, 'LoopResult should contain 10').to.contain(10);\n chai_1.expect(loopResult, 'LoopResult should contain 5').to.contain(5);\n chai_1.expect(loopResult, 'LoopResult should contain 1').to.contain(1);\n done();\n }", "function onQuerySuccess(tx, results) {\n\tvar len = results.rows.length;\n//\talert(\"empresa table: \" + len + \" rows found.\");\n//\tfor (var i = 0; i < len; i++) {\n//\t\talert(\"Row = \" + i + \" ID = \" + results.rows.item(i).id + \" Nome = \" + results.rows.item(i).nome);\n//\t}\n\t\n\t$(\"#main_loading\").css(\"display\", \"none\");\n\t$(\"#main_wrapper\").css(\"display\", \"block\");\n\t$(\"#header_title_main\").html(results.rows.item(0).nome);\n\t$(\"#main_content_horario_wrapper\").html(\"<strong>Horário de Funcionamento</strong><br>\" + results.rows.item(0).horarioFuncionamento);\n}", "function done(result) {\n if (errorList.length === 0) resolve(result);else reject(new BulkError(self.name + '.bulkAdd(): ' + errorList.length + ' of ' + numObjs + ' operations failed', errorList));\n }", "function execute(query) \n{\n\ttic();\n \n\tworker.onmessage = function(event) \n {\n\t\tvar results = event.data.results;\n\t\ttoc(\"Executing SQL\");\n\n\t\ttic();\n\t\toutputElm.innerHTML = \"\";\n \n\t\tfor (var i = 0; i < results.length; i++) \n {\n\t\t\toutputElm.appendChild(tableCreate(results[i].columns, results[i].values));\n\t\t}\n \n\t\ttoc(\"Displaying results\");\n\t}\n \n\tworker.postMessage({action:'exec', sql:query});\n\toutputElm.textContent = \"Fetching results...\";\n}", "function queryAsync(statement, parameters, success) {\n /*sqrObject have the information about the result of query*/\n let sqrObject = new Object();\n sqrObject.data = new Array();\n sqrObject.cols = 0;\n sqrObject.rows = 0;\n\n let query = connection.createStatement(statement);\n for(var p in parameters){\n \tquery.params[p] = parameters[p];\n }\n query.executeAsync({\n handleResult: function(resultSet) {\n for(var row=resultSet.getNextRow(); row; row=resultSet.getNextRow()) {\n sqrObject.cols = row.numEntries;\n let dataRow = new Array(sqrObject.cols);\n for(var i=0; i < sqrObject.cols; i++) {\n dataRow[i] = row.getResultByIndex(i);\n }\n sqrObject.data[sqrObject.rows] = dataRow;\n sqrObject.rows++;\n }\n },\n handleError: function(error) {\n success(null, error);\n },\n handleCompletion: function(reason) {\n success(sqrObject, reason);\n }\n });\n}", "function query_promise_then(result) {\n my_query.url=result;\n var query={dept_regex_lst:[/Staff/],title_regex_lst:[/Owner/,/Manager/,/Director/]};\n\n var promise=MTP.create_promise(my_query.url,Gov.init_Gov,gov_promise_then,function() { GM_setValue(\"returnHit\",true); },query);\n }", "function dataHandler(transaction, results)\n {\n // Handle the results\n for (var i=0; i<results.rows.length; i++) {\n // Each row is a standard JavaScript array indexed by\n // column names.\n var row = results.rows.item(i);\n last_id = row['last_id'] + 1;\n }\n }", "set result(value) {\n this._result = value;\n }", "function results() {\r\n\r\n console.log(\"result function called\");\r\n var database=firebase.database();\r\n var ref=database.ref('NeedCovidPlasmaData');\r\n\r\n ref.on('value',gotData,errData);\r\n \r\n\r\n }", "function writeResults() {\n logger.trace(\"Starting to write results to file\");\n\n // A boolean to indicate if the writing is backed up\n var writeOK = true;\n\n // Loop over the rows watching for write backups\n do {\n // Now write it to the file\n writeOK = sourceStream.write(result.rows[i]['epochseconds'] + ',' +\n result.rows[i]['timestamp_utc'] + ',' + result.rows[i]['string_agg'] + '\\n');\n\n // Bump the counter\n i++;\n } while (i < numRows && writeOK);\n\n // Check to see if all the writes are done\n if (i < numRows) {\n logger.trace(\"Writing stopped at line \" + i + \" will wait for drain\");\n\n // Since not done, set up a handler to watch for the buffer to\n // drain and then start writing again\n sourceStream.once('drain', writeResults);\n } else {\n logger.info(\"All done writing to file, will end the write stream\");\n sourceStream.end();\n }\n }", "get result() { return this._result; }", "updateResults(results) {\n this._resultsCache[this._query] = results;\n this._results = results;\n }", "function processResults (spotifyResults) {\n searchResults = []; // actually stores the song objects. only has unique results. is indexed 0,1,2...\n // the found hash maps from songNames to an index to this array\n var found = {}\n\n for (var res in spotifyResults.tracks) {\n var songResult = spotifyResults.tracks[res];\n var songName = getSongName(songResult);\n var songArtist = getSongArtist(songResult);\n var songString = songName + songArtist;\n if (songString in found) {\n // see if availability is now true (assuming US only)\n if (isSongAvailable(songResult,'US')) {\n // since it is, we want to update the result to reflect this change\n addSongAvailable(searchResults[found[songString]], 'US');\n setSongLink(searchResults[found[songString]], getSongLink(songResult));\n }\n } \n else {\n // add to the found list\n found[songString] = searchResults.length;\n searchResults.push(songResult);\n }\n } \n}", "function defaultSuccessCallbackFn() {\n debug && console.log( \"MobileDb.defaultSuccessCallbackFn: Query successful\" );\n }", "function ParallelExecuteQuery(res,selectQuery,selectQueryCount){\n async.parallel({\n rowcount: function (cb) {\n pool.ExecuteQuery(selectQueryCount, function (err, data) {\n console.log(selectQueryCount);\n cb(err, data[0].cnt);\n });\n },\n data: function (cb) {\n pool.ExecuteQuery(selectQuery, function (err, data) {\n console.log(selectQuery);\n cb(err, data);\n });\n }\n },\n function(err,result) {\n var resultObj = utility.jsonResult(err, result.data, result.rowcount);\n res.json(resultObj);\n }\n );\n}", "function step() {\n\n // if there's more to do\n if (!result.done) {\n if (typeof result.value === \"function\") {\n result.value(function(err, data) {\n if (err) {\n result = task.throw(err);\n return;\n }\n\n result = task.next(data);\n step();\n });\n } else {\n result = task.next(result.value);\n step();\n }\n\n }\n }", "selectNextResult() {\n this.selectedResultIndex += 1;\n // Wrap around as needed\n if (this.selectedResultIndex === this.results.length) {\n this.selectedResultIndex = 0;\n }\n }", "function process() {\n\t// Get current page's data\n\toverallResult = overallResult.concat(getPrices());\n\n\tvar morePages = nextPage();\n\n\tif(morePages) {\n\t\t// Wait then call this method again\n\t\twaitCallback();\n\t} else {\n\t\t// Print results and exit\n\t\tconsole.log(overallResult.join(\"\"));\n\t\treturn;\n\t}\n}", "then(result) {\n\t\tthis.resultBlocks.push(result);\n\t\treturn this;\n\t}", "function UpdateResults(transaction, results)\r\n{\r\n if (results.rowsAffected) {\r\n }\r\n}", "function UpdateResults(transaction, results)\r\n{\r\n if (results.rowsAffected) {\r\n }\r\n}", "async processResult(\n resArray,\n originalUserData,\n botStorage,\n ignoreWildcardHistory,\n scoreBasedOnSearch\n ) {\n try {\n this.countEntry++\n debug('countEntry', this.countEntry)\n\n let pList = []\n let uList = []\n let bList = []\n let wList = []\n let infoList = []\n for (let i = 0; i < resArray.length; i++) {\n //Ok, this copies the entire user data, a costly operation.\n //One should just copy the history and database when the time comes.\n\n //debug('originalUserData', originalUserData)\n //debug('botStorage', botStorage)\n let userData = deepcopy(originalUserData)\n //debug('userData aagin', userData)\n\n let lStorage = deepcopy(botStorage)\n\n //let userData = userDataList[i];\n\n let res = resArray[i]\n //debug('RES', res)\n\n let source = res.source\n let wildcards = res.wildcards\n let confidence = res.confidence\n let storage = res.source.storage\n\n let typeIdentifier = this.pdb.getTypeIdentifier(source)\n let replies = this.tellMap.get(typeIdentifier)\n debug('replies', replies)\n debug('typeIdentifier', typeIdentifier)\n\n\n //Store data and fill in from local storage\n //These can override information in the database\n //This could also put in bogus data, but can also put in multiple\n //copies of correct data! Could cause some strange results so watch out!\n debug(\n '------------------------storage-------------------',\n storage,\n source.implies[0]\n )\n let info = null\n if (storage) {\n this.storeData(\n storage,\n wildcards,\n userData,\n source.implies[0],\n source,\n lStorage\n )\n\n //You can also fill in the values\n info = this.retrieveData(\n storage,\n wildcards,\n userData,\n source.implies[0],\n source,\n lStorage\n )\n }\n\n infoList.push(info)\n\n //Lets fill in wildcards ahead of time with guesses\n //debug('wildcards',wildcards)\n debug('userData', userData)\n debug(\n 'wildcards',\n wildcards,\n 'history',\n userData.history,\n 'lastHistory',\n userData.getLastHistory()\n )\n if (!ignoreWildcardHistory) {\n //You ignore the history if your have expanded a word, in general\n for (let i in wildcards) {\n debug('i', i)\n if (!wildcards[i] && i != 'matched') {\n debug('replacing', i, wildcards[i])\n let res = slotFiller.getWildcardFromHistory(i, userData.history, 5)\n //debug('res', res, userData.history)\n if (res.length) {\n wildcards[i] = res[0]\n debug('with', res[0])\n }\n }\n }\n }\n debug('wildcards after insertion', wildcards)\n\n res.wildcards = wildcards\n userData.unshiftHistory(res)\n\n //Actually compute the result\n debug('this.botEngine', this.botEngine)\n let firstGuess = await this.botEngine.computeResult(\n {\n typeIdentifier: typeIdentifier,\n replies: replies,\n wildcards: wildcards,\n source: source,\n doc: this.doc,\n confidence: confidence,\n score: res.score,\n },\n userData,\n scoreBasedOnSearch\n )\n debug('firstGuess', firstGuess)\n\n //All promises must resolve, which I believe they do (rejections caught and turned to resolve)\n pList.push(firstGuess)\n uList.push(userData)\n bList.push(lStorage)\n wList.push(res.wcScore)\n }\n\n debug('ans.length', pList.length)\n let newVal = []\n for (let i = 0; i < pList.length; i++) {\n pList[i].wcScore = wList[i]\n newVal.push({ val: pList[i], userData: uList[i], storage: bList[i] })\n }\n\n debug('--------------------------NEWVAL-------------------', newVal)\n\n //There are many results given in the list, pick the best.\n let final = this.trimResults(newVal, infoList)\n\n debug('final', final)\n \n //copy the two critical components\n originalUserData.shallowCopy(final.userData)\n //debug('originalUserData', originalUserData)\n\n debug(\n 'FINAL STORAGE-------------------------',\n originalUserData.storage,\n final.storage\n )\n debug('botStorage', botStorage)\n for (let i in final.storage) {\n botStorage[i] = final.storage[i]\n }\n //debug('just before final promise.',final)\n debug('finalHistory', final.userData.history)\n return final.val\n } catch (error) {\n debug('Error', JSON.stringify(error, null, 2))\n\n }\n }", "function query_db(res) {\n\tglobal_res = res;\n\tasync.waterfall(\n\t\t[\n\t\t\tdoconnect,\n\t\t\tquery_country\n\t\t],\n\t\tfunction (err, conn) {\n\t\t\tif (err) { console.error(\"In waterfall error cb: ==>\", err, \"<==\"); }\n\t\t\tif (conn)\n\t\t\t\tdorelease(conn);\n\t\t});\n}", "query(query){\n return (onSuccess,onFail) => {\n this.connect(() => {\n new sql.Request().query(query)\n .then((recordset) => {\n onSuccess(recordset);\n sql.close()\n })\n .catch((error) => {\n console.error('I fucked up',error);\n //lol like that ever happens\n if(onFail){\n onFail()\n }\n sql.close();\n });\n });\n }\n }", "function query_promise_then(result) {\n if(my_query.biz_url.length===0)\n {\n my_query.biz_url=result;\n GM_xmlhttpRequest({method: 'GET', url: my_query.biz_url,\n onload: function(response) { parse_company_page(response); },\n onerror: function(response) { console.log(\"Fail at company page\"); my_query.doneCompany=true; do_finish(); },\n ontimeout: function(response) { console.log(\"Fail at company page\"); my_query.doneCompany=true; do_finish(); }\n });\n }\n\n }" ]
[ "0.7003667", "0.6379934", "0.6334382", "0.63128835", "0.631201", "0.6074901", "0.6074901", "0.6068354", "0.60439724", "0.6020442", "0.59556055", "0.592259", "0.5914238", "0.5910801", "0.5895733", "0.5869585", "0.5869585", "0.5807305", "0.57742894", "0.57690305", "0.57608014", "0.57513744", "0.57389176", "0.5722377", "0.568447", "0.5680233", "0.5654981", "0.56209207", "0.5585682", "0.5570851", "0.55496156", "0.55236024", "0.55226636", "0.55165106", "0.5494444", "0.5482788", "0.54694015", "0.54529524", "0.54529524", "0.5451317", "0.543427", "0.54341894", "0.5420315", "0.5418394", "0.5413239", "0.54091275", "0.5407914", "0.5407914", "0.540705", "0.54021585", "0.53988194", "0.53988194", "0.53835285", "0.5374251", "0.5372561", "0.53676754", "0.536504", "0.536119", "0.53439873", "0.533926", "0.53358346", "0.5317506", "0.53150046", "0.5314029", "0.5308729", "0.53068304", "0.5291534", "0.5287506", "0.52866536", "0.528374", "0.52800846", "0.527841", "0.5274688", "0.5269779", "0.52647585", "0.5263732", "0.5263523", "0.52521044", "0.52478474", "0.524279", "0.52403396", "0.52401847", "0.5238834", "0.52293456", "0.52282774", "0.5212428", "0.5210461", "0.52073014", "0.52052975", "0.5203096", "0.5191942", "0.5191283", "0.51870614", "0.5180037", "0.5179819", "0.5179819", "0.51792175", "0.5172997", "0.51717454", "0.51702166" ]
0.66331327
1
Reject the promise on failure.
function handleError(err) { defer.reject(err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static reject(error) { return new StatefulPromise(Promise.reject(error)) }", "reject() {\n return Promise.reject(this);\n }", "reject() {\n if (!this._promise) {\n return;\n }\n this._resolve();\n }", "function promiseReject(err) {\n\t\t\treturn _resolve(rejected(err));\n\t\t}", "function promiseReject(err) {\n\t\t\treturn _resolve(rejected(err));\n\t\t}", "function reject_me() {\n\treturn Promise.reject(this.toString())\n}", "static reject(value) {\n return new Promise((resolve, reject) => { reject(value) });\n }", "function promiseFn() {\n return Promise.reject(value);\n }", "function rejected(reason) {\n return new aplus.Promise(null, reason)\n}", "function fetchDataReject() {\n\treturn new Promise((_, reject) => {\n\t\treject('error');\n\t});\n}", "function reject(arg) {\n var deferred = defer();\n deferred.reject(arg);\n return deferred.promise;\n }", "function promiseRejector(resolve, reject) {\n reject('WebUI JS Error: The rejector always rejects!');\n}", "static reject(p) { \n return (p instanceof promise) ? p : new promise((r,j)=>{\n j(p)\n })\n }", "catch(onRejected) {\n return this.then(undefined, onRejected);\n }", "function rejectError(err) {\n deferred.reject(err);\n }", "function rejectError(err) {\n deferred.reject(err);\n }", "function unhandledPromiseRejection() {\n const promise = new Promise(promiseRejector);\n promise.then(promiseSuccessful);\n}", "function reject(err) {\n return defer().reject(err).promise();\n }", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "sendReject(res) {\n this.finalize(Promise.reject(res));\n }", "fail(callback) {\n return this.then(null, callback);\n }", "function RejectPromise (promise, reason) {\n console.assert(promise['[[PromiseState]]'] === 'pending')\n var reactions = promise['[[PromiseRejectReactions]]']\n set_internal(promise, '[[PromiseResult]]', reason)\n set_internal(promise, '[[PromiseFulfillReactions]]', undefined)\n set_internal(promise, '[[PromiseRejectReactions]]', undefined)\n set_internal(promise, '[[PromiseState]]', 'rejected')\n return TriggerPromiseReactions(reactions, reason)\n }", "function foo() {\n return Promise.reject(25);\n}", "function promiseRejected(err) {\n console.error(\"Promise rejected: \", err.message);\n }", "function rejectedSyncPromise(reason) {\n\t return new SyncPromise((_, reject) => {\n\t reject(reason);\n\t });\n\t}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function RejectPromise(promise, reason) {\n console.assert(promise['[[PromiseState]]'] === 'pending');\n var reactions = promise['[[PromiseRejectReactions]]'];\n set_internal(promise, '[[PromiseResult]]', reason);\n set_internal(promise, '[[PromiseFulfillReactions]]', undefined);\n set_internal(promise, '[[PromiseRejectReactions]]', undefined);\n set_internal(promise, '[[PromiseState]]', 'rejected');\n return TriggerPromiseReactions(reactions, reason);\n }", "function rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n }", "catch(reject) {\n return this.exec().catch(reject);\n }", "beRejected() {\n return this._actual.then(\n function() {\n this._assert(false, null, '${actual} resolved incorrectly.');\n }.bind(this),\n function(error) {\n this._assert(\n true, '${actual} rejected correctly with ' + error + '.', null);\n }.bind(this));\n }", "function error(error) {\n //Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "beRejectedWith() {\n this._processArguments(arguments);\n\n return this._actual.then(\n function() {\n this._assert(false, null, '${actual} resolved incorrectly.');\n }.bind(this),\n function(error) {\n if (this._expected !== error.name) {\n this._assert(\n false, null,\n '${actual} rejected correctly but got ' + error.name +\n ' instead of ' + this._expected + '.');\n } else {\n this._assert(\n true,\n '${actual} rejected correctly with ' + this._expected + '.',\n null);\n }\n }.bind(this));\n }", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}", "function rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}", "function catchReject(err) {\n throw new Error(err);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error: \" + error);\n}", "function eventuallyRejected(promise, done) {\n all([\n promise.should.be.rejected\n ], done);\n}", "function error(error) {\n // Parameter error berasal dari Promis.reject()\n console.log(\"Error : \" + error);\n}", "function handleError(err) {\n return Promise.reject(err);\n}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error ini : \" + error); \n}", "function error(error) {\n // error Parameter from Promise.reject()\n console.log(\"Error : \" + error);\n}", "function error(error) {\n // The error parameter is from Promise.reject ()\n console.log(\"Error : \" + error);\n}", "function eventuallyRejectedWith(promise, expected, done) {\n all([\n promise.should.be.rejectedWith(expected)\n ], done);\n}", "function reject(err, async) {\n err = toErr(err);\n if (async) {\n return Promise.reject(err);\n } else {\n throw err;\n }\n}", "_reject(err){\n if(this._status !== PENDING) return\n this._status = REJECTED\n this._value = err\n }", "function error(err) {\n\t deferred.reject(err.message);\n\t}", "function fail() {\n \t\treturn __awaiter(this, void 0, void 0, function* () {\n \t\t\treturn Promise.resolve(JSON);\n \t\t});\n \t}", "function closeRejected()\n{\n console.log(\"Close Promise rejected.\");\n}", "async function asyncFn() {\n return Promise.reject(value);\n }", "async function asyncFn() {\n return Promise.reject(value);\n }", "function onReject(error){\n console.log(error.message);\n}", "async function exampleRejectedAfterResolve() {\n try {\n return await new Promise((resolve, reject) => {\n resolve('exampleRejectedAfterResolve > First call');\n reject('exampleRejectedAfterResolve > Swallowed reject');\n });\n } catch {\n throw new Error('exampleRejectedAfterResolve > Failed');\n }\n}", "function suspendRejected()\n{\n console.log(\"Suspend Promise rejected.\");\n}", "function PromiseRejectFunction () {\n var F = function (reason) {\n console.assert(Type(F['[[Promise]]']) === 'object')\n var promise = F['[[Promise]]']\n var alreadyResolved = F['[[AlreadyResolved]]']\n if (alreadyResolved['[[value]]']) return undefined\n set_internal(alreadyResolved, '[[value]]', true)\n return RejectPromise(promise, reason)\n }\n return F\n }", "function PromiseRejectFunction() {\n var F = function(reason) {\n console.assert(Type(F['[[Promise]]']) === 'object');\n var promise = F['[[Promise]]'];\n var alreadyResolved = F['[[AlreadyResolved]]'];\n if (alreadyResolved['[[value]]']) return undefined;\n set_internal(alreadyResolved, '[[value]]', true);\n return RejectPromise(promise, reason);\n };\n return F;\n }", "async function f4() {\n await Promise.reject(new Error(\"에러 발생!\"));\n}", "function catchFunc(onRejected) {\n return this.then(undefined, onRejected);\n }", "function _failure (msg) {\n const fullMsg = logPrefix + ' Failed' + (msg ? ': ' + msg : '')\n clearInterval(interval)\n return reject(new Error(fullMsg))\n }", "reject() {\n if (!this._promise) {\n return;\n }\n this._resolve(CodeSnippetForm.cancelButton());\n }", "Reject()\n\t{\n\t\tconst Args = Array.from(arguments);\n\t\tconst Value = {};\n\t\tValue.RejectionValues = Args;\n\t\tthis.PendingValues.push(Value);\n\t\tthis.FlushPending();\n\t}", "function IfAbruptRejectPromise (value, capability) {\n var rejectResult = capability['[[Reject]]'].call(undefined, value)\n return capability['[[Promise]]']\n }", "function rejectWithDelay(error, delay = 100) {\r\n return new Promise((resolve, reject) => setTimeout(reject, delay, error));\r\n}", "function exceptionPromise(){\n \n return new Promise((resolve, reject)=>{\n setTimeout(function(){\n try{\n console.log(\"in setTimeout\");\n // reject(\"error!\");\n throw new Error(\"error!\");\n //resolve(\"ok\");\n } catch (e) {\n reject(e);\n } \n }, 1500);\n });\n}", "function onReject(error) {\n console.log(error.message);\n }", "onRejected(r) {\r\n //once settled can't go back\r\n if (this.state === states[0]) {\r\n this.state = states[2];\r\n this.reason = r;\r\n //notify waiting promises about reject\r\n this.backtrackTheChainR();\r\n }\r\n }", "async function exampleRejectedMoreThanOnce() {\n try {\n return await new Promise((resolve, reject) => {\n reject('exampleRejectedMoreThanOnce > First call');\n reject('exampleRejectedMoreThanOnce > Swallowed reject');\n });\n } catch {\n throw new Error('exampleRejectedMoreThanOnce > Failed');\n }\n}", "async function fails () {\n throw new Error('Contrived Error');\n }", "function performWithServerError() {\n return Promise.reject(new HttpError(504, 'Gateway Timeout'));\n}", "async function exampleResolveAfterReject() {\n try {\n return await new Promise((resolve, reject) => {\n reject('exampleResolveAfterReject > First call');\n resolve('exampleResolveAfterReject > Swallowed reject');\n });\n } catch {\n throw new Error('exampleResolveAfterReject > Failed');\n }\n}", "function IfAbruptRejectPromise(value, capability) {\n var rejectResult = capability['[[Reject]]'].call(undefined, value);\n return capability['[[Promise]]'];\n }", "onReject(error, message, channel) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.sendVisual(ConsolePrompt.getRejectVisual(error), channel);\n });\n }", "function primjer7() {\n Promise.resolve()\n .then(() => {\n // Makes .then() return a rejected promise\n throw 'Oh no!';\n })\n .catch(reason => {\n console.error('onRejected function called: ' + reason);\n })\n .then(() => {\n console.log(\"I am always called even if the prior then's promise rejects\");\n });\n}", "function primjer5() {\n Promise.resolve()\n .then(() => {\n // Makes .then() return a rejected promise\n throw 'Oh no!';\n })\n .then(() => {\n console.log('Not called.');\n }, reason => {\n console.error('onRejected function called: ' + reason);\n });\n}", "function swallow_rejected_promise(result_set, err) {\n console.log();\n console.warn('REJECTED PROMISE: ' + result_set + ' -- ' + err);\n console.warn(err.stack);\n console.log();\n return undefined;\n}", "throwError() {\n return new Promise((resolve, reject) =>{\n setTimeout(() => reject(new Error('Intentional Error')), 200)\n })\n }", "async function f() {\n await Promise.reject(new Error(\"Whoops!\"));\n}", "function reject() {\n //console.log(\"Reject\");\n process.nextTick(function () {\n cb(\"RoleResolver Error\", false);\n });\n\n }", "function forget(promise) {\r\n promise.catch(function (e) {\r\n // TODO: Use a better logging mechanism\r\n console.error(e);\r\n });\r\n}", "catch(callback) {\n return this.then(null, callback);\n }", "function primjer6() {\n Promise.reject()\n .then(() => 99, () => 42) // onRejected returns 42 which is wrapped in a resolving Promise\n .then(solution => console.log('Resolved with ' + solution)); // Resolved with 42\n}", "destroy() {\n this.destroyed_ = true;\n if (this.initializePromiseReject_ !== null) {\n const reject = this.initializePromiseReject_;\n this.initializePromiseReject_ = null;\n reject();\n }\n }", "function rejectAll(fault){self.deferred.reject(fault);}" ]
[ "0.7628036", "0.7586068", "0.75513655", "0.74893683", "0.74893683", "0.7287908", "0.7202638", "0.71881443", "0.71757406", "0.71336883", "0.709393", "0.70612514", "0.7008286", "0.6957874", "0.6947702", "0.6947702", "0.691996", "0.68453455", "0.6828517", "0.6828517", "0.6828517", "0.6828517", "0.6828517", "0.6828517", "0.6828517", "0.6828517", "0.6828517", "0.68134403", "0.67880005", "0.66984105", "0.6697101", "0.6634441", "0.6632374", "0.66106796", "0.66106796", "0.66100174", "0.6582831", "0.65613276", "0.655933", "0.6547793", "0.6493912", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64915603", "0.64693666", "0.64693666", "0.6464735", "0.6462735", "0.64259064", "0.6413039", "0.6412602", "0.638135", "0.6365397", "0.6338643", "0.62950724", "0.62791437", "0.6262875", "0.62595874", "0.62450767", "0.6234", "0.6222124", "0.6222124", "0.6205554", "0.62041605", "0.62037295", "0.6202557", "0.61838806", "0.6173741", "0.6143082", "0.6134072", "0.6127615", "0.6123666", "0.6119109", "0.6104772", "0.61041117", "0.61028236", "0.60792387", "0.60676557", "0.6062924", "0.6059309", "0.6059085", "0.6043136", "0.6042969", "0.6039569", "0.6026603", "0.6020697", "0.6008341", "0.5987881", "0.5976082", "0.59755754", "0.5954082", "0.59472805", "0.5931092", "0.5897865" ]
0.0
-1
Check user's authentication, if not logged in, redirect user to log in page
function authenticationMiddleware () { return function (req, res, next){ console.log('user:', req.session.passport.user); if (req.isAuthenticated()) { return next(); }else{ res.redirect('signin'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLoggedIn(request, response, next){\n // If they are authenticated, carry on\n if(request.isAuthenticated()){ return next();}\n // If they aren't, redirect them to the home page\n response.redirect('/');\n}", "function isLoggedIn(req, res, next){\n if (req.isAuthenticated())\n return next();\n res.redirect('/signin');\n }", "function checkAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) {\n\t\treturn res.redirect('/users/dashboard');\n\t}\n\n\tnext();\n}", "function authenticate(req, res, next) {\n //If no user is logged in, render the home page, else continue\n if (!req.session.user) {\n res.redirect('/index');\n } else {\n next();\n }\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n else res.redirect('/signin');\n }", "function checkIfLoggedIn(req, res, next) {\n if (!req.isAuthenticated()) {\n return next();\n }\n return res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n }", "function checkAuth() {\n if (CONFIG.userLogged) {\n $location.path('/home');\n }\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/#/');\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n }", "function isLoggedIn (req, res, next) {\n if (req.isAuthenticated()) return next()\n res.redirect('/')\n}", "function isLoggedIn(request, response, next) {\n // if user is authenticated in the session, carry on\n if (request.isAuthenticated())\n return next();\n // if they aren't redirect them to the starting page\n response.redirect('/');\n}", "function checkLoggedIn(to, from, next) {\n if (auth.clientId()) {\n const user = auth.user()\n\n // If no user object - redirect to Login\n if (!user || !user.userName) {\n next({ name: 'login', params: { redir: to.name } })\n return\n }\n }\n next()\n}", "function isLoggedIn(req, res, next) { //Pull this out into a function!!\n if (req.isAuthenticated()) return next();\n\n res.redirect('/');\n }", "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n res.redirect('/');\r\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) \n \n return next();\n\n res.redirect(\"/\");\n }", "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return res.redirect(\"/dashboard\");\n }\n next();\n}", "function isLoggedIn(request, response, next) {\n\n\t// if user is authenticated in the session, carry on\n\tif (request.isAuthenticated())\n\t\treturn next();\n\n\t// if they aren't redirect them to the home page\n\tresponse.redirect('/');\n}", "function isLoggedIn (req, res, next) {\n\t\tif (req.isAuthenticated()) {\n\t\t\treturn next();\n\t\t} else {\n\t\t\tres.redirect('/');\n\t\t}\n\t}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n //redirects to home page\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/signup');\n }", "function isUserAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n\n // Store the url before login page was shown\n req.session.returnTo = req.originalUrl;\n // Message when an action fails because user need to be logged-in\n req.flash(\"error\", \"Please login to proceed.\")\n // Redirect to login page if user is not authenticated\n res.redirect(\"/user/login\");\n}", "function isLoggedIn(req,res,next){\n if(req.isAuthenticated()) return next()\n res.redirect('/')\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/signin');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "function isLoggedIn(req,res,next){\n //si esta autenticado q continue con la ruta\n if(req.isAuthenticated()){\n return next()\n }\n //sino retorne al home\n return res.redirect('/')\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) \n return next();\n res.redirect(\"/auth/google\");\n}", "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated())\n\n return next();\n\n res.redirect('/signin');\n\n }", "function isLoggedIn(req, res, next) {\n if(req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n }", "function checkAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"/blogOpdemy\");\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function checkLoggedIn(context,redirect) {\n if (!Meteor.userId()) {\n redirect('/')\n }\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n \n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n // if they aren't redirect them to the home page\n res.redirect('/logins');\n }", "function isLoggedIn(req, res, next) {\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n // if they aren't redirect them to the home page\n res.redirect('/logins');\n }", "function isLoggedIn(req, res, next) {\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n // if they aren't redirect them to the home page\n res.redirect('/logins');\n }", "function isLoggedIn(req, res, next) {\n\t\tif(req.isAuthenticated()) {\n\t\t\treturn next();\n\t\t} else {\n\t\t\tres.redirect('/');\n\t\t}\n\t}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) \n return next();\n \n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n // if they aren't redirect them to the home page\n res.redirect('/');\n }", "function isLoggedIn(req, res, next){\n\t\tif (req.isAuthenticated()){\n\t\t\treturn next();\n\t\t}\n\t\tres.redirect('/profile');\n\t}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n\n res.redirect('/');\n }", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n \n res.redirect('/');\n}", "function loggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}", "function checkIfUserIsAuthenticated(request, response, next) {\n if(request.isAuthenticated()) {\n return next();\n } else {\n request.flash(\"danger\", \"Access denied. Please login.\");\n response.redirect(\"/user/login\");\n }\n}", "function isLoggedIn (req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next();\n\n\tres.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next();\n\tres.redirect('/');\n}", "function checkAuthenticated(req, res, next) {\n // Check if the User is authenticated\n if (req.isAuthenticated()) {\n return next();\n }\n\n // If return false\n res.redirect(\"/\");\n}", "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/signin');\n }\n }", "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated())\r\n return next();\r\n\r\n res.redirect('/');\r\n}", "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated())\r\n return next();\r\n\r\n res.redirect('/');\r\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next()\n\n\tres.redirect('/')\n}", "function isAuthenticated(req, res, next) {\n if (!req.session.user) {\n //Store this Url to redirect to it after successful login\n req.session.prevUrl = req.originalUrl;\n console.log('User not logged-in', req.session.user)\n res.render('login')\n } else {\n return next()\n }\n}", "function loggedIn(req, res, next) {\n console.log(\"checking for user\");\n if (typeof req._passport.session.user == 'undefined') {\n console.log(\"no user found. redirecting...\");\n //res.redirect('/auth/tumblr');\n res.send(false);\n } else if (req._passport.session.user.isGeneric) {\n console.log(\"Logging out generic user and sending to login.\");\n req.logout();\n res.send(false);\n }else {\n\t\tres.send(true);\n }\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated()) {\n\t\treturn next();\n\t}\n\tres.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next();\n\n\tres.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next();\n\n\tres.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next();\n\n\tres.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n\tif (req.isAuthenticated())\n\t\treturn next();\n\n\tres.redirect('/');\n}", "function isLoggedIn(req,res,next){\n\tif(req.isAuthenticated()){\n\t\treturn next();\n\t}\n\tres.redirect(\"/\");\n}", "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/auth/google');\n}", "function isloggedIn(req,res,next){\n if (req.isAuthenticated()) return next();\n res.redirect('/users/login');\n}", "function isLoggedIn(req, res, next) {\n\t\tif (req.isAuthenticated()) return next();\n\t\tres.redirect('/login');\n\t}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}", "function isLoggedIn(req, res, next) {\n \n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n \n // if they aren't redirect them to the home page\n res.redirect('/');\n }" ]
[ "0.77495754", "0.76212287", "0.7585787", "0.75567377", "0.7555366", "0.75428414", "0.7542166", "0.75343007", "0.7494682", "0.7486688", "0.74865127", "0.74801296", "0.74622875", "0.7457533", "0.7452231", "0.74436563", "0.7442914", "0.74289", "0.74208075", "0.74192244", "0.740762", "0.74054956", "0.7394884", "0.7392669", "0.73915905", "0.7387454", "0.7387454", "0.73824704", "0.7380932", "0.73763067", "0.73735154", "0.7372011", "0.7364838", "0.7364695", "0.7363749", "0.73606557", "0.7357705", "0.73540527", "0.73539907", "0.7352432", "0.735132", "0.735132", "0.735132", "0.7339819", "0.733907", "0.7336904", "0.7335712", "0.7335333", "0.7334778", "0.7332179", "0.7329754", "0.73266983", "0.7322343", "0.7322343", "0.7322343", "0.7322343", "0.73151535", "0.73133117", "0.7310204", "0.73088396", "0.73088396", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.73068905", "0.72967786", "0.72864646", "0.72861665", "0.72782075", "0.72744477", "0.72744477", "0.72744477", "0.72744477", "0.72729397", "0.7269738", "0.72673625", "0.72658634", "0.7265598", "0.72591305" ]
0.0
-1
New Game Listener when user clicks New Game button, newGameListener triggered newGameListener triggers handleGameRefresh event handler
function newGameListener() { clickNewGameButton.addEventListener('click', handleNewGameClick); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onNewGame(e) {\n\t\t// Remove event listener\n\t\te.remove();\n\n\t\t// Hide all the cards\n\t\tcards.forEach(card => {\n\t\t\tcard.hideMe();\n\t\t});\n\n\t\t// Remove the New game button\n\t\tuserInterface.hideNewGameBtn();\n\n\t\t//Add Restart Button\n\t\tuserInterface.showRestartBtn();\n\t}", "addNewGameListener(callback) {\n this.newGameListeners.push(callback);\n }", "function newGame(event)\n {\n state.newGame = 1;\n DOM.game.score.innerHTML = \"Счёт: 0\";\n DOM.game.pauseButton.disabled = true;\n DOM.pause.options.continue.disabled = true;\n setFieldCards();\n toGame();\n }", "function newGame(){\n\t\tgameCount = 0;\n\t\tclicked = false;\n\t\ttotalCorrect = 0;\n\t\tcorrectCount = 0;\n\t\tquestionCount = 0;\n\t\tprogressReset();\n\t\tresetOverlays();\n\t\thideOverlay($('.endGame'));\n\t\tshowOverlay($('.instructions'));\n\t\tupdateQuestion();\n\t}", "function addGameListeners() {\n if (!zzz.listeners(\"refresh\").length) {\n zzz.on(\"refresh\", (gameId, state) => {\n // console.log(state)\n io.to(gameId).emit(\"updateGame\", state);\n });\n }\n\n if (!zzz.listeners(\"time\").length) {\n /**\n * Game emits timer info.\n *\n * Parameters:\n * gameId: id of a game that is sending\n * timePassed: how many seconds have gone\n * limit: limit of seconds that triggers action\n *\n * Sends timer info to client as a time object with properties\n * passed and limit\n */\n\n zzz.on(\"time\", (gameId, timePassed, limit) => {\n // console.log(timePassed, limit)\n\n io.to(gameId).emit(\"time\", {\n passed: timePassed,\n limit\n });\n });\n }\n\n if (!zzz.listeners(\"gameFinished\").length) {\n zzz.on(\"gameFinished\", state => {\n try {\n if (state.winner) {\n let winner = clients.get(state.winner.id);\n let turakas = clients.get(state.turakas.id);\n\n winner.rank++;\n turakas.turakas++;\n\n if (state.pagunid.length) {\n winner.madePagunid.push({\n to: turakas.id,\n cards: state.pagunid\n });\n turakas.pagunid.push({\n from: winner.id,\n cards: state.pagunid\n });\n }\n\n clients.updateStore();\n }\n\n state.players.map(player => {\n let client = clients.get(player.id);\n if (state.id === client.game) {\n client.game = null;\n }\n io.to(client.id).emit(\"updateHero\", client);\n });\n\n io.to(state.id).emit(\"updateGame\", state);\n io.emit(\"updateGameList\", state);\n } catch (error) {\n console.log(error);\n socket.emit(\"serverError\", error.message);\n }\n });\n }\n\n if (!zzz.listeners(\"closeGame\").length) {\n /**\n * Listens for closeGame from game\n * Emits leftGame to all players, so they are returned to the client lobby\n * Emits gamelist update to all clients\n */\n\n zzz.on(\"closeGame\", state => {\n try {\n console.log(`Server: closing game ${state.id}`);\n\n state.players.map(player => {\n let client = clients.get(player.id);\n // if client has not started a new game, they might still be lingering\n // in the closing game. So lets throw them out.\n if (!client.game) {\n io.to(client.id).emit(\"leftGame\");\n }\n });\n\n io.emit(\"updateGameList\", state);\n } catch (error) {\n console.log(error);\n socket.emit(error.message);\n }\n });\n }\n\n return;\n }", "addLoadGameListener(callback) {\n this.loadGameListeners.push(callback);\n }", "addDemoGameListener(callback) {\n this.demoGameListeners.push(callback);\n }", "gameCompleted() {\n console.log(\"Game completed!\");\n //this.newGame()\n alert(\"Game completed! Please refresh the screen to play again.\");\n }", "onGameChanged ( e ) {\n // This sucks...we have to go get the campaign details again because the GameStore updates the campaign internally.\n // The game store should be re-written to stop trying to alter the campaign.\n // Instead, we have to grab the latest campaign details again here so that we can find the correct version for the next update that gets done later in the flow.\n CampaignStore.sendGetCampaignDetails(this.state.campaignHash, ( campaignDetailsResponse ) => {\n this.setState( {\n campaignVersion: campaignDetailsResponse.result.version,\n campaignDetails: campaignDetailsResponse.result.details\n }, () => {\n ThemeStore.initializeTheme( this.state.campaignHash, this.state.selectedTheme.theme, this.state.selectedTheme.template );\n } );\n } );\n }", "reload()\n {\n if (this.onNewGame != undefined)\n {\n this.onNewGame();\n }\n this.retrieveNearbyGames();\n }", "function whenRefresh() {\n gameInstance.updateGridSize(ctx) ;\n gameInstance.updateGridSize(ctx2) ;\n gameInstance.drawGameStep(ctx) ;\n\n if (!buttonStateInstance.start.isSwitch) {\n newGame() ;\n }\n}", "newGame() {\n this.initMap();\n this.addMapEnvironnement();\n this.addMapPattern();\n this.addMapItems(4);\n this.players.forEach((player) => {\n this.addPlayer(player[0], player[1])\n });\n this.placePlayers(); \n this.interface.displayPlayersStatus(this.players);\n this.initializePlayerControlEvents(); \n this.roundManager(); \n }", "function roundListeners(){\r\n\t//Add event listener to each round#\r\n\troundsInput.addEventListener(\"input\", function(){\t\t \r\n\t\trounds = Number(roundsInput.value);\t\t\t\t\t\t\t\t//store the total rounds\t\r\n\r\n\t\t//New Game\t\r\n\t\tnewGame();\t\t\t\t\r\n\t\trefreshView();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\treset();\r\n\t});\r\n}", "function newGame(){\n\t$.ajax({\n\t\turl: \"game-api.php\",\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t\taction: \"new-game\"\n\t\t},\n\t\tsuccess: refreshGameContainer\n\t});\n}", "function newGame() {\n // If congrats message have not been cleared\n clearTimeout(displayTimeout);\n hideGameCompleted();\n\n // Reset data to initial state\n initData();\n\n // Shuffle and reset cards to a new game\n initCardShuffle();\n }", "function startNewGame(evt) {\n 'use strict';\n document.getElementById(\"gameDiv\").innerHTML = \"\";\n var menuDiv = document.getElementById(\"menuControls\");\n \n /* Variables for current player & last play to reset */\n var lastPlayDisplay = document.getElementById(\"lastPlayMade\");\n var currentPlayerDisp = document.getElementById('currentPlayer');\n lastPlayDisplay.innerHTML = \"\";\n currentPlayerDisp.innerHTML = \"\";\n \n menuDiv.innerHTML = \"<button id=\\\"startGameBtn\\\" type=\\\"button\\\">Start Game</button>\";\n document.getElementById(\"gameStatus\").style.display = \"none\";\n \n var newGameEntry = document.getElementById(\"userEntry\");\n newGameEntry.innerHTML = \"Player One Designation: <input id=\\\"plyrOneName\\\" type=\\\"text\\\" name=\\\"playerOneName\\\" value=\\\"Player One\\\"/><br/>\";\n newGameEntry.innerHTML += \"Player Two Designation: <input id=\\\"plyrTwoName\\\" type=\\\"text\\\" name=\\\"playerTwoName\\\" value=\\\"Player Two\\\"/><br/>\";\n \n var plyrOneName = document.getElementById(\"plyrOneName\");\n var plyrTwoName = document.getElementById(\"plyrTwoName\");\n addHandler(plyrOneName, 'input', playerNameChange);\n addHandler(plyrTwoName, 'input', playerNameChange);\n \n var startGameBtn = document.getElementById(\"startGameBtn\");\n addHandler(startGameBtn, 'click', generateGameGrid);\n}", "function registerPlayerGameEvents(){\r\n\t\t\r\n\t\tev.sub(\"game.start\",function(){\r\n\t\t\t\r\n\t\t\thud.drawGameStatistics(score,level,lifes);\r\n\t\t});\r\n\t\t\r\n\t\tev.sub(\"game.levelObjectsCreated\",function(){\r\n\r\n\t\t\t//reset paddle, ball and camera when new scene is created\r\n\t\t\tgame.resetPaddle();\r\n\t\t\t//game.resetBall();\r\n\t\t\tsound.playLevelMusic(level);\r\n\t\t\tgame.tweenCamera(Tween.easeInOutQuad,{yTarget:-7,zTarget:6});\r\n\t\t});\r\n\t\t\r\n\t\tev.sub(\"game.wallCollition\",function(){\r\n\t\t\tsound.playSound(\"music/hit2.ogg\");\r\n\t\t});\r\n\t\t\r\n\t\tev.sub(\"game.ball.created\",function(ball){\r\n\t\t\r\n\t\t\tif (game.getBallCount() == 2){\r\n\t\t\t\tgame.tweenCamera(Tween.easeInOutQuad,{yTarget:-7,zTarget:8});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tev.sub(\"game.ball.dies\",function(ball){\r\n\t\t\t\r\n\t\t\tif (game.getBallCount() == 1 && !lifes){\r\n\t\t\t\t\r\n\t\t\t\treturn gameState.startGameover();\r\n\t\t\t}\r\n\t\t\telse if (game.getBallCount() == 1){\r\n\t\t\t\r\n\t\t\t\tlifes--;\r\n\t\t\t\tbonusMultiplier =1\r\n\t\t\t\thud.drawGameStatistics(score,level,lifes);\r\n\t\t\t\tgame.resetBall(function(){\r\n\t\t\t\t\tgame.togglePause(function(){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tgame.togglePause();\r\n\t\t\t\t\t\t},1000)\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tgame.addPreRenderCb(function(){\r\n\t\t\t\t\tgame.destroyBall(ball);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (game.getBallCount() == 1){\r\n\t\t\t\t\t\tgame.tweenCamera(Tween.easeInOutQuad,{yTarget:-7,zTarget:6});\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//when ball hit brick\r\n\t\tev.sub(\"game.brickHit\",function(e){\r\n\t\t\r\n\t\t\tvar bscore = 100 * bonusMultiplier;\r\n\t\t\tscore += bscore;\r\n\t\t\thud.drawGameStatistics(score,level,lifes);\r\n\t\t\tbonusMultiplier+=1;\r\n\t\t\t\r\n\t\t\tif (e.brick.userData.type.type == 'extraBalls'){\r\n\t\t\t\tsound.playSound(\"music/bonus1.ogg\");\r\n\t\t\t\tgame.addPreRenderCb(function(){\r\n\t\t\t\t\tgame.createBonusBall(3,3);\r\n\t\t\t\t\tgame.createBonusBall(-3,3);\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\telse if (e.brick.userData.type.type==\"bigBall\"){\r\n\t\t\t\t\r\n\t\t\t\tif (e.ball.userData.isBigBall != true){\r\n\t\t\t\t\r\n\t\t\t\t\tsound.playSound(\"music/blow.ogg\");\r\n\t\t\t\t\te.ball.userData.isBigBall = true;\r\n\t\t\t\t\tanimateBallResize(e.ball,0.2,0.2,function(){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tanimateBallResize(e.ball,0.4,-0.2,function(){\r\n\t\t\t\t\t\t\t\te.ball.userData.isBigBall = false; \r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},5000);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (e.brick.userData.type.type==\"superspeed\"){\r\n\t\r\n\t\t\t\tsound.playSound(\"music/alarm.ogg\");\r\n\t\t\t\tvar lv = e.ball.GetLinearVelocity();\r\n\t\t\t\t\r\n\t\t\t\tvar xv = lv.x * 2\r\n\t\t\t\tvar yv = lv.y * 2\r\n\t\t\t\t\r\n\t\t\t\tif (xv < 0){\r\n\t\t\t\t\txv= Math.max(xv,-15)\r\n\t\t\t\t}else{\r\n\t\t\t\t\txv=Math.min(xv,15)\r\n\t\t\t\t}\r\n\t\t\t\tif (yv < 0){\r\n\t\t\t\t\tyv=Math.max(yv,-15)\r\n\t\t\t\t}else{\r\n\t\t\t\t\tyv=Math.min(yv,15)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\te.ball.SetLinearVelocity(new b2Vec2(xv,yv))\t\r\n\t\t\t}\r\n\t\t\telse if (e.brick.userData.type.type == 'ghost'){\r\n\t\t\t\tsound.playSound(\"music/bonus3.ogg\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tsound.playSound(\"music/hit.ogg\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//show some fancy things when the ball hits the brick. if there is no hitcount left, we remove the brick\t\r\n\t\t\tif (!brick.userData.hitCount){\r\n\t\t\t\tonBrickHit({\r\n\t\t\t\t\t'brick' : e.brick,\r\n\t\t\t\t\t'score' : bscore,\r\n\t\t\t\t\t'enableBrickFadeOut' : true\r\n\t\t\t\t}, function(brick) {\r\n\t\t\t\t\tgame.destroyBrick(brick);\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tonBrickHit({\r\n\t\t\t\t\t'brick' : e.brick,\r\n\t\t\t\t\t'score' : bscore,\r\n\t\t\t\t\t'enableBrickFadeOut' : false\r\n\t\t\t\t}, function(brick) {\r\n\t\t\t\t\t\r\n\t\t\t\t})\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//if no bricks are left we reset the game and starts the next level\t\t\r\n\t\t\tif (!e.bricksLeft){\r\n\t\t\t\t\r\n\t\t\t\tlevel++;\r\n\t\t\t\t\r\n\t\t\t\t//when no more levels show credits\r\n\t\t\t\tif (!levels.getLevel(level)){\r\n\t\t\t\t\tsound.stopLevelMusic(level-1);\r\n\t\t\t\t\treturn gameState.startCredits();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tgame.setLevel(level);\r\n\t\t\t\t\r\n\t\t\t\tgame.togglePause(function(){\r\n\t\t\t\t\t\r\n\t\t\t\t\tgame.setCameraLookAtMesh(null);\r\n\t\t\t\t\tgame.cameraFollowsPaddle(false);\r\n\t\t\t\t\t\r\n\t\t\t\t\tzoomToBrick(e.brick,function(){\r\n\r\n\t\t\t\t\t\t//fade(0,1,function(){})\r\n\t\t\t\t\t\tgame.togglePause(function(){\t\t\t\t\r\n\t\t\t\t\t\t\tgame.reset(function(){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//fade(1,-1,function(){})\r\n\t\t\t\t\t\t\t\tgame.resetPaddle();\r\n\t\t\t\t\t\t\t\tgame.resetBall();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tgame.setCameraLookAtMesh(game.getPaddle().mesh);\r\n\t\t\t\t\t\t\t\tgame.cameraFollowsPaddle(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tanimateBricksFadeIn(function(){\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\thud.drawGameStatistics(score,level,lifes);\r\n\t\t\t\t\t\t\t\t\tgame.togglePause();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},true);\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t},function(){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfade(0,1,function(){\r\n\t\r\n\t\t\t\t\t\t\tfade(1,-1,function(){})\r\n\t\t\t\t\t\t})\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\t\r\n\t\t//event is fired just before a brick ball collition is occuring\r\n\t\tev.sub(\"game.brickPreHit\",function(e){\r\n\t\r\n\t\t\t//create ghost ball for 3 seconds\r\n\t\t\tif (e.brick.userData.type.type == 'ghost'){\r\n\t\t\t\t\r\n\t\t\t\te.contact.SetEnabled(false);\r\n\t\t\t\te.ball.userData.isGhost = true;\r\n\t\t\t\te.ball.userData.guiref.material.opacity = 0.5;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t(function(contact){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\te.ball.userData.guiref.material.opacity = 1;\r\n\t\t\t\t\t\te.contact.SetEnabled(true);\r\n\t\t\t\t\t\te.ball.userData.isGhost = false;\r\n\t\t\t\t\t},5000)\r\n\t\t\t\t})(e.contact)\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (e.ball.userData.isGhost){\r\n\t\t\t\te.contact.SetEnabled(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//when ball hits paddle we reset the bonus multiplyer\r\n\t\tev.sub(\"game.paddleHit\",function(){\r\n\t\t\t\r\n\t\t\tbonusMultiplier = 1;\r\n\t\t});\t\r\n\t}", "addSaveGameListener(callback) {\n this.saveGameListeners.push(callback);\n }", "function newGame() {\n gameEnd = true; //Indicate game has ended.\n if (winnerAnnounced) { // If winner has been announced.\n //If a player has won that means the player had the current turn in the previous game. Reset the player's name\n //from 'Winner!' to the default name because new game has been declared.\n playerName[playerTurn].textContent = 'Player ' + (playerTurn + 1);\n }\n resetGame(); //Reset the game.\n}", "function initializeListeners(){\n $('.createGame').on('click', launchGameCreation);\n $('.search').on('input', function(){\n showSearchResults($(this).val());\n });\n\n}", "function onGameOver(e) {\n\t\t// Change the game state to over\n\t\tcurrentState = gameState.over;\n\n\t\t// Show new game button and add event listener\n\t\tuserInterface.showNewGameBtn();\n\t\tuserInterface._btnNewGame.on('newGameClicked', onNewGame);\n\n\t\t//Hide Restart Button\n\t\tuserInterface.hideRestartBtn();\n\t}", "function newGame(e) {\n e.preventDefault()\n const newTiles = createTileData()\n setTiles(newTiles)\n setAlive(true)\n console.log(newTiles)\n }", "function newGame() {\n // Reset score\n score = 0;\n \n // Set the gamestate to ready\n gamestate = gamestates.ready;\n \n // Reset game over\n //gameover = false;\n $(\"#player1\").block();\n hod = 2;\n \n // Create the level\n createLevel();\n \n // Find initial clusters and moves\n findMoves();\n findClusters(); \n playerchange(hod);\n \n }", "function newGame () {\n\tlevel = 0;\n\tscore = 0;\n\tlives = gameLives;\n\tship = newShip();\n\t\n\tdocument.removeEventListener(\"keydown\", newGame);\n\t\n\t//High score from local storage\n\tlet scoreStr = localStorage.getItem(saveScore);\n\tif (scoreStr === null) {\n\t\thighScore = 0;\n\t} else {\n\t\thighScore = parseInt(scoreStr);\n\t}\n\t\n\tnewLevel();\n}", "function onStartGame(e) {\n\t\t// Reset Points and guesses and other variables\n\t\tcorrectMatches = 0;\n\t\ttotalPoints = 0;\n\t\tfirstGuess = true;\n\t\tconsecutiveGuesses = 0;\n\t\tuserInterface.score = totalPoints;\n\t\tfirstCard = null;\n\t\tsecondCard = null;\n\n\t\t// Play New Game Sound\n\t\tcreatejs.Sound.play('gameStartSound');\n\n\t\t// If the game isn't resetting\n\t\tif (currentState != gameState.resetting) {\n\t\t\t// If the game state is ready then add the cards to the stage\n\t\t\tif (currentState == gameState.ready) {\n\t\t\t\t//Show cards\n\t\t\t\tcards.forEach(card => {\n\t\t\t\t\tcard.addMe();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Remove the New game button\n\t\t\tuserInterface.hideNewGameBtn();\n\n\t\t\t//Add Restart Button\n\t\t\tuserInterface.showRestartBtn();\n\n\t\t\t// Remove click event on New Game Button\n\t\t\te.remove();\n\t\t}\n\n\t\t// Enable all the cards\n\t\tonEnableCards();\n\n\t\t// Add the event listener to restart button\n\t\tuserInterface._btnRestart.on('restartClicked', onResetGame);\n\n\t\t// Change current game state\n\t\tcurrentState = gameState.running;\n\t}", "function addGameListener(color){\n gamesock = createGameSocket(color)\n setTimeout(keepAlive(),10000)\n\n gamesock.addEventListener('message', function (event) {\n var msg = JSON.parse(event.data)\n if(msg['flags'] != \"keepAlive\"){\n var fen = msg['fen']\n delete msg['fen']\n game.move(msg)\n board.position(fen,true)\n updateStatus()\n }\n else {\n console.log('keep alive')\n }\n });\n\n gamesock.onclose = function(event) {\n cancelKeepAlive();\n }\n}", "function registerEventListeners(){\n //Preventing default behaviour of arrow keys which will make the page scroll up and down\n window.addEventListener(\"keydown\", (e) => { if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) e.preventDefault() });\n \n //Database envent listeners\n //Getting the player count and player information from the database\n database.ref('playerCount').on('value', (data) => {\n playerCount = data.val();\n if(data.val() == 4){\n setTimeout(()=>{\n game.updateGameState(1);\n game.startGame();\n },2500);\n };\n }, showError);\n database.ref('players').on('value', (data) => playerData = data.val(), showError);\n \n //getting the gamestate from the database\n database.ref('gameState').on('value', (data) => {\n game.gamestate = data.val();\n }, showError);\n}", "createGamePressed(self, event) {\n console.log(\"App.createGamePressed\");\n let board = self.boardGenerator.generateBoard(this.getValue(\"howBig\"), this.getValue(\"howLong\"), this.getValue(\"minimumScore\"));\n self.sheet.addNewBoard(board);\n self.showReadyToPlay();\n }", "newGame() {\n canClick = false;\n model.reset();\n model.makeRandomPairs(numberOfPairs);\n view.newGame(model.getRandomCards(), startTime);\n view.printScore(model.getScore());\n\n setTimeout(() => {\n canClick = true;\n }, startTime + (animationTime * 1.5));\n }", "function initGame(){\n\t// show pickers and new game button\n\tnewGameBtn.classList.remove('hide')\n\tselectX.classList.remove('hide')\n\tselectO.classList.remove('hide')\n\n\t// enable pickers and new game button\n\tnewGameBtn.removeAttribute('disabled')\n\tselectXhuman.removeAttribute('disabled')\n\tselectXcomputer.removeAttribute('disabled')\n\tselectOhuman.removeAttribute('disabled')\n\tselectOcomputer.removeAttribute('disabled')\n\n\t// add event lister for new game button\n\tnewGameBtn.addEventListener('click', newGame, {once : true})\n}", "function newGame(gameMode) {\n seriesPlayed = 1;\n gameIsStarted = true;\n gameHasEnded = false;\n isReady = false;\n $('#instructionsContent').text(\"Clique quand la couleur change\");\n $('#actionButton').text(\"START\");\n\n console.log(\"New Game starting.\")\n\n}", "newGame() {\n $('#new-game-button').on('click', () => {\n round.roundNumber=1;\n score=5;\n $('h3').show();\n $('.modal').hide();\n $('.game-container').css('display', 'block');\n $('.mushroom-container').css('display', 'block');\n setUpRound();\n $('#new-game-button').off();\n });\n }", "_startNewGame(){\n if(this._gameon){\n return;\n }\n this._gameon=true;\n this.interval = setInterval(this.playGame.bind(this),100);\n }", "function game_listener(event)\n\t{\n\t\t// optional host checking\n\t\t/*if ( event.origin !== \"http://localhost\" )\n\t\t{\n\t\t\tconsole.log(proxy_ghAPIname + \": origin not whitelisted, message discarded.\");\n\t\t\treturn\n\t\t}*/\n\n\t\ttry\n\t\t{\n\t\t\tvar message = JSON.parse(event.data);\n\t\t\tif (message.hasOwnProperty(\"eventName\")===true)\n\t\t\t{\n\t\t\t\t// only listen to SERVER messages\n\t\t\t\tif (message.eventName.indexOf(\"SERVER_\") === 0) {\n\t\t\t\t\tconsole.log(ghAPIname + \": received event: '\" + event.data + \"' from origin: '\"+event.origin+\"'\");\n\t\t\t\t}\n\t\t\t\telse return;\n\n\t\t\t\tif (message.eventName == \"SERVER_CONNECT\")\n\t\t\t\t{\n\t\t\t\t\tconsole.log(ghAPIname + \": connection with proxy established.\");\n\t\t\t\t\tAPIconnected=true;\n\t\t\t\t\tclearInterval(APIconnectionTimeout);\n\n\t\t\t\t\tif (message.hasOwnProperty(\"vars\")===true)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var key in message.vars)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log(ghAPIname + \": received: \" + key + \"= \" + message.vars[key]);\n\t\t\t\t\t\t\t_instance[key] = message.vars[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tonConnect();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tfireGamehouseGameEvent(message.eventName);\n\t\t\t}\n\t\t}\n\t\tcatch (e)\n\t\t{\n\t\t\tconsole.log(ghAPIname + \": received message did not meet expectations. Error: \" + e);\n\t\t}\n\t}", "async onCreateGame(proceed, game) {\n this.speak(\"ON CREATE GAME\");\n this.createGameScreen.hide();\n if (proceed) {\n let result = await this.dbman.addGame(game);\n }\n this.show();\n }", "function newGame(){\n //On remet les scores à 0\n score = 0;\n globalScore = [0,0,0];\n player = 1;\n playing = true;\n \n $('#global-score-1').text('0');\n $('#global-score-2').text('0');\n $('#round-score-1').text('0');\n $('#round-score-2').text('0');\n \n $('#player1-title').text('PLAYER 1');\n $('#player2-title').text('PLAYER 2');\n \n $('#player2').removeClass('active');\n $('#player1').removeClass('active').addClass('active');\n \n $('#roll-dice').show();\n $('#hold').show();\n }", "function newGame() {\n userScore = 0;\n gameStart();\n }", "function newGame() {\n if (DEBUG) console.log('inside newGame(), calling clearGame() to clean things up...');\n clearGame();\n if (DEBUG) console.log('about to wait a bit before starting the next game...');\n delayOperation = window.setTimeout(function(){ initGame(); }, millisecondOperationDelay);\n }", "function newGame() {\n\t// Das Spielfeld leeren\n\tctx.clearRect(0,0, canvasWidth, canvasHeight);\n\t\n\t// Wenn der Timer widererwarten noch laufen sollte, dann muss er angehalten werden\n\tif(time.Enable){\n\t\ttime.Stop();\n\t}\n\t\n\t// Timer zurücksetzen\n\tseconds = 0;\n\t$('span#timer').html(seconds);\n\t\n\talive = true;\n\t// Baue das Spielfeld\n\tarrayBuild();\n\t// Zeichne die Anzahl der Minen\n\t$('span#mines').html(exsistingMines);\n\t\n\t// Den Schwierigkeitsgrad des Statistikdiv setzen\n\t$('#difficulty4statistics').val($('#difficulty').val());\n\t\n\trepaint();\n}", "function newGame() {\n // Reset score\n score = 0;\n \n // Set the gamestate to ready\n gamestate = gamestates.ready;\n \n // Reset game over\n gameover = false;\n \n // Create the level\n createLevel();\n \n // Find initial clusters and moves\n findMoves();\n findClusters(); \n }", "initBindingsAndEventListeners() {\n this.instructions = document.querySelector(\"#instructions\")\n this.howToButton = document.querySelector(\"#how-to-play\")\n this.howToButton.addEventListener('click', (e) => {\n if (this.instructions.style.display == \"none\") {\n this.instructions.style.display = \"block\"\n } else {\n this.instructions.style.display = \"none\"\n }\n\n });\n\n this.score = document.querySelector(\"#score\")\n this.form = document.querySelector(\"#form\")\n this.nameInput = document.querySelector(\"#name\")\n this.submitButton = document.querySelector(\"#submit\")\n this.submitButton.addEventListener('click', (e) => {\n this.createGame(e);\n });\n\n\n this.leaderboardLink = document.querySelector(\"#show-leaderboard\")\n this.leaderboardContainer = document.querySelector(\"#leaderboard-container\")\n this.leaderboardLink.addEventListener('click', (e) => {\n if (this.leaderboardContainer.style.display == \"none\") {\n this.leaderboardContainer.style.display = \"block\"\n } else {\n this.leaderboardContainer.style.display = \"none\"\n }\n });\n this.leaderboard = document.querySelector(\"#leaderboard\")\n\n this.counterContainer = document.querySelector(\"#counter\")\n\n this.foodButton = document.querySelector(\"#food\")\n this.foeButton = document.querySelector(\"#foe\")\n this.peices = document.querySelector(\"#peices\")\n\n this.startGame = document.querySelector(\"#start\")\n this.startGame.addEventListener('click', (e) => {\n console.log(\"THE GAME HAS BEGUN\")\n // Show game peice and enable game buttons, disable start button while game is in session\n this.peices.style.display = \"flex\"\n document.getElementById(\"food\").disabled = false;\n document.getElementById(\"foe\").disabled = false;\n document.getElementById(\"start\").disabled = true;\n document.getElementById(\"submit\").disabled = true;\n\n // Start the timer\n this.startTimer()\n\n // When the timer runs out, render the form to save your game\n setTimeout(this.renderForm, (30000));\n\n // Disable game buttons when the timer runs out\n setTimeout(this.endTimer, (30000));\n });\n }", "function newGame(){\n\n\tio.socket.post('/game',{userId: $('#user-id').val()},function(game){\n\n\t\t//This creates a new html structure inside which the game will be played. Create game div is defined in game.js.\n\t\tcreateGameDiv({id: game.id});\n\n\t\t//Join the room\n\t\tio.socket.post('/game/'+ game.id + '/users', {id: $('#user-id').val()});\n\t});\n}", "function newGame() {\n // Reset score\n score = 0;\n \n // Set the gamestate to ready\n gamestate = gamestates.ready;\n \n // Reset game over\n gameover = false;\n \n // Create the level\n createLevel();\n \n // Find initial clusters and moves\n findMoves();\n findClusters();\n clearNew();\n }", "function initializeEventListeners() {\n // Delegated listener for cell clicks\n $('.board').on('click', '.cell', function() {\n state.updateStoreGrid($(this));\n Render.renderUpdatedGrid();\n });\n // Listener for new game button\n $('#new-game').on('click', function() {\n state.startNewGame();\n });\n}", "create() {\n game.handleOpponentLeaving = this.handleOpponentLeaving\n \n game.loadOpponent = this.loadOpponent\n game.disconnectSocket = this.disconnectSocket\n game.checkForDoubleClick = this.checkForDoubleClick\n game.animateOpponentLeaving = this.animateOpponentLeaving\n game.startMultiplayer = this.startMultiplayer\n game.updatePlacedPieces= this.updatePlacedPieces\n\n game.gametype = app.gameType;\n game.userkey = app.keyValue;\n game.nameOfUser = app.username;\n game.username = app.username;\n game.battleText = app.battleText;\n game.cash = parseInt(app.money);\n game.url = app.img_url;\n console.log(\"in load: \", game.gametype);\n game.opponentLeft = false;\n game.state.start('menu');\n }", "function newGame() {\n rebuildDeck(shapes);\n resetOpenCards();\n resetMoves();\n resetMatchCount();\n timer.reset();\n}", "function newGame(e) {\n\n // Delete All cards\n deck.innerHTML=\"\";\n\n // Reset any related variable\n\n // reset open cards\n openCards = [];\n // reset pairs\n matchedCards=[];\n // reset moves\n resetMoves();\n // reset star rating\n resetStarRating();\n //reset timer\n resetTimer();\n\n //play\n startGame();\n\n //clickOnCard();\n deck.addEventListener('click',clickOnCard);\n}", "function onEvent(event){\n\n switch(event.type){\n\n case 'CONNECTED':\n log('Server connected!');\n prepareNewGame();\n break;\n\n case 'REGISTERED':\n log('Ready to play!');\n gameInfo = event.payload;\n renderer = MapRenderer(gameInfo.getGameSettings().getWidth(), gameInfo.getGameSettings().getHeight());\n client.startGame();\n break;\n\n case 'GAME_MAP_UPDATED':\n log('Game map updated - gameTick:' + event.payload.getGameTick());\n var snakeBrainDump = handleGameUpdate(event.payload);\n renderer.record(event.payload, snakeBrainDump);\n break;\n\n case 'GAME_SNAKE_DEAD':\n log('A snake died!');\n renderer.record(event.payload);\n break;\n\n case 'GAME_ENDED':\n log('Game ended!');\n renderer.record(event.payload);\n renderer.render(function(){process.exit()}, {followPid : gameInfo.getPlayerId()});\n //renderer.render(function(){process.exit()}, {animate: true, delay: 500, followPid : gameInfo.getPlayerId()});\n break;\n\n default:\n case 'ERROR':\n logError('Error - ' + event.payload);\n break;\n }\n}", "function onInit() {\n const game = new Game();\n game.start();\n\n document.querySelector(`#restart`).addEventListener(\"click\", (event) => {\n game.start();\n });\n \n document.querySelector(`#play-again`).addEventListener(\"click\", (event) => {\n game.onPlayAgain();\n });\n}", "startGamePressed(self, event) {\n console.log(\"App.startGamePressed\");\n self.state = AppState.PLAYING;\n self.gameManager = new GameManager(self.sheet.currentBoard(), self);\n document.getElementById(\"board\").classList.remove(\"unplayable\"); // kell?\n document.getElementById(\"readyToPlay\").style.display = \"none\";\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"results\").style.display = \"none\";\n document.getElementById(\"game\").style.display = \"block\";\n document.getElementById(\"standing\").style.display = \"block\";\n document.getElementById(\"timeLeftPar\").style.display = \"block\";\n document.getElementById(\"timeIsUp\").style.display = \"none\";\n document.getElementById(\"stopButton\").style.display = \"block\";\n }", "static createNewGame(event) {\n\n const configObject = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n name: event.target[0].value,\n game_players_attributes: {\n \"0\": {player_id: currentPlayer.id}\n }\n })\n }\n \n // Create a new Game on the back-end\n fetch(`${apiUrl}/games`, configObject)\n .then(res => res.json())\n .then(gameObject => {\n\n console.log(gameObject)\n\n // Close the existing websocket connection to the games_channel\n socket.close();\n\n // Create a new Game object on the front-end based on the game info\n currentGame = new Game(gameObject.id, gameObject.name, gameObject.status, gameObject.phase);\n\n Game.joinNewGame(gameObject)\n }) \n \n }", "function onNewPlayer (data) {\n \n}", "handleNewGame() {\n this.redTurnOrder.forEach((player) => {super.updatePlayerScore(player, \"\")});\n this.blueTurnOrder.forEach((player) => {super.updatePlayerScore(player, \"\")});\n this.teams = {};\n this.redTurnOrder = [];\n this.blueTurnOrder = [];\n this.redHints = [];\n this.blueHints = [];\n this.redNum = 0;\n this.blueNum = 0;\n this.currentRound = 0;\n this.redSel = [\"0\", \"0\", \"0\", \"0\", \"0\", \"0\"];\n this.blueSel = [\"0\", \"0\", \"0\", \"0\", \"0\", \"0\"];\n this.redWords = this.generateWords();\n this.blueWords = this.generateWords();\n this.redCode = [\"?\", \"?\", \"?\"];\n this.blueCode = [\"?\", \"?\", \"?\"];\n this.redGuessHistory = [];\n this.blueGuessHistory = [];\n this.redHistory = [];\n this.blueHistory = [];\n this.redScore = [0, 0];\n this.blueScore = [0, 0];\n this.gameState = 0;\n super.sendGameData({ event: \"reset-game\" });\n }", "function newGame() {\n if (player.name) {\n player.score = computer.score = 0;\n gameState = 'started';\n setGameElements();\n\n playerNameElem.innerHTML = player.name;\n setGamePoints(); \n }\n}", "function handleOnClick(game) {\n const buttonAddPlayer = document.querySelector('.btn-add-player');\n buttonAddPlayer.addEventListener('click', () => game.addPlayer());\n\n const buttonPlay = document.querySelector('.btn-play');\n buttonPlay.addEventListener('click', () => game.play());\n\n const buttonRoll = document.querySelector('.btn-roll');\n buttonRoll.addEventListener('click', () => game.roll());\n}", "function StartNewGame() {\n\tsnowStorm.stop();\n\tsnowStorm.freeze();\n\n\tvar params = {\n\t\tchosen: \"riley\"\n\t};\n\n\t_gameObj = new Game();\n\t_gameObj.SetupCanvas(params);\n\t$j(window).resize(function () {\n\t\t_gameObj.SetupCanvas(params);\n\t});\n\n\t$j.mobile.changePage($j('#game'));\n}", "function initializeGame() {\n $('#restart-game-icon').click(startGame);\n $('#play-game-icon').click(startGame);\n $.dialog({\n title: 'Hey there!',\n content: 'Click on start button to play the game.',\n escapeKey: true,\n backgroundDismiss: true\n });\n timer.addEventListener('secondsUpdated', function (e) {\n $('#timer').html(timer.getTimeValues().toString());\n });\n}", "function chessEvent(snapshot) {\n if (!snapshot.val()) return; // information not ready yet\n gData=jQuery.extend(true, {}, snapshot.val()); // copy of gameData from database\n gInfo=gameInfo[gameID];\n \n if (gameID != gInfo.gid) {\n debug(0,\"Incorrect Game ID:\"+gInfo.gid+\"/\"+gameID);\n return;\n }\n debug(1,\"chessEvent GID=\"+gameID+\" status=\"+gInfo.status);\n debug(2,gData);\n $(\"#chessBoard .playerPics\").empty(); // pictures of Players\n for (var p in gInfo.playerList) {\n var element= $(\"<div><img src='\"+gInfo.playerList[p].photoURL+\"'></div>\");\n element.css('background',roleColors[gInfo.playerList[p].role]);\n element.css('border',\"medium \"+((gInfo.currentPlayer==p)?\"solid\":\"none\")+\" red\");\n element.prop('title', gInfo.playerList[p].displayName);\n $(\"#chessBoard .playerPics\").append(element);\n }\n if (ignoreNextUpdate==2) {\n if (mode == \"animation\") {\n ignoreNextUpdate=1; // mark that response was received\n return;\n }\n else { // Late arrival of response - re-do animation\n ignoreNextUpdate=0;\n debug(1,\"Finally got response. Stop the spinner\");\n spinnerActive=false;\n }\n }\n mychessIndex=0;\n var i=1;\n for (var p in gInfo.playerList) {\n if (gInfo.playerList[p].uid==currentUID) mychessIndex|=i;\n i=i*2;\n }\n debug(2,\"mychessIndex=\"+mychessIndex);\n if (mychessIndex && gInfo.status!=\"quit\")\n $(\"#chessBoard .gameButtonEnd\").attr(\"disabled\",false);\n else\n $(\"#chessBoard .gameButtonEnd\").attr(\"disabled\",true);\n $(\"#chessBoard .gameTurn\").css(\"color\",\"black\");\n $(\"#chessBoard .gameTurn\").html(\"\");\n if (gInfo.status==\"active\") {\n if (checkPlayer()) $(\"#chessBoard .gameTurn\").css(\"color\",\"red\");\n $(\"#chessBoard .gameTurn\").html(gInfo.playerList[gInfo.currentPlayer].role+\" player's turn\");\n }\n $(\"#sjButtons\").hide();\n $(\"#gameButtonJoin\").hide();\n $(\"#gameButtonStart\").hide();\n switch(gInfo.status) {\n case \"pending\":\n var color= (gInfo.playerList[0].role != \"White\") ? \"White\" : \"Black\";\n reverse=(color==\"Black\");\n $(\"#gameButtonJoin\").val(color);\n $(\"#gameButtonJoin\").html(\"Join as \"+color);\n $(\"#gameButtonJoin\").show();\n $(\"#sjButtons\").show();\n mode=\"passive\";\n printBoard();\n break;\n case \"active\":\n// reverse=(mychessIndex==2);\n reverse=(gInfo.playerList[1].uid==currentUID && gInfo.playerList[0].uid!=currentUID); // reverse the board if I'm playing Black only\n printBoard();\n animationInit(gData.movedPiece,gData.newPiece);\n break;\n/* \n case \"quit\":\n swal({\n title: gInfo.overMsg,\n text: \" \",\n buttons: false,\n icon: \"../pics/swal-quit.jpg\",\n timer: 2000,\n });\n\n newGID= 0;\n gameMsg=\"chess\";\n $(\"#chessBoard\").hide();\n*/ \n }\n debug(2,\"mode=\"+mode);\n}", "handleGameOverEvent() {\n \n }", "onGameOver(){\n this.gameOverTriggered = true;\n this.playAgainButton = new GameOverButton(this.game, 300, 300, -300, 0, \"play again\", this.restartGame);\n this.returnToMenuButton = new GameOverButton(this.game, 300, 400, 300, 0, \"return to menu\", this.backToMenu);\n\n this.movingUI.push(this.playAgainButton);\n this.movingUI.push(this.returnToMenuButton);\n this.playAgainButton.button.visible = true;\n\n var numSimilar = 0;\n this.game.gameData.dailyConstellations.forEach((item, i) => {\n if(this.constellationsFoundThisGame.has(item)){\n numSimilar++;\n }\n });\n this.game.gameData.constellationsFoundLastGame = this.constellationsFoundThisGame;\n if(numSimilar == this.game.gameData.dailyConstellations.length){\n console.log(\"found all daily in single game\");\n this.game.gameData.solvedAllDaily = true;\n localStorage.setItem(\"wizardSolvedAllWeekly\", true);\n }\n }", "function loadEventListeners() {\n // Check! Button\n checkButton.addEventListener('click', checkBtn);\n // Again button \n againButton.addEventListener('click', againBtn);\n //Score Tracker\n\n}", "connectedCallback () {\n this._setupNewGame(this._rows, this._cols)\n this._setupMemoryListeners()\n\n this._containerHeader.addEventListener('click', this._dropDownClick.bind(this))\n this._mainContainer.addEventListener('click', this._mainContainerClick.bind(this))\n this._mainContainer.addEventListener('windowRemoved', e => {\n this._userNameWindowOpen = false\n })\n }", "function addGame(game){\n\n\t// Finding HTML element which will contain the game buttons.\n\tvar div = $('#games');\n\n\tvar button = createGameButton(game.id);\n\tdiv.append(button);\n\n\t//Binding event handler on the button to trigger attemptJoinGame , which will send request to the creater of the game.\n\tbutton.click({gameId: button.val(),userId: $('#user-id').val()},attemptJoinGame);\n}", "function newGame() {\n //hide game over screen\n $(\"#finish\").remove();\n //show board\n $(\"#board\").show();\n\n //reset variables, classes and attributes\n playerOne = [];\n playerTwo = [];\n moveCounter = 0;\n $('.box').css('background-image', 'none'); //clear background images\n \t\t$('#player1').addClass('active'); //set player one to active\n $(\"li.box\").removeAttr(\"clicked\").removeClass(\"box-filled-1 box-filled-2 filled\");\n $(\"li.box\").removeClass(\"box-filled-1 box-filled-2 filled\");\n\n //invoke previous game choice\n //board(playerOneName, playerTwoName);\n }", "function newGame(){\r\n\tclearGame();\r\n}", "function cam_eventGameLoaded()\n{\n\tisReceivingAllEvents = true;\n\t__camSaveLoading = true;\n\tconst SCAV_KEVLAR_MISSIONS = [\n\t\t\"CAM_1CA\", \"SUB_1_4AS\", \"SUB_1_4A\", \"SUB_1_5S\", \"SUB_1_5\",\n\t\t\"CAM_1A-C\", \"SUB_1_7S\", \"SUB_1_7\", \"SUB_1_DS\", \"CAM_1END\", \"SUB_2_5S\"\n\t];\n\n\t//Need to set the scavenger kevlar vests when loading a save from later Alpha\n\t//missions or else it reverts to the original texture.\n\tfor (var i = 0, l = SCAV_KEVLAR_MISSIONS.length; i < l; ++i)\n\t{\n\t\tif (__camNextLevel === SCAV_KEVLAR_MISSIONS[i])\n\t\t{\n\t\t\tif (tilesetType === \"ARIZONA\")\n\t\t\t{\n\t\t\t\treplaceTexture(\"page-7-barbarians-arizona.png\",\n\t\t\t\t\t\t\t\"page-7-barbarians-kevlar.png\");\n\t\t\t}\n\t\t\telse if (tilesetType === \"URBAN\")\n\t\t\t{\n\t\t\t\treplaceTexture(\"page-7-barbarians-arizona.png\",\n\t\t\t\t\t\t\t\"page-7-barbarians-urban.png\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t//Subscribe to eventGroupSeen again.\n\tcamSetEnemyBases();\n\t__camSaveLoading = false;\n}", "function gameCreate() {\n // get the level from url\n setLevel();\n GameNumber.updateNumLevels(document);\n GameNumber.setNextLevel(document);\n\n // set the game tutorial text\n GameHelp.setHelpText(GameNumber.currGame, document);\n\n // initialize tile selector\n tileDisplay = new TileDisplay(document);\n\n // Initialize board object\n board = new Board(PIXI, app, tileDisplay);\n\n // Initialize selector object\n selector = new Selector(graphics, app);\n\n // create the rulesets\n ruleSet = GameNumber.getRuleset();\n generateRulesetDisplay(ruleSet.accepting_rule, true);\n generateRulesetDisplay(ruleSet.rules, false);\n\n // init game ticker\n app.ticker.add(delta => gameLoop(delta));\n \n}", "function newGame() {\n //Reseta a score\n score = 0;\n scoreText = 0;\n //Inicia\n if (!firsTime) {\n gameState = gameStates.ready;\n }\n //Reseta o game over\n gameOver = false;\n pause = false;\n //Tempo\n time = 10;\n //Cria o level\n createLevel();\n }", "newGame() {\n location.reload();\n }", "function handleAddGame(e) {\n e.preventDefault();\n const game = {\n homeTeam: homeTeam,\n awayTeam: awayTeam,\n date: date,\n time: time,\n isCanceled: false\n };\n\n addGame(game);\n\n // Clear date and time inputs after the Add button is clicked and set the state back to an empty string\n document.getElementById('date-input').value = '';\n document.getElementById('time-input').value = '';\n setDate('');\n setTime('');\n }", "function newGame() {\n location.reload();\n}", "startFreeGameEvent () {\n this.getInst('ControlDesktopViewHandler')._freeGameStartFlag = true;\n this.getInst('ControlDesktopViewHandler').startFreeGameBlock();\n }", "function startNewGame(){\n\t\tclearTimeout(intervalVar);\n\t\tcurWin.set({\n\t\t\tcurrentWin: -1\n\t\t});\n\n\t\tplayerOneRef.update({\n\t\t\tchoice: \"undefined\"\n\t\t});\n\n\t\tplayerTwoRef.update({\n\t\t\tchoice: \"undefined\"\n\t\t});\t\t\n\n\t\tturnRef.set({\n\t\t\tturn: 1\n\t\t});\n\t}", "function bindEvents() {\n // difficulty select\n document.querySelector('.play-btn').addEventListener('click', function () {\n event.preventDefault();\n var difficulty = $('.difficulty-select').val();\n new GameBoard(difficulty);\n new HealthBar(difficulty);\n $('.home-container, .game-wrapper').toggleClass('is-hidden');\n });\n\n // gameplay\n $gameContainer.on('click', '.tile-container', function () {\n if (!$(this).children('.front').hasClass('paired')) {\n player.currentGuess = {\n guess: $(this).children('.front').attr('src'),\n id: $(this).attr('data-id')\n };\n player.guesses.push(player.currentGuess);\n player.turns++;\n\n // console.log('prev: '+player.guesses[player.turns - 2].id);\n if (player.turns >= 2 && player.currentGuess.id !== player.guesses[player.turns - 2].id) {\n $(this).children('.back').addClass('is-hidden');\n $(this).children('.front').removeClass('is-hidden');\n checkGuess();\n } else {\n $(this).children('.back').addClass('is-hidden');\n $(this).children('.front').removeClass('is-hidden');\n }\n }\n\n // game reset\n document.querySelector('.restart-btn').addEventListener('click', function () {\n location.reload();\n });\n });\n }", "function hostCreateNewGame() {\n // Create a unique Socket.IO Room\n var thisGameId = ( Math.random() * 100000 ) | 0;\n var gameObj = {playerCount: 0, gameId: thisGameId, readyCount: 0, hintGiver: 0};\n games.push(gameObj);\n // Return the Room ID (gameId) and the socket ID (mySocketId) to the browser client\n this.emit('newGameCreated', {gameId: thisGameId, mySocketId: this.id});\n //console.log(this.id.toString());\n //console.log(thisGameId.toString());\n // Join the Room and wait for the players\n this.join(thisGameId.toString());\n}", "function addGameListeners(){\n //Show squares a piece can move to\n $('span[data-piece]').on('click',function(){\n var color, type, location, target;\n $('[data-piece-selected]').removeAttr('data-piece-selected');\n\n color = $(this).attr('data-piece').charAt(0);\n type = $(this).attr('data-piece').charAt(1);\n location = $(this).parent('[data-square-id]').attr('data-square-id');\n\n $(this).attr('data-piece-selected','');\n \n showValidMoves([color, type, location]);\n //Try move\n $('[data-square-id]').off('click');//remove all listener and reapply valid move listeners;\n $('[data-valid]').on('click', function(){\n target = $(this).attr('data-square-id');\n movePiece(color, type, location, target);\n $('[data-valid]').off('click').removeAttr('data-valid');\n });\n });\n}", "constructor(gamePage, winningPlayer=null){\n super();\n this.gamePage = gamePage;\n this.winningPlayer = winningPlayer;\n this.addEvents({\n 'click .rematch-btn' : 'rematch',\n 'click .new-game-btn' : 'newGame',\n 'click .hide-window-btn' : 'hideWindow'\n });\n FixEverything.navbar.render();\n }", "NewGame() {\n //Clear message and hands.\n this.message = \"\";\n this.pHand = new Hand();\n this.dHand = new Hand();\n\n //Show and hide buttons.\n this.ShowDeal = true;\n this.ShowHit = false;\n this.ShowStand = false;\n this.ShowNewGame = false;\n }", "function onServerStartGame(data)\n{\n\tif (state != ClientStates.WaitPage)\n\t{\n\t\tconsole.log(\"serverStartGame message received at unexpected time. Ignored.\");\n\t\treturn;\n\t}\n\t$(\"#homePage\").hide(1000);\n\t$(\"#waitPage\").hide(1000);\n\t$(\"#gamePage\").show(1000, function(){\n\t\tcontroller = new GameController(data);\n\t});\n}", "function CreateNewGame(){\n if(typeof(newGame) == \"object\"){\n gameInstances.push(newGame);\n }\n newGame = new Hangman.game();\n// Run the logic in newGame to alter from the defaults to what should be the start.\n\tnewGame.gameWordLogic();\n newGame.gameWordUniqueLogic();\n gameStartInterfaceHelpers.makeHiddenWordField();\n console.log(\"made it after the helper.\"+newGame);\n\n var missProg = document.getElementById(\"misses\");\n\n}", "newGame () {\n this.setState({\n mode: \"play\"\n });\n\n this.newRound();\n }", "function initGameOfLifeDev()\n{\n window.onbeforeunload = function(event) {\n console.log(\"game no longer in focus\");\n pauseGameOfLifeDev();\n enableScroll();\n $('#overlay-modal').modal('close');\n modalType = null;\n };\n\n // INIT ALL THE CONSTANTS, i.e. ALL THE\n // THINGS THAT WILL NEVER CHANGE\n initConstantsDev();\n\n // INIT THE RENDERING SURFACE\n initCanvasDev();\n\n // INIT ALL THE GAME-RELATED VARIABLES\n initGameOfLifeDataDev();\n\n // INIT THE LOOKUP TABLES FOR THE SIMULATION\n initCellLookupDev();\n\n // SETUP THE EVENT HANDLERS\n initEventHandlersDev();\n\n // CLEAR THE CANVAS AND INTIALIZE THE GRIDS\n // also adds grid lines to the canvasDev\n resetGameOfLifeDev();\n\n // RENDER THE GRID\n initGridDev();\n\n // INIT IMAGES AND SUBSEQUENTLY THE SHIP\n initShipPatternsDev();\n\n // BRING UP START SCREEN\n //if(startOverlay === true){\n //document.getElementById(\"middle-card-play\").style.backgroundImage = null;\n pauseGameOfLifeDev();\n //} else {\n //document.getElementById(\"middle-card-play\").style.backgroundImage = null;\n //startGameOfLifeDev();\n //}\n showGameStartDev()\n\n console.log(cellLengthDev);\n}", "function newGame() {\n playerTurn = Math.random() < 0.5;\n gameOver = false;\n gameTied = false;\n\n createGrid();\n}", "function newGame() {\n /* This uses a callback function as all of the other processes are dependant on the configuration information. */\n GAME.loadConfig(function() {\n GAME.loadSVGFiles(); // This will also begin to draw the starting room when complete. //\n GAME.createMaze();\n GAME.prepareCanvas(); // Draws a blank canvas in preparation for rooms. //\n PLAYER.setRandomRoom(); // Assign the player to a random room. //\n });\n}", "whenUpdate(eventClass) {\n this.listenersEvents[0] = eventClass\n window.addEventListener(\"load\", () => this.listenersEvents[0], false)\n }", "function newGame(){\n reset ();\n correct = 0;\n incorrect =0;\n unanswered = 0;\n time = 10;\n intervalId;\n clockRunning = false;\n clicked = false;\n\n}", "function startNewGame() {\n game = new Game(); //create a new Game object\n game.startGame(); //Start game by calling startGame() method in the Game class\n keysPressed.length = 0; //reset keysPressed array\n}", "function newGame() {\n\n // when new game starts it clears both arrays(computer and player)\n clearGame();\n}", "function initGame() {\r\n clearInterval(gTimerInterval)\r\n gTimeCounter = 0;\r\n renderLevelButton()\r\n resetHints();\r\n resetSafeClick();\r\n var elLive = document.querySelector('.lives')\r\n elLive.innerText = LIVE + LIVE + LIVE\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n shownCount: 0,\r\n markedCount: 0,\r\n mines: [],\r\n gLives: 0,\r\n gHint: false,\r\n isCanClick: true,\r\n minesExposed: 0\r\n\r\n }\r\n renderIcon(NORMAL_FACE);\r\n renderScoreStart()\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n document.querySelector('.records').style.display = 'none';\r\n var elTimer = document.querySelector(\".timer\");\r\n elTimer.innerText = 0;\r\n}", "function newGame() {\r\n resetGame();\r\n for (var i = 0; i < 2; i++) {\r\n playerCards();\r\n }\r\n dealerCards();\r\n dealerarea.appendChild(backCard());\r\n checkBlackJack();\r\n }", "function newGame() {\n generateTileArray();\n refreshCanvas();\n\n}", "function returnToGameHandler() {\n\n var btn = document.getElementById(\"return-to-game-btn\");\n btn.addEventListener(\"click\", function() {\n\n analysisMode.disable();\n\n // reset board and group table to latest state\n board.state = analysisMode.mainBoard.state;\n groupTable.table = analysisMode.mainGroupTable.table;\n groupTable.total = analysisMode.mainGroupTable.total;\n groupTable.groupId = analysisMode.mainGroupTable.groupId;\n\n view.refreshWholeBoard(board);\n \n });\n\n}", "startGame(params) {\n this.toRemoveBorderColor = new Set();\n this.keyHandler.start();\n this.popup.remove();\n this.params = params;\n const score = document.getElementsByClassName('online-game__score')[0];\n score.style.display = 'flex';\n this.setOpponent(this.params.opponent);\n this.drawField();\n\n const row = document.getElementsByClassName('js-row')[0];\n\n row.addEventListener('click', evt => {\n evt.preventDefault();\n evt.stopPropagation();\n if (this.popupEl) {\n this.popup.renderTo(this.popupEl);\n this.popup.render({type: 'exit'});\n }\n });\n\n this.keyHandler.addKeyListener('startDrag', (evt) => this.onStartEvent(evt));\n window.addEventListener('resize', debounce(() => this.onResize(), 200));\n }", "function refresh_game() {\n var form = get_form_data('#play_game_form');\n get_game_overview(form.game_id);\n}", "function initEventListeners() {\n document.querySelectorAll(\".game-spot\").forEach(gameSpot => {\n gameSpot.addEventListener(\"click\", event => {\n if (gameSpot.innerHTML == \"\") {\n gameSpot.innerHTML = currentPlay.name;\n board[gameSpot.getAttribute(\"data-index\")] = currentPlay;\n checkWinner(board, currentPlay);\n changePlayer();\n if (gameMode == \"hvc\") {\n computerMove();\n checkWinner(board, currentPlay);\n changePlayer();\n }\n }\n });\n });\n }", "function final(event) {\n if (event.target.classList.contains('rematch')) {\n deck = new Deck\n player.unshift(player[1])\n player.unshift(player[0])\n gameStart = Math.round(Date.now()/1000)\n game()\n }\n if (event.target.classList.contains('new')) {\n gameStart = Math.round(Date.now()/1000)\n deck = new Deck\n document.querySelector('.game-start').innerHTML =\n `<section class=\"text-center game-start-info\">\n <input type=\"text\" name=\"player1\" value=\"\" maxlength=\"32\" placeholder=\"PLAYER 1\"> <input type=\"text\" name=\"player2\" value=\"\" maxlength=\"32\" placeholder=\"PLAYER 2\">\n <div class=\"inputs\">\n <span class=\"names\">PLAYER 1</span><span class=\"names\">PLAYER 2</span>\n </div>\n <span class=\"error-1 hide\">Both Players Must Enter A Name</span>\n <button type=\"button\" name=\"button\" class=\"play-game\" disabled=\"true\">PLAY GAME</button>\n </section>`\n }\n }", "function initGameHooks() {\n gameScoreField.value = gameScore;\n gameRankField.value = gameRank;\n rotateLetters(outerLetterButtons);\n changeBtnLtr(document.querySelector('.centerLetter'), centerLetter);\n displayAnswerList(answerList);\n // The main game header uses the player name entered at the start\n // of the game. It uses \"DEBUG MODE\" instead of a date if the\n // game was started in debug mode.\n let header1 = `${playerName[0].toUpperCase()}${playerName.slice(1)}'s ${\n document.getElementById('gameHeader').innerText\n }`;\n let header2 = `${debugMode ? 'DEBUG MODE' : `${gameWeekday}, ${gameDate}`}`;\n document.getElementById('gameHeader').innerText = header1;\n document.getElementById('gameDateHdr').innerText = header2;\n gameStartModal.style.visibility = 'hidden';\n}", "handleGameStartEvent(data) {\n console.log('in handleGameStartEvent handler ');\n this.setGameStartAndPlayerMove();\n }", "function newGame() {\n location.reload();\n}", "function newGame() {\n location.reload();\n}" ]
[ "0.76282966", "0.7032363", "0.668305", "0.66767275", "0.6576853", "0.6499657", "0.64264834", "0.6414469", "0.63900584", "0.6384485", "0.6358583", "0.633364", "0.6323034", "0.63127697", "0.63001305", "0.6291104", "0.6271721", "0.6270458", "0.6207338", "0.619879", "0.61495656", "0.61291987", "0.61150557", "0.60938144", "0.60822433", "0.6081424", "0.605554", "0.60446924", "0.6035473", "0.6035223", "0.6032903", "0.60214996", "0.6013902", "0.6009713", "0.59972453", "0.5993221", "0.59902596", "0.59882724", "0.5984593", "0.5984432", "0.5975808", "0.59744334", "0.59519523", "0.59351134", "0.59340143", "0.59307724", "0.59300923", "0.5918919", "0.5918654", "0.59106755", "0.5904711", "0.58956593", "0.5875153", "0.5863055", "0.5843644", "0.58275306", "0.5814245", "0.5809408", "0.5793495", "0.57929844", "0.57917947", "0.5780304", "0.57765454", "0.577455", "0.57709366", "0.57679754", "0.5766338", "0.57368654", "0.57315296", "0.5725414", "0.57205516", "0.5701147", "0.5694513", "0.56909627", "0.56824267", "0.567928", "0.56754154", "0.5666334", "0.56659", "0.5661614", "0.5657761", "0.5651264", "0.5644093", "0.56360275", "0.56358093", "0.5632864", "0.5631806", "0.56276584", "0.56267387", "0.5624821", "0.5617355", "0.5612532", "0.56106496", "0.5604899", "0.55961317", "0.5595585", "0.55919755", "0.5589983", "0.55833757", "0.55833757" ]
0.79992265
0
sending counter to local storage
function scoreToLocalStorage(counter) { localStorage.setItem('score', JSON.stringify(counter)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCount(){\n\tlocalStorage.setItem(\"count\", getCount()+1);\n}", "function add_count() {\n var count = parseInt(localStorage[\"count\"]);\n count++;\n localStorage[\"count\"] = count;\n}", "function setCounter(status) {\n let counter = document.getElementById(`${status}-counter`);\n counter.innerText = (parseInt(counter.innerText) + 1).toString();\n myStorage.setItem(status,(parseInt(myStorage.getItem(status)) + 1).toString());\n }", "function Save(){\n localStorage.setItem(\"monsterrawrs\",monstercount)\n}", "function plusOne() {\r\n\tlocalStorage.setItem(\"count\", (Number(localStorage.getItem(\"count\")) + 1));\r\n\tupdate();\r\n}", "function update() {\n\tdocument.getElementById(\"count\").innerHTML = localStorage.getItem(\"count\");\n}", "function update() {\n\tdocument.getElementById(\"count\").innerHTML = localStorage.getItem(\"count\");\n}", "function incrementClickCounter() {\n if (typeof(Storage)!== \"undefined\") {\n if (localStorage.clickcount) {\n localStorage.clickcount = Number(localStorage.clickcount)+1;\n } else {\n localStorage.clickcount = 1;\n }\n }\n}", "function updateVisit() {\n if (typeof (Storage) != \"undefined\") {\n if(localStorage.count !== undefined) {\n localStorage.count = parseInt(localStorage.count) + 1;\n document.getElementById(\"count\").innerHTML = localStorage.count;\n } else {\n localStorage.count = 1;\n document.getElementById(\"count\").innerHTML = 1;\n }\n } else {\n document.write(\"Sem suporte para Web Storage\");\n } \n}", "function plusOne() {\n\tlocalStorage.setItem(\"count\",Number(localStorage.getItem(\"count\"))+1);\n\tupdate();\n}", "function plusOne() {\n\tlocalStorage.setItem(\"count\", (Number(localStorage.getItem(\"count\")) + 1));\n\tupdate();\n}", "function newGameNumber(){\r\n\tvar gameid = localStorage.getItem(\"gameID\");\r\n\tgameid++;\r\n\tlocalStorage.setItem(\"gameID\", gameid);\r\n}", "function valueCounter() {\r\n let storage = db.transaction(\"data\", \"readwrite\").objectStore(\"data\");\r\n storage.get(\"save-data\").addEventListener(\"success\", function(e) {\r\n cookieValue += cookiesPerSecond;\r\n this.result.cookieValue = cookieValue;\r\n storage.put(this.result, \"save-data\");\r\n })\r\n }", "function increment() {\n\n //set local storage to storageTime\n localStorage.setItem('time', JSON.stringify(storageTime));\n\n //increment time by 1\n storageTime.second++;\n\n //show updated time on seconds id\n $('#seconds').text(storageTime.second);\n if (storageTime.second >= 60) {\n storageTime.minute++;\n $('#minutes').text(storageTime.minute);\n storageTime.second = 0;\n }\n if (storageTime.minute >= 60) {\n storageTime.hour = storageTime.hour % 360 + 1;\n $('#hours').text(storageTime.hour);\n storageTime.minute = 0;\n }\n if (storageTime.hour >= 60) {\n storageTime.day = storageTime.day % 360 + 1;\n $('#day').text(storageTime.day);\n storageTime.hour = 0;\n }\n if (storageTime.day >= 360) {\n storageTime.year = storageTime.year % 360 + 1;\n $('#year').text(storageTime.year);\n storageTime.day = 0;\n }\n }", "function khoitao()\n{\n\t//kiem tra kho\n\tvar c=window.localStorage.getItem(\"count\");\n\tif(c==null)\n\t{\n\t\twindow.localStorage.setItem(\"count\",0);\n\t}\n}", "function counterCheck(){\n let total = 0;\n for (let i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) != \"Varukorgen\"){ // Kollar alla keys förutom Varukorgen\n total += parseInt(localStorage.getItem(localStorage.key(i))); // Lägger till rätt antal\n }\n }\n document.getElementById('counter').innerHTML = total; \n }", "function keyCounter() {\r\n if(localStorage.getItem('entryCount') == null || localStorage.getItem('entryCount') == 0) {\r\n // Reset counter\r\n console.log(\"No LocalStorage data found, resetting counter...\");\r\n localStorage.setItem('entryCount', 0);\r\n }\r\n else {\r\n // Loop through localstorage and write saved data to page\r\n console.log(\"LocalStorage data found, attempting to load...\");\r\n\r\n for(i=1;i<=localStorage.getItem('entryCount');i++) {\r\n if(localStorage.getItem(`${i}date`) == null) {\r\n // Skip if current entry no longer exists\r\n continue;\r\n } else if( !(i + 1 == localStorage.getItem('entryCount')) ) {\r\n // Update page\r\n pageUpdate(i + 1, false);\r\n } else if(i + 1 == localStorage.getItem('entryCount')) {\r\n // Update page, is most recent item\r\n pageUpdate(i + 1, true);\r\n }\r\n }\r\n }\r\n }", "constructor() {\n this.storage = {};\n this.counter = 0;\n }", "function AddClassic() {\n classic_cnt++;\n total++;\n localStorage.setItem(\"classic\", classic_cnt);\n localStorage.setItem(\"total\", total);\n\n // DEBUG Log\n// console.log(\"Classic Count INCREASED\");\n// console.log(\"total Count INCREASED\");\n\n document.getElementById(\"cart\").innerHTML = \"<a class='counter'><i class='fa fa-shopping-cart fa-9x pr-10'></i>\" + localStorage.total + \"</a>\";\n}", "function setCounter() {\n var now = new Date().getTime();\n var elapsed = (now - myStorageTime);\n var remain = status.expiry - elapsed;\n if (remain < 0) remain = 0;\n\n if (remain > 0) {\n $('#logouttime').html(_millisecondsToStr(remain));\n } else {\n if (!connectionFailure) {\n dialogOff();\n }\n $('#logouttime').html(\"\");\n }\n\n\n }", "function scoreStore(){\n localStorage.setItem($url, $currentScreen);\n }", "constructor() {\n this.storage = {};\n this.counter = 0;\n }", "function showCount(){\n var count = JSON.parse(localStorage.getItem(\"storedTasks\")).length;\n if(count == 0){\n document.getElementById(\"countNum\").innerHTML = \"0\";\n }\n document.getElementById(\"countNum\").innerHTML = count.toString();\n}", "function salvarecent(ID){\n var vid=[recommender_size];\n var dim=caricarecent(vid);\n var exist=false;\n for (var i = 0; i <dim; i++) {\n if(ID==vid[i])\n exist=true;\n }\n\n if(!exist){\n var key=localStorage.getItem(\"counter\"); //counter=valore della prossima chiave libera \n if (!key) //se non esiste già\n key=0; \n localStorage.setItem(key, ID);\n key++;\n key=key%recommender_size;\n localStorage.setItem(\"counter\", key);\n }\n }", "function storeTalkCount() {\n startingTalkCount = $(\"#recent-talks-container\").attr(\"data-count\");\n talkCountInt = parseInt(startingTalkCount);\n console.log(talkCountInt);\n}", "function lifeset(){\n\t\tlifes = localStorage.getItem(\"lifes\");\n\t\tif (lifes){\n\t\t\tdocument.getElementById(\"lifecounter\").innerHTML = lifes;\n\t\t}\n\t\telse {\n\t\t\tlocalStorage.setItem(\"lifes\", \"20\");\n\t\t\tdocument.getElementById(\"lifecounter\").innerHTML = lifes;\n\t\t}\n\t}", "function countUpdate() {\n var curpage = document.getElementById(\"container\");\n var storedList = JSON.parse(localStorage.getItem(\"myCart\"));\n\n var curNum = storedList.length;\n var count = document.createElement(\"div\");\n count.id = \"count\";\n count.innerHTML = curNum;\n\n curpage.appendChild(count);\n}", "function updateVisit() {\n let div = document.getElementById(\"count\");\n if (localStorage === null || typeof (Storage) === 'undefined') {\n document.write(\"Sem suporte para Web Storage\");\n }\n localStorage.count === undefined ? visitCount(div, true) : visitCount(div, false);\n }", "function setCount(){\n\tif (localStorage.getItem(\"count\") == null){\n\t\tlocalStorage.setItem(\"count\",0);\n\t}\n\n\tlet count = localStorage.getItem(\"count\");\n\n\tif (count < 1){\n\t\t$(\".shopping-cart > .count\").hide();\n\t}\n\telse {\n\t\t$(\".shopping-cart > .count\").text(count).show();\n\n\t}\n}", "function setCount(){\n\tif (localStorage.getItem(\"count\") == null){\n\t\tlocalStorage.setItem(\"count\",0);\n\t}\n\n\tlet count = localStorage.getItem(\"count\");\n\n\tif (count < 1){\n\t\t$(\".shopping-cart > .count\").hide();\n\t}\n\telse {\n\t\t$(\".shopping-cart > .count\").text(count).show();\n\n\t}\n}", "function cartCount(){\n let productNumbers = localStorage.getItem('cartNumbers');\n productNumbers = parseInt(productNumbers);\n if(productNumbers){\n localStorage.setItem(cartNumber, productNumbers + 1);\n }\n}", "function set_pointsToAdd(num){\n localStorage[\"pointsToAdd\"] = num;\n}", "function onLoadCounter(){\n var counter = document.getElementById('counter');\n if(!counter){\n return;\n }\n setCounter(counter);\n}", "async incrementCount() {\n try {\n const currentCount = await this.getCount();\n await AsyncStorage.setItem(eventCountKey, (currentCount + 1).toString());\n\n return currentCount + 1;\n } catch (ex) {\n console.log('Could not increment count. Error:', ex);\n }\n }", "static setsIndexTotalPlusOne() {\n let total = this.getIndexTotal();\n total += 1;\n localStorage.setItem('index', JSON.stringify(total));\n }", "function save() {\n let timeEntered = timeStamp()\n let countStr = count + ' - '\n saveEl.innerHTML += `<p>${countStr} ${timeEntered}</p>`\n total()\n}", "function Load(){\n monstercount=localStorage.getItem(\"monsterrawrs\");\n monstercount=parseInt(monstercount);\n document.getElementById('text').value=monstercount; \n}", "function AddStandout() {\n standout_cnt++;\n total++;\n localStorage.setItem(\"standout\", standout_cnt);\n localStorage.setItem(\"total\", total);\n\n // DEBUG Log\n// console.log(\"Standout Count INCREASED\");\n// console.log(\"total Count INCREASED\");\n\n document.getElementById(\"cart\").innerHTML = \"<a class='counter'><i class='fa fa-shopping-cart fa-9x pr-10'></i>\" + localStorage.total + \"</a>\";\n}", "function cartNumbers() {\n let productNumbers = localStorage.getItem('cartNumbers');\n productNumbers = parseInt(productNumbers);\n\n if (productNumbers) {\n localStorage.setItem('cartNumbers', productNumbers + 1);\n document.querySelector('.cart-count').textContent = productNumbers + 1;\n } else {\n localStorage.setItem('cartNumbers', 1);\n document.querySelector('.cart-count').textContent = 1;\n }\n}", "@action\n addCounter() {\n this.counters.push({\n id: String(Math.random() * 1000000),\n state: new CounterState(this.startingCount),\n });\n }", "function incrementCounter() {\n setCounter(counter + 1);\n }", "function startCountdown() {\n\t// check if taskCount is null, then start taskCount from 1\n\tif (taskCount != null) {\n\t\t// 이미 진행중인 task 가 있는 경우\n\t\t// check if there is previousTaskCount, then replace it to current askCount\n\t\tif (localStorage.getItem(\"previousTaskCount\") != null) {\n\t\t\t// 이어하기를 한 경우\n\t\t\t// current TaskCount is Previous Task Count + 1, and clear\n\t\t\ttaskCount = parseInt(localStorage.getItem(\"previousTaskCount\")) + 1;\n\t\t\tphaseCount = 1;\n\t\t\tlocalStorage.removeItem(\"previousTaskCount\");\n\n\t\t\tlocalStorage.setItem(\"taskCount\", taskCount);\n\t\t\tvar x = \"task\" + taskCount;\n\t\t\tvar y = x + \"p\" + phaseCount;\n\t\t\tvar taskValue = getFocusTask();\n\t\t\tvar a = {\n\t\t\t\tphaseCount: phaseCount\n\t\t\t}\n\t\t\tvar b = {\n\t\t\t\ttaskCount: taskCount,\n\t\t\t\ttimerCount: 0,\n\t\t\t\tfocusCount: 0,\n\t\t\t\tbreakCount: 0,\n\t\t\t\tphaseCount: 1,\n\t\t\t\ttaskValue: taskValue\n\t\t\t}\n\t\t\tlocalStorage.setObj(x, a);\n\t\t\tlocalStorage.setObj(y, b);\n\n\t\t}\n\t\telse {\n\t\t\t// 이어하지 않고 계속 task를 추가하는 경우\n\t\t\ttaskCount++;\n\t\t\tlocalStorage.setItem(\"taskCount\", taskCount);\n\t\t\tvar x = \"task\" + taskCount;\n\t\t\tvar y = x + \"p\" + phaseCount;\n\t\t\tvar taskValue = getFocusTask();\n\t\t\tvar a = {\n\t\t\t\tphaseCount: 1\n\t\t\t}\n\t\t\tvar b = {\n\t\t\t\ttaskCount: taskCount,\n\t\t\t\ttimerCount: 0,\n\t\t\t\tfocusCount: 0,\n\t\t\t\tbreakCount: 0,\n\t\t\t\tphaseCount: 1,\n\t\t\t\ttaskValue: taskValue\n\t\t\t}\n\t\t\tlocalStorage.setObj(x, a);\n\t\t\tlocalStorage.setObj(y, b);\n\t\t}\n\t}\n\telse {\n\t\t// 처음으로 task를 추가하는 경우\n\t\ttaskCount = 1;\n\t\tlocalStorage.setItem(\"taskCount\", \"1\");\n\t\tvar taskValue = getFocusTask();\n\t\tvar a = {\n\t\t\tphaseCount: 1\n\t\t}\n\t\tvar b = {\n\t\t\ttaskCount: 1,\n\t\t\ttimerCount: 0,\n\t\t\tfocusCount: 0,\n\t\t\tbreakCount: 0,\n\t\t\tphaseCount: 1,\n\t\t\ttaskValue: taskValue\n\t\t}\n\t\tlocalStorage.setObj(\"task1\", a);\n\t\tlocalStorage.setObj(\"task1p1\", b);\n\t};\n\n\t// start pomodoro\n\tfocus25min();\n\n\t// every second, call the \"tick\" function\n\t// have to make it into a variable so that you can stop the interval later!!!\n\tintervalHandle = setInterval(tick, 500);\n\n\t// show focusTask, button area\n\tdocument.getElementById(\"focusArea\").style.display = \"\";\n\n\t// hide input area\n\tdocument.getElementById(\"inputArea\").style.display = \"none\";\n\n\t// set Task History Area opacity to 0\n\t// show Task History\n\t// document.getElementById(\"focusHistory\").style.opacity = \"\";\n\n\t// set countArea message\n\tNowFocus();\n\n\t// hide all continueCountdown throughout li\n\tvar i;\n\tvar x = document.getElementById(\"historyUl\").querySelectorAll(\".icon_btn\");\n\tfor (i = 0; i < x.length; i++) {\n\t\tx[i].style.display = \"none\";\n\t}\n}", "function AddPremium() {\n premium_cnt++;\n total++;\n localStorage.setItem(\"premium\", premium_cnt);\n localStorage.setItem(\"total\", total);\n\n // DEBUG Log\n// console.log(\"Premium Count INCREASED\");\n// console.log(\"total Count INCREASED\");\n\n document.getElementById(\"cart\").innerHTML = \"<a class='counter'><i class='fa fa-shopping-cart fa-9x pr-10'></i>\" + localStorage.total + \"</a>\";\n}", "function hitCount(){\r\n\tif (localStorage.pagecount){\r\n\t\tlocalStorage.pagecount=Number(localStorage.pagecount) +1;\r\n\t}\r\n\telse{\r\n\t\tlocalStorage.pagecount=0;\r\n\t}\r\n\tdocument.getElementById(\"hits\").innerHTML=localStorage.pagecount;\r\n}//end hitCount", "function hitCount(){\r\n\tif (localStorage.pagecount){\r\n\t\tlocalStorage.pagecount=Number(localStorage.pagecount) +1;\r\n\t}\r\n\telse{\r\n\t\tlocalStorage.pagecount=1;\r\n\t}\r\n\tdocument.getElementById(\"hits\").innerHTML=localStorage.pagecount;\r\n}", "function increase() {\n var holdCount1 = count + 1;\n setCount(holdCount1);\n var holdItem1 = props;\n window.localStorage.setItem(JSON.stringify(holdItem1), holdCount1);\n cartContext.setCartTotal(calTotal());\n }", "function createId() {\n var id = $localStorage.booksId;\n $localStorage.booksId = $localStorage.booksId + 1;\n return id;\n }", "function landingPageCounter() {\n if (typeof (Storage) !== \"undefined\") {\n if (localStorage.getItem(\"landingFirstTimeCount\")) {\n if (Number(localStorage.getItem(\"landingFirstTimeCount\")) == 0) {\n $('#squarespaceModal').modal('show');\n $('#MugurthamModal').modal('show');\n localStorage.setItem(\"landingFirstTimeCount\", \"1\");\n }\n }\n } else {\n toastr.error(\"Sorry, your browser does not support web storage...\");\n }\n}", "function updateCartCounter() {\n\tlet storedCart = JSON.parse(localStorage.getItem('cart'));\n\tlet counter = 0;\n\tif (storedCart === null) {\n\t\tcounter = 0;\n\t} else {\n\t\tstoredCart.forEach((item) => {\n\t\t\tcounter += item.qty;\n\t\t});\n\t\tcartCounter.innerText = counter;\n\t}\n}", "function clickFunction(){\n console.log(clicks)\n clicks++;\n document.getElementById(\"clickcount\").innerHTML=\"LIKES:\"+clicks;\n localStorage.setItem('likes',clicks);\n}", "function storeFinalScore() {\n localStorage.setItem(\"score\", score);\n}", "function addCounter(name, count) {\n var html = counterHtml(name, count);\n $(\"#list\").append(html);\n // setCookie(currentCounters, html);\n storeCounter(currentCounters, html);\n\n var countNr = currentCounters;\n $(`#input${currentCounters}`).change(() => {\n console.log(countNr);\n // setCookie(countNr, html);\n storeCounter(countNr, html);\n }).keypress(function (e) {\n if (e.which == 13) {\n this.blur();\n }\n });\n\n currentCounters++;\n}", "function Increment(){\n setCounter(counter + 1) \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}", "function inCount() {\n\n \"use strict\";\n var count = sessionStorage.getItem('cnt');\n count++;\n\n if(count >= 5){\n count = 0;\n }\n\n sessionStorage.setItem('cnt', count);\n\n}", "function cartNumbers(product){\r\n let productNumbers = localStorage.getItem('cartNumbers');\r\n productNumbers = parseInt(productNumbers);\r\n if (productNumbers){\r\n localStorage.setItem('cartNumbers', productNumbers + 1);\r\n document.querySelector('.cart span') .textContent =productNumbers + 1;\r\n } else {\r\n localStorage.setItem('cartNumbers', 1);\r\n document.querySelector('.cart span ') .textContent = 1 ;\r\n }\r\n setItems(product);\r\n}", "function save() {\n localStorage.productData = JSON.stringify(Product.allProducts);\n localStorage.totalCounter = totalCounter;\n}", "function timer(){\n\t\n\t\n\tcounter--;\n\n\t\t\tif( counter >= 0 ){\n\t\t\t\t\n\t\t\t\tid = document.getElementById(\"count\");\n\t\t\t\tid.innerHTML = counter;\n\t\t\t}\n\n\t\t\tif( counter == 0 ){\n\t\t\t\talert(\"You are out of time, the order is canceleld \\n Returning to homepage\");\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tlocation.href=\"index.php\";\n\t\t\t}\n\t\n}", "function them(i)\n{\t\n\tvar kq=tim(arr[i].ten);\n\tif(kq==-1)//k thay sp nay\n\n\t{\n\t\tvar c=window.localStorage.getItem(\"count\");\n\t\tc++;\n\t\twindow.localStorage.setItem(c,arr[i].ten+\",\"+arr[i].hinh+\",\"+arr[i].gia+\",\"+1);\n\t\twindow.localStorage.setItem(\"count\",c);\n\n\t}\n\telse //timthay\n\t{\n\t\tvar v=window.localStorage.getItem(kq);\n\t\tif(v!=null)\n\t\t{\n\t\t\tvar tam=v.split(\",\");\t\n\t\t\ttam[3]=parseInt(tam[3])+1;\n\t\t\t//cap nhat tam vao kho\n\t\t\twindow.localStorage.setItem(kq,tam[0]+\",\"+tam[1]+\",\"+tam[2]+\",\"+tam[3]);\n\t\t}\n\t}\n}", "function commitToStorage(objectCount, newObject)\n{\n var item = getFileName();\n localStorage.setItem('saveCount', objectCount);\n\n localStorage.setItem(item, JSON.stringify(newObject));\n alert(\"Saved \" + item);\n}", "function showEntrances() {\n var countVisited = localStorage.count;\n document.getElementById('entrances').innerHTML = Math.abs(countVisited);\n}", "function setBot1LossesToLS() {\n bot1Losses = JSON.parse(localStorage.getItem('bot1Losses'));\n bot1Losses +=1;\n localStorage.setItem('bot1Losses', bot1Losses);\n}", "function updateCounter() {\n var itemCount = document.getElementById('itemCount');\n var spanEl = document.createElement('span');\n spanEl.textContent=counter;\n itemCount.appendChild(spanEl);\n}", "function setCount(storage, key, value) {\n try {\n storage.setItem(countKey, value + '');\n exports.count[key] = value;\n return true;\n }\n catch (err) {\n return false;\n }\n}", "startCounter(){\n const self = this;\n this.toggleTutorial;\n this.counter = setInterval(function(){\n self.seconds = parseInt(self.seconds) + 1;\n if (self.seconds > 59) {\n self.minutes += 1;\n self.seconds = \"00\";\n } else if (self.seconds < 10) {\n self.seconds = \"0\" + self.seconds;\n }\n // Saves the cookie with all the game data\n self.setCookie(\"save\", btoa(JSON.stringify({\n \"score\": self.score,\n \"seconds\": self.seconds,\n \"minutes\": self.minutes,\n \"cardLayout\": self.randomizedCards,\n \"cardRemoved\": self.removedCards\n })));\n }, 999.9);\n }", "function updateView() {\n document.querySelector('#counter').innerText = store.getState().counter;\n}", "function setStats(stats) {\n localStorage.getItem(\"stats\")? 0 : localStorage.setItem(\"stats\", JSON.stringify(stats));\n}", "componentDidUpdate(prevState) {\n if(prevState.count !== this.state.count) {\n localStorage.setItem(\"number\", this.state.count);\n console.log(\"Saving Data!\");\n }\n }", "function incrementDictionaryIndex() {\n index = sessionStorage.getItem(\"index\");\n index++;\n sessionStorage.setItem(\"index\", index);\n console.log(index);\n}", "function updateBuyCircle() {\n let anzahl = 0;\n for (let i = 0; i < localStorage.length; i++) {\n let key = localStorage.key(i);\n if (!key.match(\"randid\") && !key.match(\"Warenkorb\")) {\n anzahl = anzahl + 1;\n localStorage.setItem(\"Warenkorb\", String(anzahl));\n }\n }\n let cartCount = document.getElementById(\"cartCount\");\n cartCount.innerHTML = localStorage.getItem(\"Warenkorb\");\n }", "function incrementCounter () {\r\n counter ++;\r\n console.log('counter', counter);\r\n }", "function WriteToStorage(item){\n var currentStorage = ReadFromStorage();\n currentStorage.push(item);\n localStorage.setItem('indexBun', JSON.stringify(currentStorage));\n indexBun++;\n //renderCartPrice();\n}", "constructor() {\n \tthis.storage = {};\n this.count = 0;\n }", "function cartNumbers(item){\n\n let productNumb = localStorage.getItem('cartNumbers');\n\n productNumb = parseInt(productNumb);\n\n if(productNumb){\n localStorage.setItem('cartNumbers', productNumb + 1);\n document.querySelector('.cart span').textContent = productNumb + 1;\n }else {\n localStorage.setItem('cartNumbers', 1);\n document.querySelector('.cart span').textContent =1;\n }\n\n setCartItems(item);\n}", "function increment() {\n\t// Increment the counter value in server\n\tsocket.emit('incrementCounterValue');\n}", "function viewCounter() {\n // for realtime database\n dbRef.child(\"counter\").get().then((snapshot) => {\n let counter = snapshot.val();\n let viewed = counter.view + 1;\n let downloaded = counter.graph_download + counter.pdf_download + counter.excel_download;\n dbRef.child(\"counter\").update({ view: viewed });\n document.getElementById('view-counter').innerText = viewed;\n document.getElementById('download-counter').innerText = downloaded;\n });\n \n // for firebase database\n // let docRef = firestore_db.collection('view_counter').doc('DyePhHD4DbEQ6iQUFFdm');\n // docRef.get().then((doc) => {\n // let viewed = doc.data().viewed + 1;\n // let downloaded = doc.data().data_pdf_downloaded + doc.data().data_xlsx_downloaded + doc.data().graph_downloaded;\n // docRef.update({\n // viewed: viewed\n // });\n // document.getElementById('view-counter').innerText = viewed;\n // document.getElementById('download-counter').innerText = downloaded;\n // })\n}", "function countTime() {\n\tdocument.getElementById(\"time\").innerHTML = \"Vreme: \" + ++ value;\n\tif (value == list[0].vreme) {\n\t\tconsole.log(\"Kraj igre...\");\n\t\tlocalStorage.setItem('allAnswersLs', JSON.stringify(allAnswers));\n\t\tstop();\n\t\tfinishGame();\n\t}\n}", "function updateScore() \n{\n var current_score = localStorage.getItem('score');\n\n if (isNaN(current_score)) {\n localStorage.setItem('score', 0);\n document.getElementById(\"SCORE\").innerHTML = \" [ \" + current_score + \" ] \";\n } else {\n localStorage.setItem('score', parseInt(current_score) + 1);\n document.getElementById(\"SCORE\").innerHTML = \" [ \" + current_score + \" ] \";\n }\n}", "function conserveScore() {\n if (counter < savedScore || savedScore === null || savedScore === '--') {\n localStorage.setItem('localScore', counter);\n bestScore.innerHTML = localStorage.getItem('localScore'); \n savedScore = localStorage.getItem('localScore');\n } else {\n bestScore.innerHTML = localStorage.getItem('localScore');\n }\n}", "function sendLocalDataToServer() {\n var status = document.querySelector('#status');\n status.className = 'online';\n status.innerHTML = 'Online';\n var i = 0,\n dataString = '';\n while (i <= window.localStorage.length - 1) {\n\tdataString = localStorage.key(i);\n\tif (dataString) {\n\t sendDataToServer(localStorage.getItem(dataString));\n\t window.localStorage.removeItem(dataString);\n\t}\n\telse {\n\t i++;\n\t}\n }\n document.querySelector('#local-count').innerHTML = window.localStorage.length;\n \n}", "function increaseCounter()\n{\n\t//increase the global counter in one\n\tcounter++;\n\t//update the screen with the new value\n\tdocument.getElementById('screen').innerHTML = \"The counter value is \"+counter;\n}", "function setCounter() {\n document.getElementById(\"counter\").innerText = \"Counter : \" + attempts_counter;\n}", "function savePurchase() {\n var purchaseCounter = localStorage.getItem(\"purchase\");\n if (purchaseCounter == null) {\n purchaseCounter = 1;\n } else {\n purchaseCounter++;\n }\n\n localStorage.setItem(\"purchase\", purchaseCounter);\n\n var purchaseData = [];\n purchaseData.push(\"Película: \" + $(\"#titleFilm .emphasis\").text());\n purchaseData.push(\"Nombre: \" + $(\"#first-name\").val());\n purchaseData.push(\"Apellidos: \" + $(\"#last-name\").val());\n purchaseData.push(\"Email: \" + $(\"#address\").val());\n purchaseData.push($(\"#totalPrice .subtotal\").text());\n purchaseData.push(\"Asientos: \" + seatIDs);\n\n localStorage.setItem(\"purchase_\" + purchaseCounter, JSON.stringify(purchaseData));\n}", "function incrLevel() {\n var level = localStorage.getItem('level');\n if(!level) {\n level = 1;\n localStorage.setItem('level', level);\n return level;\n } else {\n level = parseInt(level, 10);\n level += 1;\n localStorage.setItem('level', level);\n return level;\n }\n }", "function increaseCounter() {\n\tmoveCounter.innerText = counter;\n\tcurrentDisk.classList.toggle('selected');\n\tcounter++;\n}", "function onLoadCartNumbers() {\r\n\tlet productNumbers = localStorage.getItem('cartNumbers');\r\n\tif (productNumbers) {\r\n\t\tdocument.getElementById('count').textContent = productNumbers;\r\n\t}\r\n}", "function taskCounter()\n{\n\treturn JSON.parse(localStorage.getItem(\"tasks\")).length;\n}", "function UpdateCart() {\n\n // get current text displaying for cart\n\tvar cart_num = parseInt(document.getElementById('cart_number').innerText);\n\n\t// get value from quantity drop down menu\n\tvar qty1 = document.getElementById('qty1').value;\n\tqty1 = parseInt(qty1);\n\t//console.log(qty1);\n\n\t// Add quantity selected to the total & update total\n\titem_number += qty1;\n\tcart_num = item_number;\n\tdocument.getElementById('cart_number').innerText = cart_num;\n // console.log(cart_num);\n //console.log(cart_num);\n\n window.localStorage.setItem('cart_count', JSON.stringify(cart_num));\n\n}", "function cartNumbers (response){\n let productNumbers = localStorage.getItem('cartNumbers');\n productNumbers = parseInt(productNumbers);\n console.log(response.name);\n //if there are any add one to them\n if (productNumbers){\n localStorage.setItem('cartNumbers', productNumbers + 1);\n document.querySelector('.spanCart').textContent = productNumbers + 1;\n //if there is none set local storage to one\n }else{\n localStorage.setItem('cartNumbers', 1);\n document.querySelector('.spanCart').textContent = 1; \n }\n setItems(response);\n \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 updateScore() {\n var current_score = localStorage.getItem('score');\n\n if (isNaN(current_score)) {\n localStorage.setItem('score', 0);\n document.getElementById(\"SCORE\").innerHTML = \" Score: [ \" + current_score + \" ] \";\n } else {\n localStorage.setItem('score', parseInt(current_score) + 1);\n document.getElementById(\"SCORE\").innerHTML = \" Score: [\" + current_score + \" ] \";\n }\n\n}", "function counters(){\n counters.count++;\n}", "function deleteWorkItem(count) {\n $(\"#\" + count).remove();\n localStorage.removeItem(count);\n $('#workItemNum').html('').html(--count); \n}", "function incrementId(){\n //increment the counter\n incrementProgress.child('counter').transaction(function(currentValue){\n return (currentValue || 0) + 1\n }, function(err, committed, ss){\n if(err){\n setError(err);\n }\n \n else if(committed){\n //if update succeeds, then create a record\n addRecord(ss.val());\n }\n });\n }", "function set_name_storage(){\r\n\tvar name_local_storage = document.querySelector('#userName').value;\r\n\tlocalStorage.setItem(\"name_storage\", name_local_storage);\r\n\t//alert(localStorage.getItem(\"name_storage\"));\r\n\r\n\tlocalStorage.setItem(\"countSD_storage\", countSD);\r\n\tlocalStorage.setItem(\"countSE_storage\", countSE);\r\n\tlocalStorage.setItem(\"countID_storage\", countID);\r\n\tlocalStorage.setItem(\"countIE_storage\", countIE);\r\n\t\r\n}", "function actualizaCantidad()\n{\n if(localStorage.getItem('cantidad'))\n {\n numero.innerHTML = localStorage.getItem('cantidad');\n }\n}", "function updateScore(winner){\n let x = parseInt(localStorage.getItem(winner));\n x = x + 1;\n localStorage.setItem(winner, x);\n storeScore();\n}", "function tim(tencantim)\n{\n\tvar c=window.localStorage.getItem(\"count\");\n\tif(c!=null)\n\t{\n\t\tfor(var i=1;i<=c;i++)\n\t\t{\n\t\t\tvar v=window.localStorage.getItem(i);\n\t\t\tif(v!=null)\n\t\t\t{\n\t\t\t\tvar tam=v.split(\",\");\n\t\t\t\tif(tam[0]==tencantim)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "function tim(tencantim)\n{\n\tvar c=window.localStorage.getItem(\"count\");\n\tif(c!=null)\n\t{\n\t\tfor(var i=1;i<=c;i++)\n\t\t{\n\t\t\tvar v=window.localStorage.getItem(i);\n\t\t\tif(v!=null)\n\t\t\t{\n\t\t\t\tvar tam=v.split(\",\");\n\t\t\t\tif(tam[0]==tencantim)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}", "function storeItem() {\n\n localStorage.setItem(initialsInput.value, finalScore);\n\n}" ]
[ "0.7959239", "0.78576595", "0.7571163", "0.73970383", "0.7213411", "0.720338", "0.720338", "0.7148376", "0.7129366", "0.70923907", "0.7063236", "0.6979693", "0.69158053", "0.688649", "0.68651706", "0.68344253", "0.6740908", "0.66805243", "0.667799", "0.66474944", "0.6600458", "0.6590113", "0.65863395", "0.6518631", "0.65183854", "0.6513657", "0.65104145", "0.6490304", "0.6478607", "0.6478607", "0.6473759", "0.6461064", "0.64537954", "0.64476055", "0.6437911", "0.6402932", "0.6401558", "0.63921314", "0.63860065", "0.63773805", "0.63686085", "0.6362995", "0.63521844", "0.6351308", "0.6322141", "0.63072294", "0.6295505", "0.6289017", "0.62737906", "0.62737846", "0.627279", "0.62687904", "0.6260934", "0.6251177", "0.6242194", "0.6240678", "0.62309074", "0.62227595", "0.6207113", "0.6201488", "0.61975074", "0.61966085", "0.6158255", "0.615178", "0.61500263", "0.6142336", "0.6132467", "0.6124646", "0.61215764", "0.61040986", "0.60970485", "0.6093623", "0.6088999", "0.60787606", "0.6067821", "0.60624164", "0.60575944", "0.6056754", "0.60481936", "0.6044145", "0.6042863", "0.6040403", "0.6038989", "0.6031799", "0.6024565", "0.6018263", "0.6011356", "0.6010377", "0.60095894", "0.60064983", "0.600277", "0.59985363", "0.5983548", "0.5976097", "0.59674114", "0.5966191", "0.5965442", "0.5961739", "0.5961739", "0.59590816" ]
0.73718536
4
function that calls localStorage for counter, redirects user to Scores page when seconds reach 0
function handleEndTime(seconds) { if (seconds === 0) { scoreToLocalStorage(counter); location.href = 'scores.html'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countDown() {\n startingTime--;\n document.getElementById(\"timer\").innerHTML = \"Timer: \" + startingTime;\n if (startingTime <= 0) {\n window.localStorage.setItem('finalScore', startingTime);\n location.assign(\"scores.html\");\n }\n}", "function timer() {\n seconds = seconds - 1;\n \n if (seconds <= 0) {\n saveScore(val);\n console.log(getScore());\n window.location.replace(\"./score.html?s=\" + val);\n }\n\n document.getElementById(\"timer\").innerHTML = seconds;\n}", "function conserveScore() {\n if (counter < savedScore || savedScore === null || savedScore === '--') {\n localStorage.setItem('localScore', counter);\n bestScore.innerHTML = localStorage.getItem('localScore'); \n savedScore = localStorage.getItem('localScore');\n } else {\n bestScore.innerHTML = localStorage.getItem('localScore');\n }\n}", "function timer(){\n\t\n\t\n\tcounter--;\n\n\t\t\tif( counter >= 0 ){\n\t\t\t\t\n\t\t\t\tid = document.getElementById(\"count\");\n\t\t\t\tid.innerHTML = counter;\n\t\t\t}\n\n\t\t\tif( counter == 0 ){\n\t\t\t\talert(\"You are out of time, the order is canceleld \\n Returning to homepage\");\n\t\t\t\tlocalStorage.clear();\n\t\t\t\tlocation.href=\"index.php\";\n\t\t\t}\n\t\n}", "function countDown() {\n var remaining = localStorage.endTime - Math.floor(new Date().getTime() / 1000);\n if (remaining >= 0) {\n timerDiv.innerHTML = \"Timer: \" + remaining + \"s\";\n } else if (remaining < 0) {\n if (window.location.href.match(/add/)) {\n localStorage.removeItem(\"endTime\");\n window.location.href = \"sub.html\";\n } else if (window.location.href.match(/sub/)) {\n localStorage.removeItem(\"endTime\");\n window.location.href = \"div.html\";\n } else if (window.location.href.match(/div/)) {\n window.location.href = \"result.html\";\n }\n }\n}", "function storeScore(event) {\n scores.push({\n initials: userInitials.value,\n score: secondsLeft\n })\n event.preventDefault();\n localStorage.setItem(\"scores\", JSON.stringify(scores))\n clearInterval(timeInterval);\n window.location = \"highscore.html\"\n}", "function updateScore() {\n var current_score = localStorage.getItem('score');\n\n if (isNaN(current_score)) {\n localStorage.setItem('score', 0);\n document.getElementById(\"SCORE\").innerHTML = \" Score: [ \" + current_score + \" ] \";\n } else {\n localStorage.setItem('score', parseInt(current_score) + 1);\n document.getElementById(\"SCORE\").innerHTML = \" Score: [\" + current_score + \" ] \";\n }\n\n}", "function updateScore() \n{\n var current_score = localStorage.getItem('score');\n\n if (isNaN(current_score)) {\n localStorage.setItem('score', 0);\n document.getElementById(\"SCORE\").innerHTML = \" [ \" + current_score + \" ] \";\n } else {\n localStorage.setItem('score', parseInt(current_score) + 1);\n document.getElementById(\"SCORE\").innerHTML = \" [ \" + current_score + \" ] \";\n }\n}", "function endGame() {\n // stop timer\n clearInterval(timerInterval);\n\n // remember the score (local storage)\n localStorage.setItem(\"secondsLeft\", secondsLeft);\n // direct user to the scores page\n window.location.href = \"highscores.html\";\n}", "function scoreStore(){\n localStorage.setItem($url, $currentScreen);\n }", "function livesLeft(){\n if (lives <= 0){\n sessionStorage.setItem(\"score\",`${score}`);\n document.location.href = 'gameover.html';\n };\n }", "function storeFinalScore() {\n localStorage.setItem(\"score\", score);\n}", "function scoreToLocalStorage(counter) {\n localStorage.setItem('score', JSON.stringify(counter));\n}", "function checkScore() {\n if (this.localStorage) {\n localStorage.setItem('score',score);\n if (localStorage.highScore) {\n if (score > localStorage.highScore) {\n localStorage.setItem('highScore',score);\n }\n }\n else {\n localStorage.setItem('highScore',score);\n }\n }}", "function tallyScore (time){\n if(quizIndex>=4)\n {\n countdownEl.textContent =\"\";\n verifyEl.textContent =\"\";\n questionEl.textContent =\"All Done!\"\n contentEl.textContent =\"Your Score is \" + time;\n endGame.style.display =\"block\";\n \n }\n // Submit button grabbing intials and going to highscore page\n\n endGame.addEventListener(\"submit\", function(event){\n var scoreEntry = {\n name: document.getElementById(\"name\").value,\n score: time\n };\n \n \n var scoreLists = JSON.parse(localStorage.getItem(\"score\"));\n // just check to see if the user has an item in localStorage called \"score\"\n // if so, we'll use it like we're doing already\n // if not, let's create that item in their localStorage\n if (scoreLists !== null)\n {\n scoreLists.unshift(scoreEntry);\n console.log(scoreLists);\n localStorage.setItem(\"score\", JSON.stringify(scoreLists));\n }\n else{\n var newScoreList = [];\n newScoreList.unshift(scoreEntry);\n localStorage.setItem(\"score\", JSON.stringify(newScoreList));\n }\n \n \n})\n \n}", "function saveHighscore() {\n var score = quiz.score + Math.ceil(seconds);\n // get value of input box\n var initialsInput = document.querySelector('#initials');\n var initials = initialsInput.value.trim();\n\n // make sure input is valid\n if (initials === \"\" || initials.length < 3 || initials.length > 3) {\n alert(\"Initials field cannot be blank and must be 3 characters long! Try again.\");\n\n } else {\n alert(\"Your score has been saved. Let's see if you made the Top 10!\");\n // get saved scores from localstorage, or if not any, set to empty array\n var highscores =\n JSON.parse(window.localStorage.getItem(\"highscores\")) || [];\n // format new score object for current user\n var newScore = {\n score: score,\n initials: initials\n }\n // save to localstorage\n highscores.push(newScore);\n window.localStorage.setItem(\"highscores\", JSON.stringify(highscores));\n location.replace(\"high-scores.html\")\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 countDown () {\n timer -= 1\n clock.textContent = timer\n if (timer === 0) {\n window.alert(\"'Time's up! your score is \" + scoreLine)\n window.location.reload()\n }\n }", "function quizOver() {\n //initials = prompt(\"enter your initials\");\n finalScore = timeLeft;\n localStorage.setItem(initials, finalScore);\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 startQuiz() {\n highscores = JSON.parse(localStorage.getItem(\"scores\"))\n\n // var highscores = localStorage.getItem(\"highScores\"); if(highscores){\n // highscores = JSON.parse(highscores); }else { highscores = []; } // loop over\n // high scores // add them to the page\n\n\n var timerInterval = setInterval(function () {\n timer.textContent = time;\n time--;\n\n if (questionIndex === questions.length) {\n\n clearInterval(timerInterval);\n\n }\n\n if (time <= 0) {\n\n clearInterval(timerInterval);\n endGame();\n\n }\n\n }, 1000);\n\n\n startcont.style.display = \"none\";\n\n showQuestions();\n\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 displayScore() {\n clearInterval(interval);\n interval = undefined;\n score += secondsLeft;\n\n alert(\"Your score is: \" + score);\n let initials = prompt('Please Enter your initials');\n if(initials != null) {\n scores.push(initials + \": \" + score);\n localStorage.setItem('scores', JSON.stringify(scores));\n }\n}", "function countScore() {\n \n var CookieValue = 0;\n // get page increment\n var page = dataLayer[0].pageType;\n if (page == \"detail\") {\n var increment = 2;\n } else {\n var increment = 1;\n }\n\n // create cookie if does not exist\n if( $.cookie('PopupCounter') === null || $.cookie('PopupCounter') === undefined) { \n\n CookieValue = increment;\n \n $.cookie(\"PopupCounter\", CookieValue); \n \n // if cookie exists, add 1 or 2 depending on pagetype\n } else {\n \n CookieValue = parseInt($.cookie(\"PopupCounter\")); \n CookieValue += increment;\n\n // set the new cookie value (+1 or +2) and refresh duration\n $.cookie(\"PopupCounter\", CookieValue);\n } \n}", "function question_screen_go()\n {\n //Fetch the Value of the timer storing HTML element\n // var a=parseInt(question_screen_timer.innerHTML);\n\n //Decrement the value\n aa--;\n\n //If value goes to zero then its time up\n if(aa==0)\n {\n //Clear the interval\n //Ref 4 based on stackoverflow in licenses.txt\n // Answer Link:https://stackoverflow.com/questions/21714860/stop-javascript-counter-once-it-reaches-number-specified-in-div\n\n clearInterval(question_screen_tid);\n //Set the Value again\n question_screen_timer.innerHTML=\"Times Up!!Try Again!!!!!!\";\n //Make the button disabled\n question_screen_check_button.disabled=true;\n question_screen_restart_button.style.display=\"block\";\n question_screen_welcome_button.style.display=\"block\";\n\n //Update the stats\n gameData.gamesPlayed++;\n gameData.timer=10;\n\n var present_highest_score=gameData.highestScore;\n\n if(question_score>present_highest_score)\n {\n gameData.highestScore=question_score;\n }\n\n\n }\n\n else if(aa>0)\n {\n //Again reset the value\n question_screen_timer.innerText=aa;\n\n }\n }", "function tick() {\n var current_minutes = 0\n seconds--;\n $(\"#timer\").html('Time Left: ' + current_minutes.toString()+ \":\" + (seconds < 10 ? \"0\" : \"\") + String(seconds));\n if (seconds > 0) {\n x = setTimeout(tick,1000);\n }\n if (seconds === 0) {\n reset();\n $('#userAlert').text(\"Sorry, you've run out of time!\");\n $('#start').css('background-color', '');\n var highScore = localStorage.getItem('highScore');\n if (score > highScore) {\n localStorage.setItem(\"highScore\", score);\n }\n // Retrieve\n $('#highScore').text(\"High Score: \" + highScore);\n\n return;\n }\n if (inProgress === false){\n $('#start').css('background-color', '');\n return;\n }\n }", "function mylevel(){\n if(score>40){\n window.location.href='second.html';\n }\n else{\n return 0;\n }\n }", "function gameOver(){\n seconds = 0;\n alert(\"Game Over!\")\n window.location = 'highscores.html'\n}", "function printScores() {\n if (localStorage.getItem(\"bestScore\")) {\n bestScore.textContent = localStorage.getItem(\"bestScore\");\n } else {\n bestScore.textContent = 0;\n }\n currentScore.textContent = 0;\n}", "function landingPageCounter() {\n if (typeof (Storage) !== \"undefined\") {\n if (localStorage.getItem(\"landingFirstTimeCount\")) {\n if (Number(localStorage.getItem(\"landingFirstTimeCount\")) == 0) {\n $('#squarespaceModal').modal('show');\n $('#MugurthamModal').modal('show');\n localStorage.setItem(\"landingFirstTimeCount\", \"1\");\n }\n }\n } else {\n toastr.error(\"Sorry, your browser does not support web storage...\");\n }\n}", "function saveHighScores() {\n var initials = initialsEl.value.trim();\n \n if (initials !== \"\") {\n var highscores = JSON.parse(window.localStorage.getItem('highscores')) || [];\n var newScore = {\n score: secondsLeft,\n initials: initials\n };\n\n //save to local storage\n highscores.push(newScore);\n window.localStorage.setItem('highscores', JSON.stringify(highscores));\n\n window.location.href = \"highscores.html\";\n }\n}", "function clearScore() {\n window.localStorage.clear();\n location.reload();\n\n}", "function gameover(){\nmusic.pause();\nalert(\"Your score: \" + score);\nif (score>highscore){\nlocalStorage.setItem(\"highscore\",score);\n}\n\ninitialize();\n}", "function savePreviousScore(){\n\t\t\n\t\tvar gamePreviousScore = window.localStorage.getItem(\"local-storage-game-over-score\");\n\t\twindow.localStorage.setItem(\"local-storage-previous-score\", gamePreviousScore);\n\t\t\t\n\t\t\n\t}", "function highScore() {\n wrapper.innerHTML = \"\"\n document.querySelector(\".time\").innerHTML =\"\"\n var div = document.createElement(\"div\")\n var h1 = document.createElement(\"h1\")\n h1.innerHTML = \"High score\"\n wrapper.appendChild(h1)\n var userInfo = JSON.parse(localStorage.getItem(\"userInfo\"))\n userInfo.forEach(function (item) {\n var p = document.createElement(\"p\")\n p.innerHTML = \"Initial: \" + item.initial + \" Score: \" + item.score\n div.appendChild(p)\n wrapper.appendChild(div)\n })\n var goBack = document.createElement(\"button\")\n goBack.innerHTML = \"Go Back\"\n var clearScore = document.createElement(\"button\")\n clearScore.innerHTML = \"Clear Score\"\n wrapper.appendChild(goBack)\n wrapper.appendChild(clearScore)\n clearScore.addEventListener(\"click\", function () {\n div.innerHTML = \"\"\n localStorage.clear()\n })\n goBack.addEventListener(\"click\", function () {\n mainPage()\n })\n}", "function startQuiz() {\n var timeLeft = 75;\n\n setInterval(function() {\n timer.textContent = \"Time: \" + timeLeft;\n timeLeft--;\n\n if (timeLeft === 0) {\n //ADD DATA HERE AT END ONCE SCORE PAGE IS CREATED\n }\n }, 1000);\n}", "function checkScore(){\n if(snakeLen>highScore){\n highScore = snakeLen\n localStorage.setItem(\"highScore\",highScore);\n }\n document.getElementById(\"highscore\").innerHTML = \"High Score: \" + (highScore/bodyIncrement).toString();\n document.getElementById(\"score\").innerHTML = \"Score: \" + (snakeLen/bodyIncrement).toString();\n // document.getElementById(\"highscore\").innerHTML = \"High Score: \" + (Math.round((highScore/bodyIncrement) * (((100-increment)+100)/100))).toString();\n}", "function sendScores(){\n if (landed == false){\n landedstore = 0;\n }else if (landed == true && bonus == 5000){\n landedstore = 2;\n }else{\n landedstore = 1;\n }\n //send the score and other info to PHP in the URL so it can go to the MySQL database\n window.location.href = \"highscores.php?pn=\"+playername+\"&ln=\"+levelnum+\"&s=\"+score+\"&l=\"+landedstore;\n //Go back to the menu after 0.5 seconds - this is only useful in Firefox so that when you press back to go to the game menu. Chrome\n setTimeout(gotoMenu, 500);\n}", "function countDown() {\n \n //if timeRemaining is less than or equal to 0\n if (timeRemaining <= 0){\n\n // //increment unansweredCounter\n // unansweredCounter++;\n\n //call losePage()\n losePage();\n }\n \n //decrement timeRemaining by 1\n timeRemaining--;\n \n //display timeRemaining to index.html by using the id #timeRemaining\n $(\"#timeRemaining\").text(timeRemaining + \" seconds\");\n\n}", "function endGame() {\n // Resets the timer interval\n clearInterval(timer);\n // Prompt for user initials\n user = prompt(\"Please enter your initials here:\");\n // Sets the seconds left as the final score\n score = secondsLeft;\n // Stores values of user and score to localStorage\n localStorage.setItem(\"score\", secondsLeft);\n localStorage.setItem(\"user\", user);\n\n window.location.href = \"leaderboard.html\";\n}", "function redirectToSummaryPage() {\n storeFinalScore();\n window.location.href = \"summary.html\";\n}", "startCounter(){\n const self = this;\n this.toggleTutorial;\n this.counter = setInterval(function(){\n self.seconds = parseInt(self.seconds) + 1;\n if (self.seconds > 59) {\n self.minutes += 1;\n self.seconds = \"00\";\n } else if (self.seconds < 10) {\n self.seconds = \"0\" + self.seconds;\n }\n // Saves the cookie with all the game data\n self.setCookie(\"save\", btoa(JSON.stringify({\n \"score\": self.score,\n \"seconds\": self.seconds,\n \"minutes\": self.minutes,\n \"cardLayout\": self.randomizedCards,\n \"cardRemoved\": self.removedCards\n })));\n }, 999.9);\n }", "function scoreHistory() {\n\tvar initials = initialsInput.value;\n\tvar scoreEntry = initials + \" - \" + secondsLeft;\n\tscores.push(scoreEntry);\n\tlocalStorage.setItem(\"scores\", JSON.stringify(scores));\n\tquizscoreDiv.classList.toggle(\"collapse\");\n\tscoreHistoryDiv.classList.toggle(\"collapse\");\n\tactiveDiv = scoreHistoryDiv;\n\tlistofscores();\n}", "function saveScores() \n{\n var savedScores = JSON.parse(localStorage.getItem(\"score\")) || [];\n\n var initials = playerInitials.value;\n var userInfo = {\n initials: initials,\n score: score\n }\n savedScores.push(userInfo);\n localStorage.setItem(\"score\", JSON.stringify(savedScores))\n window.location.href=\"highscores.html\";\n}", "function reset(){\r\n\r\n gameState=PLAY;\r\n \r\nif(localStorage[\"HighScore\"]<score){\r\n\r\n localStorage[\"HighScore\"]=score;\r\n\r\n}\r\n\r\n score=0;\r\n}", "function saveHighscore() {\n var score = secs;\n var userInitials = identification.value;\n\n var newScore = [\n {\n score: score,\n initials: userInitials\n }\n ];\n // save to localstorage\n localStorage.setItem(\"newscore\", JSON.stringify(newScore));\n // redirect to highscores\n window.location.href = \"highScores.html\";\n}", "function updateScore(winner){\n let x = parseInt(localStorage.getItem(winner));\n x = x + 1;\n localStorage.setItem(winner, x);\n storeScore();\n}", "function saveScores() {\n var initials = userInitialsInput.value.trim();\n //Calls a new var \"user\" that will allow you to pass the dat through local storage\n if (initials !== \"\") {\n var highscores = JSON.parse(window.localStorage.getItem(\"highscores\")) || [];\n var user = {\n initials: initials,\n score: time/1000\n };\n highscores.push(user);\n window.localStorage.setItem(\"highscores\", JSON.stringify(highscores));\n }\n window.location.href = \"highscore.html\";\n}", "function highScore (){\n // get value of input box\n var initials = initialsEl.value.trim()\n\n // check to make sure value is empty\n if(initials !== \"\"){\n // get saved score from localstorage,\n // if there is not anything saved to localstorage, set as an empty array\n var highScore = JSON.parse(window.localStorage.getItem(\"highscores\")) || [];\n\n //format new scores object for current user\n var newScore = {\n score: time,\n initials: initials\n };\n highScore.push(newScore);\n window.localStorage.setItem(\"highscores\", JSON.stringify(highscores));\n\n// redirect to next page\nwindow.location.href =\"highscores.html\";\n }\n}", "function addScore() {\n let bestScore;\n if (localStorage) {\n bestScore = parseInt(localStorage[board.height + \" \" + \n board.width + \" \" + board.numMines]);\n }\n if (!bestScore) bestScore = 0;\n document.getElementById(\"score\").innerHTML = \"Quickest -> \" +\n Math.floor(bestScore / 3600) + \"h : \" + \n Math.floor(bestScore % 3600 / 60) + \"m : \" + \n Math.floor(bestScore % 60) + \"s\";\n} // end addScore", "function endGame() {\n localStorage.setItem(\"qIndex\", 0);\n localStorage.setItem(\"score\", score);\n localStorage.setItem(\"totalTime\", totalTime)\n window.location.href = \"./endgame.html\";\n}", "function lastPage(finalTime) {\n finalHeader.setAttribute(\"class\", \"final-header d-block\");\n outroText.setAttribute(\"class\", \"outro-text d-block\");\n answersList.setAttribute(\"class\", \"d-none\");\n header.setAttribute(\"class\", \"d-none\");\n timerText.setAttribute(\"class\", \"d-none\");\n document.querySelector(\".input-group\").setAttribute(\"class\", \"d-block\");\n\n // displays and stores score\n outroText.textContent = outroText.textContent + finalTime;\n localStorage.setItem(\"score\", finalTime);\n console.log(\"time recorded\")\n\n //takes in a name input and saves it\n document.querySelector(\".submit-btn\").addEventListener(\"click\", function() {\n if (document.getElementById(\"High-Score\") === \"\") {\n alert(\"Enter your name or initials\");\n } else {\n localStorage.setItem(\"name\", document.getElementById(\"High-Score\").value);\n document.getElementById(\"High-Score\").value = \"\";\n console.log(\"Name recorded\")\n }\n });\n\n}", "function gameOver(){\n if(i = questions.length){\n score = secondsLeft;\n clearInterval(timerNum);\n initialPage();\n }else if (secondsLeft == 0){\n score = 0;\n clearInterval(timerNum);\n initialPage();\n }\n}", "function setCounter() {\n var now = new Date().getTime();\n var elapsed = (now - myStorageTime);\n var remain = status.expiry - elapsed;\n if (remain < 0) remain = 0;\n\n if (remain > 0) {\n $('#logouttime').html(_millisecondsToStr(remain));\n } else {\n if (!connectionFailure) {\n dialogOff();\n }\n $('#logouttime').html(\"\");\n }\n\n\n }", "function initialsSave() {\n const initials = document.querySelector(\"#initials\");\n let initializer = initials.value.trim();\n if (initializer !== \"\") {\n let highScores = JSON.parse(window.localStorage.getItem(\"high-scores\") || \"[]\");\n\n let newScore = {\n score: secondsLeft,\n initials: initializer,\n }\n\n highScores.push(newScore);\n window.localStorage.setItem(\"high-scores\", JSON.stringify(highScores));\n\n window.location.href = \"index.html\";\n }\n}", "function gameOver() {\n console.log(score);\n endGameEl.innerHTML = `\n <h1>Time ran out<h1>\n <p>You final score is ${score}</p>\n <button onclick=\"location.reload()\">Reload</button>\n `;\n\n endGameEl.style.display = 'flex';\n\n let highScore = localStorage.getItem('highScore');\n if (highScore === null) {\n localStorage.setItem('highScore', score);\n } else if (highScore <= score) {\n localStorage.setItem('highScore', score);\n } else {\n localStorage.getItem('highScore');\n }\n}", "function timer()\n{\n count=count-1;\n if (count <= 0)\n {\n clearInterval(counter);\n console.log(\"time is up\");\n window.location.href = 'done.html';\n return;\n }\n\n document.getElementById(\"timer\").innerHTML=count + \" Seconds\";\n}", "function setTime() {\n\n var timerInterval = setInterval(function () {\n secondsLeft--;\n timeEl.textContent = \"Time: \" + secondsLeft;\n\n if (secondsLeft <= 0 || questions.length < currentQuestionIndex + 1) {\n var finalScore = (secondsLeft * 2) + score;\n\n clearInterval(timerInterval);\n quizBox.classList.add(\"hide\");\n endBox.classList.remove(\"hide\");\n endBox.setAttribute(\"style\", \"color: green\");\n\n if (score === 0) {\n finalScore = \"0\";\n finalScoreEl.textContent = (\"Your final score is: \" + finalScore);\n }\n else {\n\n finalScoreEl.textContent = (\"Your final score is: \") + finalScore;\n }\n };\n\n submitBtn.addEventListener(\"click\", function () {\n endBox.classList.add(\"hide\");\n highscoreBox.classList.remove(\"hide\");\n\n var initials = document.querySelector(\"#initials\").value\n\n localStorage.getItem(\"initials\")\n localStorage.getItem(\"score\");\n localStorage.setItem(\"initials\", initials);\n localStorage.setItem(\"score\", finalScore);\n\n userScore.textContent = initials + \" = \" + finalScore;\n\n\n });\n\n $(\"#highscore-value\").prepend(finalScore);\n\n // clears highscoreBox\n clear.addEventListener(\"click\", function () {\n userScore.textContent = \"\";\n });\n\n }, 1000);\n }", "victory() {\n clearInterval(this.countDown);\n $('#victory').addClass('visible');\n if (this.score > localStorage.getItem(\"highScore\")) {\n this.setHighScore();\n }\n\n document.getElementById('high-score').innerText = localStorage.highScore;\n }", "function saveScore() {\n if (localStorage.getItem('highScore') != null) {\n const prevScore = localStorage.getItem('highScore');\n if (stars > prevScore) {\n localStorage.setItem(\"highScore\", stars);\n }\n } else {\n localStorage.setItem(\"highScore\", stars);\n }\n\n }", "function saveHighScore() {\n var userInitials = document.querySelector(\"#init\").value.trim();\n if (userInitials !== \"\") {\n var localData = JSON.parse(window.localStorage.getItem(\"data\")) || [];\n var userScore = finalScore.textContent;\n var newData = {\n initial: userInitials,\n score: userScore\n }\n localData.push(newData);\n window.localStorage.setItem(\"data\", JSON.stringify(localData));\n\n //redirecting user\n window.location.href = \"score.html\"\n }\n\n}", "function timer(){\n secs=secs-1;\n document.getElementById('timeleft').innerHTML=\"Timeleft: \"+secs+\" seconds\";\n if(secs == 0){\n window.alert(\"Time up! You have made \"+cm+\" correct matches \");\n location.reload();\n }\n\n }", "function savescoreTime(event)\n{\n event.preventDefault();\n window.location.replace('view_highscore.html');\n\n var scoreList = []; \n var existingList = JSON.parse(localStorage.getItem(\"uScore\"));\n \n if (existingList == null) \n {\n scoreList.push(nameTextB.value+\" - \"+scoreTime)\n localStorage.setItem(\"uScore\", JSON.stringify(scoreList));\n }\n \n else \n {\n scoreList=JSON.parse(localStorage.getItem(\"uScore\"));\n scoreList.push(nameTextB.value+\" - \"+scoreTime)\n localStorage.setItem(\"uScore\", JSON.stringify(scoreList));\n } \n}", "function saveScore(){\n /* standardize value provided in initials field */\n var initials = initialsEl.value.toUpperCase();\n initials.trim();\n \n /* validation to prevent blank form entry */\n if (initials === \"\"){\n alert(\"Please provide initials\");\n // saveScore;\n } else {\n var highscores;\n\n /* Get any highscores present in local storage */\n if (JSON.parse(localStorage.getItem(\"highscores\")) != null) {\n highscores = JSON.parse(window.localStorage.getItem(\"highscores\"));\n \n /* if no high scores in local storage, create an empty array */\n } else {\n highscores = []\n }\n /* create an object for current completion */\n var newScore = {\n initials: initials,\n score: time,\n };\n\n /* Add object created for current completion to the end of the highscores array */\n highscores.push(newScore);\n \n /* Save highscores array to local storage as string */\n window.localStorage.setItem(\"highscores\",JSON.stringify(highscores));\n\n window.location.href = \"leaderboards.html\";\n }\n}", "function saveScores() {\n\n var initials = initialsEl.value.trim();\n\n if (initials !== \"\") {\n var highscores =\n JSON.parse(window.localStorage.getItem(\"highscores\")) || [];\n var newScore = {\n score: time,\n initials: initials\n };\n\n // store and puts into string\n highscores.push(newScore);\n window.localStorage.setItem(\"highscores\", JSON.stringify(highscores));\n\n // next page\n window.location.href = \"highscores.html\";\n \n }\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 endPageFunc() {\n\tconst mostRecentScore = localStorage.getItem(\"mostRecentScore\");\n\tfinalScore.innerText = mostRecentScore;\n\tconst highScores = JSON.parse(localStorage.getItem(\"highScores\")) || [];\n\tconst MAX_HIGH_SCORES = 5;\n\n\tusername.addEventListener(\"keyup\", function () {\n\t\tsaveScoreBtn.disabled = !username.value;\n\t});\n\n\tsaveScoreBtn.addEventListener(\"click\", function (e) {\n\t\te.preventDefault();\n\n\t\tscore = 0;\n\t\tconst scores = {\n\t\t\tscore: mostRecentScore,\n\t\t\tname: username.value,\n\t\t};\n\n\t\thighScores.push(scores);\n\n\t\thighScores.sort((a, b) => b.score - a.score);\n\t\thighScores.splice(5);\n\t\tlocalStorage.setItem(\"highScores\", JSON.stringify(highScores));\n\n\t\tendPage.classList.add(\"hidden\");\n\t\thomePage.classList.remove(\"hidden\");\n\t\tscoreText.innerHTML = \"0\";\n\t});\n}", "clearScores(){\n let scores=JSON.parse(localStorage.getItem(document.title+\"game-1-scores\"));\n if (scores){\n localStorage.setItem(document.title+'game-1-scores',JSON.stringify([]));\n window.location.href = \"/games\";\n }\n \n }", "function pageRedirect() {\n var initials = document.querySelector(\"#initials\").value;\n\n if (initials) {\n saveScoreInLocalStorage();\n window.location.href = \"high-scores.html?\";\n } else {\n alert(\"Please provide your initials\");\n }\n}", "function initialsSave() {\n const initials = document.querySelector(\"#initials\");\n let initializer = initials.value.trim();\n if (initializer !== \"\") {\n let highScores = JSON.parse(window.localStorage.getItem(\"high-scores\")|| \"[]\");\n\n let newScore = {\n score: secondsLeft,\n initials: initializer,\n }\n\n highScores.push(newScore);\n window.localStorage.setItem(\"high-scores\", JSON.stringify(highScores));\n window.location.href = \"index.html\";\n }\n}", "function playerScore(num1){\r\n \r\n if(num1 == 1){\r\n sessionStorage.userScore = Number(sessionStorage.userScore) + 1;\r\n }\r\n else{\r\n sessionStorage.userScore = Number(sessionStorage.userScore) + 0;\r\n }\r\n\r\n document.getElementById('pScore').innerHTML = sessionStorage.userScore;\r\n}", "function compareScore() {\n if (localStorage.getItem(\"bestScore\") !== 0) {\n if (level > localStorage.getItem(\"bestScore\")) {\n localStorage.setItem(\"bestScore\", level);\n }\n }\n}", "function endGame() {\n\n console.log(\"end game\");\n $(\".container\").addClass('hide');\n highScoreLink.removeClass('hide');\n score = sec;\n let userName = prompt(\"please enter a username\");\n if (score > localStorage.getItem(\"score\")) {\n localStorage.setItem(\"user\", userName);\n localStorage.setItem(\"score\", score);\n }\n // localStorage.setItem(\"user\", userName);\n // localStorage.setItem(\"score\", score);\n}", "function submitScore() {\n var inputNameEl = document.getElementById(\"score-name\");\n localStorage.setItem(\"name\", inputNameEl.value);\n localStorage.setItem(\"score\", timeLeft);\n}", "startScoreCounter() {\n // variable to track level\n let levelTracker = 0;\n // set interval to increase the score, update the level tracker by each interval\n // enemy speed will increase by .05 every 15 seconds\n this.scoreInterval = setInterval(() => {\n // get the elements for the score to update\n // on first load of the game on the browser, highscore will not exist\n // in local storage, set high score to 0 in this case\n let highScoreDisplay = document.querySelector(\".high-score\");\n let highScore = localStorage.getItem(\"highScore\");\n highScoreDisplay.innerHTML = highScore\n ? \"High Score: \" + highScore\n : \"High Score: \" + 0;\n let scoreDisplay = document.querySelector(\".your-score\");\n scoreDisplay.innerHTML = \"Your Score: \" + this.score;\n this.score++;\n levelTracker++;\n // Setinterval is called every .5 second so levelTracker / 30 = 15 seconds\n if (levelTracker > 29 && levelTracker % 30 === 0) {\n this.speedIncrementor += 0.05;\n let levelDisplay = document.querySelector(\".level-number\");\n levelDisplay.innerHTML = \"Level \" + (levelTracker / 30 + 1);\n let levelContainer = document.querySelector(\".level-container\");\n levelContainer.style.display = \"block\";\n // Briefly show the level on the screen\n setTimeout(() => {\n levelContainer.style.display = \"none\";\n }, 1500);\n }\n }, 500);\n }", "function scoredisplay(){\r\n scorepage.style.display = \"block\";\r\n quiz.style.display = \"none\";\r\n timer.style.display = \"none\";\r\n let scorePercent = Math.round(100 * score/questions.length);\r\n scorealert.innerHTML = \"<h2>\" + \"Your score is\" + \" \" + scorePercent + \"%\" + \"</h2>\";\r\n record();\r\n }", "function scorePage(theirInitials, theirScore) {\n let userData = {\n personInitials: theirInitials,\n userScore: theirScore\n };\n allScores.push(userData);\n localStorage.setItem('userData', JSON.stringify(allScores));\n location.href = \"highScore.html\";\n}", "function resetScore(){\n localStorage.removeItem('game1HighScore');\n highScoreBoard.textContent='HIGH SCORE: ' + 0;\n}", "function logHiScore() {\n var playerName = document.querySelector(\"#init\").value;\n var score = timeLeft + 100;\n if (playerName === \"\") {\n alert(\"You must place your initals to save your score!\")\n return;\n } else {\n localStorage.setItem('name', playerName);\n localStorage.setItem('score', score);\n console.log(playerName);\n console.log(score);\n }\n qDisplay.textContent = \"Thank you for saving your score!\"\n}", "function scores() {\n\tlet password = document.getElementById('password').value\n\tif (password === 'ClockGame123') {\n\t\twindow.location.replace('data/scores.html')\n\t}\n}", "function endQuiz(){\n clearInterval(myTimer);\n countdown.innerHTML = \"Quiz Over\";\n localStorage.setItem('score', timeleft)\n \n //hide questions\n showQuestions.setAttribute(\"hidden\", \" \");\n\n // show scorepage\n scorePage.removeAttribute('hidden');\n scorePage.innerHTML = `\n <div class =\"container justify-items-centre m-5 col\"> \n <p> Your score is: '${timeleft}' </p>\n <input id=\"initials\" type=\"text\" class=\"form-control\" type=\"text\" placeholder=\"Enter Initials\"> \n </input>\n <button value ='Submit' type=\"submit\" id ='submitInitials' class ='btn btn-primary m-2' onclick =\"submitData()\"> \n Submit \n </button>\n </div>`\n}", "function finishQuiz() {\n clearInterval(intervalId);\n var body = document.body;\n body.innerHTML = \" All Done, You have scored \" + count;\n\n //created form to write iniitials\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"post\");\n form.setAttribute(\"action\", \"submit.php\");\n\n var initials = document.createElement(\"input\");\n initials.setAttribute(\"type\", \"text\");\n initials.setAttribute(\"placeholder\", \"Enter your Initials\");\n\n var submit = document.createElement(\"input\");\n submit.setAttribute(\"type\", \"submit\");\n submit.setAttribute(\"value\", \"Submit\");\n\n form.appendChild(initials);\n form.appendChild(submit);\n body.appendChild(form);\n\n // event listener to capture initials and local storage for initials and score\n // submit.addEventListener(\"click\", function (event) {\n\n\n // var initials = createInput.value;\n\n // if (initials === null) {\n\n // console.log(\"No value entered!\");\n\n // } else {\n // var finalScore = {\n // initials: initials,\n // score: timeRemaining\n // }\n // console.log(finalScore);\n\n // var scores = localStorage.getItem(\"scores\");\n // if (scores === null) {\n // scores = [];\n // } else {\n // scores = JSON.parse(scores);\n // }\n // scores.push(finalScore);\n\n // }\n // var newScore = JSON.stringify(scores);\n // localStorage.setItem(\"scores\", newScore);\n // // Travels to final page\n // window.location.replace(\"./highscore.html\");\n // }\n\n // });\n\n\n}", "function countplus() {\n var time = 10;\n var cookieName = \"temp_value\";\n var timer = document.getElementById(\"timer\");\n var temp_value = getCookie(cookieName) ? getCookie(cookieName) : time;\n timer.innerHTML = \"Time Remaining: \" + convertTimer(temp_value--);\n document.cookie = \"temp_value=\" + (temp_value);\n if (temp_value == 0) {\n location.href = \"Result\"\n document.cookie = \"temp_value=\" + time;\n }\n}", "function recordScores (name){\n if (score > localStorage.getItem(name)) {\n localStorage.setItem(name, score);\n newHighScore.textContent = `You've set a new record score of ${localStorage.getItem(name)}!`;\n }\n else if (score < localStorage.getItem(name)) {\n newHighScore.textContent = `The record score to beat is: ${localStorage.getItem(name)}`;\n } \n}", "function quizTimer(duration, display) {\n var quizTimer1 = duration, seconds;\n setInterval(function () { \n debugger;\n seconds = parseInt(quizTimer1 % 60, 10);\n // if (quizTimer1 == 0) {\n // seconds = 60;\n // }\n\n if (foo == 1) {\n seconds -= 20;\n quizTimer1 -= 20;\n foo = 0;\n }\n\n globalseconds = seconds;\n\n // Log seconds to HTML\n display.textContent = \"Time Left: \" + seconds;\n console.log(seconds);\n\n if (--quizTimer1 < 0) {\n document.location.href = \"finalscore.html\";\n }\n }, 1000)\n}", "function refreshPage() {\n window.location.reload();\n}//added function to in case user wants a empty score tally", "function setHighScore(currentScore) {\n if (currentScore + 1 > highScore) {\n localStorage.setItem(\"highScore\", currentScore);\n }\n}", "function highScorePage() {\n var enterInitials = document.getElementById(\"enterInitials\");\n finalScore = finalScore + timeLeft;\n\n var player = {\n initials: enterInitials.value,\n score: finalScore\n }\n var retrieveScores = localStorage.getItem(\"player\");\n var players = JSON.parse(retrieveScores);\n if (players !== null){\n players.push(player)\n }\n else players = [player]\n localStorage.setItem(\"player\", JSON.stringify(players))\n window.location.replace(\"./highscore.html\") \n}", "function setScore() {\n localStorage.setItem(\"highscore\", score);\n localStorage.setItem(\"highscoreName\", document.getElementById(\"name\").value);\n \n getScore()\n\n }", "function remainingLives() {\n if (vaisseau.userData.lifes == 3) {\n lifesId.innerHTML = '&#x2665;&#x2665;&#x2665;' ;\n }else if (vaisseau.userData.lifes == 2) {\n lifesId.innerHTML = '&#x2665;&#x2665;' ;\n }else if (vaisseau.userData.lifes == 1) {\n lifesId.innerHTML = '&#x2665;' ;\n }else{\n lifesId.innerHTML = '' ;\n stopScore = false;\n gameOverId.style.display = 'block';\n restartButton.style.display = 'block';\n //une fois la partie perdue, on verifie si le score acquis est plus grand que l'actuel meilleur score\n if (vaisseau.userData.score > localStorage.getItem('bestscore')) {\n bestScoreId.innerHTML = 'Best Score : ' + vaisseau.userData.score;\n //Si le score est plus grand, il sera enregistré dans la mémoire locale du navigateur\n localStorage.setItem('bestscore', vaisseau.userData.score)\n }else if(vaisseau.userData.score <= localStorage.getItem('bestscore')){\n bestScoreId.innerHTML = 'Best Score : ' + localStorage.getItem('bestscore');\n }\n //arrete l'animanition quand on n'a plus de vies\n animationFrame.cancelAnimationFrame();\n }\n}", "function timer()\n{\n count=count-1;\n if (count <= 0)\n {\n \tlocation.reload();\n \t// Every 1000 it heads down by one\n clearInterval(counter);\n //counter ended, do something here\n return;\n }\n\n\t$(\"#Timer\").text(count);\n}", "function saveGameOverScoreOnLocalStorage(){\n\t\t//var gameOverScore = $(\"#score\").val();\n\t\tvar gameOverScore = parseInt($(\"#score\").html());\n\t\twindow.localStorage.setItem(\"local-storage-game-over-score\", gameOverScore);\n\t}", "function healthSubmit() {\n healthSquareHold.classList.add(\"hide\");\n if (typeof(Storage) !== \"undefined\") {\n if (localStorage.clickcountHealth) {\n localStorage.clickcountHealth = Number(localStorage.clickcountHealth)+1;\n } else {\n localStorage.clickcountHealth = 1;\n }\n if (healthCount >= 2) {\n healthResults.innerHTML = `\n <h3 class=\"results\">Congrats! </h3>\n <p>Good Job! Your Streak Is At ` + localStorage.clickcountHealth + ` Days!</p>\n `\n } else {\n healthResults.innerHTML = `\n <p>That's Okay, You Lost Your Streak Of ` + localStorage.clickcountHealth + ` But You Can Try Again!</p>\n `\n localStorage.clickcountHealth = 0;\n }\n } else {\n document.getElementById(\"healthSquareHold\").innerHTML = \"Sorry, your browser does not support web storage...\";\n }\n}", "function endQuiz(){\r\n clearInterval(counterStart);\r\n // Prevent user from skipping this part.\r\n do{\r\n input = prompt(\"Quiz is over! Please type your initials to save your score.\");\r\n }while(input == null || input == \"\" );\r\n \r\n // Pass results onto local storage.\r\n var storeResults = \"{\\\"Initials\\\": \\\"\" + input + \"\\\",\" +\r\n \"\\\"Score\\\":\"+ \"\\\"\" + correct + \"\\\"\"\r\n + \"}\";\r\n\r\n localStorage.setItem('pastString', storeResults);\r\n housekeeping();\r\n window.location.href = \"index.html\";\r\n\r\n}", "function countTime() {\n\tdocument.getElementById(\"time\").innerHTML = \"Vreme: \" + ++ value;\n\tif (value == list[0].vreme) {\n\t\tconsole.log(\"Kraj igre...\");\n\t\tlocalStorage.setItem('allAnswersLs', JSON.stringify(allAnswers));\n\t\tstop();\n\t\tfinishGame();\n\t}\n}", "function save_score(mode, score) {\n\told_score = getCookie(mode);\n\tif (old_score === \"\")\n\t\tsetCookie(mode, score, 5000); \n\telse \n\t\tsetCookie(mode, parseInt(old_score) + score, 5000); \t\n}", "function storeScore() {\n localStorage.setItem(\"highscore\", score);\n\n localStorage.setItem(\"highscoreName\", document.getElementById(\"name\").value);\n\n getScore();\n}", "function initialQuiz() {\n console.log(\"Page reloaded.\");\n quizLayout.innerHTML = \"Answer all the questions within the time limit! Incorrect answers will subtract \" + PENALTYTIME + \" seconds from the time.\";\n startBtn.style.display = \"visible\";\n\n // retrieve high scores lists from local storage.\n let storedHighScoresArray = JSON.parse(localStorage.getItem(\"highestScoresArray\"));\n if (storedHighScoresArray !== null) {\n highestScores = storedHighScoresArray;\n }\n let storedHighScoreList = JSON.parse(localStorage.getItem(\"storedHighScoreList\"));\n if (storedHighScoreList !== null) {\n highScoresObj = storedHighScoreList;\n }\n}", "function clearScores() {\n localStorage.clear();\n location.reload();\n}", "function playClicked() {\n\n var playerPoints = cookie.get('points');\n\n if (playerPoints > 0) {\n\n var counter = \"-1\";\n var xhr = new XMLHttpRequest();\n xhr.addEventListener('load', () => {\n counter = xhr.response;\n const winnings = assessWinnings(counter);\n registerWinnings(winnings);\n })\n\n const url = window.location.href;\n const wholePath = url + 'secretpathforcounterfetching'; \n xhr.open('GET', wholePath);\n xhr.send();\n }\n\n\n}" ]
[ "0.7922412", "0.779823", "0.719319", "0.71331716", "0.70923203", "0.7045898", "0.7019843", "0.7007919", "0.6997191", "0.6897528", "0.6842901", "0.68145645", "0.6765177", "0.6726712", "0.6721546", "0.6673309", "0.66393614", "0.66359216", "0.66107833", "0.66024625", "0.65955293", "0.6585085", "0.65763915", "0.6538902", "0.6538462", "0.6535986", "0.6525392", "0.6524145", "0.65085375", "0.6507599", "0.64983743", "0.6494769", "0.648166", "0.6478669", "0.64774334", "0.64736336", "0.6462799", "0.6454595", "0.64428085", "0.6432789", "0.6432001", "0.64257836", "0.6422273", "0.64064974", "0.640531", "0.6391041", "0.638372", "0.6379955", "0.6374977", "0.636703", "0.6361976", "0.6359616", "0.63582283", "0.63556796", "0.63504314", "0.6344467", "0.63414705", "0.6340858", "0.63309306", "0.6330588", "0.6329859", "0.6321559", "0.632108", "0.63201505", "0.6314907", "0.6308771", "0.6308309", "0.63060415", "0.63050663", "0.6302399", "0.62969136", "0.6291122", "0.62816525", "0.62793136", "0.6270259", "0.6265016", "0.6259024", "0.6256805", "0.6256542", "0.6255851", "0.62548965", "0.6248811", "0.6247305", "0.6245906", "0.62439233", "0.6243631", "0.624187", "0.62409157", "0.6239755", "0.6239711", "0.6239343", "0.62326187", "0.6230935", "0.6223667", "0.6217667", "0.6216352", "0.62077206", "0.6206461", "0.6203785", "0.6194832" ]
0.6926619
9
retrieves sound preference data from Local Storage
function getSoundFromLocalStorage() { // if localStorage exists if (localStorage.length > 0) { // retrieve, parse, assign to array of objects soundChoice = JSON.parse(localStorage.getItem('soundPref')); } else { } return soundChoice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function music(){\n if (localStorage.getItem('musicvar') === \"on\"){\n document.getElementById(\"backgroundsound\").pause();\n document.getElementById(\"pauser\").style.display=\"block\";\n document.getElementById(\"player\").style.display=\"none\";\n localStorage.setItem('musicvar', \"off\");\n }\n else {\n document.getElementById(\"backgroundsound\").play();\n document.getElementById(\"player\").style.display=\"block\";\n document.getElementById(\"pauser\").style.display=\"none\";\n localStorage.setItem('musicvar', \"on\");\n }\n}", "function retrieveAndSetPreference(){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n if(localStorage.guddi_ca_xkcd_user_preference){\n var userPreferenceRetrieved = JSON.parse(localStorage.getItem(\"guddi_ca_xkcd_user_preference\"));\n totWords.value = userPreferenceRetrieved[0];\n totSpChars.value = userPreferenceRetrieved[1];\n totNumbers.value = userPreferenceRetrieved[2];\n useSeparator.value = userPreferenceRetrieved[3];\n wordCase.value = userPreferenceRetrieved[4];\n savePreference.checked = userPreferenceRetrieved[5];\n } //End of inner IF\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of outer IF\n }", "function getSoundSettings() {\n var cookieSplit = document.cookie.split(';');\n \n let sound = \"\";\n for (let i = 0; i < cookieSplit.length; i++) {\n let indivCookie = cookieSplit[i];\n while (indivCookie.charAt(0) == ' ') {\n indivCookie = indivCookie.substring(1);\n }\n if (indivCookie.indexOf(\"sound\") == 0) {\n sound = indivCookie.substring(6, indivCookie.length);\n }\n }\n \n if (sound == \"\") {\n return 0;\n } else {\n return (sound === \"true\");\n }\n}", "function loadFavoritesFromLocalStorage() {\n favorites = getFromLocalStorage(\"favorites\");\n}", "function get_mood_song(mood_id) {\n console.log(\"inside get_mood_song, mood_id: \", mood_id);\n\n if (mood_id == \"happy_emoji\") {\n chrome.storage.local.get([\"happy_song_url\"], function (result) {\n song_url = result.happy_song_url;\n console.log(\"retrieved\", song_url, \"for\", mood_id);\n });\n } else if (mood_id == \"sad_emoji\") {\n chrome.storage.local.get([\"sad_song_url\"], function (result) {\n song_url = result.sad_song_url;\n console.log(\"retrieved\", song_url, \"for\", mood_id);\n });\n } else if (mood_id == \"tired_emoji\") {\n chrome.storage.local.get([\"tired_song_url\"], function (result) {\n song_url = result.tired_song_url;\n console.log(\"retrieved\", song_url, \"for\", mood_id);\n });\n } else if (mood_id == \"cute_emoji\") {\n chrome.storage.local.get([\"cute_song_url\"], function (result) {\n song_url = result.cute_song_url;\n console.log(\"retrieved\", song_url, \"for\", mood_id);\n });\n } else if (mood_id == \"content_emoji\") {\n chrome.storage.local.get([\"content_song_url\"], function (result) {\n song_url = result.content_song_url;\n console.log(\"retrieved\", song_url, \"for\", mood_id);\n });\n } else if (mood_id == \"excited_emoji\") {\n chrome.storage.local.get([\"excited_song_url\"], function (result) {\n song_url = result.excited_song_url;\n console.log(\"retrieved\", song_url, \"for\", mood_id);\n });\n }\n\n return song_url;\n}", "function loadLocalSettings() {\n if (typeof (window.localStorage) === 'undefined') {\n console.log(\"Local settings cannot be saved. No web storage support!\");\n return;\n }\n\n if (typeof (localStorage.favoritePresets) !== 'undefined' && localStorage.favoritePresets !== null) {\n favoritePresetID = JSON.parse(localStorage.favoritePresets);\n console.log(\"Loading Parameter [localStorage.favoritePresets]:\");\n console.log(favoritePresetID);\n }\n\n if (typeof (localStorage.currentAddress) !== 'undefined' && localStorage.currentAddress !== null) {\n address = localStorage.currentAddress;\n console.log(\"Loading Parameter [localStorage.currentAddress]:\");\n console.log(address);\n }\n}", "function getStoredSelectedPlaylists(){\n chrome.storage.local.get({storedPlaylists: []}, function (result) {\n console.log(\"Getting playlists\");\n var pluginContainer = document.getElementById(\"vibe-playlist-container\");\n if(result.storedPlaylists.length > 0){\n console.log(\"Foound playlists\");\n selectedPlaylists = result.storedPlaylists; \n getCheckedPlaylists();\n loadPlaylistsOnPage();\n }\n else if(pluginContainer != null){\n console.log(\"No playlists found\");\n pluginContainer.parentNode.removeChild(pluginContainer);\n }\n else{\n console.log(\"Can not run \" + result.storedPlaylists);\n }\n });\n}", "function getPlayerData(plyId)\n {\n var playId = plyId;\n localStorage.setItem(\"playerID\",playId);\n }", "function getSavedData() {\n chrome.storage.sync.get({\n data: SAMPLE_DATA,\n }, function (saved) {\n data = saved.data;\n });\n}", "function getLocalStorage() {\n const favLocal = JSON.parse(localStorage.getItem(\"favorite\"));\n return favLocal;\n}", "function musicSave(){\nmusic = localStorage.getItem(\"music\");\nif(music == \"off\"){\ndocument.getElementById(\"musicSett\").checked = true;}}", "function getPlayerData() {\n var storedPlayerInitials = JSON.parse(localStorage.getItem(\"player-initials\"));\n if (storedPlayerInitials !== null) {\n playerInitials = storedPlayerInitials;\n }\n var storedPlayerScores = JSON.parse(localStorage.getItem(\"player-scores\"));\n if (storedPlayerScores !== null) {\n playerScores = storedPlayerScores;\n }\n}", "function loadFromStorage() {\n var favs = storage.getItem(\"favs\");\n if (favs) {\n favs = JSON.parse(favs);\n } else {\n favs = [];\n }\n return favs;\n }", "function restore_options() {\n chrome.storage.sync.get({\n moodPredict: true,\n recommendedContent: true,\n moodUpdate: 'weekly'\n }, function(items) {\n document.getElementById('moodPredict').checked = items.moodPredict;\n document.getElementById('recommendedContent').checked = items.recommendedContent;\n document.getElementById('moodUpdate').value = items.moodUpdate;\n });\n}", "function initAudio(){\n var volume=localStorage.getItem(SOUND_VOLUME),\n time=localStorage.getItem(SOUND_CURRENT_TIME);\n sound = new Howl({\n src: [\"../res/Exploration.wav\",],\n loop:true,\n });\n sound.play();\n sound.volume(volume);\n sound.seek(time);\n }", "function readUserPreferencesFromLocalStorage() {\n let userPrefences = readObjectFromLocalStorage(userPreferencesKeyInLocalStorage);\n if ( Object.keys(userPrefences).length > 0){\n return userPrefences;\n }\n return {\n favouriteMeals : [],\n favouriteAreas : [],\n }\n}", "function uploadMusic() {\n //returns array of music available for ringtone after reading from file, is used for \"tones\" array\n}", "readSoundLocation() {\n let soundUrl = document.getElementById(\"alarmSoundFileField\");\n soundUrl.value = Preferences.get(\"calendar.alarms.soundURL\").value;\n if (soundUrl.value.startsWith(\"file://\")) {\n soundUrl.label = gAlarmsPane.convertURLToLocalFile(soundUrl.value).leafName;\n } else {\n soundUrl.label = soundUrl.value;\n }\n soundUrl.style.backgroundImage = \"url(moz-icon://\" + soundUrl.label + \"?size=16)\";\n return undefined;\n }", "function getSong() {\r\n // This gets the random word from local storage\r\n var word = localStorage.getItem(\"word\");\r\n\r\n // This sets the URL for the ajax call\r\n var queryURL =\r\n \"https://api.spotify.com/v1/search?q=\" + word + \"&type=track&market=us\";\r\n\r\n // This gets the data from the SPOTIFY API\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\",\r\n headers: {\r\n Authorization: \"Bearer \" + localStorage.getItem(\"new token\"),\r\n },\r\n }).then(function (response) {\r\n // This creates a new var with the preview audio\r\n localStorage.setItem(\"song-src\", response.tracks.items[0].preview_url);\r\n song.src = localStorage.getItem(\"song-src\");\r\n song.volume = 0.2\r\n\r\n var isPlaying = false;\r\n\r\n // This changes the HTML with the data from the response\r\n $(\"#Song-name\").html(response.tracks.items[0].name);\r\n $(\"#artist\").html(response.tracks.items[0].artists[0].name);\r\n $(\"#song-cover\")[0].attributes[1].nodeValue =\r\n response.tracks.items[0].album.images[0].url;\r\n //Set Song and Artist elements in local storage to be fetch by the lyrics API\r\n var setSong = response.tracks.items[0].name;\r\n var setArtist = response.tracks.items[0].artists[0].name;\r\n\r\n console.log(setSong);\r\n console.log(setArtist);\r\n\r\n localStorage.setItem(\"Song\", setSong);\r\n localStorage.setItem(\"Artist\", setArtist);\r\n\r\n var play;\r\n\r\n // This plays the song\r\n $(\".fa-play-circle\").click(function () {\r\n console.log(song.src)\r\n if (isPlaying == false) {\r\n play = song.play();\r\n // This changes the play/pause icon\r\n $(\"#play-i\")[0].className = \"fas fa-pause-circle\";\r\n isPlaying = true;\r\n // Pause\r\n } else if (isPlaying == true) {\r\n song.pause();\r\n $(\"#play-i\")[0].className = \"fas fa-play-circle\";\r\n isPlaying = false;\r\n } \r\n\r\n \r\n });\r\n\r\n \r\n });\r\n}", "function record() {\r\n var storedScores = JSON.parse(localStorage.getItem(\"scores\"));\r\n \r\n if (storedScores !== null) {\r\n scores = storedScores;\r\n }\r\n \r\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 dev_play_sound() {\n\n\n player.src = \"\";\n\n\n $(\"div#time\").css(\"opacity\", \"0\")\n var selected_button = $(\"div#finder div:focus\")[0];\n if (selected_button != \"undefined\" && status != \"delete\") {\n var source = selected_button.getAttribute('data-content2');\n\n\n player.src = source\n player.play();\n //rember last played track\n localStorage.setItem('last_played_sound', selected_button.getAttribute('data-content'))\n\n\n\n //time duration\n $(player).on(\"loadedmetadata\", function() {\n\n setInterval(function() {\n var time = player.duration - player.currentTime;\n var percent = (player.currentTime / player.duration) * 100;\n var minutes = parseInt(time / 60, 10);\n var seconds_long = parseInt(time % 60, 10);\n var seconds;\n if (seconds_long < 10) {\n seconds = \"0\" + seconds_long;\n } else {\n seconds = seconds_long;\n }\n $(\"div#time\").text(minutes + \":\" + seconds);\n\n percent = percent + \"%\";\n\n $(\"div#finder div.active\").css({ background: 'linear-gradient(to right, orange ' + percent + ', white 0%)' })\n $(\"div#finder div.active\").css('color', 'black')\n\n }, 1000);\n\n\n });\n\n player.ondurationchange = function() {\n setTimeout(function() {\n $(\"div#time\").css(\"opacity\", \"1\");\n }, 2000);\n };\n\n\n }\n\n\n $('div.items').removeClass('active')\n $(\"div#finder div#app-list div.items\").css(\"background\", \"black\");\n $(\"div#finder div#app-list div.items\").css(\"color\", \"white\");\n $(\"div#finder div#app-list div.items:focus\").css(\"color\", \"black!Important\");\n $(\"div#finder div#app-list div.items:focus\").css(\"background\", \"white!Important\");\n\n $(selected_button).addClass('active')\n\n }", "get (key, callback) {\n chrome.storage.local.get(key, callback)\n }", "static getStorageData() {\n let storedBooks = JSON.parse(localStorage.getItem('storedBooks'));\n return storedBooks;\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}", "function loadTest() {\n loadMessage();\n clickedOnce = true;\n \n // Eventually this will read a value from the cookie.\n // For now, it will just instantiate the wordList array\n \n\t// This is used for testing purposes only.\n\t//wordList = [\"cat\", \"dog\", \"and\", \"a\", \"to\"];\n\n item = window.localStorage.getItem(\"wordList\");\n wordList = JSON.parse(item);\n console.log(wordList);\n loadCorrect();\n loadWrong();\n \tfor(var i = 0; i<wordList.length; i++) {\n\t\tvar soundFile = new Audio(\"audioFiles/\" + wordList[i] + \".mp3\");\n\t\tsoundFile.load();\n\t\taudioFiles[i] = soundFile;\n\t}\n\taudioFiles[0].addEventListener(\"canplaythrough\", clearMessage);\n\twhiteTextField();\n //doWord(wordList[currentWordIndex]);\n\t\n}", "function getLocalStorage() {\n if (localStorage.myLibrary !== \"[]\" && localStorage.myLibrary) {\n bookIdCount = JSON.parse(localStorage.bookIdCount);\n myLibrary = JSON.parse(localStorage.myLibrary)\n };\n}", "function retrieveData(key) {\n var retrieved = JSON.parse(window.localStorage.getItem(key));\n return retrieved;\n }", "addFavourite() {\n if (localStorage.music) {\n let musiclist = localStorage.music.split(',');\n musiclist.push(this.music.src);\n localStorage.music = musiclist;\n // sid\n let sidlist = localStorage.sid.split(',');\n sidlist.push(this.src_sid);\n localStorage.sid = sidlist;\n // picture\n let picturelist = localStorage.picture.split(',');\n picturelist.push(this.src_picture);\n localStorage.picture = picturelist;\n // singer\n let singerlist = localStorage.singer.split(',');\n singerlist.push(this.src_singerName);\n localStorage.singer = singerlist;\n // title\n let titlelist = localStorage.title.split(',');\n titlelist.push(this.src_musicName);\n localStorage.title = titlelist;\n } else {\n let musiclist = [];\n musiclist.push(this.music.src);\n localStorage.music = musiclist;\n\n // sid\n let sidlist = [];\n sidlist.push(this.src_sid);\n localStorage.sid = sidlist;\n // picture\n let picturelist = [];\n picturelist.push(this.src_picture);\n localStorage.picture = picturelist;\n // singer\n let singerlist = [];\n singerlist.push(this.src_singerName);\n localStorage.singer = singerlist;\n // title\n let titlelist = [];\n titlelist.push(this.src_musicName);\n localStorage.title = titlelist;\n }\n }", "function readFromLS(key) {\n \n if( !(\"localStorage\" in window) ) return;\n \n return window.localStorage.getItem(key); // podajemu co ma odczytac z LS\n \n }", "function getLocalStorage() {\n const localStorageFavorites = localStorage.getItem(\"favorites\");\n if (localStorageFavorites !== null) {\n favoritesList = JSON.parse(localStorageFavorites);\n }\n paintFavorites();\n}", "function getItemsFromLocalStorage() {\r\n notesCount = localStorage.getItem(\"count\");\r\n notesFromLocalStorage = JSON.parse(localStorage.getItem(\"notes\"));\r\n }", "getFavorites() {\n return JSON.parse(localStorage.getItem(\"spaceFavs\"));\n }", "function getFromLocalStorage(name) {\n return JSON.parse(localStorage.getItem(name));\n \n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.local.get({\n 'checkFrequency': 15000,\n 'notificationEnable': false,\n 'alertEnable': false,\n 'notificationTimeout': 30000,\n 'notificationEnableStatus': false,\n 'notificationEnablePlayers': false,\n 'notificationPlayerList': 'Banxsi, externo6, LukeHandle'\n }, function (items) {\n document.getElementById('checkFrequency').value = items.checkFrequency;\n document.getElementById('notificationEnable').checked = items.notificationEnable;\n document.getElementById('alertEnable').checked = items.alertEnable;\n document.getElementById('notificationTimeout').value = items.notificationTimeout;\n document.getElementById('notificationEnableStatus').checked = items.notificationEnableStatus;\n document.getElementById('notificationEnablePlayers').checked = items.notificationEnablePlayers;\n document.getElementById('notificationPlayerList').value = items.notificationPlayerList;\n });\n}", "firstTimePlay() {\n if (localStorage.getItem(\"playedBefore\") !== \"true\") {\n // User Global Settings\n localStorage.setItem(\"playedBefore\", \"true\");\n\n localStorage.setItem(\"registedInServer\", \"false\");\n localStorage.setItem(\"score\", 0);\n\n localStorage.setItem(\"musicConfig\", JSON.stringify({volume: 0.1, loop: true}));\n localStorage.setItem(\"VFXConfig\", JSON.stringify({volume: 0.1}));\n\n // format: [5, 5, 3, ...] where the first element is respective to chapter 1 and is the level the user has access to\n localStorage.setItem(\"levelsReached\", JSON.stringify([0]));\n\n // levels' scores\n localStorage.setItem(\"levelsScores\", JSON.stringify({}));\n\n // skins that user owns\n localStorage.setItem(\"skins\", JSON.stringify([\"player\"]));\n }\n }", "getSoundState() {\r\n return this.storeAccess.getAudibleSounds();\r\n }", "function getStorage(data)\n{\n return JSON.parse(localStorage.getItem(data))\n}", "static getFilmsFromStorage()\n {\n let films;\n if(localStorage.getItem('films') === null)\n {\n films = [];\n }else{\n films = JSON.parse(localStorage.getItem('films'));\n }\n return films;\n }", "function loadFavourites() {\n favouritesArray = JSON.parse(localStorage[\"favouritesArray\"]);\n}", "function showScores() {\n scoresObj = JSON.parse(localStorage.getItem('scoresObj'));\n console.log(scoresObj.scoresStr);\n alert(\"Current String:\"+scoresObj.scoresStr)\n}", "function getSettings(){\n if(localStorage.getItem('settings') !== null){\n settings = JSON.parse(localStorage.getItem('settings'));\n }\n}", "function getShoesFromStorage() {\r\n let shoes;\r\n\r\n //get the value if present in the storage, else return an empty array\r\n if (localStorage.getItem('shoes') === null) {\r\n shoes = [];\r\n } else {\r\n shoes = JSON.parse(localStorage.getItem('shoes'));\r\n }\r\n return shoes;\r\n}", "function prefsCallback(prefs, which)\r\n{\r\n\tsetSpeechRate(prefs.speechRate);\r\n\t\r\n\tif(!introducing)\r\n\t\tplayWindSound('wind', arrowRotation); //Adjust wind sound volumes, since wind sounds last so long (unless we are introducing the game)\r\n\t\r\n\tmasterVolume=prefs.volume;\r\n\tspeechVolume=prefs.speechVolume;\r\n\tsoundVolume=prefs.soundVolume;\r\n\t\r\n\t//Volume adjustment during long speeches and sounds\r\n\tif(introducing || givingHint || isFalling || playingFinishedSound || playingScoreSound || playingLivesLeft || isGameOver)\r\n\t\taudio.setProperty({name : 'volume', value : masterVolume*speechVolume, channel : (givingHint ? 'eighth' : 'default'), immediate : true});\r\n}", "function readLS(){\n let content = localStorage.getItem('hiScore');\n if(!content){ \n return [];\n }\n return JSON.parse(content); \n}", "function restore() {\n let soundboard = JSON.parse(window.localStorage.getItem(\"soundboard\"));\n if(soundboard) {\n soundboard.forEach(item => create(item.id, item.start));\n }\n}", "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 getPod()\n{\n \n var retrievedObject;\n var podcastList = null;\n \n if (localStorage.getItem('podcastData')){\n retrievedObject = localStorage.getItem('podcastData');\n console.log(\"retrieved object successfully\");\n podcastList = JSON.parse(retrievedObject);\n }\n \n else{\n console.log(\"no podcast data\");\n }\n \n return podcastList;\n}", "async fetchYourSoundtracks(ctx) {\n let docRef = await db.collection(auth.currentUser.uid).doc(ctx.getters.getSoundtracksId);\n let data = []\n await docRef.get().then(e => {\n data.push(e.data())\n });\n delete data[0].soundtracks;\n let resultArray = Object.keys(data[0]).map(function(key) {\n return [Number(key), data[0][key]];\n });\n resultArray.sort((a, b) => (a[1].soundtrackTitle > b[1].soundtrackTitle) ? 1 : -1)\n ctx.commit('setSoundtrackList', resultArray);\n localStorage.setItem('userSoundtracks', JSON.stringify(resultArray));\n }", "function retrieFromLocal(key){\n\tconsole.log(\"recovered\");\n\treturn JSON.parse(localStorage.getItem(key));\t\n}", "function getPokemon(){\n var storedPickedPokemon = JSON.parse(localStorage.getItem(\"picked pokemon\"));\n var storedWildPokemon = JSON.parse(localStorage.getItem(\"wild pokemon\"));\n var storedCaughtPokemon = JSON.parse(localStorage.getItem(\"caught pokemon\"));\n\n if (storedCaughtPokemon !==null){\n \n wildPokemon = storedWildPokemon;\n caughtPokemon = storedCaughtPokemon;\n }\n\n if (storedPickedPokemon !== null){\n pickedPokemon = storedPickedPokemon; \n }\n}", "function retrieveStockInfo(ticker){\n return JSON.parse(localStorage.getItem(ticker));\n}", "function playLullaby(path) {\n var songRef = storageRef.child(localStorage.getItem(\"userName\")+'/songs/' + path); //Reference to the file on storage\n\n songRef.getDownloadURL().then(function (url) { // Get the download URL\n songAudio = new Audio(url); //Create audio instance and Play\n playAudioFile();\n\n //add on ended event listener\n songAudio.onended = function () {\n console.log(\"lullaby is finished...\");\n isPlaying = false;\n };\n }).catch(function (error) {\n switch (error.code) {\n case 'storage/object_not_found':\n // File doesn't exist\n break;\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n case 'storage/canceled':\n // User canceled the upload\n break;\n case 'storage/unknown':\n // Unknown error occurred, inspect the server response\n break;\n }\n });\n}", "function onButtonClicked(){\n localStorage.setItem(SOUND_CURRENT_TIME,sound.seek());\n window.location.href=\"menu.html\";\n }", "function getStorage() {\r\n chrome.storage.local.get(null, function (data) {\r\n\t\tdocument.getElementById(\"pi_uri_base\").defaultValue = data.pi_uri_base;\r\n document.getElementById(\"api_key\").defaultValue = data.api_key;\r\n document.getElementById(\"max_time\").defaultValue = data.max_time;\r\n });\r\n}", "function GetSetting(key) {\n // Check if local storage is supported\n if (supports_html5_storage()) {\n // If it does then return the value.\n return localStorage.getItem(key);\n } else {\n alert(\"Browser does not support local storage!\")\n }\n}", "function loadPopSound(){\n var audio = new Audio('sounds/balloon-pop.mp3');\n audio.preload = \"auto\";\n $(audio).on(\"loadeddata\",start);\n return audio;\n}", "static load() { return JSON.parse(window.localStorage.getItem('settings')) || {}; }", "function load_settings() {\n chrome.storage.local.get(usedKeys, function (result) {\n enabled.checked = result[usedKeys[0]];\n interval.value = result[usedKeys[1]];\n });\n}", "load () {\n return JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]')\n }", "function getDataFromLocalStorage(){\n var students = JSON.parse(localStorage.getItem(\"students\"));\n return students;\n \n }", "function loadPreference(preference, defaultVar) {\n var savedItem = window.localStorage.getItem(preference);\n if (savedItem !== null) {\n if (savedItem === 'true') {\n window[preference] = true;\n } else if (savedItem === 'false') {\n window[preference] = false;\n } else {\n window[preference] = savedItem;\n }\n window.log('Setting found for ' + preference + ': ' + window[preference]);\n } else {\n window[preference] = defaultVar;\n window.log('No setting found for ' + preference +\n '. Used default: ' + window[preference]);\n }\n return window[preference];\n }", "function getNotes() {\n chrome.storage.local.get(['notes-keeper'], function(result) {\n loadNotes(result); //calling loadNotes(result) to display the data on screen\n });\n}", "function getPreferences() {\n return settings.get('preferences');\n}", "function getOptions() {\n chrome.storage.sync.get(['value'], function (status) {\n document.getElementById('toggle').checked = status.value;\n }); \n}", "function save_options() {\n var sound = document.getElementById('sound').value;\n var type = document.getElementById('type').value;\n browser.storage.sync.set({\n sound: sound,\n type: type\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = ' ';\n }, 750);\n });\n }", "function getScores() {\n var storedNames = JSON.parse(localStorage.getItem(\"names\"));\n var storedScores = JSON.parse(localStorage.getItem(\"scores\"));\n var storedTimes = JSON.parse(localStorage.getItem(\"times\"));\n\n if (storedNames !== null){\n names = storedNames;\n scores = storedScores;\n times = storedTimes;\n }\n\n}", "function musicMainScreen() {\n //Get the file and play it\n}", "function displayTickSoundValue() {\r\n\tif (localStorage.tickSoundInputValue === \"true\") {\r\n\t\ttickSoundInput.checked = localStorage.tickSoundInputValue;\r\n\t} else {\r\n\t\ttickSoundInput.checked = false;\r\n\t}\r\n}", "function getLocalCache() {\n chrome.storage.local.get(null, function(data) {\n if(data.schemaVersion != undefined) { // Check that local cache exists.\n whiteLister.whitelist = data.whitelist;\n sessionCache = data.session;\n console.log(data);\n if (data.paused === true) {\n sessionCache.global_status = \"paused\";\n chrome.storage.local.set({session: sessionCache}, function(){});\n } else {\n authTwingl.check();\n }\n } else {\n console.log(\"Nothing in local storage! Terminating extension.\")\n }\n })\n}", "function sound(click) {\n var mute = document.getElementById(\"mute\"), entry = {};\n \n // toggle muted boolean\n muted = !muted;\n mute.firstChild.classList.toggle(\"fa-volume-up\"), mute.firstChild.classList.toggle(\"fa-volume-off\");\n \n // change tooltip\n if (muted) {\n mute.title = \"Unmute\";\n } else {\n mute.title = \"Mute\";\n }\n \n if (click) {\n entry[\"muted\"] = muted;\n chrome.storage.sync.set(entry);\n }\n}", "function currentSong() {\n if ($.cookie(\"playlist\")){\n var i = +$.cookie(\"song_index\");\n var songs = $.cookie(\"playlist\").split(\",\");\n if (i === songs.length) {\n $.cookie(\"song_index\", 0);\n i = $.cookie(\"song_index\");\n };\n return songs[i];\n }\n else {return null}\n}", "loadFromLocal() {\n if (localStorage.getItem(\"alarmTime\")) {\n let alarmsJson= localStorage.getItem(\"alarmTime\");\n this.alarms = JSON.parse(alarmsJson);\n };\n if (localStorage.getItem(\"currentId\")) {\n let currentIdString = localStorage.getItem(\"currentId\");\n this.currentId = Number(currentIdString);\n } \n }", "function getFromStorage(key) {\n return JSON.parse(window.localStorage.getItem(key))\n}", "function getLocalStorage() {\n\treturn chrome.storage.local;\n}", "readStorage()\n {\n // Get the likes array from localStorage, converting it\n // back from JSON into an actual array like it's supposed\n // to be.\n const storage = JSON.parse(localStorage.getItem('likes'));\n\n // localStorage.getItem() will return null if there's no item\n // corresponding to the key that was passed in; we have to\n // check for this! Make sure there's actually something in\n // the storage variable.\n\n // Restore the persisted likes from localStorage into\n // our actual state.\n if (storage) this.likes = storage;\n }", "function getFSoundState() {\n\tconst storageFSound = localStorage.getItem('fsound');\n\treturn storageFSound ? storageFSound === 'true' : true;\n}", "function getFromLocalStorage(key) {\n\tvar item = localStorage.getItem(key);\n\tif(item) { \n\t\treturn item;\n\t}\n\telse {\n\t\tconsole.log(\"could not store \" + key);\n\t\treturn null;\n\t}\n}", "function getChosenItem(){\n $(\"#spinlabel\").html(localStorage.getItem(\"chosenItem\"));\n}", "useDefaultSound() {\n let defaultSoundUrl = \"chrome://calendar/content/sound.wav\";\n Preferences.get(\"calendar.alarms.soundURL\").value = defaultSoundUrl;\n document.getElementById(\"alarmSoundCheckbox\").checked = true;\n this.readSoundLocation();\n }", "function retrieveStoredHS() {\n var storedHS = JSON.parse(localStorage.getItem(\"highScores\"));\n\n if (storedHS !== null) {\n highScores = storedHS;\n }\n\n renderHS();\n }", "function promptSpeech() {\n\t// Prompt the user to speak.\n\ticon.src = \"images/mic.png\";\n\ttext.innerHTML = \"Speak now\";\n\t// If enabled, play a sound.\n\tchrome.storage.sync.get({\n\t\tsounds: defaultSettings.sounds\n\t}, function(settings) {\n\t\tif(settings.sounds) {\n\t\t\tdocument.getElementById(\"startSound\").play();\n\t\t}\n\t});\n}", "function chromeStorageGet(keys, callback) {\r\n window.chrome.storage.local.get(keys, callback);\r\n }", "function storageGet(callback) {\n chrome.storage.sync.get([\"zillowHouseHide\"], result => {\n console.log(result);\n callback(result.zillowHouseHide);\n });\n}", "function getNoteData(){\n return JSON.parse(localStorage.getItem(\"notes\")) || {};\n}", "function getStoredGifs () {\n // if gifs array is stored in localStorage, retrieve and parse\n if (localStorage.getItem('gifs')) {\n return JSON.parse(localStorage.getItem('gifs'));\n } else {\n return []; // array for holding gifs\n }\n }", "getData(name) {\n\t\tlet data;\n\t\tif (localStorage.getItem(name) === null) {\n\t\t\tdata = [];\n\t\t} else {\n\t\t\tdata = JSON.parse(localStorage.getItem(name));\n\t\t}\n\t\treturn data;\n\t}", "getStoredSettings(level) {\n if (window.localStorage && window.localStorage.getItem(`SNAKE_SETTINGS_${level}`)) {\n let settings = new Settings(level, JSON.parse(window.localStorage.getItem(`SNAKE_SETTINGS_${level}`)));\n return settings;\n } else {\n return null;\n }\n }", "function loadSettings () {\n storage.get(vatobeStorage, function (error, data) {\n if (error) throw error\n // load storage into app state\n var intervalRange = data.intervalRange || data.interval // for backwards compatibility\n appState.interval = convertRangeToMillis(intervalRange)\n appState.speak = data.speak\n appState.notification = data.notification\n // match UI to the stored settings\n range.value = data.intervalRange\n speak.checked = data.speak\n notification.checked = data.notification\n })\n}", "retrieveFromLocalStorage(difficulty, rank) {\n return JSON.parse(localStorage.getItem(`${difficulty}_${rank}`));\n }", "function readStorage() {\n\tstudentGrade = localStorage.getItem(\"Student Grade:\");\n\tstudentGender = localStorage.getItem(\"Student Gender:\");\n\tstudentClub = localStorage.getItem(\"Student Club:\");\n\tstudentNumber = localStorage.getItem(\"Student Number:\");\n\tannTitle = JSON.parse(localStorage.getItem(\"AnnTitle:\"));\n\tannDetails = JSON.parse(localStorage.getItem(\"AnnDetails:\"));\n\tannGrade = JSON.parse(localStorage.getItem(\"AnnGrade:\"));\n\tannGender = JSON.parse(localStorage.getItem(\"AnnGender:\"));\n\tannClub = JSON.parse(localStorage.getItem(\"AnnClub:\"));\n\tannStudentNumber = JSON.parse(localStorage.getItem(\"AnnStudentNumber:\"));\n\tannDateTime = JSON.parse(localStorage.getItem(\"AnnDateTime:\"));\n}", "function restoreSettings() {\n function setCurrentChoice(result) {\n if(result !== undefined && result.insert !== undefined && result.insert !== \"\"){\n document.getElementById('cmn-toggle-1').checked = result.insert;\n }\n else{\n console.log(\"No Settings Found\");\n return null;\n }\n }\n\n chrome.storage.local.get(\"insert\", setCurrentChoice);\n chrome.storage.local.get(\"lang\", function(result) {\n if(result !== undefined && result.lang !== undefined && result.lang !== \"\") {\n lang = result.lang;\n updateStrings();\n var select = document.getElementById('lang-sel').value = result.lang;\n }\n });\n}", "function LocalSettingStorage() {\n}", "readStorage() {\n const storage = JSON.parse(localStorage.getItem('likes')); \n\n // Restoring like from the localStorage\n if (storage) this.likes = storage;\n }", "function successSoundMove(entry) {\n localStorage.setItem('soundpath', entry.toURL())\n var _sound = localStorage.getItem('soundpath')\n console.log(\"k = \" +k)\n db.transaction(function(tx) {\n tx.executeSql(\"UPDATE maintable SET sound = \"+ \"'\"+_sound +\"'\"+\" WHERE id = \"+ k);\n }, function(error) {\n console.log('Update Sound ERROR: ' + error.message + error.code);\n }, function() {\n console.log('Update Sound OK');\n }\n )\n\n db.transaction(function(tx) {\n tx.executeSql(\"SELECT sound FROM maintable WHERE id = \" + k, [], function(tx, rs) {\n var len = rs.rows.length;\n console.log(len + \" rows found.\");\n imgarray[i].nextElementSibling.src = rs.rows.item(0).sound\n }, function(tx, error) {\n console.log('SELECT Sound error: ' + error.message);\n })\n })\n }", "function getPimpedList() {\n\treturn JSON.parse(sessionStorage.getItem(pimpedStorage));\n}", "function soundChoice() {\n\t\t\tvar sb;\n\t\t\tif (soundSelectorElem.selectedIndex <1) return; // we added a \"blank\" to the selector list.\n\t\t\tvar pathToLoad = \"jsaSound/\" + soundList[soundSelectorElem.selectedIndex-1].fileName;\n\t\t\tloadSoundFromPath(pathToLoad);\n\t\t}", "function getSound() {\n return tdInstance.sound();\n }", "async onLoad(options) {\n this.setData({\n postList\n })\n wx.setStorageSync('flag', true);\n wx.getStorage({\n key: 'flag'\n }).then((val) => {\n console.log(val)\n })\n console.log(await wx.getStorage({ key: 'flag'}))\n }", "function restore_options() {\n\n chrome.storage.local.get(null, function (result) {\n\n document.getElementById('wpmSetting').value = result.rapidReadWPM;\n document.getElementById('chunkSizeSetting').value = result.rapidReadChunkSize;\n \n});\n}" ]
[ "0.65890175", "0.64682657", "0.64596266", "0.62830764", "0.6206682", "0.6203028", "0.6188775", "0.6179075", "0.61480856", "0.6123198", "0.6116882", "0.60905904", "0.6012607", "0.60101295", "0.60061425", "0.60045826", "0.594584", "0.5944852", "0.59231675", "0.5918354", "0.58910865", "0.58841383", "0.58751243", "0.58670926", "0.5852432", "0.58430374", "0.58416104", "0.58410513", "0.58407277", "0.5838794", "0.58350396", "0.5828091", "0.58273405", "0.581558", "0.58155763", "0.5815483", "0.5807614", "0.580203", "0.5800948", "0.5800818", "0.57940865", "0.5792677", "0.5791541", "0.57773983", "0.57745457", "0.5769044", "0.5767562", "0.5764494", "0.5757223", "0.57386637", "0.5735007", "0.57348645", "0.5734683", "0.5731372", "0.57259685", "0.5725653", "0.57252127", "0.5718032", "0.571593", "0.57101756", "0.5708343", "0.5702591", "0.569753", "0.56917864", "0.56889117", "0.5686814", "0.56808686", "0.5678944", "0.5672983", "0.5671655", "0.56636614", "0.56579036", "0.5656273", "0.5641957", "0.56363934", "0.5635052", "0.5633748", "0.56317616", "0.5630787", "0.5629615", "0.5626764", "0.5623302", "0.5622635", "0.5614351", "0.56034356", "0.55972", "0.55904835", "0.55888796", "0.5582543", "0.55785626", "0.5578484", "0.5574929", "0.5571143", "0.5570574", "0.5569958", "0.5567915", "0.55635285", "0.55607885", "0.55544984", "0.5549578" ]
0.82418525
0
eslintdisable linebreakstyle / eslintdisable react/proptypes Bootstrap Local Imports
function format(num) { return num != null ? num.toString() : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend (config, { isDev, isClient }) {\n /*\n // questo linta ogni cosa ad ogni salvataggio\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }*/\n }", "extend(config, ctx) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }", "import() {\n }", "babelConfig() {\n return {\n presets: ['@babel/preset-react']\n };\n }", "function App() {\n return (\n //JSX=>needs to import React\n <div >\n Hello Worldfff\n </div>\n );\n}", "extend (config, ctx) {\n // if (ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n // options: {\n // fix: true\n // },\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // muse设置\n config.resolve.alias['muse-components'] = 'muse-ui/src'\n config.resolve.alias['vue$'] = 'vue/dist/vue.esm.js'\n config.module.rules.push({\n test: /muse-ui.src.*?js$/,\n loader: 'babel-loader'\n })\n }", "extend(config) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "dependencies() {\n return ['@babel/preset-react'];\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n }\n }", "extend(config, {\n isDev,\n isClient\n }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "function App() {\n return (\n <div className=\"App\">\n {/*<Table />*/}\n <Sticky />\n {/*<TableExamplePagination />*/}{/*https://www.geeksforgeeks.org/reactjs-importing-exporting/*/}\n {/*<Scroll />*/}\n </div>\n );\n}", "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n })\n }\n }", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "function hooks() {\n \"use strict\";\n}", "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }\n }", "function SeamonkeyImport() {}", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "static get propTypes() {\n return {\n config: React.PropTypes.object,\n test: React.PropTypes.string,\n };\n }", "extend(config, { isDev }) {\n if (isDev) config.devtool = '#source-map';\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(ts|js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_module)/\n })\n }\n }", "extend(config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend(config, ctx) {\n // // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n \n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.devtool = false\n }", "extend (config, { isDev, Client }) {\n if (isDev && Client) {\n config.module.rules.push({ enforce: 'pre', test: /\\.(js|vue)$/, loader: 'eslint-loader', exclude: /(node_modules)/ })\n }\n }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "react() {\n return;\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|bower_components)/\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/,\n // options: {\n // fix: false\n // }\n // })\n // }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n\n /*\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n */\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n /*\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options : {\n fix : true\n }\n })\n }\n */\n }", "extend(config, ctx) {\n config.devtool = \"source-map\";\n\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n fix: true,\n },\n });\n }\n\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.txt$/,\n loader: \"raw-loader\",\n exclude: /(node_modules)/,\n });\n }", "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "resolveImports() {\n return { safeMath: true, pausable: true, tokenInterface: true };\n }", "extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n // config.module.rules.push({\n // test: /\\.postcss$/,\n // use: [\n // 'vue-style-loader',\n // 'css-loader',\n // {\n // loader: 'postcss-loader'\n // }\n // ]\n // })\n }\n }", "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === 'sass-loader') {\n use.options = use.options || {};\n use.options.includePaths = ['node_modules/foundation-sites/scss', 'node_modules/motion-ui/src'];\n }\n }\n }\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n formatter: require('eslint-friendly-formatter'),\n fix: true\n }\n })\n }\n }", "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n // options: {\n // fix: true\n // }\n })\n }\n }", "extend(config, { isDev }) {\n if (process.server && process.browser) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "function shim() {\n\t\t\t\t\t\tinvariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n\t\t\t\t\t}" ]
[ "0.5466979", "0.5399886", "0.53972447", "0.53882116", "0.53879005", "0.53487873", "0.5302345", "0.529765", "0.5269413", "0.52576023", "0.5256077", "0.5256077", "0.5256077", "0.5256077", "0.5254723", "0.52539647", "0.5246944", "0.52374786", "0.52374786", "0.52362573", "0.52335167", "0.52335167", "0.5231227", "0.5230166", "0.52299166", "0.52239496", "0.52147835", "0.51978326", "0.5196705", "0.51934826", "0.51900655", "0.51878077", "0.51878077", "0.51878077", "0.51878077", "0.51878077", "0.51744825", "0.51738685", "0.51669466", "0.5163715", "0.5163331", "0.5158939", "0.5158939", "0.5158939", "0.5158939", "0.5158939", "0.5158939", "0.5147897", "0.5144215", "0.5144215", "0.5132177", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5123898", "0.5119687", "0.5113564", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.50959194", "0.5093797", "0.5093064", "0.5082476", "0.5081162", "0.50801253", "0.50798345", "0.5060134", "0.50344616", "0.5031545", "0.5030636", "0.502161", "0.5019498", "0.5011964", "0.50037247" ]
0.0
-1
Main action call to the blockchain
async function takeAction(action, dataValue) { let textDecoder = new TextDecoder('utf-8'); let textEncoder = new TextEncoder('utf-8'); const privateKey = localStorage.getItem("cardgame_key"); const rpc = new JsonRpc(url, { fetch }); const signatureProvider = new JsSignatureProvider([privateKey]); const api = new Api({ rpc, signatureProvider, textDecoder, textEncoder }); dataValue = { payload: dataValue} //make our blockchain call after setting our action try { const resultWithConfig = await api.transact({ actions: [{ account: process.env.REACT_APP_EOS_CONTRACT_NAME, name: action, authorization: [{ actor: localStorage.getItem("cardgame_account"), permission: 'active', }], data: dataValue, }] }, { blocksBehind: 3, expireSeconds: 30, }); } catch (err) { throw(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function main() {\n await tools.loadWallet(await tools.loadFile(process.env.WALLET_LOCATION));\n console.log(\"Wallet loaded\");\n\n console.log(\"Deploying NFT\");\n const deployedTxId = await deployNFT()\n await checkTxConfirmation(deployedTxId);\n\n console.log(\"Burning Koii\");\n const burnTxId = await tools.burnKoi(\n ATTENTION_CONTRACT,\n \"nft\",\n deployedTxId\n );\n await checkTxConfirmation(burnTxId);\n\n console.log(\"Migrating content\");\n const migrateTxId = await tools.migrate(\n ATTENTION_CONTRACT\n );\n await checkTxConfirmation(migrateTxId);\n}", "async function main() {\n if (args.action == undefined) {\n console.log(parser.format_help());\n console.error('[!] Introduce una acción');\n } else {\n if (args.action == 'check') {\n if(args.hashList || args.file || args.hash)\n check();\n else{\n console.log(parser.format_help());\n console.error('[!] Especifica un metodo de entrada');\n }\n \n }else if(args.action == 'secret'){\n new Secret().start();\n }\n }\n}", "async function main() {\n showContract();\n\n // await deployContract();\n // await getCodeOfDeployedContract();\n // await callMethod();\n // await callMethodWithOptions();\n\n // methodCreateReturnedTransaction();\n\n // await sendMethodTransaction();\n // await sendMethodTransactionWithEstimate();\n // await signAndSendMethodTransaction();\n\n // await getLogsOfTransfer();\n}", "async function main() {\n // Encode a bunch of token mints and burns.\n const mintSignature = 'mint(address,uint256)'\n const burnSignature = 'burn(address,uint256)'\n const calldatum = await Promise.all([\n ...mints.map(([receiverAddress, amount]) =>\n encodeActCall(mintSignature, [receiverAddress, amount]),\n ),\n ...burns.map(([holderAddress, amount]) =>\n encodeActCall(burnSignature, [holderAddress, amount]),\n ),\n ])\n\n const actions = calldatum.map(calldata => ({\n to: tokenManagerAddress,\n calldata,\n }))\n\n // Encode all actions into a single EVM script.\n const script = encodeCallScript(actions)\n console.log(\n `npx dao exec ${daoAddress} ${votingAddress} newVote ${script} MintsAndBurns --environment aragon:${environment} `,\n )\n\n process.exit()\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 main() {\n let msinfo = {\n cfg: null,\n acc: null,\n }\n loadConfig(msinfo)\n\n loadWallet(msinfo, (err) => {\n if(err) u.showErr(err)\n startMicroservice(msinfo)\n registerWithCommMgr()\n })\n}", "async function smartBankMain(){\n\tlet web3 = new Web3(new Web3.providers.WebsocketProvider(\"ws://localhost:7545\"))\n\tlet accounts = await web3.eth.getAccounts()\n\n\tlet abi = SmartBank.loadAbi(__dirname + \"/../../SmartBank/SmartBankAbi.json\")\n\tlet address = SmartBank.loadAddress(__dirname + \"/../../SmartBank/SmartBankAddress.json\")\n\n\tconsole.log(`Running SmartBank dapp with backend ${address}`)\n\n\tlet bank = new SmartBank(web3, accounts[0], abi, address)\n\n\t// Create bank account for weather insurer\n\tlet insurerAccount = bank.createAccount()\n\tinsurerAccount.balance = 10000000\n\n\t// Authorize the weather insurer contract to make payments through the bank\n\tlet insurerAddress = WeatherInsurer.loadAddress(__dirname + \"/../WeatherInsurerAddress.json\")\n\tawait bank.authorize(insurerAddress, insurerAccount.iban, insurerAddress)\n\n\treturn bank\n}", "async function takeAction(action, dataValue, type) {\n const privateKey = localStorage.getItem(\"user_key\");\n const rpc = new JsonRpc(process.env.REACT_APP_EOS_HTTP_ENDPOINT);\n const signatureProvider = new JsSignatureProvider([privateKey]);\n const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });\n let contractname = '';\n if (type === 'give') contractname = process.env.REACT_APP_EOS_CONTRACT_NAME;\n else if (type === 'receive') contractname = process.env.REACT_APP_EOS_CONTRACT_NAME_RE;\n\n // Main call to blockchain after setting action, account_name and data\n try {\n const resultWithConfig = await api.transact({\n actions: [{\n account: contractname,\n name: action,\n authorization: [{\n actor: localStorage.getItem(\"user_account\"),\n permission: 'active',\n }],\n data: dataValue,\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n });\n return resultWithConfig;\n } catch (err) {\n throw (err)\n }\n}", "function startBitcoin() {\n updateLatestChainBlock()\n processBlocks()\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 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 main() {\n // Keys should be ED25519\n // TODO: Fix the wallet to work with ECDSA\n if (process.env.OPERATOR_ID == null || process.env.OPERATOR_KEY == null) {\n throw new Error(\n \"Environment variables OPERATOR_ID, and OPERATOR_KEY are required.\"\n );\n }\n const myAccountId = hashgraph.AccountId.fromString(process.env.OPERATOR_ID);\n\n const wallet = new hashgraph.Wallet(\n process.env.OPERATOR_ID,\n process.env.OPERATOR_KEY,\n new hashgraph.LocalProvider()\n );\n\n const alicePrivateKey = hashgraph.PrivateKey.generateED25519();\n const alicePublicKey = alicePrivateKey.publicKey;\n\n let transaction = await new hashgraph.AccountCreateTransaction()\n .setKey(alicePublicKey)\n .setInitialBalance(hashgraph.Hbar.fromString(\"10\"))\n .freezeWithSigner(wallet);\n transaction = await transaction.signWithSigner(wallet);\n\n let response = await transaction.executeWithSigner(wallet);\n const aliceAccountId = (await response.getReceiptWithSigner(wallet))\n .accountId;\n\n const aliceWallet = new hashgraph.Wallet(\n aliceAccountId,\n alicePrivateKey,\n new hashgraph.LocalProvider()\n );\n\n // Instantiate ContractHelper\n\n // The contract bytecode is located on the `object` field\n const contractBytecode = /** @type {string} */ (contract.bytecode);\n\n const contractHelper = await ContractHelper.init(\n contractBytecode,\n new hashgraph.ContractFunctionParameters()\n .addAddress(wallet.getAccountId().toSolidityAddress())\n .addAddress(aliceAccountId.toSolidityAddress()),\n wallet\n );\n\n // Configure steps in ContracHelper\n contractHelper\n .setPayableAmountForStep(0, new hashgraph.Hbar(20))\n .addSignerForStep(1, alicePrivateKey);\n // step 0 creates a fungible token\n // step 1 Associate with account\n // step 2 transfer the token by passing a zero value\n // step 3 mint the token by passing a zero value\n // step 4 burn the token by passing a zero value\n // step 5 wipe the token by passing a zero value\n\n await contractHelper.executeSteps(\n /* from step */ 0,\n /* to step */ 5,\n wallet\n );\n\n // step 6 use SDK and transfer passing a zero value\n //Create Fungible Token\n console.log(`Attempting to execute step 6`);\n\n let tokenCreateTransaction = await new hashgraph.TokenCreateTransaction()\n .setTokenName(\"Black Sea LimeChain Token\")\n .setTokenSymbol(\"BSL\")\n .setTreasuryAccountId(myAccountId)\n .setInitialSupply(10000) // Total supply = 10000 / 10 ^ 2\n .setDecimals(2)\n .setAutoRenewAccountId(myAccountId)\n .freezeWithSigner(wallet);\n\n tokenCreateTransaction = await tokenCreateTransaction.signWithSigner(\n wallet\n );\n let responseTokenCreate = await tokenCreateTransaction.executeWithSigner(\n wallet\n );\n const tokenId = (await responseTokenCreate.getReceiptWithSigner(wallet))\n .tokenId;\n\n //Associate Token with Account\n // Accounts on hedera have to opt in to receive any types of token that aren't HBAR\n const tokenAssociateTransaction =\n await new hashgraph.TokenAssociateTransaction()\n .setAccountId(aliceAccountId)\n .setTokenIds([tokenId])\n .freezeWithSigner(aliceWallet);\n\n const signedTxForAssociateToken =\n await tokenAssociateTransaction.signWithSigner(aliceWallet);\n const txResponseAssociatedToken =\n await signedTxForAssociateToken.executeWithSigner(wallet);\n const status = (\n await txResponseAssociatedToken.getReceiptWithSigner(wallet)\n ).status;\n\n console.log(\"Associate Status\", status.toString());\n\n //Transfer token\n const transferToken = await new hashgraph.TransferTransaction()\n .addTokenTransfer(tokenId, myAccountId, 0) // deduct 0 tokens\n .addTokenTransfer(tokenId, aliceAccountId, 0) // increase balance by 0\n .freezeWithSigner(wallet);\n\n const signedTransferTokenTX = await transferToken.signWithSigner(wallet);\n const txResponseTransferToken =\n await signedTransferTokenTX.executeWithSigner(wallet);\n\n //Verify the transaction reached consensus\n const transferReceipRecord =\n await txResponseTransferToken.getRecordWithSigner(wallet);\n\n console.log(\n `step 6 completed, and returned valid result. (TransactionId \"${transferReceipRecord.transactionId.toString()}\")`\n );\n\n console.log(\"All steps completed with valid results.\");\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}", "async function takeAction(actor, key, action, dataValue, EndPoint) {\n const privateKey = key\n // console.log(key);\n const rpc = new JsonRpc(EndPoint.EOS_HTTP_ENDPOINT, { fetch });\n const signatureProvider = new JsSignatureProvider([privateKey]);\n// const signatureProvider = privateKey;\n const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });\n // console.log(await rpc.get_account('user1account'));\n // Main call to blockchain after setting action, account_name and data\n try {\n console.log(dataValue);\n const resultWithConfig = await api.transact({\n actions: [{\n account: EndPoint.EOS_CONTRACT_NAME,\n name: action,\n authorization: [{\n actor,\n permission: 'active',\n }],\n data: dataValue,\n }]\n }, {\n blocksBehind: 3,\n expireSeconds: 30,\n });\n return resultWithConfig;\n } catch (err) {\n throw(\"err TakeAction \" + action,err)\n }\n}", "function main() {\n doCbaam()\n doEcb()\n updateGraphFile()\n}", "async function main() {\n //Grab your Hedera testnet account ID and private key from your .env file\n const myAccountId = process.env.ACCOUNT_ID;\n const myPrivateKey = process.env.PRIVATE_KEY;\n // If we weren't able to grab it, we should throw a new error\n if (myAccountId == null || myPrivateKey == null ) {\n throw new Error(\"Environment variables myAccountId and myPrivateKey must be present\");\n } else {\n console.log('Keys imported successfully from env');\n }\n\n const client = Client.forTestnet()\n client.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);\n\n\n\n\n /***** ACCOUNT BALANCE *****/\n //Create the account balance query\n const query = new AccountBalanceQuery()\n .setAccountId(myAccountId);\n\n //Submit the query to a Hedera network\n const accountBalance = await query.execute(client);\n console.log(\"Balance: \" + accountBalance.hbars);\n /***** ACCOUNT BALANCE *****/\n\n\n\n /***** ACCOUNT INFO *****/\n // const query2 = new AccountInfoQuery()\n // .setAccountId(myAccountId);\n\n // const accountInfo = await query2.execute(client);\n // console.log(accountInfo);\n /***** ACCOUNT INFO *****/\n\n\n\n\n /***** TRANSACTION *****/\n // Create a transaction to transfer 100 hbars\n const transaction = new TransferTransaction()\n .addHbarTransfer('0.0.2908916', new Hbar(-1))\n .addHbarTransfer('0.0.2908905', new Hbar(1));\n\n //Submit the transaction to a Hedera network\n const txResponse = await transaction.execute(client);\n\n //Request the receipt of the transaction\n const receipt = await txResponse.getReceipt(client);\n\n //Get the transaction consensus status\n const transactionStatus = receipt.status;\n\n console.log(\"The transaction consensus status is \" +transactionStatus.toString());\n /***** TRANSACTION *****/\n}", "function startApp() {\n Owners.init();\n TXID.blocknumber = 0\n if(config.ipfshost == 'ipfs')ipfs.id(function (err, res) {\n if(err){}\n if(res)plasma.id = res.id\n })\n processor = hiveState(client, startingBlock, config.prefix, config.username);\n processor.on('send', HR.send);\n processor.on('claim', HR.claim);\n processor.on('node_add', HR.node_add);\n //processor.on('node_delete', HR.node_delete);\n processor.on('report', HR.report);\n processor.on('gov_down', HR.gov_down);\n processor.on('gov_up', HR.gov_up);\n processor.onOperation('account_update', HR.account_update);\n processor.onOperation('comment', HR.comment);\n processor.on('queueForDaily', HR.q4d)\n processor.on('nomention', HR.nomention)\n if(config.features.pob){\n processor.on('power_up', HR.power_up); // power up tokens for vote power in layer 2 token proof of brain\n processor.on('power_down', HR.power_down);\n processor.on('power_grant', HR.power_grant);\n processor.on('vote_content', HR.vote_content);\n processor.onOperation('vote', HR.vote) //layer 2 voting\n processor.onOperation('delegate_vesting_shares', HR.delegate_vesting_shares);\n processor.onOperation('comment_options', HR.comment_options);\n processor.on('cjv', HR.cjv);\n processor.on('cert', HR.cert); // json.cert is an open ended hope to interact with executable posts... unexplored\n }\n if(config.features.dex){\n processor.on('dex_sell', HR.dex_sell);\n processor.on('dex_clear', HR.dex_clear);\n processor.on('sig_submit', HR.sig_submit); //dlux is for putting executable programs into IPFS... this is for additional accounts to sign the code as non-malicious\n processor.on('osig_submit', HR.osig_submit);\n }\n if(config.features.dex || config.features.nft || config.features.ico){\n processor.onOperation('transfer', HR.transfer);\n }\n if(config.features.nft){\n processor.on('ft_bid', HR.ft_bid)\n processor.on('ft_auction', HR.ft_auction)\n processor.on('ft_sell_cancel', HR.ft_sell_cancel)\n processor.on('ft_buy', HR.ft_buy)\n processor.on('ft_sell', HR.ft_sell)\n processor.on('ft_escrow_cancel', HR.ft_escrow_cancel)\n processor.on('ft_escrow_complete', HR.ft_escrow_complete)\n processor.on('ft_escrow', HR.ft_escrow)\n processor.on('fts_sell_h', HR.fts_sell_h)\n processor.on('fts_sell_hcancel', HR.fts_sell_hcancel)\n processor.on('nft_buy', HR.nft_buy)\n processor.on('nft_sell', HR.nft_sell)\n processor.on('nft_sell_cancel', HR.nft_sell_cancel)\n processor.on('ft_transfer', HR.ft_transfer)\n processor.on('ft_airdrop', HR.ft_airdrop)\n processor.on('nft_transfer', HR.nft_transfer)\n processor.on('nft_auction', HR.nft_auction)\n processor.on('nft_hauction', HR.nft_hauction)\n processor.on('nft_bid', HR.nft_bid)\n processor.on('nft_transfer_cancel', HR.nft_transfer_cancel)\n processor.on('nft_reserve_transfer', HR.nft_reserve_transfer)\n processor.on('nft_reserve_complete', HR.nft_reserve_complete)\n processor.on('nft_define', HR.nft_define)\n processor.on('nft_add_roy', HR.nft_add_roy)\n processor.on('nft_div', HR.nft_div)\n processor.on('nft_define_delete', HR.nft_define_delete)\n processor.on('nft_melt', HR.nft_delete)\n processor.on('nft_mint', HR.nft_mint)\n processor.on('nft_pfp', HR.nft_pfp)\n }\n //do things in cycles based on block time\n processor.onBlock(\n function (num, pc, prand, bh) {\n Log.block(num);\n if(num < TXID.blocknumber){\n require('process').exit(2)\n } else {TXID.clean(num)}\n return new Promise((resolve, reject) => {\n let Pchron = getPathSome(['chrono'],{\n gte: \"\" + num - 1,\n lte: \"\" + (num + 1)\n })\n let Pmss = getPathSome(['mss'],{\n gte: \"\" + (num - 1000000),\n lte: \"\" + (num - 100)\n }) //resign mss\n let Pmsso = getPathSome(['msso'],{\n gte: \"\" + (num - 1000000),\n lte: \"\" + (num - 100)\n })\n let Pmsa = getPathObj(['msa'])\n let Pmso = getPathObj(['mso'])\n Promise.all([Pchron, Pmss, Pmsa, Pmso, Pmsso]).then(mem => {\n var a = mem[0],\n mss = mem[1], //resign mss\n msa = mem[2], //if length > 80... sign these\n mso = mem[3],\n msso = mem[4],\t\n mso_keys = Object.keys(mso)\n let chrops = {},\n msa_keys = Object.keys(msa)\n mso_keys = Object.keys(mso)\n for (var i in a) {\n chrops[a[i]] = a[i]\n }\n var ints = 0\n let j = Object.keys(chrops)\n loop(0,ints,j)\n function loop (i,ints, j){\n ints++\n let delKey = chrops[j[i]]\n if(i<j.length)ChonOp(delKey, ints, prand, num).then(x=>{\n i++\n if(i<j.length)loop(i,ints,j)\n else every()\n })\n else every()\n function ChonOp (delKey, ints, prand, num){\n return new Promise((res,rej)=>{\n store.getWith(['chrono', chrops[j[i]]], {delKey, ints}, function(e, b, passed) {\n switch (b.op) {\n case 'mint':\n //{op:\"mint\", set:json.set, for: from}\n let setp = getPathObj(['sets', b.set]);\n NFT.mintOp([setp], passed.delKey, num, b, `${passed.ints}${prand}`)\n .then(x=>res(x))\n break;\n case 'ahe':\n let ahp = getPathObj(['ah', b.item]),\n setahp = ''\n if (b.item.split(':')[0] != 'Qm') setahp = getPathObj(['sets', b.item.split(':')[0]])\n else setahp = getPathObj(['sets', `Qm${b.item.split(':')[1]}`])\n NFT.AHEOp([ahp, setahp], passed.delKey, num, b)\n .then(x=>res(x))\n break;\n case 'ahhe':\n let ahhp = getPathObj(['ahh', b.item]),\n setahhp = ''\n if (b.item.split(':')[0] != 'Qm') setahhp = getPathObj(['sets', b.item.split(':')[0]])\n else setahhp = getPathObj(['sets', `Qm${b.item.split(':')[1]}`])\n NFT.AHHEOp([ahhp, setahhp], passed.delKey, num, b, bh.timestamp)\n .then(x=>res(x))\n break;\n case 'ame':\n let amp = getPathObj(['am', b.item]),\n setamp = ''\n if (b.item.split(':')[0] != 'Qm') setamp = getPathObj(['sets', b.item.split(':')[0]])\n else setamp = getPathObj(['sets', `Qm${b.item.split(':')[1]}`])\n NFT.AMEOp([amp, setamp], passed.delKey, num, b)\n .then(x=>res(x))\n break;\n case 'div':\n let contract = getPathObj(['div', b.set]),\n set = getPathObj(['sets', b.set]),\n sales = getPathObj(['ls']),\n auctions = getPathObj(['ah'])\n NFT.DividendOp([contract, set, sales, auctions], passed.delKey, num, b)\n .then(x=>res(x))\n break;\n case 'del_pend':\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }, { type: 'del', path: ['pend', `${b.author}/${b.permlink}`]}], [res, rej,'info'])\n break;\n case 'ms_send':\n recast(b.attempts, b.txid, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'expire':\n release(b.from, b.txid, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'check':\n enforce(b.agent, b.txid, { id: b.id, acc: b.acc }, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'denyA':\n enforce(b.agent, b.txid, { id: b.id, acc: b.acc }, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'denyT':\n enforce(b.agent, b.txid, { id: b.id, acc: b.acc }, num)\n store.batch([{ type: 'del', path: ['chrono', passed.delKey] }], [res, rej,'info'])\n break;\n case 'gov_down': //needs work and testing\n let plb = getPathNum(['balances', b.by]),\n tgovp = getPathNum(['gov', 't']),\n govp = getPathNum(['gov', b.by])\n Chron.govDownOp([plb, tgovp, govp], b.by, passed.delKey, num, passed.delKey.split(':')[1], b)\n .then(x=>res(x))\n break;\n case 'power_down': //needs work and testing\n let lbp = getPathNum(['balances', b.by]),\n tpowp = getPathNum(['pow', 't']),\n powp = getPathNum(['pow', b.by])\n Chron.powerDownOp([lbp, tpowp, powp], b.by, passed.delKey, num, passed.delKey.split(':')[1], b)\n .then(x=>res(x))\n break;\n case 'post_reward':\n Chron.postRewardOP(b, num, passed.delKey.split(':')[1], passed.delKey)\n .then(x=>res(x))\n break;\n case 'post_vote':\n Chron.postVoteOP(b, passed.delKey)\n .then(x=>res(x))\n break;\n default:\n\n }\n })\n })\n }\n }\n function every(){\n return new Promise((res, rej)=>{\n let promises = [HR.margins()]\n if(num % 100 !== 50){\t\n if(mso_keys.length){\t\n promises.push(new Promise((res,rej)=>{\t\n osig_submit(osign(num, 'mso', mso_keys, bh))\t\n .then(nodeOp => {\t\n res('SAT')\t\n try{\t\n if(plasma.rep && JSON.parse(nodeOp[1][1].json).sig)NodeOps.unshift(nodeOp)\t\n }catch(e){}\t\n })\t\n .catch(e => { rej(e) })\t\n }))\t\n } else if(msso.length){\t\n promises.push(new Promise((res,rej)=>{\t\n osig_submit(osign(num, 'msso', msso, bh))\t\n .then(nodeOp => {\t\n res('SAT')\t\n try {\t\n if(plasma.rep && JSON.parse(nodeOp[1][1].json).sig)NodeOps.unshift(nodeOp) //check to see if sig\t\n }catch(e){}\t\n })\t\n .catch(e => { rej(e) })\t\n }))\t\n } else if(msa_keys.length > 80){\n promises.push(new Promise((res,rej)=>{\n sig_submit(consolidate(num, plasma, bh))\n .then(nodeOp => {\n res('SAT')\n if(plasma.rep)NodeOps.unshift(nodeOp)\n })\n .catch(e => { rej(e) })\n }))\n }\n for(var missed = 0; missed < mss.length; missed++){\n if(mss[missed].split(':').length == 1){\n missed_num = mss[missed]\n promises.push(new Promise((res,rej)=>{\n sig_submit(sign(num, plasma, missed_num, bh))\n .then(nodeOp => {\n res('SAT')\n if(JSON.parse(nodeOp[1][1].json).sig){\n NodeOps.unshift(nodeOp)\n }\n })\n .catch(e => { rej(e) })\n })) \n break;\n }\n }\n }\n if (num % 100 === 0 && processor.isStreaming()) {\n client.database.getDynamicGlobalProperties()\n .then(function(result) {\n console.log('At block', num, 'with', result.head_block_number - num, `left until real-time. DAO in ${30240 - ((num - 20000) % 30240)} blocks`)\n });\n }\n if (num % 100 === 50) {\n promises.push(new Promise((res,rej)=>{\n report(plasma, consolidate(num, plasma, bh))\n .then(nodeOp => {\n res('SAT')\n if(processor.isStreaming())NodeOps.unshift(nodeOp)\n })\n .catch(e => { rej(e) })\n }))\n }\n if ((num - 18505) % 28800 === 0) { //time for daily magic\n promises.push(dao(num))\n block.prev_root = block.root\n block.root = ''\n }\n if (num % 100 === 0) {\n promises.push(tally(num, plasma, processor.isStreaming()));\n }\n if (num % 100 === 99) {\n if(config.features.liquidity)promises.push(Liquidity());\n }\n if ((num - 2) % 3000 === 0) {\n promises.push(voter());\n }\n Promise.all(promises).then(()=>resolve(pc))\n })\n }\n if (num % 100 === 1 && !block.root) {\n block.root = 'pending'\n block.chain = []\n block.ops = []\n store.get([], function(err, obj) {\n const blockState = Buffer.from(stringify([num + 1, obj]))\n\n ipfsSaveState(num, blockState, ipfs)\n .then(pla => {\n TXID.saveNumber = pla.hashBlock\n block.root = pla.hashLastIBlock\n plasma.hashSecIBlock = plasma.hashLastIBlock\n plasma.hashLastIBlock = pla.hashLastIBlock\n plasma.hashBlock = pla.hashBlock\n })\n .catch(e => { console.log(e) })\n\n })\n } else if (num % 100 === 1) {\n const blockState = Buffer.from(stringify([num + 1, block]))\n block.ops = []\n issc(num, blockState, null, 0, 0)\n }\n if (config.active && processor.isStreaming() ) {\n store.get(['escrow', config.username], function(e, a) {\n if (!e) {\n for (b in a) {\n if (!plasma.pending[b]) {\n NodeOps.push([\n [0, 0],\n typeof a[b] == 'string' ? JSON.parse(a[b]) : a[b]\n ]);\n plasma.pending[b] = true\n }\n }\n var ops = [],\n cjbool = false,\n votebool = false\n signerloop: for (i = 0; i < NodeOps.length; i++) {\n if (NodeOps[i][0][1] == 0 && NodeOps[i][0][0] <= 100) {\n if (NodeOps[i][1][0] == 'custom_json' && JSON.parse(NodeOps[i][1][1].json).sig_block && num - 100 > JSON.parse(NodeOps[i][1][1].json).sig_block){\n NodeOps.splice(i, 1)\n continue signerloop\n }\n if (NodeOps[i][1][0] == 'custom_json' && !cjbool ) {\n ops.push(NodeOps[i][1])\n NodeOps[i][0][1] = 1\n cjbool = true\n } else if (NodeOps[i][1][0] == 'custom_json'){\n // don't send two jsons at once\n } else if (NodeOps[i][1][0] == 'vote' && !votebool){\n ops.push(NodeOps[i][1])\n NodeOps[i][0][1] = 1\n votebool = true\n } else if (NodeOps[i][1][0] == 'vote'){\n // don't send two votes at once\n } else { //need transaction limits here... how many votes or transfers can be done at once?\n ops.push(NodeOps[i][1])\n NodeOps[i][0][1] = 1\n }\n } else if (NodeOps[i][0][0] < 100) {\n NodeOps[i][0][0]++\n } else if (NodeOps[i][0][0] == 100) {\n NodeOps[i][0][0] = 0\n }\n }\n for (i = 0; i < NodeOps.length; i++) {\n if (NodeOps[i][0][2] == true) {\n NodeOps.splice(i, 1)\n }\n }\n if (ops.length) {\n console.log('attempting broadcast', ops)\n broadcastClient.broadcast.send({\n extensions: [],\n operations: ops\n }, [config.active], (err, result) => {\n if (err) {\n console.log(err) //push ops back in.\n for (q = 0; q < ops.length; q++) {\n if (NodeOps[q][0][1] == 1) {\n NodeOps[q][0][1] = 3\n }\n }\n } else {\n console.log('Success! txid: ' + result.id)\n for (q = ops.length - 1; q > -1; q--) {\n if (NodeOps[q][0][0] = 1) {\n NodeOps.splice(q, 1)\n }\n }\n }\n });\n }\n } else {\n console.log(e)\n }\n })\n }\n })\n })\n });\n processor.onStreamingStart(HR.onStreamingStart);\n processor.start();\n setTimeout(function(){\n API.start();\n }, 3000);\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}", "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 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 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}", "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}", "submitStarData() {\n this.server.route({\n method: 'POST',\n path: '/block',\n handler: async (request, h) => {\n const result = await this.mempool.verifyAddressRequest(request.payload);\n if (result.address !== undefined) {\n //add block to blockchain\n let blockResult = await this.blockchain.addBlock(new BlockClass.Block(result));\n return await this.blockchain.addDecodedStoryToReturnObj(blockResult); \n }\n return result; \n }\n });\n }", "async function main(){\n\nvar password=\"pengshu\";\n\nvar oneBranchAccount=await web3.eth.personal.newAccount(password);\nconsole.log(\"one branch\",oneBranchAccount);\n\n\nlet unlock;\n\ntry{\n unlock=await web3.eth.personal.unlockAccount(oneBranchAccount,password);}\ncatch(e){}\n console.log(\"one branch unlock\",unlock);\n \n\nvar message=\"I am the flash\";\nlet signature;\ntry{\n signature=await web3.eth.sign(message,oneBranchAccount);\n}catch(e){}\nconsole.log(\"signature one branch:\",signature);\n\nlet verfication;\ntry {\n verification= await web3.eth.personal.ecRecover(message,signature);\n}catch(e){console.log(e);}\nconsole.log(verfication);\n}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to read the Account Type Amounts by Company Code\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Calculate Values\n\t\t\t\tvar records = getEntries();\n\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\tdata: records\n\t\t\t\t}));\n\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "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 Greeter = await ethers.getContractFactory(\"Greeter\");\n const greeter = await Greeter.deploy(\"Ropsten Greeter\");\n\n console.log(\"Greeter address:\", greeter.address);\n}", "executeOP(blockchain,transaction){\n switch (transaction.type) {\n case TRANSACTION_SYNTAX.createAccount.type:\n blockchain.accounts.initialize(transaction);\n break;\n }\n }", "async function main() {\n const contract = await ethers.getContractFactory(\"YearnV1EarnKeep3r\").then(f => f.attach(workableAddr));\n const tx = await contract.requestWork().then(t => t.wait());\n console.log(`Requested work for Workable contract`);\n}", "async handleFormEvent(event) {\n // stop default behaviour\n event.preventDefault()\n\n console.log()\n // collect form data\n let account = \"janesmith\"\n let privateKey = \"5KLqT1UFxVnKRWkjvhFur4sECrPhciuUqsYRihc1p9rxhXQMZBg\"\n\n // prepare variables for the switch below to send transactions\n let actionName = \"emppostjob\"\n let actionData = {\n timestamp: (Date.now() / 1000) | 0,\n employer: \"block.one\",\n title: event.target.title.value,\n desc: event.target.desc.value,\n maxpriceeos: event.target.budget.value\n }\n\n // eosjs function call: connect to the blockchain\n const rpc = new JsonRpc(endpoint)\n const signatureProvider = new JsSignatureProvider([privateKey])\n const api = new Api({\n rpc,\n signatureProvider,\n textDecoder: new TextDecoder(),\n textEncoder: new TextEncoder()\n })\n try {\n const result = await api.transact(\n {\n actions: [\n {\n account: \"notechainacc\",\n name: actionName,\n authorization: [\n {\n actor: account,\n permission: \"active\"\n }\n ],\n data: actionData\n }\n ]\n },\n {\n blocksBehind: 3,\n expireSeconds: 30\n }\n )\n\n console.log(result)\n\n let path = \"/jobmarket\"\n this.props.history.push(path)\n } catch (e) {\n console.log(\"Caught exception: \" + e)\n if (e instanceof RpcError) {\n console.log(JSON.stringify(e.json, null, 2))\n }\n }\n }", "function start(){\n let bank = \"Navy Federal Credit Union\";\n console.log(`welcome to ${bank}!!`);\n atm.pinVerify();\n menu();\n}", "async initLedger(ctx){\n await ctx.stub.putState(\"Init\", \"Fasten Network Project\");\n return \"success\";\n }", "function runProgramLogic() {\n fcl\n .config() \n .put(\"accessNode.api\", \"https://access-testnet.onflow.org\") // connect to Flow testnet\n .put(\"challenge.handshake\", \"https://fcl-discovery.onflow.org/testnet/authn\")\n\n subscribeEvents()\n\n app.listen(port, () => {\n console.log(`Example app listening at http://localhost:${port}`)\n })\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}", "function run() {\n\n // connection.connect(function (err) {\n // if (err) throw err;\n\n // //run basic start program function to display bamazon table \n // start();\n // // purchase();\n // });\n start();\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}", "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}", "function main() {\n console.log(\"Contacting \" + HOST + \":\" + PORT);\n\n // Set access token and user id for example requests\n var accessToken = '';\n var userId = '';\n \n // Create template callback\n callback = function(err, resp) {\n if (err) console.log(\"Call did not succeed: \" + err);\n else console.log(\"Call succeeded: \" + JSON.stringify(resp));\n };\n\n /*\n * Example usage of getSeedTracks()\n *\n * exports.getSeedTracks(accessToken, userId, callback);\n */\n}", "function executeAction(abi, contract_address, method_name, params) {\n\n const member1 = new Web3(\"http://127.0.0.1:20000\");\n\n let contractInstance = new member1.eth.Contract(abi, contract_address);\n\n // console.log(rawTransactionManager);\n\n var _params = Object.values(params);\n\n var methodArgs = {\n from: member2_addr,\n gas: 0x55d4a80,\n privateFor: [member3TMPubKey],\n };\n\n const functionAbi = abi.find((e) => {\n return e.name === method_name;\n });\n\n let callOrSend = functionAbi.constant ? \"call\" : \"send\";\n\n let web3Method = contractInstance.methods[method_name](..._params);\n\n web3Method[callOrSend](methodArgs).then((err, res) => {\n console.log(err);\n console.log(res);\n });\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}", "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 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 main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.GET) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"GET is not supported, perform a POST to add Entries\"\n\t\t\t}));\n\t\t} else {\n\t\t\t//Perform Table Entry to be created in Table\n\t\t\ttry {\n\t\t\t\tif (gvGuid) {\n\t\t\t\t\t_createEntries();\n\t\t\t\t}\n\t\t\t} catch (errorObj) {\n\t\t\t\tgvTableUpdate = \"Error during table insert:\" + errorObj.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tTableUpdateStatus: gvTableUpdate\n\t\t\t}));\n\t\t}\n\t}", "async function main (params) {\n // create a Logger\n const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' })\n\n try {\n // 'info' is the default level if not set\n logger.info('Calling the main action brief-list')\n\n // check for missing request input parameters and headers\n const requiredParams = []\n const requiredHeaders = ['Authorization']\n const errorMessage = checkMissingRequestInputs(params, requiredParams, requiredHeaders)\n if (errorMessage) {\n // return and log client errors\n return errorResponse(400, errorMessage, logger)\n }\n\n const files = await filesLib.init()\n const existingFiles = await files.list('/briefs/')\n \n if(!existingFiles.length){\n return errorResponse(404,'No briefs found',logger)\n }else{\n const body = []\n\n for(let {name} of existingFiles){\n let buffer = await files.read(`${name}`)\n body.push(JSON.parse(buffer.toString()))\n }\n\n return{\n statusCode:200,\n body\n }\n }\n } catch (error) {\n // log any server errors\n logger.error(error)\n // return with 500\n return errorResponse(500, 'server error', logger)\n }\n}", "function main()\n{\n const srcfile = process.argv[2];\n const outfile = process.argv[3];\n \n const basename = path.basename(srcfile);\n const content = fs.readFileSync(srcfile, \"utf8\");\n\n const sources = {};\n sources[basename] = {content};\n\n const input =\n {\n language: \"Solidity\",\n sources: sources,\n settings:\n {\n outputSelection:\n {\n \"*\": {\"*\": [\"*\"]}\n }\n }\n };\n\n const compiled = JSON.parse(solc.compile(JSON.stringify(input), imports));\n if(compiled.errors)\n {\n console.log(\"failed to compile contract\", compiled.errors[0]);\n process.exit(1);\n }\n else\n {\n const contracts = compiled.contracts;\n const contract = contracts[basename];\n const classes = Object.keys(contract);\n const classname = classes[0];\n const main = contract[classname];\n console.log(\"contract compiled\");\n fs.writeFileSync(outfile, JSON.stringify(main, null, 4));\n console.log(\"saved compiled contract in file\", outfile);\n process.exit(0);\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}", "async function startFlow(){\n try{\n await helper.initialize();\n await helper.checkBalance();\n await helper.approveSCContract();\n await helper.topup();\n await helper.checkBalance();\n await helper.setPending();\n await helper.setResult();\n await helper.getResult();\n await helper.setFinished();\n await helper.checkBalance();\n process.exit(0);\n }catch(err){\n console.error(err);\n process.exit(1);\n }\n}", "function main() {\n addEventListeners();\n fetchListOfCurrencies();\n }", "async function main (params) {\n // create a Logger\n const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' })\n\n try {\n // 'info' is the default level if not set\n logger.info('Calling the main action')\n\n // log parameters, only if params.LOG_LEVEL === 'debug'\n logger.debug(stringParameters(params))\n\n // check for missing request input parameters and headers\n const requiredParams = ['tenant', 'apiKey', 'entityId', 'entityIdNS']\n const requiredHeaders = ['Authorization', 'x-gw-ims-org-id']\n const errorMessage = checkMissingRequestInputs(params, requiredParams, requiredHeaders)\n if (errorMessage) {\n // return and log client errors\n return errorResponse(400, errorMessage, logger)\n }\n\n // extract the user Bearer token from the Authorization header\n const token = getBearerToken(params)\n\n // initialize sdk\n const orgId = params.__ow_headers['x-gw-ims-org-id']\n const client = await CustomerProfile.init(params.tenant, orgId, params.apiKey, token)\n // call methods, eg getProfile\n const profile = await client.getProfile({\n entityId: params.entityId,\n entityIdNS: params.entityIdNS\n });\n const response = {\n statusCode: 200,\n body: profile\n }\n\n // log the response status code\n logger.info(`${response.statusCode}: successful request`)\n return response\n } catch (error) {\n // log any server errors\n logger.error(error)\n // return with 500\n return errorResponse(500, 'server error', logger)\n }\n}", "function run(){\n //console.log(\"O meu programa esta a correr\");\n\n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"action\",\n message: \"Action?\",\n choices: [\"Create Index\", \"Get Index\", \"Delete Index\"]\n }\n ]).then(function (answers) {\n if(answers['action'] == \"Create Index\"){\n // Create Index\n createIndex();\n }else if(answers['action'] == \"Delete Index\"){\n // TODO: Delete index\n }else if(answers['action'] == \"Get Index\"){\n getIndex()\n }else{\n // Do nothing\n }\n }).catch()\n}", "function go() {\n console.log('SimpleCTI.go()');\n\n // Once initialised, request all our owned lines are returned\n IPCortex.PBX.getLines(linesCB, true);\n CB.status(true, 0, 'API Initialised');\n }", "async function main() {\n const signer = (await ethers.getSigners())[0];\n \n //Get Abis\n // const ytcAbi = getAbi(\"YieldTokenCompounding.sol/YieldTokenCompounding.json\")\n // const trancheAbi = getAbi(\"element-finance/ITranche.sol/ITranche.json\") \n // const erc20Abi = getAbi(\"balancer-core-v2/lib/openzeppelin/ERC20.sol/ERC20.json\")\n const ytcAbi = getAbi(\"ytc/YieldTokenCompounding.sol/YieldTokenCompounding.json\")\n const erc20Abi = getAbi(\"balancer-core-v2/lib/openzeppelin/ERC20.sol/ERC20.json\")\n const trancheAbi = getAbi(\"ytc/interfaces/ITranche.sol/ITranche.json\")\n\n // Get data\n let data = JSON.parse(fs.readFileSync(\"./goerli-constants.json\"));\n const yieldTokenCompoundingAddress = data[\"yieldTokenCompoundingAddress\"];\n const userData = getUserInput(data);\n const baseTokenAddress = data[\"tokens\"][userData[\"baseTokenName\"]];\n // Get specific tranche\n \n const trancheDetails = data[\"tranches\"][userData[\"baseTokenName\"]][userData[\"trancheIndex\"]];\n const trancheAddress = trancheDetails[\"address\"];\n const balancerPoolId = trancheDetails[\"ptPool\"][\"poolId\"]; \n \n // Load contracts\n console.log(\"Laod Contracts\");\n const ytc = new ethers.Contract(yieldTokenCompoundingAddress, ytcAbi, signer, { gasLimit : 250000});\n console.log(\"get ytc\");\n const tranche = new ethers.Contract(trancheAddress, trancheAbi, signer);\n console.log(\"get tranche\");\n const yieldTokenAddress = await tranche.interestToken();\n console.log(\"get yldtokenaddr\", yieldTokenAddress);\n const yieldToken = new ethers.Contract(yieldTokenAddress, erc20Abi, signer, { gasLimit : 250000});\n console.log(\"get yieldtoken\");\n const yieldTokenDecimals = ethers.BigNumber.from(await yieldToken.decimals()).toNumber();\n console.log(\"get BigNumner\");\n const baseToken = new ethers.Contract(baseTokenAddress, erc20Abi, signer);\n console.log(\"get basetoken\");\n const baseTokenDecimals = ethers.BigNumber.from(await baseToken.decimals()).toNumber();\n console.log(\"get baseToklenDecimal\");\n\n /**\n * FORMULA: \n * Collateral Deposited = amount of base tokens deposited = `amountCollateralDeposited`\n * Balance = final amount of base tokens left\n * base tokens spent = Collateral Deposited - Balance\n * term = days left in term /365\n * yield exposure = number of YTs\n * gross gain = (speculated variable rate * term) * Yield exposure + Balance\n * Net gain = gross gain - collateral deposited - gas fee\n * = (speculated variable rate * term) * Yield exposure - base Tokens Spent - gas fee\n * Adjusted APR = (Net Gain / (Collateral Deposited - Balance))*100 \n * = (Net Gain / (base tokens spent))*100 \n */\n const trancheExpirationTimestamp = parseInt(trancheDetails[\"expiration\"]) * 1000\n const daysLeftInTerm = Math.floor((trancheExpirationTimestamp - new Date().getTime())/(1000*60*60*24));\n\n //On goerli, as of today (July), there is only 1 active tranche due to expire on August so YTC gives poor APY. For demo purposes, we mimicked a tranche which would expire 6 months from today. Hence term = 0.5\n const term = 0.5//daysLeftInTerm/365\n // console.log(\"Days left in term, term: \", daysLeftInTerm, term);\n \n let values = {};\n console.log(\"Going through Loop\")\n for (let i=1; i<2; i++) {\n // TODO: Gas fee estimation + tx fee + convert to base token amount\n // let gasFee = ethers.utils.formatEther(ethers.BigNumber.from(\n // await ytc.estimateGas.compound(i,trancheAddress, balancerPoolId, userData[\"amountCollateralDeposited\"], \"10\")).toNumber());\n let gasFee = await ytc.estimateGas.compound(i,trancheAddress, balancerPoolId, userData[\"amountCollateralDeposited\"], \"10\");\n \n // FIXME: Need to convert gasFee in baseToken amount!\n \n console.log(\"Gas Fee\", gasFee)\n let returnedVals = await ytc.callStatic.compound(i,trancheAddress, balancerPoolId, userData[\"amountCollateralDeposited\"], \"10\", { gasLimit : 2500000, gasPrice: 8000000000});\n\n console.log(\"retuned value\")\n [ytExposure, baseTokensSpent] = returnedVals.map(val => ethers.BigNumber.from(val).toNumber());\n ytExposure = ytExposure / (10**yieldTokenDecimals);\n baseTokensSpent = baseTokensSpent / (10**baseTokenDecimals);\n // console.log(\"yt exposure, base token spent: \", ytExposure, baseTokensSpent);\n // console.log(\"grossYtGain: \", userData[\"speculatedVariableRate\"] * term * ytExposure)\n let netGain = (userData[\"speculatedVariableRate\"] * term * ytExposure) - baseTokensSpent //- gasFee;\n let finalApy = (netGain / baseTokensSpent)*100\n\n console.log(\"values table setup\")\n // Add values to table.\n values[i] = {\n \"YT Exposure\": ytExposure, \n \"Net Gain\": `${netGain} ${userData[\"baseTokenName\"]}`,\n \"Final APR\": finalApy\n }\n }\n console.table(values);\n}", "constructor(app, blockchainObj) {\n this.app = app;\n this.blockchain = blockchainObj;\n // All the endpoints methods needs to be called in the constructor to initialize the route.\n this.getBlockByHeight();\n this.requestOwnership();\n this.submitStar();\n this.getBlockByHash();\n this.getStarsByOwner();\n this.getChainErrorList();\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 function main (params) {\n // create a Logger\n const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' })\n\n try {\n // 'info' is the default level if not set\n logger.info('Calling the main action')\n\n // log parameters, only if params.LOG_LEVEL === 'debug'\n logger.debug(stringParameters(params))\n\n const content = createResponse()\n logger.debug('fetch content = ' + JSON.stringify(content, null, 2))\n const response = {\n statusCode: 200,\n body: content\n }\n\n // log the response status code\n logger.info(`${response.statusCode}: successful request`)\n return response\n } catch (error) {\n // log any server errors\n logger.error(error)\n // return with 500\n return errorResponse(500, 'server error', logger)\n }\n}", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function genesis_step(ip, api_endpt, query_string, method_type, status_code) {\n //create genesis block (prev_block)\n prev_block = new objects.Block(ip, api_endpt, query_string, method_type, null, status_code);\n blockchain = new objects.Blockchain(prev_block, null, 1);\n return [prev_block, blockchain];\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 main() {\n console.log('Loading config file: ' + configFileName)\n try {\n config = JSON.parse(fs.readFileSync(configFileName));\n } catch (err) {\n console.log('Error: unable to load ' + configFileName);\n console.log(err);\n process.exit(1);\n }\n console.log(config);\n config.log.service_name = 'twitch_code_miner';\n log = new logger.Logger(config.log);\n\n api.SetConfig(config)\n bluebird.promisifyAll(api);\n\n log.Info('Generating initial key..')\n for (var i = 0; i < 15; i++) {\n //sk += charSet.charAt(Math.floor(Math.random() * 16));\n sk += charSet.charAt(Math.floor(Math.random() * 36))\n }\n\n log.Info('Start mining..')\n mine();\n}", "function performAction(){\n\tlet params = request.httpParameterMap; \n\tlet orderNo = params.isParameterSubmitted(\"orderno\") ? params.orderno.value : \"\";\n\tlet planID = params.isParameterSubmitted(\"planID\") ? params.planID.value : \"\";\n\tlet amount = params.isParameterSubmitted(\"amount\") ? params.amount.value : \"\";\n\tlet fullRefund = params.isParameterSubmitted(\"fullRefund\") ? params.fullRefund.value : \"\";\n\tlet action = \"refund\";\n\t\n\tif (orderNo === '' || planID === '' || amount === '' || fullRefund === '') {\n\t\tLogger.error(\"Exception in Operation-performAction: Some parameters are empty\");\n return;\n\t}\n\tvar transActions = require(\"bm_openpay/cartridge/scripts/TransActions.js\"),\n\t\tresult;\n\tswitch(action){\n\t\tcase \"refund\":\n\t\t\tresult = transActions.refund(orderNo, planID, amount, fullRefund);\n\t\t\tbreak;\n\t}\n\t\n\tresponse.getWriter().println(JSON.stringify(result));\n}", "async function Main(callback) {\n\ntry {\n // Pull the parameters from process arguments. Specifying them like this lets tests add its own.\n const result = await approveTokenSpending(argv.tokens);\n console.log(`completed Spending-Approval of ${argv.tokens} - with transactionHash: ${result}`);\n } catch (error) {\n console.error(error);\n }\n callback();\n}", "constructor(app, blockchainObj) {\n\t\tthis.app = app;\n\t\tthis.blockchain = blockchainObj;\n\t\t// All the endpoint methods need to be called in the constructor to initialize the route.\n\t\tthis.getBlockByHeight();\n\t\tthis.requestOwnership();\n\t\tthis.submitStar();\n\t\tthis.getBlockByHash();\n\t\tthis.testChainValidation();\n\t\tthis.getStarsByOwner();\n\t}", "async function doBlockingSend(action) {\n await null;\n // blockManagerConsole.warn(\n // 'FIGME: blockHeight',\n // action.blockHeight,\n // 'received',\n // action.type,\n // );\n switch (action.type) {\n case ActionType.AG_COSMOS_INIT: {\n const { isBootstrap, upgradePlan, blockTime } = action;\n // This only runs for the very first block on the chain.\n if (isBootstrap) {\n verboseBlocks && blockManagerConsole.info('block bootstrap');\n savedHeight === 0 ||\n Fail`Cannot run a bootstrap block at height ${savedHeight}`;\n const blockHeight = 0;\n const runNum = 0;\n controller.writeSlogObject({\n type: 'cosmic-swingset-bootstrap-block-start',\n blockTime,\n });\n controller.writeSlogObject({\n type: 'cosmic-swingset-run-start',\n blockHeight,\n runNum,\n });\n await processAction(action.type, async () =>\n bootstrapBlock(blockHeight, blockTime),\n );\n controller.writeSlogObject({\n type: 'cosmic-swingset-run-finish',\n blockHeight,\n runNum,\n });\n controller.writeSlogObject({\n type: 'cosmic-swingset-bootstrap-block-finish',\n blockTime,\n });\n }\n if (upgradePlan) {\n const blockHeight = upgradePlan.height;\n if (blockNeedsExecution(blockHeight)) {\n controller.writeSlogObject({\n type: 'cosmic-swingset-upgrade-start',\n blockHeight,\n blockTime,\n upgradePlan,\n });\n // Process upgrade plan\n const upgradedAction = {\n type: ActionType.ENACTED_UPGRADE,\n upgradePlan,\n blockHeight,\n blockTime,\n };\n await doBlockingSend(upgradedAction);\n controller.writeSlogObject({\n type: 'cosmic-swingset-upgrade-finish',\n blockHeight,\n blockTime,\n });\n }\n }\n return true;\n }\n\n case ActionType.ENACTED_UPGRADE: {\n // Install and execute new core proposals.\n const {\n upgradePlan: { info: upgradeInfoJson = null } = {},\n blockHeight,\n blockTime,\n } = action;\n const upgradePlanInfo =\n upgradeInfoJson &&\n parseLocatedJson(upgradeInfoJson, 'ENACTED_UPGRADE upgradePlan.info');\n\n // Handle the planned core proposals as just another action.\n const { coreProposals = [] } = upgradePlanInfo || {};\n\n if (!coreProposals.length) {\n // Nothing to do.\n return undefined;\n }\n\n // Find scripts relative to our location.\n const myFilename = fileURLToPath(import.meta.url);\n const { bundles, code: coreEvalCode } =\n await extractCoreProposalBundles(coreProposals, myFilename, {\n handleToBundleSpec: async (handle, source, _sequence, _piece) => {\n const bundle = await bundleSource(source);\n const { endoZipBase64Sha512: hash } = bundle;\n const bundleID = `b1-${hash}`;\n handle.bundleID = bundleID;\n harden(handle);\n return harden([`${bundleID}: ${source}`, bundle]);\n },\n });\n\n for (const [meta, bundle] of Object.entries(bundles)) {\n await controller\n .validateAndInstallBundle(bundle)\n .catch(e => Fail`Cannot validate and install ${meta}: ${e}`);\n }\n\n // Now queue the code for evaluation.\n //\n // TODO: Once SwingSet sprouts some tools for preemption, we should use\n // them to help the upgrade process finish promptly.\n const coreEvalAction = {\n type: ActionType.CORE_EVAL,\n blockHeight,\n blockTime,\n evals: [\n {\n json_permits: 'true',\n js_code: coreEvalCode,\n },\n ],\n };\n highPriorityQueue.push({\n context: {\n blockHeight,\n txHash: 'x/upgrade',\n msgIdx: 0,\n },\n action: coreEvalAction,\n });\n\n return undefined;\n }\n\n case ActionType.COMMIT_BLOCK: {\n const { blockHeight, blockTime } = action;\n verboseBlocks &&\n blockManagerConsole.info('block', blockHeight, 'commit');\n if (blockHeight !== savedHeight) {\n throw Error(\n `Committed height ${blockHeight} does not match saved height ${savedHeight}`,\n );\n }\n\n controller.writeSlogObject({\n type: 'cosmic-swingset-commit-block-start',\n blockHeight,\n blockTime,\n });\n\n // Save the kernel's computed state just before the chain commits.\n const start2 = Date.now();\n await saveOutsideState(savedHeight);\n saveTime = Date.now() - start2;\n\n blockParams = undefined;\n\n blockManagerConsole.debug(\n `wrote SwingSet checkpoint [run=${runTime}ms, chainSave=${chainTime}ms, kernelSave=${saveTime}ms]`,\n );\n\n return undefined;\n }\n\n case ActionType.AFTER_COMMIT_BLOCK: {\n const { blockHeight, blockTime } = action;\n\n const fullSaveTime = Date.now() - endBlockFinish;\n\n controller.writeSlogObject({\n type: 'cosmic-swingset-commit-block-finish',\n blockHeight,\n blockTime,\n saveTime: saveTime / 1000,\n chainTime: chainTime / 1000,\n fullSaveTime: fullSaveTime / 1000,\n });\n\n afterCommitWorkDone = afterCommit(blockHeight, blockTime);\n\n return undefined;\n }\n\n case ActionType.BEGIN_BLOCK: {\n const { blockHeight, blockTime, params } = action;\n blockParams = parseParams(params);\n verboseBlocks &&\n blockManagerConsole.info('block', blockHeight, 'begin');\n runTime = 0;\n\n controller.writeSlogObject({\n type: 'cosmic-swingset-begin-block',\n blockHeight,\n blockTime,\n inboundQueueStats: inboundQueueMetrics.getStats(),\n });\n\n return undefined;\n }\n\n case ActionType.END_BLOCK: {\n const { blockHeight, blockTime } = action;\n controller.writeSlogObject({\n type: 'cosmic-swingset-end-block-start',\n blockHeight,\n blockTime,\n });\n\n blockParams || Fail`blockParams missing`;\n\n if (!blockNeedsExecution(blockHeight)) {\n // We are reevaluating, so do not do any work, and send exactly the\n // same downcalls to the chain.\n //\n // This is necessary only after a restart when Tendermint is reevaluating the\n // block that was interrupted and not committed.\n //\n // We assert that the return values are identical, which allows us to silently\n // clear the queue.\n try {\n replayChainSends();\n } catch (e) {\n // Very bad!\n decohered = e;\n throw e;\n }\n } else {\n // And now we actually process the queued actions down here, during\n // END_BLOCK, but still reentrancy-protected.\n\n provideInstallationPublisher();\n\n await processAction(action.type, async () =>\n endBlock(blockHeight, blockTime, blockParams),\n );\n\n // We write out our on-chain state as a number of chainSends.\n const start = Date.now();\n await saveChainState();\n chainTime = Date.now() - start;\n\n // Advance our saved state variables.\n savedHeight = blockHeight;\n }\n controller.writeSlogObject({\n type: 'cosmic-swingset-end-block-finish',\n blockHeight,\n blockTime,\n inboundQueueStats: inboundQueueMetrics.getStats(),\n });\n\n endBlockFinish = Date.now();\n\n return undefined;\n }\n\n default: {\n throw Fail`Unrecognized action ${action}; are you sure you didn't mean to queue it?`;\n }\n }\n }", "async function main (params) {\n // create a Logger\n const logger = Core.Logger('main', { level: params.LOG_LEVEL || 'info' })\n\n try {\n // 'info' is the default level if not set\n logger.info('Calling the main action brief-save')\n\n // log parameters, only if params.LOG_LEVEL === 'debug'\n logger.debug(stringParameters(params))\n\n // check for missing request input parameters and headers\n const requiredParams = [\n 'briefDate',\n 'copyDate',\n 'releasePrintDate',\n 'requestType',\n 'campaign',\n 'deliverables',\n 'description',\n 'selectedAssets'\n ]\n const requiredHeaders = ['Authorization']\n const errorMessage = checkMissingRequestInputs(params, requiredParams, requiredHeaders)\n if (errorMessage) {\n // return and log client errors\n return errorResponse(400, errorMessage, logger)\n }\n\n const files = await filesLib.init()\n let briefRequest = {}\n \n for (const fieldName in requiredParams) {\n briefRequest[requiredParams[fieldName]] = params[requiredParams[fieldName]];\n }\n\n const requestFileId = new Date().getTime()\n briefRequest['id'] = requestFileId\n\n const existingFile = await files.list(`briefs/${requestFileId}.json`)\n\n if(!existingFile.length){\n await files.write(`briefs/${requestFileId}.json`,JSON.stringify(briefRequest))\n return{\n statusCode: 200,\n body: briefRequest\n }\n }else{\n return errorResponse(400, `Brief with same name exists ${requestFileId}`, logger)\n }\n\n } catch (error) {\n // log any server errors\n logger.error(error)\n // return with 500\n return errorResponse(500, 'server error', logger)\n }\n}", "async function main() {\n const {stdout} = await exec('docker exec bitcoin cat /root/.bitcoin/regtest/.cookie');\n let [username, password] = stdout.split(\":\");\n\n let client = axios.create({\n baseURL: \"http://localhost:18443\",\n auth: {\n username,\n password\n }\n });\n\n const args = process.argv.slice(2);\n const walletName = args[0];\n\n let createPsbtResponse = await client.post(`/wallet/${walletName}`, {\n method: \"walletcreatefundedpsbt\",\n params: [\n [],\n [\n {\n \"bcrt1q3vpmd8rpgr3duys6fv30lgyau3n6lh07qns2ck\": 1\n }\n ],\n null,\n {\n feeRate: 0.001\n }\n ]\n });\n\n let psbt = createPsbtResponse.data.result.psbt;\n\n let decodeResponse = await client.post(`/wallet/${walletName}`, {\n method: \"decodepsbt\",\n params: [psbt]\n });\n\n psbt = bitcoin.Psbt.fromBase64(psbt);\n\n let transport = await TransportNodeHid.default.open();\n const btc = new AppBtc.default(transport)\n\n const outputScriptHex = await serializer.serializeTransactionOutputs({\n outputs: psbt.txOutputs.map(output => {\n let amount = Buffer.alloc(8);\n amount.writeBigUInt64LE(BigInt(output.value), 0);\n\n return {\n amount: amount,\n script: output.script\n }\n })\n }).toString('hex');\n\n let decodedPsbt = decodeResponse.data.result;\n\n let inputs = await Promise.all(decodedPsbt.tx.vin.map(async utxo => {\n let prevTx = await client.post(`/wallet/${walletName}`, {\n method: \"getrawtransaction\",\n params: [utxo.txid, false]\n }).then(response => response.data.result);\n\n let ledgerPrevTx = btc.splitTransaction(prevTx, true);\n\n return [ledgerPrevTx, utxo.vout]\n }));\n let derivationPaths = decodedPsbt.inputs.map(input => input.bip32_derivs[0].path);\n\n let signedTx = await btc.createPaymentTransactionNew({\n inputs: inputs,\n associatedKeysets: derivationPaths,\n outputScriptHex,\n segwit: true,\n additionals: [\"bech32\"]\n });\n\n console.log(signedTx)\n}", "function runCall(cb) {\n // check to the sender's account to make sure it has enough wei and the correct nonce\n var fromAccount = self.stateManager.cache.get(tx.from);\n var message;\n\n if (!opts.skipBalance && new BN(fromAccount.balance).lt(tx.getUpfrontCost())) {\n message = \"sender doesn't have enough funds to send tx. The upfront cost is: \" + tx.getUpfrontCost().toString() + ' and the sender\\'s account only has: ' + new BN(fromAccount.balance).toString();\n cb(new Error(message));\n return;\n } else if (!opts.skipNonce && !new BN(fromAccount.nonce).eq(new BN(tx.nonce))) {\n message = \"the tx doesn't have the correct nonce. account has nonce of: \" + new BN(fromAccount.nonce).toString() + ' tx has nonce of: ' + new BN(tx.nonce).toString();\n cb(new Error(message));\n return;\n }\n\n // increment the nonce\n fromAccount.nonce = new BN(fromAccount.nonce).addn(1);\n\n basefee = tx.getBaseFee();\n gasLimit = new BN(tx.gasLimit);\n if (gasLimit.lt(basefee)) {\n return cb(new Error('base fee exceeds gas limit'));\n }\n gasLimit.isub(basefee);\n\n fromAccount.balance = new BN(fromAccount.balance).sub(new BN(tx.gasLimit).mul(new BN(tx.gasPrice)));\n self.stateManager.cache.put(tx.from, fromAccount);\n\n var options = {\n caller: tx.from,\n gasLimit: gasLimit,\n gasPrice: tx.gasPrice,\n to: tx.to,\n value: tx.value,\n data: tx.data,\n block: block,\n populateCache: false\n };\n\n if (tx.to.toString('hex') === '') {\n delete options.to;\n }\n\n // run call\n self.runCall(options, parseResults);\n\n function parseResults(err, _results) {\n if (err) return cb(err);\n results = _results;\n\n // generate the bloom for the tx\n results.bloom = txLogsBloom(results.vm.logs);\n fromAccount = self.stateManager.cache.get(tx.from);\n\n // caculate the total gas used\n results.gasUsed = results.gasUsed.add(basefee);\n\n // process any gas refund\n results.gasRefund = results.vm.gasRefund;\n if (results.gasRefund) {\n if (results.gasRefund.lt(results.gasUsed.divn(2))) {\n results.gasUsed.isub(results.gasRefund);\n } else {\n results.gasUsed.isub(results.gasUsed.divn(2));\n }\n }\n\n results.amountSpent = results.gasUsed.mul(new BN(tx.gasPrice));\n\n async.series([updateFromAccount, updateMinerAccount, cleanupAccounts], cb);\n\n function updateFromAccount(next) {\n // refund the leftover gas amount\n var finalFromBalance = new BN(tx.gasLimit).sub(results.gasUsed).mul(new BN(tx.gasPrice)).add(new BN(fromAccount.balance));\n fromAccount.balance = finalFromBalance;\n\n self.stateManager.putAccountBalance(utils.toBuffer(tx.from), finalFromBalance, next);\n }\n\n function updateMinerAccount(next) {\n var minerAccount = self.stateManager.cache.get(block.header.coinbase);\n // add the amount spent on gas to the miner's account\n minerAccount.balance = new BN(minerAccount.balance).add(results.amountSpent);\n\n // save the miner's account\n if (!new BN(minerAccount.balance).isZero()) {\n self.stateManager.cache.put(block.header.coinbase, minerAccount);\n }\n\n next(null);\n }\n\n function cleanupAccounts(next) {\n if (!results.vm.selfdestruct) {\n results.vm.selfdestruct = {};\n }\n\n var keys = Object.keys(results.vm.selfdestruct);\n\n keys.forEach(function (s) {\n self.stateManager.cache.del(Buffer.from(s, 'hex'));\n });\n\n self.stateManager.cleanupTouchedAccounts(next);\n }\n }\n }", "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error during mapping IN to OUT:\" + errorObj.message;\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\t\tresult: gvErrorMessage,\n\t\t\t\t\t\tstatus: gvStatus,\n\t\t\t\t\t\ttableUpdates: gvTableUpdate\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// \t\t} else if ($.request.method === $.net.http.GET) {\n\t\t// \t\t\t//Read Entries from the Table\n\t\t// \t\t\ttry {\n\t\t// \t\t\t\t_getEntries();\n\t\t// \t\t\t} catch (errorObj) {\n\t\t// \t\t\t\t$.response.status = 200;\n\t\t// \t\t\t\t$.response.setBody(JSON.stringify({\n\t\t// \t\t\t\t\tmessage: \"API Called\",\n\t\t// \t\t\t\t\tresult: gvErrorMessage\n\t\t// \t\t\t\t}));\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t}", "async add_transaction_to_blockchain(key, data) {\n if(global.localhost) {\n return \"Stop wasting credit!\";\n }\n var [error, pendingResponse, response_data] = await this.blockchain.invoke(\"add_transaction\", {}, { args: [key, data] });\n\n return {error: false, response: response_data};\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}", "async loadBlockchainData() {\n const Web3 = require('web3')\n const web3Extension = require('@energi/web3-ext');\n const web3 = new Web3(Web3.givenProvider || \"https://nodeapi.test3.energi.network\")\n\n web3Extension.extend(web3);\n\n// instantiate the contract and the Metamask app\n\n const election = await new web3.eth.Contract(election_ABI, election_address)\n\n this.setState({Contract: election})\n\n const accounts = await web3.eth.getAccounts()\n\n this.setState({account: accounts[0]})\n\n\n// instantiate the methods of the contract\n\n const getCandidate = await election.methods.candidateName().call()\n this.setState({candidateName: getCandidate})\n\n\n}", "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 }", "action() {}", "mineCoins(web3, contractData , minerEthAddress)\n {\n\n var solution_number = web3utils.randomHex(32) //solution_number like bitcoin\n\n var challenge_number = contractData.challengeNumber;\n var target = contractData.miningTarget;\n\n var digest = web3utils.soliditySha3( challenge_number , minerEthAddress, solution_number )\n\n\n // console.log(web3utils.hexToBytes('0x0'))\n var digestBytes32 = web3utils.hexToBytes(digest)\n var digestBigNumber = web3utils.toBN(digest)\n\n var miningTarget = web3utils.toBN(target) ;\n\n\n\n // console.log('digestBigNumber',digestBigNumber.toString())\n // console.log('miningTarget',miningTarget.toString())\n\n if ( digestBigNumber.lt(miningTarget) )\n {\n\n if(this.testMode){\n console.log(minerEthAddress)\n console.log('------')\n console.log(solution_number)\n console.log(challenge_number)\n console.log(solution_number)\n console.log('------')\n console.log( web3utils.bytesToHex(digestBytes32))\n\n //pass in digest bytes or trimmed ?\n\n\n this.mining = false;\n\n this.networkInterface.checkMiningSolution( minerEthAddress, solution_number , web3utils.bytesToHex( digestBytes32 ),challenge_number,miningTarget,\n function(result){\n console.log('checked mining soln:' ,result)\n })\n }else {\n console.log('submit mined solution with challenge ', challenge_number)\n\n\n this.submitNewMinedBlock( minerEthAddress, solution_number, web3utils.bytesToHex( digestBytes32 ) , challenge_number);\n }\n }\n\n\n }", "static async queryByKey() {\n try {\n var contract = process.argv[2];\n var func = process.argv[3];\n var parameters = process.argv.slice(4);\n const userExists = await wallet.exists(userName);\n if (!userExists) {\n console.log('An identity for the user ' + userName + ' does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n response.error = 'An identity for the user ' + userName + ' does not exist in the wallet. Register ' + userName + ' first';\n return response;\n }\n\n // const identityLabel = 'Admin@org1.example.com';\n // let connectionProfile = yaml.safeLoad(fs.readFileSync('./network.yaml', 'utf8'));\n\n // let connectionOptions = {\n // identity: identityLabel,\n // wallet: wallet,\n // discovery: {\n // asLocalhost: true\n // }\n // };\n\n // Connect to gateway using network.yaml file and our certificates in _idwallet directory\n await gateway.connect(ccp, {\n wallet,\n identity: userName,\n discovery: gatewayDiscovery\n });\n\n console.log('Connected to Fabric gateway.');\n\n // Connect to our local fabric\n const network = await gateway.getNetwork('mychannel');\n\n console.log('Connected to mychannel. ');\n\n // Get the contract we have installed on the peer\n const channel = network.getChannel();\n let request = { chaincodeId: contract, fcn: func, args: parameters};\n let response = await channel.queryByChaincode(request);\n console.log(response.toString());\n return response;\n\n } catch (error) {\n console.log(`Error processing transaction. ${error}`);\n console.log(error.stack);\n } finally {\n // Disconnect from the gateway\n console.log('Disconnect from Fabric gateway.');\n gateway.disconnect();\n }\n }", "function performAction(){\n\tvar action = request.httpParameterMap.action.value,\n\t\torderNo = request.httpParameterMap.orderno.value,\n\t\tamount = request.httpParameterMap.amount.value,\n\t\tbulkCompleteArray = request.httpParameterMap.bulkComplete.value,\n\t\ttransActions = require(\"~/cartridge/scripts/TransActions\"),\n\t\tresult;\n\t\n\tswitch(action){\n\t\tcase \"refund\":\n\t\t\tresult = transActions.refund(orderNo, amount);\n\t\t\tbreak;\n\t}\n\t\n\tresponse.getWriter().println(JSON.stringify(result));\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}", "constructor(core, baseurl = '/ext/bc/C/avax', blockchainID = '') {\n super(core, baseurl);\n /**\n * @ignore\n */\n this.keychain = new keychain_1.KeyChain('', '');\n this.blockchainID = '';\n this.blockchainAlias = undefined;\n this.AVAXAssetID = undefined;\n this.txFee = undefined;\n /**\n * Gets the alias for the blockchainID if it exists, otherwise returns `undefined`.\n *\n * @returns The alias for the blockchainID\n */\n this.getBlockchainAlias = () => {\n if (typeof this.blockchainAlias === \"undefined\") {\n const netID = this.core.getNetworkID();\n if (netID in constants_1.Defaults.network && this.blockchainID in constants_1.Defaults.network[netID]) {\n this.blockchainAlias = constants_1.Defaults.network[netID][this.blockchainID].alias;\n return this.blockchainAlias;\n }\n else {\n /* istanbul ignore next */\n return undefined;\n }\n }\n return this.blockchainAlias;\n };\n /**\n * Sets the alias for the blockchainID.\n *\n * @param alias The alias for the blockchainID.\n *\n */\n this.setBlockchainAlias = (alias) => {\n this.blockchainAlias = alias;\n /* istanbul ignore next */\n return undefined;\n };\n /**\n * Gets the blockchainID and returns it.\n *\n * @returns The blockchainID\n */\n this.getBlockchainID = () => this.blockchainID;\n /**\n * Refresh blockchainID, and if a blockchainID is passed in, use that.\n *\n * @param Optional. BlockchainID to assign, if none, uses the default based on networkID.\n *\n * @returns A boolean if the blockchainID was successfully refreshed.\n */\n this.refreshBlockchainID = (blockchainID = undefined) => {\n const netID = this.core.getNetworkID();\n if (typeof blockchainID === 'undefined' && typeof constants_1.Defaults.network[netID] !== \"undefined\") {\n this.blockchainID = constants_1.Defaults.network[netID].C.blockchainID; //default to C-Chain\n return true;\n }\n if (typeof blockchainID === 'string') {\n this.blockchainID = blockchainID;\n return true;\n }\n return false;\n };\n /**\n * Takes an address string and returns its {@link https://github.com/feross/buffer|Buffer} representation if valid.\n *\n * @returns A {@link https://github.com/feross/buffer|Buffer} for the address if valid, undefined if not valid.\n */\n this.parseAddress = (addr) => {\n const alias = this.getBlockchainAlias();\n const blockchainID = this.getBlockchainID();\n return bintools.parseAddress(addr, blockchainID, alias, constants_2.EVMConstants.ADDRESSLENGTH);\n };\n this.addressFromBuffer = (address) => {\n const chainID = this.getBlockchainAlias() ? this.getBlockchainAlias() : this.getBlockchainID();\n return bintools.addressToString(this.core.getHRP(), chainID, address);\n };\n /**\n * Retrieves an assets name and symbol.\n *\n * @param assetID Either a {@link https://github.com/feross/buffer|Buffer} or an b58 serialized string for the AssetID or its alias.\n *\n * @returns Returns a Promise<Asset> with keys \"name\", \"symbol\", \"assetID\" and \"denomination\".\n */\n this.getAssetDescription = (assetID) => __awaiter(this, void 0, void 0, function* () {\n let asset;\n if (typeof assetID !== 'string') {\n asset = bintools.cb58Encode(assetID);\n }\n else {\n asset = assetID;\n }\n const params = {\n assetID: asset,\n };\n const tmpBaseURL = this.getBaseURL();\n // set base url to get asset description\n this.setBaseURL(\"/ext/bc/X\");\n const response = yield this.callMethod('avm.getAssetDescription', params);\n // set base url back what it originally was\n this.setBaseURL(tmpBaseURL);\n return {\n name: response.data.result.name,\n symbol: response.data.result.symbol,\n assetID: bintools.cb58Decode(response.data.result.assetID),\n denomination: parseInt(response.data.result.denomination, 10),\n };\n });\n /**\n * Fetches the AVAX AssetID and returns it in a Promise.\n *\n * @param refresh This function caches the response. Refresh = true will bust the cache.\n *\n * @returns The the provided string representing the AVAX AssetID\n */\n this.getAVAXAssetID = (refresh = false) => __awaiter(this, void 0, void 0, function* () {\n if (typeof this.AVAXAssetID === 'undefined' || refresh) {\n const asset = yield this.getAssetDescription(constants_1.PrimaryAssetAlias);\n this.AVAXAssetID = asset.assetID;\n }\n return this.AVAXAssetID;\n });\n /**\n * Overrides the defaults and sets the cache to a specific AVAX AssetID\n *\n * @param avaxAssetID A cb58 string or Buffer representing the AVAX AssetID\n *\n * @returns The the provided string representing the AVAX AssetID\n */\n this.setAVAXAssetID = (avaxAssetID) => {\n if (typeof avaxAssetID === \"string\") {\n avaxAssetID = bintools.cb58Decode(avaxAssetID);\n }\n this.AVAXAssetID = avaxAssetID;\n };\n /**\n * Gets the default tx fee for this chain.\n *\n * @returns The default tx fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getDefaultTxFee = () => {\n return this.core.getNetworkID() in constants_1.Defaults.network ? new bn_js_1.default(constants_1.Defaults.network[this.core.getNetworkID()][\"C\"][\"txFee\"]) : new bn_js_1.default(0);\n };\n /**\n * Gets the tx fee for this chain.\n *\n * @returns The tx fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getTxFee = () => {\n if (typeof this.txFee === \"undefined\") {\n this.txFee = this.getDefaultTxFee();\n }\n return this.txFee;\n };\n /**\n * Send ANT (Avalanche Native Token) assets including AVAX from the C-Chain to an account on the X-Chain.\n *\n * After calling this method, you must call the X-Chain’s import method to complete the transfer.\n *\n * @param username The Keystore user that controls the X-Chain account specified in `to`\n * @param password The password of the Keystore user\n * @param to The account on the X-Chain to send the AVAX to.\n * @param amount Amount of asset to export as a {@link https://github.com/indutny/bn.js/|BN}\n * @param assetID The asset id which is being sent\n *\n * @returns String representing the transaction id\n */\n this.export = (username, password, to, amount, assetID) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n amount: amount.toString(10),\n username,\n password,\n assetID\n };\n return this.callMethod('avax.export', params).then((response) => response.data.result.txID);\n });\n /**\n * Send AVAX from the C-Chain to an account on the X-Chain.\n *\n * After calling this method, you must call the X-Chain’s importAVAX method to complete the transfer.\n *\n * @param username The Keystore user that controls the X-Chain account specified in `to`\n * @param password The password of the Keystore user\n * @param to The account on the X-Chain to send the AVAX to.\n * @param amount Amount of AVAX to export as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns String representing the transaction id\n */\n this.exportAVAX = (username, password, to, amount) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n amount: amount.toString(10),\n username,\n password,\n };\n return this.callMethod('avax.exportAVAX', params).then((response) => response.data.result.txID);\n });\n /**\n * Retrieves the UTXOs related to the addresses provided from the node's `getUTXOs` method.\n *\n * @param addresses An array of addresses as cb58 strings or addresses as {@link https://github.com/feross/buffer|Buffer}s\n * @param sourceChain A string for the chain to look for the UTXO's. Default is to use this chain, but if exported UTXOs exist\n * from other chains, this can used to pull them instead.\n * @param limit Optional. Returns at most [limit] addresses. If [limit] == 0 or > [maxUTXOsToFetch], fetches up to [maxUTXOsToFetch].\n * @param startIndex Optional. [StartIndex] defines where to start fetching UTXOs (for pagination.)\n * UTXOs fetched are from addresses equal to or greater than [StartIndex.Address]\n * For address [StartIndex.Address], only UTXOs with IDs greater than [StartIndex.Utxo] will be returned.\n */\n this.getUTXOs = (addresses, sourceChain = undefined, limit = 0, startIndex = undefined) => __awaiter(this, void 0, void 0, function* () {\n if (typeof addresses === \"string\") {\n addresses = [addresses];\n }\n const params = {\n addresses: addresses,\n limit\n };\n if (typeof startIndex !== \"undefined\" && startIndex) {\n params.startIndex = startIndex;\n }\n if (typeof sourceChain !== \"undefined\") {\n params.sourceChain = sourceChain;\n }\n return this.callMethod('avax.getUTXOs', params).then((response) => {\n const utxos = new utxos_1.UTXOSet();\n let data = response.data.result.utxos;\n utxos.addArray(data, false);\n response.data.result.utxos = utxos;\n return response.data.result;\n });\n });\n /**\n * Send ANT (Avalanche Native Token) assets including AVAX from an account on the X-Chain to an address on the C-Chain. This transaction\n * must be signed with the key of the account that the asset is sent from and which pays\n * the transaction fee.\n *\n * @param username The Keystore user that controls the account specified in `to`\n * @param password The password of the Keystore user\n * @param to The address of the account the asset is sent to.\n * @param sourceChain The chainID where the funds are coming from. Ex: \"X\"\n *\n * @returns Promise for a string for the transaction, which should be sent to the network\n * by calling issueTx.\n */\n this.import = (username, password, to, sourceChain) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n sourceChain,\n username,\n password,\n };\n return this.callMethod('avax.import', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Send AVAX from an account on the X-Chain to an address on the C-Chain. This transaction\n * must be signed with the key of the account that the AVAX is sent from and which pays\n * the transaction fee.\n *\n * @param username The Keystore user that controls the account specified in `to`\n * @param password The password of the Keystore user\n * @param to The address of the account the AVAX is sent to. This must be the same as the to\n * argument in the corresponding call to the X-Chain’s exportAVAX\n * @param sourceChain The chainID where the funds are coming from.\n *\n * @returns Promise for a string for the transaction, which should be sent to the network\n * by calling issueTx.\n */\n this.importAVAX = (username, password, to, sourceChain) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n sourceChain,\n username,\n password,\n };\n return this.callMethod('avax.importAVAX', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Give a user control over an address by providing the private key that controls the address.\n *\n * @param username The name of the user to store the private key\n * @param password The password that unlocks the user\n * @param privateKey A string representing the private key in the vm's format\n *\n * @returns The address for the imported private key.\n */\n this.importKey = (username, password, privateKey) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n privateKey,\n };\n return this.callMethod('avax.importKey', params).then((response) => response.data.result.address);\n });\n /**\n * Calls the node's issueTx method from the API and returns the resulting transaction ID as a string.\n *\n * @param tx A string, {@link https://github.com/feross/buffer|Buffer}, or [[Tx]] representing a transaction\n *\n * @returns A Promise<string> representing the transaction ID of the posted transaction.\n */\n this.issueTx = (tx) => __awaiter(this, void 0, void 0, function* () {\n let Transaction = '';\n if (typeof tx === 'string') {\n Transaction = tx;\n }\n else if (tx instanceof buffer_1.Buffer) {\n const txobj = new tx_1.Tx();\n txobj.fromBuffer(tx);\n Transaction = txobj.toString();\n }\n else if (tx instanceof tx_1.Tx) {\n Transaction = tx.toString();\n }\n else {\n /* istanbul ignore next */\n throw new Error('Error - avax.issueTx: provided tx is not expected type of string, Buffer, or Tx');\n }\n const params = {\n tx: Transaction.toString(),\n };\n return this.callMethod('avax.issueTx', params).then((response) => response.data.result.txID);\n });\n /**\n * Exports the private key for an address.\n *\n * @param username The name of the user with the private key\n * @param password The password used to decrypt the private key\n * @param address The address whose private key should be exported\n *\n * @returns Promise with the decrypted private key as store in the database\n */\n this.exportKey = (username, password, address) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n address,\n };\n return this.callMethod('avax.exportKey', params).then((response) => response.data.result.privateKey);\n });\n /**\n * Helper function which creates an unsigned Import Tx. For more granular control, you may create your own\n * [[UnsignedTx]] manually (with their corresponding [[TransferableInput]]s, [[TransferableOutput]]s).\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param toAddress The address to send the funds\n * @param ownerAddresses The addresses being used to import\n * @param sourceChain The chainid for where the import is coming from\n * @param fromAddresses The addresses being used to send the funds from the UTXOs provided\n *\n * @returns An unsigned transaction ([[UnsignedTx]]) which contains a [[ImportTx]].\n *\n * @remarks\n * This helper exists because the endpoint API should be the primary point of entry for most functionality.\n */\n this.buildImportTx = (utxoset, toAddress, ownerAddresses, sourceChain, fromAddresses) => __awaiter(this, void 0, void 0, function* () {\n const from = this._cleanAddressArray(fromAddresses, 'buildImportTx').map((a) => bintools.stringToAddress(a));\n let srcChain = undefined;\n if (typeof sourceChain === \"string\") {\n // if there is a sourceChain passed in and it's a string then save the string value and cast the original\n // variable from a string to a Buffer\n srcChain = sourceChain;\n sourceChain = bintools.cb58Decode(sourceChain);\n }\n else if (typeof sourceChain === \"undefined\" || !(sourceChain instanceof buffer_1.Buffer)) {\n // if there is no sourceChain passed in or the sourceChain is any data type other than a Buffer then throw an error\n throw new Error('Error - EVMAPI.buildImportTx: sourceChain is undefined or invalid sourceChain type.');\n }\n const utxoResponse = yield this.getUTXOs(ownerAddresses, srcChain, 0, undefined);\n const atomicUTXOs = utxoResponse.utxos;\n const avaxAssetID = yield this.getAVAXAssetID();\n const atomics = atomicUTXOs.getAllUTXOs();\n if (atomics.length === 0) {\n throw new Error(\"Error - EVMAPI.buildImportTx: no atomic utxos to import\");\n }\n const builtUnsignedTx = utxoset.buildImportTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), [toAddress], from, atomics, sourceChain, this.getTxFee(), avaxAssetID);\n return builtUnsignedTx;\n });\n /**\n * Helper function which creates an unsigned Export Tx. For more granular control, you may create your own\n * [[UnsignedTx]] manually (with their corresponding [[TransferableInput]]s, [[TransferableOutput]]s).\n *\n * @param amount The amount being exported as a {@link https://github.com/indutny/bn.js/|BN}\n * @param assetID The asset id which is being sent\n * @param destinationChain The chainid for where the assets will be sent.\n * @param toAddresses The addresses to send the funds\n * @param fromAddresses The addresses being used to send the funds from the UTXOs provided\n * @param changeAddresses The addresses that can spend the change remaining from the spent UTXOs\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n * @param locktime Optional. The locktime field created in the resulting outputs\n * @param threshold Optional. The number of signatures required to spend the funds in the resultant UTXO\n *\n * @returns An unsigned transaction ([[UnsignedTx]]) which contains an [[ExportTx]].\n */\n this.buildExportTx = (amount, assetID, destinationChain, fromAddressHex, fromAddressBech, toAddresses, nonce = 0, locktime = new bn_js_1.default(0), threshold = 1) => __awaiter(this, void 0, void 0, function* () {\n let prefixes = {};\n toAddresses.map((address) => {\n prefixes[address.split(\"-\")[0]] = true;\n });\n if (Object.keys(prefixes).length !== 1) {\n throw new Error(\"Error - EVMAPI.buildExportTx: To addresses must have the same chainID prefix.\");\n }\n if (typeof destinationChain === \"undefined\") {\n throw new Error(\"Error - EVMAPI.buildExportTx: Destination ChainID is undefined.\");\n }\n else if (typeof destinationChain === \"string\") {\n destinationChain = bintools.cb58Decode(destinationChain);\n }\n else if (!(destinationChain instanceof buffer_1.Buffer)) {\n throw new Error(\"Error - EVMAPI.buildExportTx: Invalid destinationChain type\");\n }\n if (destinationChain.length !== 32) {\n throw new Error(\"Error - EVMAPI.buildExportTx: Destination ChainID must be 32 bytes in length.\");\n }\n const fee = this.getTxFee();\n const assetDescription = yield this.getAssetDescription(\"AVAX\");\n const evmInputs = [];\n if (bintools.cb58Encode(assetDescription.assetID) === assetID) {\n const evmInput = new inputs_1.EVMInput(fromAddressHex, amount.add(fee), assetID, nonce);\n evmInput.addSignatureIdx(0, bintools.stringToAddress(fromAddressBech));\n evmInputs.push(evmInput);\n }\n else {\n // if asset id isn't AVAX asset id then create 2 inputs\n // first input will be AVAX and will be for the amount of the fee\n // second input will be the ANT\n const evmAVAXInput = new inputs_1.EVMInput(fromAddressHex, fee, assetDescription.assetID, nonce);\n evmAVAXInput.addSignatureIdx(0, bintools.stringToAddress(fromAddressBech));\n evmInputs.push(evmAVAXInput);\n const evmANTInput = new inputs_1.EVMInput(fromAddressHex, amount, assetID, nonce);\n evmANTInput.addSignatureIdx(0, bintools.stringToAddress(fromAddressBech));\n evmInputs.push(evmANTInput);\n }\n const to = [];\n toAddresses.map((address) => {\n to.push(bintools.stringToAddress(address));\n });\n let exportedOuts = [];\n const secpTransferOutput = new outputs_1.SECPTransferOutput(amount, to, locktime, threshold);\n const transferableOutput = new outputs_1.TransferableOutput(bintools.cb58Decode(assetID), secpTransferOutput);\n exportedOuts.push(transferableOutput);\n // lexicographically sort array\n exportedOuts = exportedOuts.sort(outputs_1.TransferableOutput.comparator());\n const exportTx = new exporttx_1.ExportTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), destinationChain, evmInputs, exportedOuts);\n const unsignedTx = new tx_1.UnsignedTx(exportTx);\n return unsignedTx;\n });\n /**\n * Gets a reference to the keychain for this class.\n *\n * @returns The instance of [[KeyChain]] for this class\n */\n this.keyChain = () => this.keychain;\n this.blockchainID = blockchainID;\n const netID = core.getNetworkID();\n if (netID in constants_1.Defaults.network && blockchainID in constants_1.Defaults.network[netID]) {\n const { alias } = constants_1.Defaults.network[netID][blockchainID];\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), alias);\n }\n else {\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), blockchainID);\n }\n }", "mineCoins(web3, miningParameters , minerEthAddress, addressFrom)\n {\n\n\n var solution_number = web3utils.randomHex(32) //solution_number like bitcoin\n\n var challenge_number = miningParameters.challengeNumber;\n var target = miningParameters.miningTarget;\n var difficulty = miningParameters.miningDifficulty;\n\n var digest = web3utils.soliditySha3( challenge_number , addressFrom, solution_number )\n\n\n // console.log(web3utils.hexToBytes('0x0'))\n var digestBytes32 = web3utils.hexToBytes(digest)\n var digestBigNumber = web3utils.toBN(digest)\n\n var miningTarget = web3utils.toBN(target) ;\n\n\n\n //console.log('digestBigNumber',digestBigNumber.toString())\n //console.log('miningTarget',miningTarget.toString())\n\n if ( digestBigNumber.lt(miningTarget) )\n {\n\n if(this.testMode){\n console.log(minerEthAddress)\n console.log('------')\n console.log(solution_number)\n console.log(challenge_number)\n console.log(solution_number)\n console.log('------')\n console.log( web3utils.bytesToHex(digestBytes32))\n\n //pass in digest bytes or trimmed ?\n\n\n this.mining = false;\n\n /*this.networkInterface.checkMiningSolution( minerEthAddress, solution_number , web3utils.bytesToHex( digestBytes32 ),challenge_number,miningTarget,\n function(result){\n console.log('checked mining soln:' ,result)\n })*/\n\n\n }else {\n console.log('submit mined solution with challenge ', challenge_number)\n\n this.submitNewMinedBlock( addressFrom, minerEthAddress, solution_number, web3utils.bytesToHex( digestBytes32 ) , challenge_number, target, difficulty );\n }\n }\n\n\n }", "async function submit(privateKey, courseAddress, filehash) {\n urls.find().toArray()\n .then(results => {\n rpcUrl = results[0].url\n console.log(rpcUrl);\n })\n .catch()\n const provider = new HDWalletProvider(privateKey, rpcUrl)\n web3 = new Web3(provider)\n const accounts = await web3.eth.getAccounts()\n\n const courseContract = new web3.eth.Contract(CourseAbi, courseAddress)\n await courseContract.methods.submit(filehash).send({ from: accounts[0] }, (error, result) => { console.log(result) })\n return \"true\";\n}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to update the status from HCI\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Get all the Entries that are applicable for update\n\t\t\t\tvar oDBRecords = getAllDBEntries();\n\t\t\t\t//Read the Status from Cloud Integration\n\t\t\t\tvar oHCIRecords = retrieveRecordsFromHCI(oDBRecords.valueSet);\n\t\t\t\t//Execute the updates\n\t\t\t\tvar oUpdateResults = mapUpdates(oHCIRecords.retrievedValues, oDBRecords.valueMap);\n\t\t\t\t//Write to the trace\n\t\t\t\t$.trace.info(JSON.stringify({\n\t\t\t\t\ttotalDBRecords: oDBRecords.valueSet.length,\n\t\t\t\t\ttotalHCIRecordsRetrieved: oHCIRecords.retrievedValues.length,\n\t\t\t\t\ttotalHCIFailedRetrievals: oHCIRecords.failedRetrievals.length,\n\t\t\t\t\tHCIFailedRetrievalDetails: oHCIRecords.failedRetrievals,\n\t\t\t\t\tupdatesRequested: oUpdateResults.iUpdatesRequested,\n\t\t\t\t\tupdatesProcessed: oUpdateResults.iUpdatesProcessed\n\t\t\t\t}));\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tTableUpdateStatus: gvTableUpdate\n\t\t\t}));\n\t\t}\n\t}", "async function runTrasaction(GCI, pathFolder, address, amount) {\n let client = await lotion.connect(GCI)\n let wallet = coins.wallet(pathNewFolder,client)\n return await wallet.send(address, amount)\n }", "async function main() {\n // Buidler always runs the compile task when running scripts through it.\n // If this runs in a standalone fashion you may want to call compile manually\n // to make sure everything is compiled\n // await bre.run('compile');\n\n // We get the contract to deploy\n const Greeter = await ethers.getContractFactory('Greeter')\n const greeter = await Greeter.deploy('Hello, Buidler!')\n\n await greeter.deployed()\n\n console.log('Greeter deployed to:', greeter.address)\n}", "async function doDeploy() {\n var file_id = await createFile(\"state.data\", [])\n var send_opt = {gas:4700000, from:config.base}\n console.log(send_opt, file_id)\n var init_hash = \"0xc555544c6083b2a311c8999924893ced050615f712e240c7c439a7d8248226dc\"\n var code_address = \"QmdFE8Wcj7q6447q2sZ7ttNkCxK5TcmHLFQe1j714k6jTY\"\n var contract = await new web3.eth.Contract(abi).deploy({data: code, arguments:[config.tasks, config.fs, file_id, code_address, init_hash]}).send(send_opt)\n contract.setProvider(w3provider)\n config.plasma = contract.options.address\n console.log(JSON.stringify(config))\n var tx = await contract.methods.deposit().send({gas:4700000, from:config.base, value: 100000000})\n console.log(\"deposit\", tx)\n var dta = await contract.methods.debugBlock(1).call(send_opt)\n console.log(\"what happened\", dta)\n var tx = await contract.methods.validateDeposit(1).send({gas:4700000, from:config.base})\n console.log(\"submitted task\", tx)\n contract.events.GotFiles(function (err,ev) {\n console.log(\"Files\", ev.returnValues)\n var files = ev.returnValues.files\n files.forEach(outputFile)\n })\n // process.exit(0)\n}", "async function main() {\n await amazonDB.displayAllItems();\n var userOptions = [\n {\n type: 'input',\n name: 'itemId',\n message: 'Which item would you like to buy? (enter item id)'\n },\n {\n type: 'input',\n name: 'quantity',\n message: 'What quantity would you like to buy?'\n }\n ];\n const userInput = await inquirer.prompt(userOptions);\n const result = await amazonDB.buyItems(userInput.itemId, userInput.quantity);\n await amazonDB.terminate();\n}", "function testNode() {\n // Retrieve the ABI from the local json file\n fetch(\"./contracts/voting.sol\").then(response => {\n return response.text();\n }).then((code) => {\n $.ajax({\n type: \"POST\",\n url: \"http://localhost:8080/toAbi\",\n dataType: \"json\",\n contentType: \"application/json\",\n data: code,\n success: (abi) => {\n if (abi.error) {\n console.log(abi.error);\n } else {\n nodeUrl = $(\".node-url\").val();\n console.log(\"Node url: \" + nodeUrl);\n // Instantiate the web3 object\n if (typeof web3 !== 'undefined') {\n web3 = new Web3(web3.currentProvider);\n } else {\n web3 = new Web3(new Web3.providers.HttpProvider(nodeUrl));\n // web3.setProvider(new Web3.providers.WebsocketProvider('ws://localhost:8545'));\n }\n // Get the available accounts\n web3.eth.getAccounts().then(accounts => {\n // Create a voting contract instance\n var votingInstance = new web3.eth.Contract(abi.abiDefinition);\n $(\".compat-contract-abi\").html(syntaxHighlight(JSON.stringify(abi.abiDefinition, null, 4)));\n $(\".compat-contract-code\").html(code);\n // Just take the first one\n web3.eth.defaultAccount = accounts[0];\n // Same as the default account\n votingInstance.options.from = web3.eth.defaultAccount;\n if (web3.utils.isAddress(address)) {\n web3.eth.getCode(address).then(data => {\n if (data === \"0x0\") {\n $(\".compat-deploy-new\").text(\"true\");\n deployContract(votingInstance, abi, accounts, nodeUrl);\n } else {\n $(\".compat-deploy-new\").text(\"false\");\n votingInstance.options.address = address;\n $(\".compat-deploy-address\").text(address);\n setupExampleUI(votingInstance);\n testRpcCalls(abi.abiDefinition, accounts, abi.byteCode, votingInstance);\n $(\".contract-address\").html(\"(\" + nodeUrl + \")\");\n $(\".spinner\").hide();\n $(\".compat-content\").show();\n }\n });\n } else {\n $(\".compat-deploy-new\").text(\"true\");\n deployContract(votingInstance, abi, accounts, nodeUrl);\n }\n }).catch(data => {\n console.error(data);\n $(\".contract-address\").html(\"(\" + nodeUrl + \")\");\n $(\".no-ganache-cli-info\").show();\n $(\".spinner\").hide();\n });\n }\n }\n });\n });\n}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to schedule the alert job\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tif (gvMethod === \"Create\" || gvMethod === \"CREATE\") {\n\t\t\t\t\tDeleteJob();\n\t\t\t\t\tScheduleJob();\n\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, schedule created\"\n\t\t\t\t\t}));\n\t\t\t\t} else if (gvMethod === \"DELETE\" || gvMethod === \"Delete\") {\n\t\t\t\t\tDeleteJob();\n\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, schedule deleted\"\n\t\t\t\t\t}));\n\t\t\t\t} else {\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called, but no action taken, method was not supplied\"\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\n\t\t}\n\t}", "handler(app, req, res) {\n wallet.stop();\n network.stop();\n peer.stop();\n database.runVacuumAll()\n .then(() => database.runWallCheckpointAll())\n .then(() => {\n return wallet.initialize(true)\n .then(() => network.initialize())\n .then(() => peer.initialize())\n .then(() => {\n res.send({api_status: 'success'});\n });\n })\n .catch(e => res.send({\n api_status : 'fail',\n api_message: `unexpected generic api error: (${e})`\n }));\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 loadBlockchainData() { \n //Obtener la cuenta\n const web3 = window.web3;\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n console.log(accounts)\n \n //Obtener la red\n const networkId = await web3.eth.net.getId();\n console.log(networkId)\n const networkData = Curriculum.networks[networkId];\n console.log(networkData)\n \n if (networkData) {\n //Obtener abi\n const abi = Curriculum.abi\n console.log(abi)\n //Obtener la dirección\n const address = networkData.address\n console.log(address)\n //Fetch Contrato\n const contract = new web3.eth.Contract(abi, address)\n this.setState({contract})\n const ipfsHash = await contract.methods.get().call()\n\n this.setState({ipfsHash})\n console.log(ipfsHash)\n } else {\n window.alert('El Smart Contract no ha sido desplegado en la red.')\n }\n\n }", "function testInvoke (scriptHash, operation, arg1, arg2, assetType, assetAmount ) {\n var args = [arg1, arg2]\n\n var tx = {'operation': operation, 'args': args, 'scriptHash': scriptHash, 'amount': assetAmount, 'type': assetType }\n\n // test invoke contract\n chrome.runtime.sendMessage({'msg': 'testInvoke', 'tx': tx}, function(response) {\n if (response.error) {\n console.log('contentInit testInvoke error: '+response.error)\n window.postMessage(response.error, '*')\n } else {\n console.log('contentInit testInvoke response: '+response.msg)\n // TODO: send invoke result to page\n window.postMessage(response.msg, '*')\n }\n })\n}", "secondPass(ledger) {}", "function initialize_rpc() {\n try {\n window.web3 = new Web3(new Web3.providers.HttpProvider(document.getElementById(\"initialize_rpc_input\").value));\n newBlockchain.setChainId(document.getElementById(\"initialize_chainid_input\").value);\n try {\n web3.eth.getNodeInfo(function(error, nodeInfo) {\n if (!error) {\n document.getElementById(\"initialize_rpc_output\").innerHTML = \"Connected to: \" + nodeInfo;\n document.getElementById(\"initialize_rpc_output_2\").innerHTML = \"RPC: \" + document.getElementById(\"initialize_rpc_input\").value;\n }\n });\n } catch {\n document.getElementById(\"initialize_rpc_output\").innerHTML = error;\n\n }\n try {\n web3.eth.getChainId(function(error, chainId) {\n if (!error) {\n document.getElementById(\"initialize_rpc_output_3\").innerHTML = \"ChainId: \" + chainId;\n }\n });\n } catch (err) {\n document.getElementById(\"initialize_rpc_output_4\").innerHTML = err;\n }\n try {\n web3.eth.getBlockNumber(function(error, blockNumber) {\n if (!error) {\n //console.log(blockNumber);\n document.getElementById(\"initialize_rpc_output_4\").innerHTML = \"Latest block number: \" + blockNumber;\n } else {\n document.getElementById(\"initialize_rpc_output_4\").innerHTML = error;\n }\n });\n } catch (error) {\n document.getElementById(\"latest_block_number_output\").innerHTML = error;\n }\n } catch (error) {\n document.getElementById(\"initialize_rpc_output\").innerHTML = \"Unable to connect to: \" + document.getElementById(\"initialize_rpc_input\").value + \"\\n\" + error;\n }\n\n}", "function Handle(args) {\n\tLogger.warn('--------------In credit Hndle Method-------------');\n\tvar paymentInstrument;\n var cart = Cart.get(args.Basket);\n var creditCardForm = app.getForm('billing.paymentMethods.creditCard');\n var PaymentMgr = require('dw/order/PaymentMgr');\n var cardNumber = creditCardForm.get('number').value();\n var cardSecurityCode = creditCardForm.get('cvn').value();\n var cardType = creditCardForm.get('type').value();\n var expirationMonth = creditCardForm.get('expiration.month').value();\n var expirationYear = creditCardForm.get('expiration.year').value();\n var paymentCard = PaymentMgr.getPaymentCard(cardType);\n\n var creditCardStatus = paymentCard.verify(expirationMonth, expirationYear, cardNumber, cardSecurityCode);\n\n if (creditCardStatus.error) {\n\n var invalidatePaymentCardFormElements = require('app_oscill8/cartridge/scripts/checkout/InvalidatePaymentCardFormElements');\n invalidatePaymentCardFormElements.invalidatePaymentCardForm(creditCardStatus, session.forms.billing.paymentMethods.creditCard);\n\n return {error: true};\n }\n\n Transaction.wrap(function () {\n cart.removeExistingPaymentInstruments(dw.order.PaymentInstrument.METHOD_CREDIT_CARD);\n paymentInstrument = cart.createPaymentInstrument(dw.order.PaymentInstrument.METHOD_CREDIT_CARD, cart.getNonGiftCertificateAmount());\n\n paymentInstrument.creditCardHolder = creditCardForm.get('owner').value();\n paymentInstrument.creditCardNumber = cardNumber;\n paymentInstrument.creditCardType = cardType;\n paymentInstrument.creditCardExpirationMonth = expirationMonth;\n paymentInstrument.creditCardExpirationYear = expirationYear;\n });\n\n try{\n \tgetToken(paymentInstrument,cardSecurityCode);\n }catch(ex){\n \tLogger.error(ex.message);\n\t\treturn {error: true, errorMessage: ex.message};\n }\n\n return {error: false, success: true};\n}", "async loadBlockchainData() {\n const web3 = await window.web3;\n const account = await web3.eth.getAccounts(); // get the account from our blockchain data \n\n this.setState({ account: account[0] });\n console.log(account); // 0x6021e2c50B7Ff151EDb143e60DDf52358a33689B\n\n // set up network ID that we can connect to Tether contract\n const networkID = await web3.eth.net.getId();\n console.log(networkID) // 5777\n\n // load Tether Contract\n const tetherData = Tether.networks[networkID];\n if (tetherData) {\n const tether = new web3.eth.Contract(Tether.abi, tetherData.address) // ABI + Address \n this.setState({ tether });\n // load Tether balance\n let tetherBalance = await tether.methods.balanceOf(this.state.account).call();\n this.setState({ tetherBalance: tetherBalance.toString() }); // set to the state of tether.balance{}\n console.log({balance: tetherBalance}, 'tether balance')\n } else { // if we dont load tether data\n alert('Error! Tether contract data not available. Consider changing to the Ganache network.')\n }\n \n \n // load Reward token Contract\n const rewardData = Reward.networks[networkID];\n if (rewardData) {\n const reward = new web3.eth.Contract(Reward.abi, rewardData.address) // ABI + Address \n this.setState({ reward });\n // load Tether balance\n let rewardBalance = await reward.methods.balanceOf(this.state.account).call();\n this.setState({ rewardBalance: rewardBalance.toString() }); \n console.log({balance: rewardBalance})\n } else { \n alert('Error! Reward contract data not available. Consider changing to the Ganache network.')\n }\n\n // load Decentral Bank Contract\n const decentralBankData = DecentralBank.networks[networkID];\n if (decentralBankData) {\n const decentralBank = new web3.eth.Contract(DecentralBank.abi, decentralBankData.address) \n this.setState({ decentralBank });\n let stakingBalance = await decentralBank.methods.stakingBalance(this.state.account).call();\n this.setState({ stakingBalance: stakingBalance.toString() }); \n console.log({balance: stakingBalance})\n } else { \n alert('Error! Decentral Bank contract data not available. Consider changing to the Ganache network.')\n }\n\n this.setState({loading: false });\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 }", "function payumoney() {\n // Data to be Sent to API to generate hash.\n let data = {\n 'txnid': RequestData.txnid,\n 'email': RequestData.email,\n 'amount': RequestData.amount,\n 'productinfo': RequestData.productinfo,\n 'firstname': RequestData.firstname\n }\n\n // API call to get the Hash value\n fetch('http://localhost:3000/payment/payumoney', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n })\n .then(function (a) {\n return a.json();\n })\n .then(function (json) {\n RequestData.hash = json['hash']\n // With the hash value in response, we are ready to launch the bolt overlay.\n //Function to launch BOLT \n console.log(RequestData);\n bolt.launch(RequestData, {\n responseHandler: function (response) {\n fetch('http://localhost:3000/payment/payumoney/response', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(response.response)\n })\n .then(function (a) {\n return a.json();\n })\n .then(function (json) {\n console.log(json);\n });\n },\n catchException: function (BOLT) {\n console.log(BOLT);\n }\n });\n });\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 actionButton() {\n\t\t\tif ($('#status').hasClass('play')) {\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\t// capture screenshot\n\t\t\t\t\tvar xml = capture.captureXml();\n\n\t\t\t\t\t// log screenshot data to database\n\t\t\t\t\tdbService.saveProgram(xml);\n\n\t\t\t\t\t// capture blockly and run generated code\n\t\t\t\t\tvar code = Blockly.JavaScript.workspaceToCode(vm.workspace);\n\t\t\t\t\teval(code);\n\t\t\t\t} else {\n\t\t\t\t\t// capture screenshot and save to database\n\t\t\t\t\tcapture.capturePng('.program-inner');\n\n\t\t\t\t\t// convert program in to list of instructions\n\t\t\t\t\tvar program = [];\n\n\t\t\t\t\tfor (var i = 0; i < vm.program.length; i++) {\n\t\t\t\t\t\tvar ins = vm.program[i];\n\t\t\t\t\t\tprogram.push(ins.name);\n\t\t\t\t\t}\n\n\t\t\t\t\tdbService.saveProgram(program);\n\t\t\t\t}\n\n\t\t\t\t// run program\n\t\t\t\trun();\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('play');\n\n\t\t\t} else if ($('#status').hasClass('stop')) {\n\n\t\t\t\t// stop program\n\t\t\t\tstate.current = state.STOPPED;\n\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\tvm.program.length = 0;\n\t\t\t\t}\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('stop');\n\n\t\t\t} else if ($('#status').hasClass('rewind')) {\n\t\t\t\trewind();\n\t\t\t}\n\t\t}", "function main() {\n var client = new protoDefinition.NeoTv('localhost:50051',\n grpc.credentials.createInsecure());\n\n \n app.get('/', (req, res) => res.send('Hello World!'))\n app.get('/neotv', (req, res) => {\n const data = req.query;\n return client.GetNeoTvStatus({username: data.username, password: data.password, carrier: data.carrier}, (err, status) => {\n res.send(status);\n })\n })\n\n app.listen(port, () => console.log(`Example app listening on port ${port}!`))\n app.use(bodyParser.json());\n}", "async function main(params) {\n const command = params.command || 'hello';\n const message = await invokeAction(command, params);\n return {message};\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 }" ]
[ "0.66196954", "0.65700436", "0.6427699", "0.63748246", "0.6232355", "0.6226786", "0.61842936", "0.6132682", "0.6109165", "0.61013365", "0.6100003", "0.6087239", "0.608478", "0.6067054", "0.6038895", "0.60273206", "0.6024793", "0.6013771", "0.59981024", "0.5965869", "0.5961196", "0.59373426", "0.5921662", "0.5903676", "0.5897629", "0.5894792", "0.58538204", "0.5852637", "0.5851885", "0.5827926", "0.57981735", "0.5794529", "0.5776551", "0.57401174", "0.5731802", "0.5722959", "0.5718987", "0.5708057", "0.5705885", "0.5693131", "0.5688958", "0.56770873", "0.56764245", "0.56640935", "0.56589586", "0.564446", "0.5643103", "0.5632379", "0.5626495", "0.5624158", "0.56194067", "0.56063336", "0.5605582", "0.55942243", "0.5567556", "0.5563287", "0.55594075", "0.5555112", "0.55540323", "0.5548799", "0.5542703", "0.55421543", "0.5537294", "0.5529494", "0.5517638", "0.55131406", "0.5510424", "0.54804975", "0.5476565", "0.54720473", "0.5463668", "0.5457733", "0.5444744", "0.5441549", "0.5436502", "0.5426604", "0.5419492", "0.5404523", "0.54012245", "0.53997034", "0.53957134", "0.53944916", "0.53833354", "0.5374436", "0.5357563", "0.5347627", "0.5343381", "0.53399956", "0.533746", "0.5335757", "0.5335595", "0.5332509", "0.5316421", "0.53148216", "0.5313529", "0.5305713", "0.53032476", "0.52932674", "0.52898884", "0.5289861" ]
0.60639554
14
Imediadtely Invoked Function Expression
function hi(myUser){ console.log(myUser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function e(e){return (0, F[e.operation])(...e.parameters)}", "function n(e){return function(){return e}}", "function a(e){return function(t){return i(t,e)}}", "function a(e){return function(t){return i(t,e)}}", "function callFunctionBody(expr) {\n return (\n '(function f() {\\n'\n + 'Object.defineProperties(arguments, {1: { writable: false },\\n'\n + ' 2: { configurable: false },\\n'\n + ' 3: { writable: false,\\n'\n + ' configurable: false }});\\n'\n + 'return (' + expr + ');\\n'\n + '})(0, 1, 2, 3);');\n}", "operator(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n }", "function justInvoke(fn){\n return fn()\n}//justInvoke", "handler(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n }", "function o(e){return function(){return e}}", "function getExpression(_, ctx) {\n var k = 'e:' + _.$expr;\n return ctx.fn[k]\n || (ctx.fn[k] = Object(__WEBPACK_IMPORTED_MODULE_3_vega_util__[\"d\" /* accessor */])(Object(__WEBPACK_IMPORTED_MODULE_1__expression__[\"e\" /* parameterExpression */])(_.$expr, ctx), _.$fields, _.$name));\n}", "function call() { //Modified this from function expression to function declaration.\r\n console.log(\"I am calling\");\r\n}", "function makefunc(x) {\r\n// return function() { return x; }\r\n// return new Function($direct_func_xxx$);\r\n return new Function(\"return x;\")\r\n}", "function FunctionExpression(node, print) {\n\t if (node.async) this.push(\"async \");\n\t this.push(\"function\");\n\t if (node.generator) this.push(\"*\");\n\n\t if (node.id) {\n\t this.push(\" \");\n\t print.plain(node.id);\n\t } else {\n\t this.space();\n\t }\n\n\t this._params(node, print);\n\t this.space();\n\t print.plain(node.body);\n\t}", "function FunctionExpression(node, print) {\n\t if (node.async) this.push(\"async \");\n\t this.push(\"function\");\n\t if (node.generator) this.push(\"*\");\n\n\t if (node.id) {\n\t this.push(\" \");\n\t print.plain(node.id);\n\t } else {\n\t this.space();\n\t }\n\n\t this._params(node, print);\n\t this.space();\n\t print.plain(node.body);\n\t}", "function Xb(){return function(v){return v}}", "parameter(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return (datum, _) => interpret(ast, fn, _, datum);\n }", "_thisIsAUsedExpression(getter) {}", "_thisIsAUsedExpression(getter) {}", "function i(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "function a(fn) { fn()}", "function identity(x) {\n\t var c = new Function('y', 'return function(){return y}')\n\t return c(x)\n\t}", "function identity(x) {\n\t var c = new Function('y', 'return function(){return y}')\n\t return c(x)\n\t}", "static _gX(fn, lambda){\n return lambda+\"*(\"+fn+\")+x\";\n }", "function myFnCall(fn) {\n return new Function('return ' + fn)();\n }", "event(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n }", "function expression(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n }", "function FunctionExpression(node, print) {\n if (node.async) this.push(\"async \");\n this.push(\"function\");\n if (node.generator) this.push(\"*\");\n\n if (node.id) {\n this.push(\" \");\n print.plain(node.id);\n } else {\n this.space();\n }\n\n this._params(node, print);\n this.space();\n print.plain(node.body);\n}", "function Fn($1) { return function($2) { return Function_ ([$1, $2]); }; }", "function Expr() {}", "function makeEmptyFunction(arg) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn arg;\n\t\t\t\t\t};\n\t\t\t\t}", "function aa() {\n return function() {}\n }", "function getExpression(_, ctx) {\n var k = 'e:' + _.$expr;\n return ctx.fn[k]\n || (ctx.fn[k] = (0,vega_util__WEBPACK_IMPORTED_MODULE_3__.accessor)((0,_expression__WEBPACK_IMPORTED_MODULE_1__.parameterExpression)(_.$expr, ctx), _.$fields, _.$name));\n}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg) {\n\t\t\t return function () {\n\t\t\t return arg;\n\t\t\t };\n\t\t\t}", "function r(e,t,a){f(function(){e(t,a)})}", "function eta(f){ \r\n var args = slice(arguments, 1)\r\n return function(){\r\n return f.apply(null, args)\r\n }\r\n}", "function e(a){f(Fa,a)}", "function g(){return function(){}}", "function FunctionValueExpression$(fun/*:Function*/, args/*:Array = null*/) {this.super$nJmn();if(arguments.length<=1)args=null;\n this.fun$nJmn = fun;\n this.args$nJmn = args || [];\n }", "function $return_val(arg) {\n return function() {\n return arg;\n }\n }", "function pure(x){\n\tvar z = x;\n\treturn function(y){\t\t\n\t\treturn z + y;\t\t\n\t}\t\n}", "function expression(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}", "function expression(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}", "function v(){return function(){}}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function constant(arg) {\n return function () {\n return arg;\n };\n }", "function expression$2(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n }", "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "function e(a,b){return function(){return a.apply(b,arguments)}}", "Evaluate() {}", "function identity(x) {\n var c = new Function(\"y\", \"return function(){return y}\")\n return c(x)\n}", "function sum1(a,b){\n var total = a+b;\n console.log(total);\n // but it is not a fully function expression\n}", "function a(fn) {\n fn()\n}", "function functionCall(stream, a) {\n var name = stream.trypopfuncname(stream, a);\n if (null == name) return null;\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ( ) after function name.');\n var params = [];\n var first = true;\n while (null == stream.trypop(')')) {\n if (!first && null == stream.trypop(','))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected , between arguments of the function.');\n first = false;\n var param = orExpr(stream, a);\n if (param == null)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression as argument of function.');\n params.push(param);\n }\n return a.node('FunctionCall', name, params);\n }", "function functionCall(stream, a) {\n var name = stream.trypopfuncname(stream, a);\n if (null == name) return null;\n if (null == stream.trypop('('))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ( ) after function name.');\n var params = [];\n var first = true;\n while (null == stream.trypop(')')) {\n if (!first && null == stream.trypop(','))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected , between arguments of the function.');\n first = false;\n var param = orExpr(stream, a);\n if (param == null)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression as argument of function.');\n params.push(param);\n }\n return a.node('FunctionCall', name, params);\n }", "function pn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fn(e);try{return t.apply(e,arguments)}finally{on(e)}}}", "function makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t }", "function Addition(x){\r\n // it is return some reference no name of function just a refernce\r\n return function (y){\r\n return x+y;\r\n };\r\n}", "function makeEmptyFunction(arg) {\r\n\t return function () {\r\n\t return arg;\r\n\t };\r\n\t}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n }", "function CallExpression() {\n\t return resolveCall(this.get(\"callee\"));\n\t}", "function CallExpression() {\n\t return resolveCall(this.get(\"callee\"));\n\t}", "function fn() {}", "function Callable(wat) {\nreturn wat;\n}", "function n(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "function makeEmptyFunction(arg) {\n\t\t return function () {\n\t\t return arg;\n\t\t };\n\t\t}", "function makeEmptyFunction(arg) {\n\t\t return function () {\n\t\t return arg;\n\t\t };\n\t\t}", "function makeEmptyFunction(arg) {\n\t\t return function () {\n\t\t return arg;\n\t\t };\n\t\t}", "function makeEmptyFunction(arg) {\n\t\t return function () {\n\t\t return arg;\n\t\t };\n\t\t}", "function makeEmptyFunction(arg) {\n\t\t return function () {\n\t\t return arg;\n\t\t };\n\t\t}", "function show() {\n return x => x + arguments[0];\n}", "function myFunction(a, b) {\n var myFunction = (a,b); {\n\n }\n console.log(myFunction)\n\n }", "function f() {\n (e)\n}", "function Eval() {\r\n}", "function identity(fn){return fn;}", "function plus( b ) { return function( a ) { return a + b; }; }", "function r(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "function r(e,t){if(\"function\"!=typeof e)throw new TypeError(\"argument fn must be a function\");return e}", "function va(t,e){0}", "function ea(){}", "function add() {\n return a +90; // the callable object returns an expression (a) which is \n // defined outside of the callable object \n }", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }" ]
[ "0.69630665", "0.6760034", "0.6754553", "0.6754553", "0.6700711", "0.66846997", "0.668468", "0.6577617", "0.64519304", "0.6422", "0.6393734", "0.63862824", "0.6367659", "0.6367659", "0.63059425", "0.6303019", "0.6302432", "0.6302432", "0.6292148", "0.6290676", "0.62816036", "0.62816036", "0.6265016", "0.6242564", "0.62158394", "0.61988837", "0.61979204", "0.618778", "0.61537725", "0.61502695", "0.61493367", "0.61265415", "0.61227834", "0.61227834", "0.61227834", "0.61227834", "0.61227834", "0.61227834", "0.6113821", "0.61108524", "0.6110273", "0.610994", "0.6105937", "0.61001337", "0.6098571", "0.6096358", "0.60909694", "0.60909694", "0.60855997", "0.6074709", "0.6074709", "0.6074709", "0.6074709", "0.6074709", "0.6074709", "0.6074709", "0.6074709", "0.60705876", "0.6069556", "0.6063679", "0.6063679", "0.6063679", "0.6063679", "0.6063679", "0.605909", "0.60475105", "0.60352933", "0.60330695", "0.6030612", "0.6029817", "0.6029817", "0.60192835", "0.60130835", "0.6005772", "0.6003402", "0.600027", "0.600027", "0.600027", "0.5999554", "0.5982216", "0.5982216", "0.5981201", "0.5975148", "0.5959426", "0.59549934", "0.59549934", "0.59549934", "0.59549934", "0.59549934", "0.5952386", "0.5948408", "0.59464717", "0.5941442", "0.593757", "0.5933568", "0.59317064", "0.59317064", "0.59163606", "0.5915573", "0.5913346", "0.5907984" ]
0.0
-1
your job is to finish writing these functions and variables that we've named // don't change the names or your program won't work as expected.
function initialPrompt() { console.log("Let's play some scrabble! "); let wordToScore = input.question("Enter a word to score:"); return wordToScore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static private internal function m121() {}", "private internal function m248() {}", "function StupidBug() {}", "function main(){\n\n\n}", "function exercise11() {}", "private public function m246() {}", "function displayMessage() {\n // Task 8: Call each of the functions as properties of the imported object.\n // Task 17: Modify each of the function within each of the displayMessage so that they use only the variable name in the function call.\n console.log(countCharacter(\"What is the color of the sky?\", \"t\"));\n console.log(capitalizeFirstCharacterOfWords(\"What is the color of the sky?\"));\n console.log(reverseWord(\"What is the color of the sky?\"));\n console.log(reverseAllWords(\"What is the color of the sky?\"));\n console.log(replaceFirstOccurence(\"What is the color of the sky?\", \"sky\", \"water\"));\n console.log(Mencode(\"What is the color of the sky?\"));\n // Task 13: Use console.log() to display the output of palindrome()) function. You will need to pass the functions a string.\n console.log(palindrome(\"What is the color of the sky?\"));\n console.log(pigLatin(\"What is the color of the sky?\", \"$\"));\n}", "function exercise07() {}", "protected internal function m252() {}", "static private protected public internal function m117() {}", "function main(){\n\t\n}", "function Main()\n {\n \n }", "static final private internal function m106() {}", "transient protected internal function m189() {}", "static final private protected internal function m103() {}", "function mistake8() {\n\ttoss();//not even a name\n}", "function _____SHARED_functions_____(){}", "function main() {\n\t// call problem # 1\n\tconst moustache = \"Moustache\";\n\tconsole.log(\"Calling hello(\" + moustache + \")\");\n\thello(moustache);\n\n\t// call problem # 2\n\t// (a) - with a name passed in\n\tconsole.log(\"\\nCalling hello2(\" + moustache + \")\");\n\thello2(moustache);\n\t// (b) - without a name passed in\n\tconsole.log(\"\\nCalling hello2()\");\n\thello2();\n\n\t// call problem # 3\n\tconst name2 = \"Anushka\";\n\tconst subject = \"art\";\n\tconsole.log(\"\\nCalling madlib(\" + name2 + \", \" + subject + \")\");\n\tconsole.log(madlib(name2, subject));\n\n\t// call problem # 4\n\t// (a) - service level is good\n\tconst service1 = \"good\";\n\tconst amount1 = 100;\n\tconsole.log(\"\\nCalling tipAmount(\" + amount1 + \", \" + service1 + \")\");\n\tconsole.log(tipAmount(amount1, service1));\n\t// (b) - service level is fair\n\tconst service2 = \"fair\";\n\tconst amount2 = 40;\n\tconsole.log(\"\\nCalling tipAmount(\" + amount2 + \", \" + service2 + \")\");\n\tconsole.log(tipAmount(amount2, service2));\n\t// (c) - service level is bad\n\tconst service3 = \"bad\";\n\tconst amount3 = 20;\n\tconsole.log(\"\\nCalling tipAmount(\" + amount3 + \", \" + service3 + \")\");\n\tconsole.log(tipAmount(amount3, service3));\n\n\t// call problem # 5\n\t// (a) - service level is good\n\tconst service11 = \"good\";\n\tconst amount11 = 200;\n\tconsole.log(\"\\nCalling totalAmount(\" + amount11 + \", \" + service11 + \")\");\n\tconsole.log(totalAmount(amount11, service11));\n\t// (b) - service level is fair\n\tconst service22 = \"fair\";\n\tconst amount22 = 80;\n\tconsole.log(\"\\nCalling totalAmount(\" + amount22 + \", \" + service22 + \")\");\n\tconsole.log(totalAmount(amount22, service22));\n\t// (c) - service level is bad\n\tconst service33 = \"bad\";\n\tconst amount33 = 40;\n\tconsole.log(\"\\nCalling totalAmount(\" + amount33 + \", \" + service33 + \")\");\n\tconsole.log(totalAmount(amount33, service33));\n\n\t// call problem # 6\n\t// (a) - service level is good\n\tconst service111 = \"good\";\n\tconst amount111 = 400;\n\tconst numberOfPersons1 = 5;\n\tconsole.log(\"\\nCalling splitAmount(\" + amount111 + \", \" + service111 + \", \" + numberOfPersons1 + \")\");\n\tconsole.log(splitAmount(amount111, service111, numberOfPersons1));\n\t// (b) - service level is fair\n\tconst service222 = \"fair\";\n\tconst amount222 = 160;\n\tconst numberOfPersons2 = 10;\n\tconsole.log(\"\\nCalling splitAmount(\" + amount222 + \", \" + service222 + \", \" + numberOfPersons2 + \")\");\n\tconsole.log(splitAmount(amount222, service222, numberOfPersons2));\n\t// (c) - service level is bad\n\tconst service333 = \"bad\";\n\tconst amount333 = 80;\n\tconst numberOfPersons3 = 20;\n\tconsole.log(\"\\nCalling splitAmount(\" + amount333 + \", \" + service333 + \", \" + numberOfPersons3 + \")\");\n\tconsole.log(splitAmount(amount333, service333, numberOfPersons3));\n}", "static private protected internal function m118() {}", "function MainFunction()\n{\n 'use strict';\n\n Steps(7);\n\n}", "function exercise06() {}", "function main(){\r\n}", "function main() {\n\n}", "static transient final private internal function m43() {}", "transient private protected internal function m182() {}", "static transient private protected internal function m55() {}", "static final private protected public internal function m102() {}", "function question4() {\n question2('functions in functions');\n}", "function Scdr() {\r\n}", "static transient final private protected internal function m40() {}", "function lalalala() {\n\n}", "function gather() {\n base();\n hootsuite();\n socialpilot();\n socialoomph();\n agorapulse();\n communit();\n crowdfire();\n loomly();\n planable();\n missinglettr();\n viraltag();\n}", "function Func_s() {\n}", "function main() {\n}", "static transient final protected internal function m47() {}", "function _454 (){\n console.log('get a life'); \n}", "function Juggermaw() {\n const juggerKogmaw = \"Season 5 Juggermaw Gluck Gluck Gluck\";\n console.log(`Kogmaw's Best Composition Was: ${juggerKogmaw}`);\n debugger;\n \n function ProtectTheKog() {\n const protecTheKog = \"A Kogmaw with 4.0 attack speed and % health damage. Good times.\";\n console.log(`Behind Every Strong Man Is A Stronger Woman. Behind Her Is: ${protecTheKog}`);\n debugger;\n \n function SlugmawMillionare() {\n const slugawMillionare = \"You Don't. Slugmaw Millionare Cash Money Always Wins BAYBEE\";\n console.log(`The Cash Money Way To Beat Kogmaw Compositions: ${slugawMillionare}`);\n debugger;\n }\n SlugmawMillionare();\n }\n ProtectTheKog();\n }", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "static protected internal function m125() {}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function fm(){}", "function a(num1, num2) { // we have this predictable functioin\n // thats minimized the bugs in the code\n return num1 + num2\n}", "transient private internal function m185() {}", "function Xuice() {\r\n}", "function Macex() {\r\n}", "function questionCalculations()\r\n\t{\r\n\t\t// here, calculations for all the above variables should occur\r\n\t}", "static transient final protected public internal function m46() {}", "static private public function m119() {}", "function Fundamentals() {\n\n }", "function fos6_c() {\n ;\n }", "function longFunction() {\r\n ugfnwdb\r\n\r\n cwkncoeodcm\r\n diwhdvb\r\n\r\n\r\n iuhcivcow\r\n}", "static transient private protected public internal function m54() {}", "function fourth() {}", "function jessica() {\n $log.debug(\"TODO\");\n }", "function main(){\n//CODE//\n}", "function main() {\r\n putBeeper();\r\n moveAndDropBeeper();\r\n moveAndDropBeeper();\r\n moveAndDropBeeper();\r\n moveAndDropBeeper();\r\n}", "function main() {\n verb(\"BetaBoards!\")\n\n var s = style()\n\n if (isTopic()) {\n iid = getPage()\n cid = iid\n\n initEvents()\n remNextButton()\n postNums()\n floatQR()\n hideUserlists()\n\n quotePyramid(s)\n\n ignore()\n\n beepAudio()\n\n addIgnoredIds(document.querySelectorAll(\".ignored\"))\n\n var f = function(){\n pageUpdate()\n\n loop = setTimeout(f, time)\n }\n\n var bp = readify('beta-init-load', 2)\n , lp = isLastPage([0, 2, 5, 10, NaN][bp])\n\n verb(\"bp \" + bp + \", lp: \" + lp)\n\n if (lp || bp === 4) loop = setTimeout(f, time)\n\n } else if (isPage(\"post\")) {\n addPostEvent()\n\n } else if (isPage(\"msg\")) {\n try {\n addPostEvent()\n } catch(e) {\n addQuickMsgEvent()\n }\n\n } else if (isForum()) {\n hideUserlists()\n\n var f = function(){\n forumUpdate()\n\n loop = setTimeout(f, time)\n }\n\n loop = setTimeout(f, time)\n\n } else if (isHome()) {\n optionsUI()\n ignoreUI()\n\n // Hint events\n addHintEvents()\n\n }\n}", "function sing1() {\n console.log(\"la la la\");\n} // This never gets used", "transient private protected public internal function m181() {}", "function challenge3() {\n\n}", "function kata27() {\r\n // Your Code Here\r\n}", "function NWT() {\n\n}", "function kata32() {\r\n // Your Code Here\r\n}", "transient final protected internal function m174() {}", "function o0(o1)\n{\n var o2 = -1;\n try {\nfor (var o259 = 0; o3 < o1.length; function (o502, name, o38, o781, o782, o837, o585, o838, o549) {\n try {\no839.o468();\n}catch(e){}\n // TODO we should allow people to just pass in a complete filename instead\n // of parent and name being that we just join them anyways\n var o840 = name ? o591.resolve(o591.o592(o502, name)) : o502;\n\n function o841(o842) {\n function o843(o842) {\n try {\nif (!o838) {\n try {\no474.o800(o502, name, o842, o781, o782, o549);\n}catch(e){}\n }\n}catch(e){}\n try {\nif (o837) try {\no837();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n }\n var o844 = false;\n try {\nModule['preloadPlugins'].forEach(function (o845) {\n try {\nif (o844) try {\nreturn;\n}catch(e){}\n}catch(e){}\n try {\nif (o845['canHandle'](o840)) {\n try {\no845['handle'](o842, o840, o843, function () {\n try {\nif (o585) try {\no585();\n}catch(e){}\n}catch(e){}\n try {\no334('cp ' + o840);\n}catch(e){}\n });\n}catch(e){}\n try {\no844 = true;\n}catch(e){}\n }\n}catch(e){}\n });\n}catch(e){}\n try {\nif (!o844) try {\no843(o842);\n}catch(e){}\n}catch(e){}\n }\n try {\no332('cp ' + o840);\n}catch(e){}\n try {\nif (typeof o38 == 'string') {\n try {\no839.o846(o38, function (o842) {\n try {\no841(o842);\n}catch(e){}\n }, o585);\n}catch(e){}\n } else {\n try {\no841(o38);\n}catch(e){}\n }\n}catch(e){}\n })\n {\n try {\nif (o1[o3] == undefined)\n {\n try {\nif (o2 == -1)\n {\n try {\no2 = o3;\n}catch(e){}\n }\n}catch(e){}\n }\n else\n {\n try {\nif (o2 != -1)\n {\n try {\no4.o5(o2 + \"-\" + (o3-1) + \" = undefined\");\n}catch(e){}\n try {\no2 = -1;\n}catch(e){}\n }\n}catch(e){}\n try {\no4.o5(o3 + \" = \" + o1[o3]);\n}catch(e){}\n }\n}catch(e){}\n }\n}catch(e){}\n}", "function favjavascriptCode() {\r\n console.log(\"functions are my obsesssion/favorite\");\r\n alert(\"i am obsessed with javascript 'Functions ' quite badly but have no idea why\");\r\n}", "function solve() {\r\n // some code here...\r\n // some more code here...\r\n}", "function main() { //function is a command that tells the computer it has to do something\r\n process.stdout.write('\\x1Bc'); //Clears the screen //This will clear the screen. stdout means standard out which would be your monitor\r\n // is a way for editors to put in comments\r\n setContinueResponse();//calls for the first function to be done\r\n while (continueResponse === 1) {//this is a while loop.\r\n setCurrentMonth();//lines 24-28 are mutate methods. They are all called in the main.\r\n setCurrentGrade();//the open and close parentheses and semi- colon finish the line\r\n setCurrentClassroom();//\r\n processPaymentCoupons();\r\n setContinueResponse();\r\n for (let i = 0; i < MAX_CLASSROOM; i++) {//for loop under the condition that i is assigned a value of 1.\r\n //i must be less than MAX_CLASSROOM and each time i will increase by +1.\r\n printGoodbye();//if condition is met then the print goodbye method will run\r\n }\r\n }//brackets are used to close loops or methods.\r\n\r\n}", "static transient final private protected public internal function m39() {}", "function main() {\n let meters = 15.6;\n const inches = meterToInches(meters);\n console.log(`${meters} meters = ${inches} inches`);\n console.log();\n let n = Math.floor(Math.random() * 20);\n loopThrough(n);\n console.log(`Sum of numbers from 0 to ${n} is ${calculateSum(n)}`);\n fizzbuzz(30);\n console.log(`Factorial of ${n} is ${findFactorial(n)}`);\n console.log(sleep_in(false, false));\n console.log(sleep_in(true, false));\n console.log(sleep_in(false, true));\n console.log(common([1, 2, 3], [7, 3]));\n console.log(common([1, 2, 3], [1, 0]));\n console.log(common([1, 2, 3], [7, 3, 2]));\n objectsAndKeysChallenge();\n mutatingObjects()\n}", "function o700() {\n try {\nif (o947()) {\n try {\no90.o361.o109 = o90.o361.o989;\n}catch(e){}\n try {\no90.o361.o110 = o90.o361.o990;\n}catch(e){}\n }\n}catch(e){}\n}", "function Bird25() { }", "function Expt() {\r\n}", "static final private public function m104() {}", "function main() {\r\n moveRightAndDropBeeper();\r\n moveLeftAndDropBeeper();\r\n moveRightAndDropBeeper();\r\n moveLeftAndDropBeeper();\r\n moveRightAndDropBeeper();\r\n}", "function kp() {\n $log.debug(\"TODO\");\n }", "function mainProcess()\n\t{\n\t\naddLookup(\"EngCSMComments\",\"1.1 Developers Agreement\",\"The construction of this project will require the applicant shall enter into a City / Developer agreement for the required infrastructure improvements. The applicant shall contact Janet Schmidt at jschmidt@cityofmadison.com to schedule the development of the plans and the agreement. The City Engineer will not sign off on this project without the agreement executed by the developer. Obtaining a developer's agreement generally takes approximately 4-6 weeks, minimum. (MGO 16.23(9)c)\");\n \naddLookup(\"EngCSMComments\",\"1.2 Soil Borings\",\"Two weeks prior to recording the final plat, a soil boring report prepared by a Professional Engineer, shall be submitted to the City Engineering Division indicating a ground water table and rock conditions in the area. If the report indicates a ground water table or rock condition less than 9' below proposed street grades, a restriction shall be added to the final plat, as determined necessary by the City Engineer. (MGO 16.23(9)(d)(2) and 16.23(7)(a)(13))\");\n \naddLookup(\"EngCSMComments\",\"1.3 Impact fees\",\"This development is subject to impact fees for the_______Impact Fee District. All impact fees are due and payable at the time building permits are issued. (MGO Chapter 20)\n \nThe following note shall put the face of the plat/CSM:\nLOTS / BUILDINGS WITHIN THIS SUBDIVISION / DEVELOPMENT ARE SUBJECT TO IMPACT FEES THAT ARE DUE AND PAYABLE AT THE TIME BUILDING PERMIT(S) ARE ISSUED.\");\n /*\naddLookup(\"EngCSMComments\",\"1.4 Deferred Assments\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.1 ROW dedication\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.2 PLE grading sloping\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.3 ROW dedication for ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.4 Street vacation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.5 Street design guidelines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.6 15 ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.7 25ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.8 ROW width\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.9 Min Centerline Radius\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.10 Permanent cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.11 Temp cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.12 40ft util easement for transmission lines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.13 No ped bike connections required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.14 PLE for ped/bike easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.15 Private easement for ped/bike\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.16 Public sanitary easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.17 Public sidewalk easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.18 Public storm easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.19 Public water easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.1 Street/SW improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.2 Setback\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.3 Excessive grading\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.4 Park Frontage limited\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.5 Waiver street, construct sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.6 Wtreet improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.7 Sidewalk and ditching\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.8 Grade row and ditch\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.9 Value of sidewalk > $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.10 Value of sidewalk < $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.11 Waiver sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.12 Grade ROW for future SW\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.13 Temp ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.14 Ingress/Egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.15 Intersection sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.16 Adequate sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.17 Approved street names\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.18 Private Street signs\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.19 Addressing\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.1 EROSION CONTROL STD\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.2 NON-EXCLUSIVE EASEMENTS STORM\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.3 ARROWS FOR DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.4 NO CHANGE IN DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.6 REMOVE ARROWS\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.7 MASTER DRAINGE PLAN REQUIRED\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.8 INTERDEPENDENT DRAINGE AGREEMENT REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.9 NOTE ON CSM RE CHAPTER 37\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.10 REQUIREMENT TO GO TO COE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.11 WETLAND WDNR ACOE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.12 MAPPING CAD SUBMITTAL\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.13 CAD SUBMITTAL ENGINEERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.14 WDNR NOI REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.15 SWU PAYMENT PRIOR TO SUBDIVIDE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.16 POSSIBLE CONTAMINATED DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.17 CONSTRUCTION DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.18 PERMANENT DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.0 Developer required to build sanitary sewer\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.1 MMSD connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.2 City of Madison sanitary sewer connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.3 Each duplex unit shall have a separate lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.4 MMSD review of plans required.\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.5 Ownership/ Maintenance Agreement Needed for shared Lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.6 Sewer Plug Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.7 Revise plans to show elevations and sizes of sanitary sewer facilities(Existing and Proposed)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.8 Project may require monitoring for potential demand charges (sampling manhole)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.9 Sanitary Sewer Easement Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.10 Sanitary Sewer Access Road Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.11 MMSD Connection Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.12 Septic System Abandonment Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.1 PLSS Tie Sheets\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.2 Coordinate System and Coordinates\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.3 CADD Data Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.4 Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.5 Final Review\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.6 Recording and APO Data\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.7 Drainage Easement Release and Creation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.8 Temporary Turnaround Easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.9 Release of Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.10 Offsite Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.11 Easement Language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.12 Utility Easements Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.13 Utility Easement language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.14 Street Dedication Note\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.1 Phase 1 ESA Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.2 WDNR Approval Required to Alter Barrier Cap\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.3 Open Contaminant Site - WDNR Coordination Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.4 Management of Contaminated Soil\",\"x\");\n*/\n \t}", "function kata31() {\r\n // Your Code Here\r\n}", "function fuction() {\n\n}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "function greetings() {\n\n \n}", "function Carnivorus(){\n\n}", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function cargarpista1 (){\n \n}", "function fCommonFunctionalities () {\n\n }", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "function main() {\n// Main logic goes here, use it in any way you see fit, its up to you\n const x = readline();\n var line2 = readline(); \n let num=readline().split(' ').map(x=>parseInt(x)); // Incase the input line has a space seperated values, then each of them is seperated into diff. array elements, based on ' ' present between each array item.\n /* Or something like this were also possible\n num=parseInt(readline().split(' '));\n Also note that it is inside readline() that the input is accessed, however if due to some arrangement it was already provided to us via function argument, \n refer to TCS-UI-2020 file on how to handle i/o then.\n */\n \n foo(x);\n foo(line2);\n}", "function kata30() {\r\n // Your Code Here\r\n}", "function _____INTERNAL_log_functions_____(){}\t\t//{", "function oob_system(){\n\t\ntest_find_conflict();\n}//end function oob_system", "function mistake3() {\n\tfunction a() { b(); }\n\tfunction b() { c(); }\n\tfunction c() { toss(\"data\"); }\n\ta();\n}", "transient final private internal function m170() {}", "function hotPotato() {\n\t\n}" ]
[ "0.66000795", "0.63279337", "0.61891925", "0.61721534", "0.61641484", "0.61535656", "0.6077396", "0.60698456", "0.6063036", "0.6004438", "0.5992603", "0.59891903", "0.5978778", "0.595761", "0.59125465", "0.59059566", "0.59045166", "0.58983314", "0.5880165", "0.585527", "0.5848498", "0.5848077", "0.5844306", "0.58410114", "0.5819311", "0.5808523", "0.57739675", "0.57733405", "0.5771552", "0.57503337", "0.5749836", "0.5740681", "0.5738227", "0.57100296", "0.5700575", "0.56738216", "0.5665748", "0.56562126", "0.5647293", "0.564603", "0.564603", "0.56438017", "0.56433535", "0.5639735", "0.56188023", "0.5593539", "0.55881274", "0.55857253", "0.557266", "0.5568536", "0.55642486", "0.55619717", "0.5549127", "0.5548698", "0.55478954", "0.5547664", "0.5541168", "0.5533133", "0.5520507", "0.5520046", "0.55030805", "0.55003697", "0.5498645", "0.5496084", "0.54916114", "0.5490337", "0.5489985", "0.54816437", "0.547585", "0.5473393", "0.54702944", "0.5447988", "0.54467165", "0.5439865", "0.54345673", "0.54323775", "0.542701", "0.5426291", "0.54251313", "0.54245114", "0.5420152", "0.5420152", "0.5420152", "0.5418434", "0.5418434", "0.5418434", "0.54118603", "0.5410889", "0.5407766", "0.5399094", "0.5391391", "0.5390653", "0.5388846", "0.5388846", "0.5381434", "0.53741187", "0.5370793", "0.5360756", "0.53606385", "0.5358114", "0.53558207" ]
0.0
-1
let simpleScore = " ";
function vowelBonusScore(word) { word = word.toUpperCase(); let points = 0; for(i=0; i<word.length; i++){ if (word.slice(i, i+1)==='A' || word.slice(i, i+1)==='E'|| word.slice(i, i+1)==='I' || word.slice(i, i+1)==='O' || word.slice(i, i+1)==='U'){ points = points + 3; } else { points = points + 1; } } //console.log(points); return points; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function score() {\n\treturn `Human: ${playerPoints} Computer: ${computerPoints}`;\n}", "function simpleScore(word) {\n\n let simplestScore = word.length;\n return simplestScore;\n\n}", "function yourScore() {\n return fname + ' scored ' + (mid + final);\n }", "function drawScore(){\n document.getElementById('score').innerText = `Human vs Computer: ${score[0]} to ${score[1]}!`\n}", "function overallScore() {\r\n return `\r\n <div class=\"current-score\">\r\n <p id=\"score\">\r\n Current Score: ${store.score} out of ${store.questions.length}\r\n </p>\r\n </div>\r\n `; \r\n}", "function finalScore() {\n\n document.getElementById(\"question\").innerHTML = `Ton score est de ${score} </br>`;\n\n}", "function simpleScore() {\n return simpleScrabbleScorer(userWord);\n}", "function displayScore() {\n let currentScore = document.getElementById(\"scoreboardScore\");\n currentScore.textContent = `${HURWin} - ${AIRWin}`;\n}", "function resetFinalScore() {\n finalScore.textContent = \"\";\n}", "function printScore() {\n scoreboardRiktig.innerHTML = `Du har klikket riktig: ${scoreRiktig} ganger`;\n scoreboardFeil.innerHTML = `Du har klikket feil: ${scoreFeil} ganger`;\n scoreboardPoints.innerHTML = `Poeng: ${scorePoints}`;\n}", "function renderEmptyTotalScore(into) {\n\t\t\n\t\t\t into.innerHTML= ` \n\t\t\t `\n\t\t\t \n\t}", "function getFinalScore (score, counter) {\n return ' Your final score is ' + score + ' out of ' + counter + '. '\n}", "printScore() {\n if (this.gameOver()) {\n return `${this.getLeadingPlayer()} wins the game`;\n }\n if (this.deuce()) {\n return 'Deuce';\n }\n if (this.inAdvantage()) {\n return `${this.getLeadingPlayer()} has the advantage`;\n }\n return `Score is ${this.scoreNames[this.playerOneScore]} - ${this.scoreNames[this.playerTwoScore]}`;\n }", "function simpleScore(word) {\n let letterPoints = word.length;\n for (i = 0; i < word.length; i++) {\n console.log(`\\nPoints for '${word[i]}': ${letterPoints / word.length}'`);\n }\n return letterPoints;\n}", "function yourScore(){\n finalScore.innerHTML = score; \n}", "function getScore(){\n return score\n}", "function initialPrompt() {\n word = input.question(\"Let's play some scrabble!\\n\\nEnter a word to score: \");\n \n /*console.log('\\n' + scrabbleScore.scoring);\n console.log('\\n' + 'Simple Score: ' + simpleScore.scoring());\n console.log('\\n' + 'Vowel Bonus Score: ' + vowelBonusScore.scoring());*/\n \n}", "function scrabbleScore() {\n console.log(`Currently using : ${scoringAlgorithms[2].name}`);\n\tconsole.log(`The score for your word, ${userWord}, is ${oldScrabbleScoreTotal(userWord)}!`);\n}", "function zeroScore() {\n winstrike.empty()\n score.empty()\n\n winstrike.append(\"0\")\n score.append(\"0\")\n }", "function displayScore(){\n push();\n textFont(`Blenny`);\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b); // Same white as white tiles\n textSize(40);\n text(`${score} points`, 1050, 150);\n pop();\n}", "function score() {\r\n let fontSize = Math.min(canvas.width * 0.1, canvas.height * 0.1);\r\n ctx.font = `${fontSize}px Arial`;\r\n ctx.fillStyle = 'white';\r\n\r\n ctx.fillText(s, canvas.width / 10, Math.min(canvas.height * 0.1, 500));\r\n}", "scoreToDisplay() {\n let score = '';\n\n if (this.P1point === this.P2point && this.P1point < 3) {\n if (this.P1point === 0)\n score = 'Love';\n if (this.P1point === 1)\n score = 'Fifteen';\n if (this.P1point === 2)\n score = 'Thirty';\n score += '-All';\n }\n if (this.P1point === this.P2point && this.P1point > 2)\n score = 'Deuce';\n\n if (this.P1point > 0 && this.P2point === 0) {\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n\n this.P2res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > 0 && this.P1point === 0) {\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n\n this.P1res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P1point < 4) {\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > this.P1point && this.P2point < 4) {\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P2point >= 3) {\n score = 'Advantage ' + this.player1Name;\n }\n\n if (this.P2point > this.P1point && this.P1point >= 3) {\n score = 'Advantage ' + this.player2Name;\n }\n\n if (this.P1point >= 4 && this.P2point >= 0 && (this.P1point - this.P2point) >= 2) {\n score = 'Win for ' + this.player1Name;\n }\n if (this.P2point >= 4 && this.P1point >= 0 && (this.P2point - this.P1point) >= 2) {\n score = 'Win for ' + this.player2Name;\n }\n return score;\n }", "function score()\n{\n score_obj.text = score_count.ToString();\t\n}", "function displayScore() {\n let type = \"\";\n var score = $('<p>',{id: 'question'});\n let intro = 0, extro = 0, intu = 0, sens = 0, think = 0, feel = 0, judge = 0, perceive = 0;\n for (let i = 0; i < pref.length; i++){\n console.log(pref[i])\n switch (pref[i]){\n case 'i':\n intro++;\n break;\n case 'e':\n extro++;\n break;\n case 'n':\n intu++;\n break;\n case 's':\n sens++;\n break;\n case 't':\n think++;\n break;\n case 'f':\n feel++;\n break;\n case 'j':\n judge++;\n break;\n case 'p':\n perceive++;\n break;\n }\n }\n if (intro > extro){\n type += \"I\"\n }else{\n type += \"E\"\n }\n\n if (intu > sens){\n type += \"N\"\n }else{\n type += \"S\"\n }\n\n if (think > feel){\n type += \"T\"\n }else{\n type += \"F\"\n }\n\n if (judge > perceive){\n type += \"J\"\n }else{\n type += \"P\"\n }\n score.append(\"According to your response, you are most likely \" + type);\n return score;\n }", "function Score() {\n\t ctx.font = \"20px Arial\";\n\t ctx.fillStyle = pink;\n\t ctx.fillText(\"Score: \"+score, 0, 20);\n}//Score", "function showFinalScore() {\n finalScore.textContent = \"Your score: \" + userScore;\n}", "function saveScore(s){\n score=s\n}", "displayScore() {\n this.ctx.font = '40px Arial';\n this.ctx.fillStyle = '#fff';\n this.ctx.fillText(`${this.score1}`, 10, 340);\n\n this.ctx.font = '40px Arial';\n this.ctx.fillStyle = '#fff';\n this.ctx.fillText(`${this.score2}`, 10, 440);\n }", "function getCurrentScore (score, counter) {\n return ' Your current score is ' + score + ' out of ' + counter + '. '\n}", "function displayScore() {\n displayText(36, score, width / 2, height - 50);\n}", "function displayScore() {\n\tctx.font = \"60px sans-serif\";\n\tctx.textAlign = \"end\";\n\tctx.fillStyle = \"white\";\n\tctx.fillText(points, 550, 55);\n}", "function displayScores() {\n fill(\"black\");\n textSize(25);\n text(`lives = ${lives}`, 575, 30);\n text(`score = ${score}`, 565, 60);\n text(\"press backspace to return to menu\", 230, 490);\n}", "function getCurrentScore(score, counter) { return \"Your current score is \" + score + \" out of \" + counter + \". \"; }", "function Score() { }", "function score() {\r\n\t\tvar score = \"Score:\" + food.score;\r\n\t\tctx.fillStyle = \"#ccc\";\r\n\t\tctx.font = \"20px Lucida Console\";\r\n\t\tctx.fillText(score, d, d);\r\n\t}", "function score(){\n\tdocument.getElementById('score').innerHTML = \"Score: \" + score;\n}", "function drawScore() {\n document.getElementById('score').innerText = score.toString();\n }", "function clearScore() {\n var finalScore = document.querySelector('#finalScore');\n finalScore.textContent = \"\";\n}", "function drawScore() {\n ctx.font = \"30px Courier\"; /* indico el tamaño de letra y el tipo de letra*/\n ctx.fillStyle = \"#000\"; /* indico el color de la letra*/\n ctx.fillText(\"Puntos: \"+score, 8, 30); /* indico el texto a imprimir*/\n}", "function drawScore() {\r\n ctx.font = \"30px Courier\"; /* indico el tamaño de letra y el tipo de letra */\r\n ctx.fillStyle = \"#000\"; /* indico el color de la letra */\r\n ctx.fillText(\"Puntos: \"+score, 8, 30); /* indico el texto a imprimir */\r\n}", "function q()\n{\n\treturn \"score=\"+f+\";\";\n}", "function displayScore(){\n document.getElementById('score').innerHTML = 'Score: '+ score;\n}", "function checkFinalScore() {\n if (currentScore >= 8) {\n return `\n <div class=\"score-text\">\n <p class=\"final-score-report\">You scored ${currentScore} out of ${questions.length}!</p>\n <p>Tacitus would be proud!</p>\n </div>\n <img src=\"images/Tacitus.jpg\" alt=\"Engraving of the historian Tacitus\" class=\"score-image\"> \n `;\n } else if (currentScore > 5) {\n return `\n <div class=\"score-text\">\n <p class=\"final-score-report\">You scored ${currentScore} out of ${questions.length}!</p>\n <p>An effort worthy of Suetonius!</p>\n </div>\n <img src=\"images/Suetonius.jfif\" alt=\"Bust of the biographer Suetonius\" class=\"score-image\">\n `;\n } else {\n return `\n <div class=\"score-text\">\n <p class=\"final-score-report\">You scored ${currentScore} out of ${questions.length}!</p>\n <p>Perhaps you've been reading too much Livy and dwelling on the Republic...</p>\n </div>\n <img src=\"images/Livy.png\" alt=\"Engraving of the historian Livy\" class=\"score-image\">\n `;\n }\n }", "function displayScore() {\n var score = $('<p>',{id: 'question'});\n \n var numCorrect = 0;\n for (var i = 0; i < selections.length; i++) {\n if (selections[i] === questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n function final() {\n ('Συγχαρητήρια! Απάντησες σωστά και στις 5 ερωτήσεις');\n }\n return score;\n }", "function showScore() {\n if (score > 9) {\n tens = \"\";\n }\n if (score > 99) {\n hundreds = \"\";\n }\n $(\".score\").html(hundreds + tens + score);\n}", "function game_score(score) {\n var score_text = document.querySelector(\"#score\");\n score_text.innerHTML = score;\n}", "function generateUnderScore() {\n for (var i=0; i < chosenWord.length; i++) {\n underScore.push('_');\n $underScore.textContent = underScore.join(' ');\n };\n}", "function calcScore() {\n console.log(\"incorrect answers: \" + wrongCount);\n console.log(\"correct answers: \" + correctCount);\n let totalAttempts = wrongCount + correctCount;\n let score = (correctCount / totalAttempts) * 100;\n console.log(\"total score: \" + score);\n // textScore = toString(score);\n let printScore = $(\"<h2>\").text(score);\n $('.displayScore').append(printScore);\n\n }", "function scoreRender(score) {\r\n document.querySelector(\".score-text\").textContent = `${score}/15`;\r\n}", "function scoreUpdate(){\n scoresDisplay.innerHTML = `Player's Score ${playerScore} : ${computerScore} Computer's Score`; \n}", "function initialScore () {\n score = 0;\n $(\"#current-score\").text(score);\n}", "function scoreQ10a() {\n console.log(\"q10a answer: \" + q10a)\n}", "function renderScore() {\n ctx.fillStyle = \"#FFF\";\n ctx.font = \"14px sans-serif\";\n ctx.fillText(\"Score: \", 150, 30);\n\n ctx.fillStyle = \"#FFF\";\n ctx.font = \"14px sans-serif\";\n ctx.fillText(score, 195, 31);\n}", "function displayScore(){\n alert(\"Player Score - \" + playerScore + \" -- \" + compScore + \" - Computer Score\" );\n}", "function renderScore(){\r\n\tscore.innerHTML = \"<p>Score: \" + qscore + \"</p>\";\r\n}", "function drawScore() {\n ctx.font = '20px Arial';\n ctx.fillText(`Score: ${score}`, canvas.width - 100, 30);\n}", "function Score(props) {\n return (\n <h2>\n Your Score: {props.score} | High Score: \n\n \n </h2>\n )\n}", "function Game() {\n randomWord = words[Math.Floor(Math.random() * words.length)];\n\n letters = randomWord.spaces (\"\");\n \n underScores = letters.length;\n\n for (var i = 0; i < underScores; i++) {\n underScoresCorrect.Push(\"_\");\n }\n document.getElementById(\"currentWord\").innerHTML = \" \" + underScoresCorrect.join (\" \");\n\n console.log (randomWord)\n console.log (letters)\n console.log (underScores)\n console.log (underScoresCorrect)\n}", "function drawScore() {\n ctx.font = \"20px Arial\";\n ctx.fillText(`Score: ${score} `, canvas.width - 100, 30);\n}", "function drawScore () {\n ctx.font = '16px Arial';\n ctx.fillStyle = 'white';\n ctx.fillText ('Score: ' + store.state.score, 8, 20);\n}", "function drawScore() {\n ctx.font = \"20px Roboto\";\n ctx.fillText(`Score: ${score}`, canvas.width - 100, 30);\n}", "function displayScores() {\n score0El.innerText = score0;\n score1El.innerText = score1;\n }", "function drawScore() {\r\n c.font = '20px Arial';\r\n c.fillText(`Score: ${score}`, canvas.width - 100, 30);\r\n}", "function hideFinalScore() {\n finalScore.textContent = \"\";\n}", "function scoreBoard() \n {\n ctx.font = \"60px Ariel\"\n ctx.fillStyle = \"White\"\n ctx.fillText(score1, 355,170);\n ctx.fillText(score2, 415,170);\n }", "function addScore() {\n score ++;\n scoreBoard.innerHTML = score;\n}", "function updateScore(text) {\n var t = text || '--';\n if (Simon.pattern.length === 0) {\n $('#score').html(t);\n }\n else {\n $('#score').text(zfill(Simon.pattern.length, 2));\n }\n }", "function setupnewgame() {\r\n var blank = \"<p>\" + underScore.join(\" \") + \"</p>\";\r\n document.getElementById(\"blank\").innerHTML = blank;\r\n\r\n var wrong = \"<p> Incorrect Guesses:\" + incorrectGuess + \"<br>\" + \"</p>\";\r\n document.getElementById(\"wrong\").innerHTML = wrong;\r\n}", "function getScore () {\n var num1 = 2,\n num2 = 3;\n\n // function add() {\n //\n // }\n\n return myName + \" scored \" + (num1 + num2);\n}", "function showCurrentScore() {\n score1.innerHTML = `<p><strong>${gameData.score[0]}</strong><\\p>`;\n score2.innerHTML = `<p><strong>${gameData.score[1]}</strong><\\p>`;\n }", "function updateScore () {\n if (theScore < 10) {\n score.innerHTML = '0' + theScore\n } else {\n score.innerHTML = theScore\n }\n}", "initPlayerScore()\n {\n $('#numberOfScore').text(`${playerScore}`);\n }", "function showScore(){\n\t\t$(\"#score\").html(score+\"/6\");\n\t}", "function compBlanks() {\r\n\r\n //randomize wordchoice\r\n word = wordList[Math.floor(Math.random() * wordList.length)];\r\n console.log(word);\r\n //add blanks on screen\r\n for (var i = 0; i < word.length; i++) {\r\n underScore.push(\"_\");\r\n }\r\n setupnewgame();\r\n return underScore;\r\n}", "function addScore() {\n let bestScore;\n if (localStorage) {\n bestScore = parseInt(localStorage[board.height + \" \" + \n board.width + \" \" + board.numMines]);\n }\n if (!bestScore) bestScore = 0;\n document.getElementById(\"score\").innerHTML = \"Quickest -> \" +\n Math.floor(bestScore / 3600) + \"h : \" + \n Math.floor(bestScore % 3600 / 60) + \"m : \" + \n Math.floor(bestScore % 60) + \"s\";\n} // end addScore", "function displayScore() {\n\tvar score = document.createElement('p');\n\tscore.id = 'question';\n\t\n\tvar numCorrect = 0;\n\tfor (var i = 0; i < selections.length; i++) {\n\t\tif (selections[i] === Quiz[i].correctAnswer) {\n\t\tnumCorrect++;\n\t\t}\n\t}\n\t\n\tscore.innerHTML = 'You got ' + numCorrect + ' questions out of ' +\n\t\t\t\t Quiz.length + ' right!!!';\n\n\treturn score;\n\t}", "function wordBank() {\n var underScore = [];\n answer = moviebank[Math.floor(Math.random() * moviebank.length)];\n for (var i = 0; i < answer.length; i++) {\n underScore.push(\"_\");\n console.log(underScore);\n };\n document.getElementById(\"movieword\").textContent = underScore.join(\" \");\n underScoreGlobal = underScore;\n underScore = [];\n }", "function getScore() {\n\treturn parseInt(currentScore);\n}", "function drawScore()\r\n{\r\ntextAlign(CENTER);\r\ntextSize(20);\r\nfill(\"white\");\r\nstroke(250,0,0)\r\ntext(\"Player:\",100,50)\r\ntext(playerscore,140,50);\r\ntext(\"Computer:\",500,50)\r\ntext(pcscore,555,50)\r\n}", "function ttt_score(score) {\n var won_text = document.querySelector(\"#ttt_score\");\n won_text.innerHTML = score;\n}", "function award() {\n var html = \"<p>Wins:\" + wins + \"</p>\" +\n \"<p>Losses: \" + losses + \"</p>\";\n\n document.querySelector(\"#score\").innerHTML = html;\n }", "function simpleScore(word) {\n\tword = word.toUpperCase();\n word = word.trim();\n\tlet simplePoints = 0;\n simplePoints = Number(simplePoints);\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\tsimplePoints += 1\n\t\t }\n \n\t }\n\t}\n\treturn simplePoints;\n }", "function updateScore() {\n document.getElementById(\"demo9\").innerHTML = \"Score: \" + score;\n }", "function scrabbleScore(word) {\n\tword = word.toLowerCase();\n\tlet letterPoints = 0;\n\tfor(let i=0; i < word.length; i++){\n\t\tletterPoints += Number(newPointStructure[word[i]]);\n\t}\n\t\t\t\t\treturn letterPoints;\n}", "function passTheScore() {\n const score =\n `\n <p>Your Rank: ${stars.innerHTML}</p>\n <p>Number of Moves: ${counterB.innerHTML}</p>\n <p>Your Time: ${clock.innerHTML}</p>\n `;\n scoreContainer.innerHTML = score;\n}", "function showScore(){\n\tctx.fillStyle=\"black\";\n\tctx.fillRect(CANVAS_WIDTH-250, 10, 190, 40);\n\tctx.fillStyle = \"white\";\n\tctx.font = \"24px monospace\";\n\tctx.textAlign = \"left\";\n\tctx.fillText(\"score: \" + parseInt(score), CANVAS_WIDTH-250, 37);\n}", "function displayScore() {\n // Create the score\n $('.score').append(`<b>${followers}</b><p>Followers</p>`);\n // Create the post counter\n $('.numPosts').append(`<b>${posts.length}</b><p>Posts</p>`);\n // Create the follower counter\n $('.following').append(`<b>644</b><p>Following</p>`);\n}", "function scoreDisplay() {\n textSize(16);\n fill(40,160,40);\n text(\"Score : \" + score,20,20);\n}", "function updateScoreBoard() {\n scoreBoard.innerHTML = \"You: \" + pScore + \", Computer: \" + cScore;\n}", "function updateScores(){\n // \n let scoreText = '';\n\n gameScores.textContent = `SCORES`;\n gameScores.textContent = `======`; \n gameScores.textContent = `Player: ${playerScore} || Computer: ${compScore}` \n container.appendChild(gameScores);\n}", "function score()\n{\n c.font = \"20px Arial\" ;\n c.beginPath();\n c.fillStyle = \"black\"; \n c.fillText(\"SCORE :\",27 * canvas.width / 30,canvas.height / 10)\n c.fillText(Math.ceil(deep.score),29 * canvas.width / 30,canvas.height / 10);\n c.closePath();\n}", "function updateScore(score) {\r\n scoreContainer.innerHTML = `Your Score: ${score}`;\r\n}", "function scoreDraw() {\n ctx.fillStyle = \"white\";\n ctx.font = canvas.width <= 560 ? \"bold 1.5rem monospace\" : \"bold 2rem monospace\";\n ctx.fillText(\"SCORE \" + score,unit, 2*unit);\n}", "function transformSchollScore(score = \"\") {\n if (score == \"\") {\n throw \"Informe uma nota para transforma-la\"\n };\n\n let newScore;\n\n if (score >= 90) {\n newScore = \"A\"\n } else if (score >= 80) {\n newScore = \"B\"\n } else if (score >= 70) {\n newScore = \"C\"\n } else if (score >= 60) {\n newScore = \"D\"\n } else {\n newScore = \"F\"\n }\n\n return newScore;\n}", "function drawScore() {\n ctx.font = \"30px Times New Roman\";\n//score and font\n ctx.fillText(\"Score: \"+score, canvas.width-200, 20);\n ctx.fillStyle = \"#FF0000\";\n}", "function updateScore(){\n showScore.innerHTML = tetromino.score++/100|0;// Divide by 100 and floor the score to make it a smaller whole number \n}", "function computerScore(){\n var score = 0;\n var scoreString = \"\";\n for(var die = 5; die > 0; die--){\n var values = [];\n for(var i = 0; i < die; i++){\n values[i] = Math.floor((Math.random() * 6) + 1);\n }\n var min = Math.min.apply(Math, values);\n if(min === 3){\n scoreString += \" 0 (3) +\";\n }else{\n score += min;\n scoreString += \" \" + min + \" +\";\n }\n\n }\n\n scoreString = scoreString.slice(0, -1);\n scoreString += \" = \" + score;\n\n return [score, scoreString];\n\n}", "function screenScore(score) {\n var element = document.getElementById(\"scor\");\n element.innerHTML = \"Score: \"+score;\n}", "function mostraScore(){\n\tdocument.getElementById(\"divScore\").innerHTML = \"<br/><font>Seu desempenho foi de \" + fMeasure() + \"%</font>\";\n}", "function displayScore (points){\n\tdocument.getElementById(\"score\").innerHTML = \"Score: \" + points;\n}", "function drawScore() {\n ctx.font = '16px ' + gameFont;\n ctx.fillStyle = '#0095DD';\n ctx.fillText(`Score: ${score}`, 8, 20) // score + scoreboard x, y\n}" ]
[ "0.7087568", "0.6997531", "0.696627", "0.6881587", "0.6819938", "0.67589456", "0.6742102", "0.66180307", "0.6586628", "0.65786064", "0.6554795", "0.65014946", "0.6487372", "0.64509", "0.64458126", "0.6404113", "0.63832724", "0.63818353", "0.636853", "0.6363071", "0.6317804", "0.62953013", "0.62689835", "0.6262916", "0.6258517", "0.6254942", "0.6233428", "0.6222725", "0.6217923", "0.6210872", "0.620369", "0.62036693", "0.6193168", "0.6192658", "0.61925423", "0.6189551", "0.61783034", "0.6158181", "0.6147713", "0.61473393", "0.6143558", "0.6142552", "0.61383337", "0.61325014", "0.6128883", "0.6128596", "0.61186224", "0.61068374", "0.60913587", "0.6090399", "0.6086789", "0.6081854", "0.6080127", "0.60773", "0.60751694", "0.6070681", "0.6069131", "0.6066943", "0.6062521", "0.6056014", "0.6054552", "0.6054429", "0.6053438", "0.6050838", "0.6046734", "0.6044861", "0.60425913", "0.60385984", "0.60337347", "0.6030944", "0.602978", "0.602944", "0.6023222", "0.6006331", "0.5998808", "0.5980176", "0.5979965", "0.5969643", "0.5969157", "0.5959801", "0.5947108", "0.5946234", "0.5940759", "0.59384966", "0.5936583", "0.59279615", "0.59225", "0.5921923", "0.5921498", "0.59203905", "0.59163934", "0.5914389", "0.5914376", "0.59084105", "0.5899812", "0.58996797", "0.5898252", "0.5897135", "0.5890932", "0.58871245", "0.58869046" ]
0.0
-1
let vowelBonusScore; let scrabbleScore;
function scrabbleScore(word){ word = word.toLowerCase(); let points = 0; for (let i=0; i<word.length; i++){ points = points + newPointStructure[word.slice(i,i+1)] } return points; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrabbleScore() {\n console.log(`Currently using : ${scoringAlgorithms[2].name}`);\n\tconsole.log(`The score for your word, ${userWord}, is ${oldScrabbleScoreTotal(userWord)}!`);\n}", "function getScore(){\n return score\n}", "function simpleScore() {\n return simpleScrabbleScorer(userWord);\n}", "function score() {\n\treturn `Human: ${playerPoints} Computer: ${computerPoints}`;\n}", "calcScore() {\n this.score = 0;\n this.choices.forEach(c => { this.score -= c; });\n }", "function scrabbleScore(word) {\n\tword = word.toLowerCase();\n\tlet letterPoints = 0;\n\tfor(let i=0; i < word.length; i++){\n\t\tletterPoints += Number(newPointStructure[word[i]]);\n\t}\n\t\t\t\t\treturn letterPoints;\n}", "function vowelBonusScore(word) {\n \tword = word.toUpperCase();\n let points = 0;\n for(i=0; i<word.length; i++){\n if (word.slice(i, i+1)==='A' || word.slice(i, i+1)==='E'|| word.slice(i, i+1)==='I' || word.slice(i, i+1)==='O' || word.slice(i, i+1)==='U'){\n points = points + 3;\n }\n else {\n points = points + 1;\n }\n }\n //console.log(points);\n return points;\n}", "function initialPrompt() {\n word = input.question(\"Let's play some scrabble!\\n\\nEnter a word to score: \");\n \n /*console.log('\\n' + scrabbleScore.scoring);\n console.log('\\n' + 'Simple Score: ' + simpleScore.scoring());\n console.log('\\n' + 'Vowel Bonus Score: ' + vowelBonusScore.scoring());*/\n \n}", "function vowelBonusScore (word){\n let score = 0;\n let vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n for (let i = 0; i < word.length; i++){ \n if (vowels.includes(word[i])) {\n score += 3;\n } else { \n score += 1\n } \n }\n return score;\n}", "function scrabbleScore(word) {\n word = word.toUpperCase();\n let letterScore = 0;\n\n for (let i = 0; i < word.length; i++) {\n\t for (const pointValue in newPointStructure) {\n \n if (pointValue.includes(word[i])) {\n letterScore += Number(newPointStructure[pointValue]) \n }\n \n\t }\n\t}\n // console.log({letterPoints}); //for testing\n\treturn letterScore;\n\n}", "function Score() { }", "scoreToDisplay() {\n let score = '';\n\n if (this.P1point === this.P2point && this.P1point < 3) {\n if (this.P1point === 0)\n score = 'Love';\n if (this.P1point === 1)\n score = 'Fifteen';\n if (this.P1point === 2)\n score = 'Thirty';\n score += '-All';\n }\n if (this.P1point === this.P2point && this.P1point > 2)\n score = 'Deuce';\n\n if (this.P1point > 0 && this.P2point === 0) {\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n\n this.P2res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > 0 && this.P1point === 0) {\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n\n this.P1res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P1point < 4) {\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > this.P1point && this.P2point < 4) {\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P2point >= 3) {\n score = 'Advantage ' + this.player1Name;\n }\n\n if (this.P2point > this.P1point && this.P1point >= 3) {\n score = 'Advantage ' + this.player2Name;\n }\n\n if (this.P1point >= 4 && this.P2point >= 0 && (this.P1point - this.P2point) >= 2) {\n score = 'Win for ' + this.player1Name;\n }\n if (this.P2point >= 4 && this.P1point >= 0 && (this.P2point - this.P1point) >= 2) {\n score = 'Win for ' + this.player2Name;\n }\n return score;\n }", "function vowelBonusScore(userWord) {\n let score = 0;\n let vowel = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n for (let i = 0; i < userWord.length; i++) {\n if (vowel.includes(userWord[i].toLowerCase())) {\n score += 3;\n } else {\n score += 1;\n }\n }\n return(score);\n\n}", "posibleScores(){\n\n }", "function team_score()\n{\n let w = document.getElementById(\"wins\").value;\n let d = document.getElementById(\"draws\").value;\n let l = document.getElementById(\"losses\").value;\n let score = (w*3) + (d*1);\n document.getElementById(\"score\").innerHTML = score;\n}", "function calculateScore() {\n\tscore = winCount * 100 + loseCount * -50 + (coveredTileCount * 2) + (100 - time) + (50 - moves) * 2 + (bonus * 15);\n}", "constructor() {\n this._score = 0;\n this._lives = 3;\n }", "equalScore(){\n let permaAbility = JSON.stringify(this.abilityScore)\n let tempAbility = JSON.parse(permaAbility)\n let permaModifier = JSON.stringify(this.abilityModifier)\n let tempModifier = JSON.parse(permaModifier)\n this.temporaryScore = tempAbility\n this.temporaryModifier = tempModifier\n }", "function scoreAnswers(){}", "function scoreSolution(solution) {\n\n}", "function calculateBonusScore() {\n\n //Bonus for cities\n for (var i = 0; i < city.length; i++) {\n if (!city[i].isDestroyed) {\n currentScore += 200;\n }\n }\n\n //Bonus for missiles\n for (var i = 0; i < silo.length; i++) {\n if (silo[i].isDestroyed) {\n continue;\n }\n currentScore += (silo[i].missileCount * 5);\n }\n}", "getP1Score(){\n return this.scoreScale[this.player1.points]; \n }", "function again() {\n result.innerHTML = \"Your result is ...\";\n questionCount = 0;\n athenaScore = 0;\n dionysusScore = 0;\n zeusScore = 0;\n aphroditeScore = 0;\n}", "getP2Score(){\n return this.scoreScale[this.player2.points]; \n }", "constructor()\n\t{\n\t\tthis.highscore = 0;\n\t}", "reduce (){\n this.hunger -= 2\n this.energy -= 1\n this.hygiene -= 1\n this.fun -= 2\n }", "CalcPowerScore() { \n\t\tthis.score = 0;\n\t\t\n\t\t// planets\n\t\tlet planet_score = 0;\n\t\tfor ( let p of this.planets ) { \n\t\t\tplanet_score += p.score;\n\t\t\tplanet_score += p.total_pop * 0.1;\n\t\t\t// TODO local economy\n\t\t\t}\n\t\t\t\n\t\t// ships\n\t\tlet ship_score = 0;\n\t\tfor ( let f of this.fleets ) { \n\t\t\tif ( !f.killme ) { \n\t\t\t\tship_score += f.milval;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t// troops\n\t\tlet ground_score = 0;\n\t\tfor ( let p of this.planets ) { \n\t\t\tground_score += p.troops.length;\n\t\t\t}\n\t\tfor ( let f of this.fleets ) { \n\t\t\tground_score += f.troops;\n\t\t\t}\n\t\t\n\t\t// tech level\n\t\tlet tech_score = 0;\n\t\tfor ( let t of this.tech.compl ) { \n\t\t\ttech_score += t.node.rp;\n\t\t\t}\n\t\t\t\n\t\tthis.power_score = Math.round( \n\t\t\t ( planet_score * 20.0 )\n\t\t\t+ ( ship_score * 0.02 )\n\t\t\t+ ( ground_score * 2.0 )\n\t\t\t+ ( tech_score * 0.1 )\n\t\t\t+ ( this.resources.$ * 0.001 )\n\t\t\t);\n\t\t\t\n\t\treturn this.power_score;\n\t\t}", "function fitness(){\n getHungry = getHungry + 3;\n document.getElementById(\"healthScore\").innerHTML = getHungry;\n \n }", "function part_one_exercise_one(){\n const maxCapacity = 14\n let surfTime = true\n let bestStudent\n // const purposeInLife\n \n console.log(maxCapacity)\n console.log(surfTime)\n console.log(bestStudent)\n console.log(\"------\")\n // console.log(purposeInLife)\n}", "calculateScore() {\n\n let totalScore = 0; \n\n for (let i = 0; i < 5; i++) {\n this.chooseCard(card); \n }\n\n }", "getScore() {\n let totalScore = 0;\n\n for (let i = 0; i < this.currentPuzzleIndex; i += 1) {\n totalScore += this.colorPuzzles[i].getScore();\n }\n\n return totalScore;\n }", "function simpleScore(word) {\n\n let simplestScore = word.length;\n return simplestScore;\n\n}", "function addPoints() {\n score += 10;\n}", "function simpleScore(word) {\n let letterPoints = word.length;\n for (i = 0; i < word.length; i++) {\n console.log(`\\nPoints for '${word[i]}': ${letterPoints / word.length}'`);\n }\n return letterPoints;\n}", "function yourScore() {\n return fname + ' scored ' + (mid + final);\n }", "computeScore() {\n this.score++\n return this.score\n }", "function updateScores() {\n dealerScore = getScore(dealerCards);\n playerScore = getScore(playerCards);\n}", "function stage2(){\n player.attack.plusser += 62;\n}", "calculateScore(playerSelection, botSelection, player1, bot1){\n //console.log(\"\\n\");\n \n if(playerSelection == botSelection){\n console.log(\"Tie!, no points awarded to either player\"); \n }\n\n if(playerSelection == \"rock\"){\n if((botSelection == \"scissors\") || (botSelection == \"lizard\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"spock\") || (botSelection == \"paper\")){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n\n if(playerSelection == \"scissors\"){\n if((botSelection == \"paper\") || (botSelection == \"lizard\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n \n else if((botSelection == \"spock\") || (botSelection == \"rock\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n\n if(playerSelection == \"lizard\"){\n if((botSelection == \"spock\") || (botSelection == \"paper\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"rock\") || (botSelection == \"scissors\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n if(playerSelection == \"spock\"){\n if((botSelection == \"scissors\") || (botSelection == \"rock\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"paper\") || (botSelection == \"lizard\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n\n if(playerSelection == \"paper\"){\n if((botSelection == \"rock\") || (botSelection == \"spock\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"scissors\") || (botSelection == \"lizard\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n //console.log(\"\\n\");\n}", "function initialiseScoreBoards(){ \n redScoreBoard.innerText=redWinsCount; \n yellowScoreBoard.innerText=yellowWinsCount;\n}", "function calcScore(quizScore, essayScore) {\n\n var score = quizScore + essayScore;\n\n return score;\n\n}", "function startGame() {\n luminousScore = 0;\n}", "function raiseScore() {\r\n\tscore += 1;\r\n}", "function getScore () {\n var num1 = 2,\n num2 = 3;\n\n // function add() {\n //\n // }\n\n return myName + \" scored \" + (num1 + num2);\n}", "function bonusScore () {\n // Currently, we have two kinds of bonus: Match and Phrase\n var bonus = 0;\n\n // TODO: Yeah, I know we can fail faster here, but it's 3 in the morning\n var firstWord = formWord(state.words[0]);\n var secondWord = formWord(state.words[1]);\n\n // Check for a Match Bonus, where both words are the same\n if (firstWord.toUpperCase() === secondWord.toUpperCase()) {\n bonus += 2 * getWordValue(state.words[0].toUpperCase());\n }\n\n // Check for a Phrase Bonus\n var phrase = firstWord.toLowerCase() + \" \" + secondWord.toLowerCase();\n if (bonusPhrases[phrase]) {\n bonus += config.phraseBonus;\n }\n console.log(\"The phrase bonus result is: \" + bonus);\n return bonus;\n}", "constructor(){\n this.hull=20;\n this.firepower=5;\n this.accuracy=0.7;\n }", "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n\tlet totalPoints = 0;\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\ttotalPoints += Number(pointValue);\n\t\t\tletterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n\tletterPoints += `Total points for word: ${totalPoints}.\\n`;\n\treturn totalPoints;\t\t// Used to be \"return letterPoints\"\n }", "function exercice1() {\n console.log(\"EXERCICE 1\")\n // declaration des variables utiles\n let val;\n let double;\n\n // traitement\n val = 231;\n double = val * 2;\n\n // resultat\n console.log('val:', val);\n console.log('double: ', double);\n}", "get score() {\n return this._score;\n }", "scoreWord(word) {\n // console.log(word);\n let score = 0;\n let wordArray = word.toUpperCase().split('');\n for (let char of wordArray) {\n // console.log(`Char ${char} has a score of ${scoreLetters[char]}`);\n score += scoreLetters[char];\n }\n if (wordArray.length >= 7) {\n score += 8;\n }\n return score\n }", "constructor(score, effect){\n this.score = score;\n this.effect = effect;\n }", "function gradeAssignment(score){\n\n}", "function scoreQ9() {\n console.log(\"q9a answer: \" + q9a)\n console.log(\"q9b answer: \" + q9b)\n \n return 0; \n}", "get score(){\n return this._score;\n }", "function drawScore(){\n document.getElementById('score').innerText = `Human vs Computer: ${score[0]} to ${score[1]}!`\n}", "function proceed(difficultyLvl) {\n randomWords();\n input.value = \"\";\n showInput.innerText = \"Value displays here\";\n input.focus();\n switch (difficultyLvl) {\n case \"Easy\":\n s += 4;\n break;\n case \"Hard\":\n s += 3;\n break;\n case \"Very Hard\":\n s += 2;\n break;\n default:\n s += 4;\n }\n console.log(s);\n score += 3;\n scoreSheet.innerText = score;\n}", "function battle() {\r\n aiPick();\r\n \r\n if (mychoice == \"water\" && aiPokemon == \"grass\") {\r\n myScore = myScore + 0;\r\n aiScore = aiScore + 1;\r\n } else if (mychoice == \"water\" && aiPokemon == \"fire\") {\r\n myScore = myScore + 1;\r\n aiScore = aiScore + 0;\r\n } else if (mychoice == \"fire\" && aiPokemon == \"water\") {\r\n myScore = myScore + 0;\r\n aiScore = aiScore + 1;\r\n } else if (mychoice == \"fire\" && aiPokemon == \"grass\") {\r\n myScore = myScore + 1;\r\n aiScore = aiScore + 0;\r\n } else if (mychoice == \"grass\" && aiPokemon == \"water\") {\r\n myScore = myScore + 1;\r\n aiScore = aiScore + 0;\r\n }\r\n else if (mychoice == \"grass\" && aiPokemon == \"fire\") {\r\n myScore = myScore + 0;\r\n aiScore = aiScore + 1;\r\n }\r\n else {\r\n myScore = myScore + 0;\r\n aiScore = aiScore + 0;\r\n }\r\n \r\n console.log(mychoice + \" \" + aiPokemon);\r\n console.log(myScore + \" \" + aiScore);\r\n\r\n me.innerHTML = myScore;\r\n ai.innerHTML = aiScore;\r\n }", "function addScore(answer) {\n _scores[answer[0]] = answer[1];\n}", "function alivenessStats(){\n\n\t//Avg. aliveness\n\n\t\n\n\t//Highest aliveness reported\n\n\t//Lowest aliveness\n\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 updateScore (winner) {\n if (winner === 'human') {\n humanScore += 1;\n }\n else {\n computerScore += 1;\n }\n}", "function DG(){\n DG.scoreP1 = 0;\n DG.scoreP2 = 0;\n DG.game = 301\n}", "function simpleScore(word){\n let totalScore = 0\nfor (let i = 0; i < word.length; i++){ \n//for(let letter of word.toUpperCase()) { this only scores if the word is in uppercase. removed that and put the for loop above\n //if (word.includes(letter))\n totalScore += 1\n\n}\nreturn totalScore\n}", "function addToScore () {\n userScore++;\n}", "function printScore() {\n scoreboardRiktig.innerHTML = `Du har klikket riktig: ${scoreRiktig} ganger`;\n scoreboardFeil.innerHTML = `Du har klikket feil: ${scoreFeil} ganger`;\n scoreboardPoints.innerHTML = `Poeng: ${scorePoints}`;\n}", "function scoreQ10b() {\n console.log(\"q10b answer: \" + q10b)\n\n}", "function initGameVar() {\n //holds the balance\n gamePot = 200;\n //holds users balance\n userPot = 50;\n //holds the state of the game\n gameOver = false;\n\n\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 displayScore() {\n let currentScore = document.getElementById(\"scoreboardScore\");\n currentScore.textContent = `${HURWin} - ${AIRWin}`;\n}", "increaseScore() {\n this.score++;\n }", "function scrabbleScore(str) {\n if (!str) {\n return 0;\n }\n let splitStr = str.toUpperCase().split(\"\");\n const mapArr = splitStr.map((letter) => $dict[letter] || 0);\n const reducer = mapArr.reduce((a, b) => a + b);\n return reducer;\n}", "function addScore(value) {\n total += value;\n}", "function Prediction() {\n this.score = {};\n}", "function getPlayerScore() {\n let score = 0;\n playerHand.forEach((card) => {\n score += parseInt(card.Weight);\n });\n return score;\n\n}", "function updateScore(winner) {\n if (winner === 'human') {\n humanScore += 1;\n } else if (winner === 'computer'){\n computerScore += 1;\n }\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 changeSecretNumber() {\n function resetScore() {\n _score = 20;\n _highScore = 0;\n }\n\n let _secretNumber = 0;\n let _score = 20;\n let _highScore = 0;\n}", "function addToScore () {\n score += questionInfo[correspondingQuestion].points\n document.querySelector('#score').innerHTML = `Score: ${score}`\n numberOfCorrectAnswers++\n}", "function getLetterScore (letter) {\n return 1; // For testing purposes\n return config.pointValues[letter.toUpperCase()];\n}", "function init() {\n\n currentPlayer = true;\n activePlayer()\n // Tous les score a 0\n\n currentScore = globalScore1 = globalScore2 = 0;\n\n \n\n // affichage des score a 0\n \n currentPointsP1.textContent = \"0\";\n currentPointsP2.textContent = \"0\";\n globalPointsP1.textContent = \"0\";\n globalPointsP2.textContent = \"0\";\n\n //Listener et stop du bouillonnement\n \n btnNewGame.addEventListener('click',resetNewGame,true);\n btnRollDice.addEventListener('click',rollDice,true);\n btnHold.addEventListener('click',holdingPoint,true);\n \n\n \n\n\n}", "getScore() {\n let score = 0;\n //loop through all the data and get total score\n _.map(this.state.tileData, function (key, value) {\n score += key['count'];\n });\n return score;\n }", "function updateScore() {\n score++;\n}", "function userScore() {\n $(\"#yourscore\").html(yourScore);\n console.log(\"yourscore \" + yourScore)\n console.log(\"crystalscore \" + crystalScore)\n }", "calcVars () {}", "function addbonus(score){\n return score +45;\n}", "function lowerScore() {\r\n\tscore -= 1;\r\n}", "getScore() {\n return this.score;\n }", "function EResonanceWeights(numelement, element){\n if(numelement>=2){\n score+=5;\n switch(element){\n case \"pyro\":\n outputstr += \"Fervent Flames</br>\\u2265 2 pyro: Elemental and Physical RES +15%</br></br>\"\n break;\n case \"cryo\":\n outputstr += \"Shattering Ice</br>\\u2265 2 cryo: 40% less time affected by electro element. For enemies affected by cryo, CRIT rate is incresed by 15%</br></br>\"\n break;\n case \"hydro\":\n outputstr += \"Soothing Waters</br>\\u2265 2 hydro: Pyro effects are less probable (by 40% of the time). 30% more healing.</br></br>\"\n break;\n case \"geo\":\n outputstr += \"Enduring Rock</br>\\u2265 2 geo: 15% more shield strength. Characters with shield have 15% more DMG, and for 15 seconds attacked enemies will have 20% less geo RES</br></br>\"\n break;\n case \"anemo\":\n outputstr += \"Impetuous Winds</br>\\u2265 2 anemo: Consumed stamina decreased by 15%, faster movement speed (by 10%), and skill CD a shorter time (by 5%)</br></br>\"\n break;\n case \"electro\":\n outputstr += \"High Voltage</br>\\u2265 2 electro: Overload, electro-charge, and superconduct are guaranteed to create an electro particle with CD of 5 seconds. Cryo effects are less probable (by 40% of the time)</br></br>\"\n break;\n }\n }\n}", "function scoreDraw() {\n let healthElement = document.getElementById(\"healthcheckup\");\n let moodElement = document.getElementById(\"moodcheckup\");\n let nameElement = document.getElementById(\"name\");\n let drinkcountElement = document.getElementById(\"drinkcounter\");\n let modsElement = document.getElementById(\"modstotalcheckup\");\n let foodElement = document.getElementById(\"foodcheckup\");\n let waterElement = document.getElementById(\"watercheckup\");\n let coffeeElement = document.getElementById(\"coffeecheckup\")\n nameElement.textContent = `Name: ${target.name}`;\n moodElement.textContent = `Mood: ${target.moodScore.toString()}`;\n healthElement.textContent = `Health: ${target.healthScore.toString()}`;\n drinkcountElement.textContent = `Number of Drinks: ${target.hits}`;\n modsElement.textContent = `Modifiers Total: ${modsTotal}`;\n foodElement.textContent = `Food: ${foodCount.toString()}`;\n waterElement.textContent = `Water: ${waterCount.toString()}`;\n coffeeElement.textContent = `Coffee: ${coffeeCount}`;\n\n}", "function initGame() {\n\n game.scores[PLAYER] = scorePlayer(PLAYER);\n game.scores[DEALER] = scorePlayer(DEALER);\n\n updateGameDisplay();\n}", "function scoreQ10a() {\n console.log(\"q10a answer: \" + q10a)\n}", "function setZeroScore() {\n playerScore = 0;\n computerScore = 0;\n drawScore = 0;\n}", "function initializeVars() {\r\n\tsimProgress = 0;\r\n\tcount5any = 0;\r\n\tcount4any = 0;\r\n\tcount3 = 0;\r\n\t\r\n\tcount5charAny = 0;\r\n\tcount5charFeat = 0;\r\n\tcount5weapAny = 0;\r\n\tcount5weapFeat1 = 0;\r\n\tcount5weapFeat2 = 0;\r\n\t\r\n\tcount4charAny = 0;\r\n\tcount4weapAny = 0;\r\n\tcount4charFeat1 = 0;\r\n\tcount4charFeat2 = 0;\r\n\tcount4charFeat3 = 0;\r\n\tcount4weapFeat1 = 0;\r\n\tcount4weapFeat2 = 0;\r\n\tcount4weapFeat3 = 0;\r\n\tcount4weapFeat4 = 0;\r\n\tcount4weapFeat5 = 0;\r\n\t\r\n\tfeat5Miss = false;\r\n\tfeat4Miss = false;\r\n\tfateActive = 0;\r\n\tfateCount = 0;\r\n\t\r\n\tnonFeat4Threshold = 500;\r\n\t\r\n\twishCount = 0;\r\n\t\r\n\tresultContent = \"\";\r\n}", "function score(value) {\n let final = 0;\n switch (value) {\n case \"ones\":\n for (const die of currentRolls) {\n if (die == 1) final++;\n }\n break;\n case \"twos\":\n for (const die of currentRolls) {\n if (die == 2) final += 2;\n }\n break;\n case \"threes\":\n for (const die of currentRolls) {\n if (die == 3) final += 3;\n }\n break;\n case \"fours\":\n for (const die of currentRolls) {\n if (die == 4) final += 4;\n }\n break;\n case \"fives\":\n for (const die of currentRolls) {\n if (die == 5) final += 5;\n }\n break;\n case \"sixes\":\n for (const die of currentRolls) {\n if (die == 6) final += 6;\n }\n break;\n case \"three_of_a_kind\":\n final = currentRolls.reduce(getSum, 0);\n break;\n case \"four_of_a_kind\":\n final = currentRolls.reduce(getSum, 0);\n break;\n case \"full_house\":\n final = 25;\n break;\n case \"small_straight\":\n final = 30;\n break;\n case \"large_straight\":\n final = 40;\n break;\n case \"chance\":\n final = currentRolls.reduce(getSum, 0);\n break;\n case \"yacht_z\":\n final = 50;\n break;\n default:\n }\n return final;\n}", "function saveScore(s){\n score=s\n}", "function setGamePoints() {\n playerPointsElem.innerHTML = player.score;\n computerPointsElem.innerHTML = computer.score;\n}", "function addScroe() {\n var totalScore = 0;\n var temp = 0;\n var bonusWord = 0;\n var bonusLetter = false;\n var bonusStop = false;\n for (i = 0; i < 15; i++) {\n var current = $.grep(boardObj, function(e) {return e.boardPos === i}); // gets the current element position\n if (current.length == 1) { // for the current element\n if (bonusStop == false) { // checks if letters are chained together\n bonusStop == true;\n }\n if (i == 0 || i == 7 || i == 14) { // Bonus words are taken care of\n bonusWord++;\n } else if (i == 3 || i == 11) { // Bonus letters are taken care of\n bonusLetter = true;\n }\n temp += letterValueGetter(current[0].charVal); // store the each letter score into the temp\n if (bonusLetter) { // so if there is a bonus letter score, increase the score for that letter\n temp += letterValueGetter(current[0].charVal);\n bonusLetter = false;\n }\n } else if (bonusStop) { // if there is a gap between words\n if (bonusWord > 0) { // bonus word are considered\n temp = temp * bonusWord * 3;\n bonusWord = 0;\n }\n bonusStop = false; // set bonusStop\n totalScore += temp; // adds up the score\n temp = 0; // and reset the temp score since there is a stop\n } else {\n if (bonusWord > 0) { // reset the bonus scoring\n temp = temp * bonusWord * 3;\n bonusWord = 0;\n }\n totalScore += temp; // calculate the total score when the bonus stops\n temp = 0;\n }\n }\n if (bonusWord > 0) { // final check for any bonus\n temp = temp * bonusWord * 3;\n totalScore += temp;\n }\n return totalScore;\n}", "function updateScore (winner) {\n if (winner === 'human' ){\n humanScore++;\n } else if ( winner === 'computer' ){\n computerScore++;\n }\n}", "function getMultiplier() {\n\treturn 1 + score / SCORE_MULTIPLIER;\n}", "function getScore() {\n num1 = 2,\n num2 = 3;\n\n function add() {\n return name + ' scored ' + (num1 + num2);\n }\n\n return add();\n}" ]
[ "0.6647555", "0.65762186", "0.6569386", "0.64685243", "0.6465729", "0.643703", "0.6429099", "0.6404797", "0.6308213", "0.62973464", "0.62915576", "0.6188451", "0.61729014", "0.61399436", "0.6137787", "0.60781676", "0.6074793", "0.6052721", "0.6048343", "0.60345006", "0.6033747", "0.6007202", "0.6003538", "0.60019577", "0.59838533", "0.59352183", "0.5915549", "0.5913397", "0.58979946", "0.5886139", "0.5872988", "0.58700544", "0.5868337", "0.58655953", "0.5849276", "0.5848228", "0.58379596", "0.58367115", "0.58218354", "0.5820869", "0.5811444", "0.57983184", "0.57957554", "0.5792113", "0.57865185", "0.5782037", "0.5779158", "0.57746994", "0.5764266", "0.5758247", "0.57573426", "0.57518166", "0.5736241", "0.5731414", "0.5729836", "0.57292175", "0.5718705", "0.5706817", "0.5698247", "0.56862515", "0.568302", "0.56825966", "0.5674272", "0.56723094", "0.56713873", "0.5667712", "0.5665372", "0.5659654", "0.5657743", "0.56532526", "0.56475246", "0.56387085", "0.5636467", "0.5632407", "0.5631268", "0.561481", "0.56098324", "0.5607412", "0.5601653", "0.55967396", "0.55961233", "0.55948406", "0.5591831", "0.55903596", "0.55893713", "0.5588422", "0.55858546", "0.5585748", "0.5578837", "0.5575131", "0.5564122", "0.55640817", "0.5557804", "0.5557477", "0.5556794", "0.5555089", "0.5553342", "0.5550028", "0.5544093", "0.5536229" ]
0.627093
11
FORM : input, button PLAYER: name GAME: 0: WAIT, 1: PLAY, 2: END
function setup() { database = firebase.database(); canvas = createCanvas(500, 500); game = new Game(); game.getState(); game.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function play(){\n endAnimLogo();\n player_1=document.querySelector(\"#name_player_1\").value;\n\n document.querySelector(\"#idPlayerField\").style.display=\"none\";\n\tdocument.querySelector(\"#game\").style.display=\"block\";\n\n /* returnConsole=document.querySelector(\"div.active\").id\n document.querySelector(\".console\").innerHTML=returnConsole; */\n\n document.querySelector(\"#essaiPrix\").addEventListener(\"click\", stopPrice);\n}", "start()\r\n {\r\n //giving condition to generate the form and increasing the playerCount\r\n if(gameState === 0)\r\n {\r\n player = new Player();\r\n player.getCount();\r\n form = new Form();\r\n form.display(); \r\n } \r\n }", "function begin_play(){\n\t//get the input\n\tvar p1 = document.getElementById('player1_id').value;\n\tvar p2 = document.getElementById('player2_id').value;\n\n\tif (this.started) { //game has already started\n\t\talert('Already started. Please Reset Play to start again.');\n\t} else { //start game\n\t\tif (isEmpty(p1) || isEmpty(p2)) { //validate that strings are non-empty\n\t\t\talert(\"Please enter a name.\");\n\t\t} else {\n\t\t\t//update disabled attribute using js: https://www.w3schools.com/jsref/prop_text_disabled.asp\n\t\t\tdocument.getElementById('player1_id').disabled = true;\n\t\t\tdocument.getElementById('player2_id').disabled = true;\n\t\t\t//add move to name\n\t\t\tdocument.getElementById('player1_id').value += ' (X)';\n\t\t\tdocument.getElementById('player2_id').value += ' (O)';\n\t\t\tthis.started = true;\n\t\t\tdocument.getElementById('turn_info').innerHTML = \"Turn for: <b>X</b>\";\n\t\t}\n\t}\n}", "function endGame() {\n var target = document.querySelector('#playerName');\n var form = document.createElement('form');\n var div = document.createElement('div');\n var label = document.createElement('label');\n var field = document.createElement('input');\n var submit = document.createElement('button');\n label.textContent = \"Please enter your name: \";\n label.setAttribute(\"class\", \"mr-2\")\n form.id = \"#form\";\n label.for = \"player\";\n label.type = \"text\"\n submit.id = \"submitName\";\n field.id = \"player\";\n field.type = \"text\";\n field.name = \"player\";\n submit.textContent = \"Submit\";\n submit.setAttribute(\"class\", \"btn-sm btn-success px-4 mt-2\");\n field.setAttribute(\"class\", \"form-control\");\n div.setAttribute(\"class\", \"form-inline\");\n target.appendChild(form);\n form.appendChild(div);\n div.appendChild(label);\n div.appendChild(field);\n target.appendChild(submit);\n submit.addEventListener(\"click\", savePlayerName);\n}", "function displayGame(){\n\tvar formHtml= ' ';\n\tfor (var i = 0; i < choices.length; i++){\n\t\tformHtml += '<div><input type=\"submit\" name=\"option\" value=\"' + choices[i] + '\" id=\"option' + i + '\"></div>'\n\t\t$('#playerChoices').html(formHtml);\n\t\t$('#playerChoices2').html(formHtml);\n\t}\n}", "function playButtonStart(startLevelUpdate, modeUpdate)\r\n\t{\t\r\n\t\tplayButton = new newButton((buttonHeight + 40), buttonWidth, \"orange\", \"orange\", (940 / 2) - 60, 215, stage, \"Iniciar\", textFont, \"white\");\r\n\t\tchangeButton = new newButton((buttonHeight + 110), buttonWidth, \"orange\", \"orange\", (940 / 2) - 94, 255, stage, \"Escuchas: Original\", textFont, \"white\");\r\n\r\n\t\tmodeText = new newText(\"Modo: \" + modeUpdate, textFont, \"darkorange\", stage, (25*10), (75*1.25));\r\n\r\n\t\tplayButton.addListeners(\"darkorange\");\r\n\t\tchangeButton.addListeners(\"darkorange\");\r\n\r\n\t\tplayButton.newContainer.addEventListener(\"click\", stopPlaying);\r\n\t\tchangeButton.newContainer.addEventListener(\"click\", changeMessage);\r\n\r\n\t\tif (startLevelUpdate == \"Easy\")\r\n\t\t{\r\n\t\t\tactivateButtons();\r\n\t\t\tgainModifier = 10;\r\n\t\t\tgameControl.generateIconigta(\"Fácil\");\r\n\t\t\tconsole.log(gameControl.Guess)\r\n\t\t}\r\n\t\telse if (startLevelUpdate == \"Medium\")\r\n\t\t{\r\n\t\t\tactivateButtons();\r\n\t\t\tnewPlayer.Correct = 20;\r\n\t\t\tnewPlayer.level = \"Intermedio\";\r\n\t\t\tbuttonActiveMedium = true;\r\n\t\t\tgainModifier = 6;\r\n\t\t\tgameControl.generateIconigta(\"Intermedio\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tactivateButtons();\r\n\t\t\tnewPlayer.Correct = 30;\r\n\t\t\tnewPlayer.level = \"Avanzado\";\r\n\t\t\tbuttonActiveHard = true;\r\n\t\t\tgainModifier = 3;\r\n\t\t\tgameControl.generateIconigta(\"Avanzado\");\r\n\t\t}\r\n\t\tif (modeUpdate == \"Cortes\") {gainModifier *= -1;}\r\n\r\n\t\tgameFilter.gain.value = gainModifier;\r\n\t\tgameFilter.frequency.value = gameControl.Guess;\r\n\r\n\t\tgainText = new newText(\"Ganancia: \" + gainModifier.toString() + \" dB\", textFont, \"darkorange\", stage, (25*28), (75*1.25));\r\n\t\trightText.createText.text = \"Aciertos: \" + newPlayer.subCounter.toString();\r\n\t\tlevelText.createText.text = \"Nivel: \" + newPlayer.level;\r\n\r\n\t\tinitEasy.newContainer.removeAllChildren();\r\n\t\tinitMedium.newContainer.removeAllChildren();\r\n\t\tinitAdvanced.newContainer.removeAllChildren();\r\n\r\n\t\tstage.removeChild(initText.createText);\r\n\r\n\t\tstage.update();\r\n\r\n\t\tdelete initText;\r\n\t\tdelete initEasy;\r\n\t\tdelete initMedium;\r\n\t\tdelete initAdvanced;\r\n\t}", "play()\r\n {\r\n // hide the form\r\n form.hide();\r\n // display start text\r\n textSize(20);\r\n text(\"START\", width/2 - 30, 40);\r\n // gets all players details\r\n Player.getPlayerInfo();\r\n // if there are players\r\n if(allPlayers!=undefined)\r\n {\r\n background(\"green\");\r\n image(trackImg, 0, -displayHeight*4, width, displayHeight*5);\r\n // give index as 0 to be incremented\r\n var index = 0;\r\n var x = width/2 - 500;\r\n var y;\r\n for(var plr in allPlayers)\r\n {\r\n index = index + 1;\r\n x += 200;\r\n y = height - allPlayers[plr].distance;\r\n cars[index - 1].x = x;\r\n cars[index - 1].y = y;\r\n if(index === player.index)\r\n {\r\n fill(\"red\");\r\n ellipse(cars[index-1].x, cars[index-1].y, 60, 60);\r\n camera.position.x = width/2;\r\n camera.position.y = y;\r\n imageMode(CENTER);\r\n image(this.titleImage, width/2, cars[index-1].y - 250, 400, 100);\r\n }\r\n }\r\n if(keyDown(UP_ARROW) && player.index != null)\r\n {\r\n player.distance += 30;\r\n player.update();\r\n }\r\n if(player.distance >= 4590)\r\n {\r\n gameState = 2;\r\n }\r\n }\r\n drawSprites();\r\n }", "start(){\n if(gameState===0){\n player = new Player();\n player.getCount();\n\n form = new Form()\n form.display();\n }\n }", "function submitForm(e){\n\n if(!player){\n //* set 'player' variable to the value given in the 'player' field\n player = $('input[name=\"player\"]').val();\n }\n //* set the url using the player variable\n var url = '/moon/start?player=' + player;\n\n //* send an ajax Request using the given values\n //*\n //* the sendAjaxRequest function expects values in this order:\n //* url, data, verb, altVerb, event, successFn\n sendAjaxRequest(url, {}, 'post', null, e, function(data){\n //* call the function that will update the DOM\n htmlInitiateGame(data);\n });\n}", "function handleSubmitBtn() {\n try {\n const result = game.playersGuessSubmission( input.value );\n if (result === 'You Win!' || result === 'You Lose.') {\n pauseScreen(result);\n } else {\n updateScreen(result);\n }\n } catch (error) {\n updateScreen(error);\n }\n \n input.value = '';\n}", "function next() {\n var playerOne = document.getElementById(\"player1Name\").value = \"block\";\n document.getElementById(\"player1Name\").innerHTML = p1;\n\t\n\tvar playerTwo = document.getElementById(\"player2Name\").value = \"block\";\n document.getElementById(\"player2Name\").innerHTML = p2;\n\t\n\tdocument.getElementById(\"playerone\").style.display = \"block\";\n}", "start() {\r\n //if the game state is in wait state(gamestate=0) we are creating a player object and a form object\r\n if(gameState === 0) {\r\n player = new Player();\r\n player.getCount();\r\n\r\n form = new Form();\r\n form.display();\r\n \r\n }\r\n }", "function btnForm(){\n \n mainElm.appendChild(btnDiv)\n //select artists\n fetchAllArtists(buildArtistsSelection)\n //start\n buildStartGameBtn()\n //input box\n buildInputBox()\n //hint button with hint content\n buildHintBtn()\n //score\n buildScore()\n //countdown timer\n buildCountDownTimer()\n //give up\n buildGiveUpBtn()\n\n\n }", "function buttonEvent(playerChoice) {\n let computer = computerChoice();\n playRound(playerChoice, computer);\n}", "function start_game(){\r\n if(name_input.value==\"\"){\r\n enter_name_alert.style=\"visibility: visible;\"\r\n }\r\n else{\r\n enter_name_alert.style=\"visibility: hidden;\"\r\n first_layer.style.display=\"none\"\r\n user_name.innerHTML=name_input.value+' <i class=\"fa fa-gamepad\" aria-hidden=\"true\"></i>'\r\n }\r\n}", "function _displayForm(){\n\n const form = document.createElement('div');\n form.setAttribute('id', 'form-container');\n\n const wrapper = document.querySelector('#wrapper');\n wrapper.insertBefore(form, document.querySelector('#restart-button'));\n\n const sign = ['X','O'];\n\n //Creating input fields for two players\n for(let i = 0; i < 2; i++){\n const label = document.createElement('label');\n label.setAttribute('for', `player${i+1}-name`);\n label.textContent = `${sign[i]} Player: `\n\n const input = document.createElement('input');\n input.setAttribute('id', `player${i+1}-name`);\n input.setAttribute('name', `player${i+1}-name`);\n\n input.setAttribute('type', 'text');\n\n form.appendChild(label);\n form.appendChild(input);\n }\n\n const submitBtn = document.createElement('button');\n submitBtn.setAttribute('id','submit-names');\n submitBtn.textContent = 'Enter';\n\n submitBtn.addEventListener('click', _submitNames);\n\n form.appendChild(submitBtn);\n }", "function startGame() {\n setMessage(\"Select an opponent above\");\n}", "function startGame() {\n id(\"pokedex-view\").classList.add(\"hidden\");\n id(\"p2\").classList.remove(\"hidden\");\n qs(\"#p1 .hp-info\").classList.remove(\"hidden\");\n id(\"results-container\").classList.remove(\"hidden\");\n id(\"flee-btn\").classList.remove(\"hidden\");\n id(\"start-btn\").classList.add(\"hidden\");\n qs(\"#p1 .buffs\").classList.remove(\"hidden\");\n let moves = qsa(\"#p1 button\");\n for (let i = 0; i < moves.length; i++) {\n moves[i].disabled = false;\n }\n\n let params = new FormData();\n params.append(\"startgame\", \"true\");\n params.append(\"mypokemon\", qs(\"#p1 .name\").id);\n fetch(URL_GAME, {method: \"POST\", body: params})\n .then(checkStatus)\n .then((resp) => resp.json())\n .then(getGUPI)\n .catch(console.error);\n\n id(\"p1-turn-results\").classList.remove(\"hidden\");\n id(\"p2-turn-results\").classList.remove(\"hidden\");\n qs(\"#p1 .buffs\").classList.remove(\"hidden\");\n qs(\"#p2 .buffs\").classList.remove(\"hidden\");\n\n }", "function next(){\n player2=new user(document.user2.name.value);\n player2.setGrid();\n fadeForm(\"user2\");\n showForm(\"boats\");\n turnInfo(player2.name);\n \n turn++;\n unlockMap(turn);\n bindGrid(turn);\n}", "function gamePickerOn() {\n var x = document.querySelector(\"form\");\n x.style.display = \"block\";\n}", "function selectTypeGame(){\r\n\r\n inputs.forEach(input => input.value = \"\");//clean all imputs\r\n //if the user want to play with other user\r\n if(this.id === '2user'){\r\n //run the btnGame's logic\r\n containerModeGame.style.display = 'none';\r\n containerForm.style.display = 'block';\r\n\r\n //if the user want to play with the computer\r\n }else if(this.id === 'computerUser'){\r\n const userSelects = document.querySelectorAll('.userSelect');//btns X or O\r\n const userPrime = document.getElementById('userPrime');// input user name\r\n \r\n containerModeGame.style.display = 'none';\r\n containerPlayWithComputer.style.display = 'block'\r\n\r\n \r\n userSelects.forEach(userSelect => userSelect.addEventListener('click',(e)=>{\r\n \r\n if(userPrime.value.length === 0){//checks if the input is empty\r\n \r\n userPrime.parentNode.lastElementChild.textContent = 'User name cannot be empty';// write the message in the div\r\n //input.parentNode.lastElementChild.classList.add('alert');//add the alert class to the div\r\n\r\n userPrime.classList.add('input-alert');//add the input-alert class to the input\r\n\r\n } else {\r\n \r\n value1 = e.target.id === 'userX'? 'X':'O';\r\n value2 = value1 === 'X'? 'O':'X';\r\n\r\n //creating the user objects\r\n user1V = Object.assign(user1V,newUser(userPrime.value,true,value1));\r\n user2V = Object.assign(user2V,newUser('Computer',false,value2));\r\n\r\n \r\n containerPlayWithComputer.style.display = 'none';\r\n containerGame.style.display = 'block';\r\n\r\n //call the game; gameTicTacToe it's a module now \r\n const gameTicTacToe = game();\r\n\r\n\r\n gameTicTacToe.newGrid();\r\n gameTicTacToe.renderGrid();\r\n \r\n }\r\n\r\n \r\n }))\r\n\r\n }\r\n}", "function continueGame() {\n game.updateDisplay();\n if (game.getState() == \"playing\") {\n $(\"#startButton\").toggleClass(\"hidden\");\n } else {\n $(\"#resetButton\").toggleClass(\"hidden\");\n }\n saveGame();\n}", "choosePlayer() {\n player.sprite = document.formular.player.value;\n player.moves = true;\n }", "function setPlayesName() {\n player01Name = document.getElementById(\"player01Name\").value;\n if (player01Name == \"\") { player01Name = \"player01\" }\n\n player02Name = document.getElementById(\"player02Name\").value;\n if (player02Name == \"\") { player02Name = \"player02\" }\n}", "start()\r\n {\r\n if(gameState===0)\r\n {\r\n player= new Player();\r\n player.getCount();\r\n\r\n form= new Form();\r\n form.display();\r\n }\r\n }", "play () {\r\n form.hide();\r\n\r\n textSize (30) ;\r\n text (\"Game Start\", 120,100);\r\n Player.getPlayerInfo ();\r\n player.getCarsAtEnd(); // get how many cars have reached end\r\n if (allPlayers != undefined) {\r\n background(groundImg);\r\n image (trackImg,0,-displayHeight *4,displayWidth,displayHeight *5) ;\r\n var x = 425 ;\r\n var y ;\r\n var index = 0 ; \r\n var display_position = 130;\r\n // display all players\r\n for (var plr in allPlayers){\r\n index = index + 1 ;\r\n y = displayHeight - allPlayers[plr].distance ; \r\n // x = x + 300 ;\r\n\r\n switch (index) {\r\n case 1 :\r\n x= 425 ;\r\n break ;\r\n case 2: \r\n x= 635 ;\r\n break ;\r\n case 3: \r\n x= 870 ;\r\n break ;\r\n case 4: \r\n x= 870 + 210 ;\r\n break ;\r\n default :\r\n break;\r\n }\r\n cars[index - 1].x = x ;\r\n cars[index - 1].y = y ;\r\n \r\n if (index == player.index) {\r\n cars[index-1].shapeColor = \"red\"; // mark the current player with red color\r\n stroke(19);\r\n fill(\"red\");\r\n ellipse(x,y,60,60);\r\n camera.position.x = displayWidth/2 ;\r\n camera.position.y = cars[index - 1].y ;\r\n } else\r\n cars[index-1].shapeColor = \"black\"; // mark the other player with black color\r\n \r\n\r\n display_position+=20;\r\n textSize (15) ;\r\n //x = x + 200 ;\r\n //text (allPlayers[plr].name+\": \" + allPlayers[plr].distance, 120, display_position);\r\n }\r\n \r\n }\r\n \r\n if (keyIsDown (UP_ARROW) && player.index != null) {\r\n \r\n player.distance= player.distance + 10; // increment player distance\r\n player.updatePlayerNameAndDistance ();\r\n }\r\n // checking for finish line \r\n if (player.distance > 4200) {\r\n gameState = 2 ; \r\n player.rank = player.rank + 1 ;\r\n Player.updateCarsAtEnd(player.rank);\r\n push () ;\r\n textFont (40);\r\n stroke(\"blue\");\r\n text (\"YOUR RANK : \"+player.rank, displayWidth/2,camera.position.y-70);\r\n pop ();\r\n // end game state\r\n }\r\n drawSprites();\r\n }", "function game() {\n const playGame = e => {\n const player = e.target.parentElement.value;\n setTimeout(function() { playRound(player); }, 500);\n }\n \n //check buttons are clicked\n const buttons = document.querySelectorAll('button')\n buttons.forEach(function(button) {\n button.addEventListener('click', playGame);\n }) \n}", "function initPreGame() {\r\n\tstartButton = new NButton.buttonBuilder()\r\n\t\t.withText(\"Start\")\r\n\t\t.withPos(width / 2 - 75, height - 100)\r\n\t\t.withWidth(150)\r\n\t\t.withHeight(75)\r\n\t\t.withTextSize(25)\r\n\t\t.build();\r\n\tpreGameMainMenu = new NButton.buttonBuilder()\r\n\t\t.withText(\"Main Menu\")\r\n\t\t.withPos(50, height - 100)\r\n\t\t.withWidth(150)\r\n\t\t.withHeight(75)\r\n\t\t.withTextSize(25)\r\n\t\t.build();\r\n\tbuttonPalletLeft = [];\r\n\tbuttonPalletRight = [];\r\n\tcreateButtonPallet(50, 250, buttonPalletLeft);\r\n\tcreateButtonPallet(width - 50 - 4 * 50 - 3 * 4, 250, buttonPalletRight);\r\n\tp1input = createInput('Player One');\r\n\tp1input.position(55 + 10, 220 + 10);\r\n\tp1input.hide();\r\n\tp1input.size(150, 40);\r\n\tp1input.style('font-size', '20px');\r\n\tp2input = createInput('Player Two');\r\n\tp2input.position(width - 250 + 10, 220 + 10);\r\n\tp2input.hide();\r\n\tp2input.size(150, 40);\r\n\tp2input.style('font-size', '20px');\r\n\tbuttonPalletLeft[9].selected = true;\r\n\tbuttonPalletRight[10].selected = true;\r\n\tcolorsSelected = {\r\n\t\tp1col: buttonPalletLeft[9].col,\r\n\t\tp2col: buttonPalletRight[10].col,\r\n\t\tp1name: \"Player One\",\r\n\t\tp2name: \"Player Two\"\r\n\t};\r\n}", "function getPlayerName() {\n // Call the promise function to query the API for a name for Player 2\n getPlayer2Name().then((response) => {\n player2.name = response;\n });\n // Sets up the animation for fading in and out the form for the user name\n const tl = new TimelineMax();\n const messageBox = document.querySelector('.messageBox');\n messageBox.innerHTML = `\n<div class=\"enterName\">\n <label for=\"name\" class=\"visuallyhidden\">Enter your name</label>\n <input type=\"text\" name=\"name\" id=\"name\" class=\"enterNameField\" placeholder=\"Enter Your Name\" autocomplete=\"off\"/>\n <button id=\"enterNameButton\" type=\"submit\" class=\"enterNameButton\">\n Submit\n </button>\n </div>\n `;\n const submitButton = document.querySelector('#enterNameButton');\n // Fade in the name form\n tl.from('.enterName', 1, {\n opacity: 0\n });\n const input = document.querySelector('#name');\n input.focus();\n // Allow the user to press the enter key instead of clicking on the button if they want\n input.addEventListener('keyup', (event) => {\n event.preventDefault();\n if (event.keyCode === 13) {\n document.querySelector('#enterNameButton').click();\n }\n });\n // Pause the animation timeline until the user clicks then fade out the form and trigger the next function\n tl.addPause(1, () => {\n submitButton.addEventListener('click', () => {\n tl.play();\n tl.to('.enterName', 0.5, {\n opacity: 0\n }).eventCallback('onComplete', getRoundsToPlay());\n });\n });\n}", "function buttonpressed() {\n // Start by clearing screen\n clear();\n background(0, 0, 0);\n textAlign(CENTER);\n textSize(16);\n fill(255);\n\n // Get the type of pokemon selected from the radio buttons and put into \"elt\" variable\n elt = document.getElementById(\"form1\")[\"poketype\"].value;\n // Initial counters\n x = 1;\n pos = 0;\n y = 0;\n amountdrawn = 0;\n\n // Call loadingText function to display \"loading...\" whilst screen is being filled with data\n loadingText();\n // Call preloadagain function to load a pokemon from api\n preloadagain();\n }", "function p1SelectPhase() {\n if (playerNumber == 1) {\n // What Player 1 sees\n \n // Make buttons in Player 1 area\n makeRPSbuttons( $(\"#player1Selection\") )\n\n // Waiting message in Player 2 area\n $(\"#player2Selection\").empty().text(\"Opponent waiting on your selection\")\n } else if (playerNumber == 2) {\n // What Player 2 sees\n\n // Waiting message in Player 1 area\n $(\"#player1Selection\").empty().text(\"Opponent is choosing\")\n\n // Waiting message in Player 2 area\n $(\"#player2Selection\").empty().text(\"Waiting on opponent's selection\")\n }\n\n}", "promptPlayerForExchangeChoice() {\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`Choosing influences to return`);\n this.currentPlayer.renderControls(announcement);\n const [idx1, idx2] = this.currentPlayer.randExchangeIdx();\n setTimeout(() => {\n this.currentPlayer.exchangePartTwo(idx1, idx2);\n this.endTurn();\n }, 1000);\n } else {\n let exchangeForm = exchangeSelectorForm(this.currentPlayer);\n this.currentPlayer.renderControls(exchangeForm);\n exchangeForm.addEventListener('submit', (e) => {\n e.preventDefault();\n exchangeForm.remove();\n this.domState = this.domState.refresh();\n const [idx1, idx2] = this.domState.exchangeIndices;\n this.currentPlayer.exchangePartTwo(idx1, idx2);\n this.endTurn();\n })\n }\n }", "function startLocalGame() {\n\t$('#mainBox').css({'width':'540px','height':'540px'});\n\t$('#localMenu').hide(0);\n\t$('#gameArea').delay(300).show(0); //delay is used to wait for animation\n\t$('#blackName').text($('#p1NameInput').val()); \n\t$('#redName').text($('#p2NameInput').val());\n}", "function resumeGame() {\r\n id(\"submit-btn\").disabled = false;\r\n id(\"skip-btn\").disabled = false;\r\n }", "function input(e){\n\tlet code = e.keyCode;\n\tif(code == 38) // Up arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\n\t\tplayer.vel = -10;\n\t}\n\telse if(code == 40) // Down arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\t\tplayer.vel = 10;\n\t}\n}", "start(){\n if(gameState === 0){\n //Creates a new player object\n player = new Player() ; \n\n //gets the total count of the players\n player.getCount();\n //creates a new form object\n form = new Form();\n //displays the form\n form.display();\n }\n }", "function acceptQuestParticipate() {\n\tdocument.getElementById(\"merlin\").style.display = \"none\";\n\tstageCounter = 0;\n\tdocument.getElementById('acceptQuest').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_quest' : true\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for others to answer\");\n}", "playNowBtnClickHandler(e) {\n this.newGame.yell();\n this.newGame.fightingSpirit.play();\n e.preventDefault();\n e.target.disabled = 'true';\n this.moveScreenUp();\n this.newGame.runGame(this.newGame.getPlayerName());\n }", "function acceptStart() {\r\n\t\r\n\tGC.playerCount = UI.getCtrlValue(\"numPlayers\");\r\n\tUI.setConsoleHTML(\"Are you sure you want \" + GC.playerCount + \" players?\");\r\n\tUI.clearControls();\r\n\tUI.addYesNo(\"accept\",\"setPlayerInfo(0)\",\"main()\");\r\n}", "function preGame() {\n // Show Game Options first.\n statusBar.innerHTML = \"<span id=\\\"welcome\\\">Welcome!</span><br />Please select your options below and click on the button to continue!\";\n document.getElementById(\"preGame\").removeAttribute(\"hidden\");\n document.getElementById(\"preGame\").style.display = \"inline-block\";\n // Color in Default animal choices\n document.getElementById(\"s4\").className = \"sign1\";\n document.getElementById(\"s4a\").className = \"sign1\";\n document.getElementById(\"s5\").className = \"sign2\";\n document.getElementById(\"s5a\").className = \"sign2\";\n document.getElementById(\"formSubmit\").innerHTML = \"Ready?\";\n}", "function play() {\n var serverName = $(\"#serverList :selected\").text();\n var nickname = $(\"#nickname\")[0].value;\n if(nickname === '') {\n $(\"#errorNickname\").css({visibility:\"visible\"});\n }\n else {\n $(\"#errorNickname\").css({visibility:\"hidden\"});\n displayGame(nickname, serverName);\n }\n}", "function introSubmitted (e) {\n\n // Prevent default behaviour \n e.preventDefault();\n\n // Get the name and store it in a variable \n status.name = nameInput.value;\n\n // Validate the name \n if (status.name === '') return;\n\n // Change the status to playing \n status.isPlaying = true;\n\n // Remove the intro container \n UI.removeIntro();\n \n // Show the instruction modal\n UI.displayInstructionModal(true);\n\n // Initialize the game \n init();\n}", "function buttonRock(){\r\n playerSelection = \"rock\";\r\n game(playerSelection);\r\n return;\r\n}", "function jugar() {\n const playerSelection1 = gameForm.selection.value; //TIRO 1\n const playerSelection2 = gameForm2.selection.value; //TIRO 2\n\n const ganadorInfo = inicia(playerSelection1, playerSelection2); //AQUI SE GUARDAN AMBOS TIROS\n\n imprimeGanador(ganadorInfo);\n}", "function startGame() {\n\tvar serverMsg = document.getElementById('serverMsg');\n\tdocument.getElementById('print').disabled = false;\n\tserverMsg.value += \"\\n> all players have joined, starting game, wait for your turn...\"\n\tdocument.getElementById('rigger').style.display = \"none\";\n}", "function beginGame() {\n startButtonEl.disabled = true;\n beginTimer();\n cueQuestion();\n}", "function startGame() {\r\n\r\n\tvar playerName = document.getElementById(\"playername\").value;\r\n\t\r\n\tif (playerName == \"\") {\r\n\t\treturn false;\r\n\t}else{\r\n\t\r\n\t\t// Store player name in pName variable\r\n\t\tpName = playerName;\r\n\t\t// Remove display of the intro screen\r\n\t\tdocument.getElementById(\"intro\").style.display = \"none\";\r\n\t\t// Add event listeners controls\r\n\t\taddControls();\r\n\t\t//Sounds.moon.play();\r\n\t}\r\n\r\n\r\n}", "function playGame()\n{\n\tloop();\n\t// close and open buttons \n\tdocument.getElementById(\"playBtn\").disabled = true;\n\tdocument.getElementById(\"pauseBtn\").disabled = false;\n}", "function renderPlayer(){\n console.log('in renderPlayer')\n let text;\n if (!state.players[0] || !state.players[1]){\n text = `\n <input name=\"player1\" placeholder=\"Enter Player 1\">\n <input name=\"player2\" placeholder=\"Enter Player 2\">\n <button class=\"start\">Start Game</button>\n `\n } else {\n text = `${state.getCurrentPlayer()} place a token!`\n }\n playerTurn.innerHTML= text;\n }", "function showCreateBattleForm(event) {\n\tvar battleForm = document.getElementById('createBattleForm');\n\tbattleForm.innerHTML = \"<p>Battle with: <input type='text' id='oppName' /><input type='button' value='Start battle' id='startBattle' /></p>\";\n\tbattleForm.innerHTML += \"<p><input type='button' value='Find an online player' name='findOnline' id='findOnline'/></p>\";\n\tdocument.getElementById('createBattle').setAttribute('hidden', 'true');\n\tdocument.getElementById('startBattle').addEventListener('click', createBattle, false);\n\tdocument.getElementById('findOnline').addEventListener('click', findPlayer, false);\n}", "function startGame() {\n playerOne = document.getElementById(\"playerOneName\").value;\n playerTwo = document.getElementById(\"playerTwoName\").value;\n if (gameType === \"PvP\") {\n if (playerOne !== \"\" && playerTwo !== \"\") {\n setGameBoard();\n } else {\n alert(`Please enter Both Player's Name`);\n }\n } else if (gameType === \"PvCEasy\" || gameType === \"PvCMedium\") {\n if (playerOne !== \"\") {\n setGameBoard();\n } else {\n alert(`Please enter Player One Name`);\n }\n }\n} // startGame()", "function checkForm(e) {\n form.style.display = \"none\";\n restart.style.display = \"inherit\";\n //Remove the first canvas created if any field modification\n if (document.querySelector('canvas') !== null) {\n document.querySelector('canvas').remove();\n }\n //Stop submitting for test\n e.preventDefault();\n\n //Grab the value of the player radio\n let pathPlayer = document.querySelector('input[name=\"player\"]:checked+label>img').src;\n window.playerImg = pathPlayer.substr(0, pathPlayer.indexOf('_')+1);\n window.playerImg += 'tilesheet.png';\n\n //Grab values of the different radio groups, one for each info we need from the form\n window.platImg = document.querySelector('input[name=\"platform\"]:checked+label>img').src;\n\n window.bgImg = document.querySelector('input[name=\"background\"]:checked+label>img').src;\n\n window.itemImg = document.querySelector('input[name=\"item\"]:checked+label>img').src;\n\n window.enemyImg = document.querySelector('input[name=\"enemy\"]:checked+label>img').src;\n\n //Config for the game\n const config = {\n type: Phaser.AUTO,\n width: 800,\n height: 600,\n parent: 'phaser',\n physics: {\n default: 'arcade',\n arcade: {\n gravity: {\n y: 300\n },\n debug: false\n }\n },\n scene: {\n preload: preload,\n create: create,\n update: update\n }\n };\n\n //Variables for the game\n let items;\n let player;\n let platforms;\n let cursors;\n let enemies;\n let score = 0;\n let gameOver = false;\n let scoreText;\n let lastScoreText;\n\n //Create a new GameObject\n let game = new Phaser.Game(config);\n\n //First function for the game - Preload the assets we need\n function preload() {\n this.load.image('background', window.bgImg);\n this.load.spritesheet('dude', window.playerImg, {frameWidth: 80, frameHeight: 111});\n this.load.image('ground', window.platImg);\n this.load.image('item', window.itemImg);\n this.load.image('enemy', window.enemyImg);\n }\n\n //Second function for the game - Placing the assets on the canvas and adding some animation/restrictions (collision)\n function create() {\n //Background added first\n this.add.tileSprite(400, 300, 800, 600, 'background');\n\n //Adding the player sprite\n player = this.physics.add.sprite(100, 450, 'dude');\n player.setBounce(0.2);\n player.setCollideWorldBounds(true);\n\n //Creating some animations for the player\n this.anims.create({\n key: 'idle',\n frames: this.anims.generateFrameNames('dude', { frames: [0]}),\n frameRate: 0.5,\n repeat: -1\n });\n this.anims.create({\n key: 'left',\n frames: this.anims.generateFrameNames('dude', { frames : [0, 9, 10] }),\n frameRate: 10,\n repeat: -1\n });\n this.anims.create({\n key: 'right',\n frames: this.anims.generateFrameNames('dude', { frames: [0, 9, 10] }),\n frameRate: 10,\n repeat: -1\n });\n\n //Grabbing the keyboard keys that are pressed - Will be used to move the player around\n cursors = this.input.keyboard.createCursorKeys();\n\n //Adding the platforms\n platforms = this.physics.add.staticGroup();\n let xIncPlat = 64;\n platforms.create(600, 400, 'ground');\n for (let x = 0; x <= 2; x++) {\n platforms.create(50 + xIncPlat * x, 250, 'ground');\n }\n for (let x = 0; x <= 15; x++) {\n platforms.create(30 + xIncPlat * x, 620, 'ground');\n }\n platforms.create(750, 220, 'ground');\n\n //Creating collision between the player and the platforms\n this.physics.add.collider(player, platforms);\n //Inputting the amount of items the creator wants to collect\n let itemsAmount = +(document.getElementById('itemsAmount').value)-1;\n //Adding the amount of items, for the steps the items should be apart a little calculation is done to seperate them evenly\n items = this.physics.add.group({\n key: 'item',\n repeat: itemsAmount,\n setXY: { x: 50, y: 10, stepX: 1/itemsAmount * 700 }\n });\n items.children.iterate(function (child) {\n // Give each star a slightly different bounce\n child.setBounceY(Phaser.Math.FloatBetween(0.4, 0.8));\n });\n this.physics.add.collider(items, platforms);\n\n this.physics.add.overlap(player, items, collectItem, null, this);\n\n enemies = this.physics.add.group();\n if (document.getElementById('enemyCollision').checked) {\n this.physics.add.collider(enemies, platforms);\n }\n this.physics.add.collider(player, enemies, hitEnemy, null, this);\n\n scoreText = this.add.text(16, 16, 'Score: 0', { fontSize: '32px', fill: '#ff6600' });\n }\n\n // This function is a loop called by the game that checks for different events happening\n function update() {\n // Test for game over, make the score bigger with a game over message\n if (gameOver) {\n lastScoreText = scoreText.text;\n scoreText.setPosition(150, 40);\n scoreText.setFill('red');\n scoreText.setFontSize(100);\n scoreText.setText(lastScoreText + '\\nGame over');\n this.scene.pause('default');\n } // Check if the player got the amount of points selected in the form -> Win\n else if (score >= document.getElementById('winScore').value) {\n player.setTint(0x008000);\n lastScoreText = scoreText.text;\n scoreText.setPosition(150, 40);\n scoreText.setFill('green');\n scoreText.setFontSize(100);\n scoreText.setText(lastScoreText + '\\nYou won!!');\n this.scene.pause('default');\n }\n\n // Check if space or up arrow are pressed and the player is on the floor to perform a jump\n if ((cursors.space.isDown || cursors.up.isDown) && player.body.onFloor())\n {\n player.body.setVelocityY(-400); // jump up\n }\n // Checking if the left arrow key is pressed\n if (cursors.left.isDown) {\n player.body.setVelocityX(-200); // move left\n player.flipX= true; // flip the sprite to the left\n if (player.body.onFloor()) {\n player.anims.play('left', true); // play walk animation\n }\n } // Check if the right arrow key is pressed\n else if (cursors.right.isDown) {\n player.body.setVelocityX(200); // move right\n player.flipX = false; // use the original sprite looking to the right\n if (player.body.onFloor()) {\n player.anims.play('right', true); // play walk animation\n }\n } else {\n // Checks if the player is not moving anymore to stop the movement\n player.body.setVelocityX(0);\n player.anims.play('idle', true);\n }\n }\n\n // Event to check every time the window is resized -> Responsivness\n window.addEventListener(\"resize\", resize, false);\n\n // Function called on window resize event\n function resize() {\n // Div containing the generated canvas of the game\n let div = document.getElementById(\"phaser\");\n // The generated game canvas\n let canvas = document.querySelector(\"canvas\");\n // Grabbing the values of the window height and width\n let windowWidth = window.innerWidth-20;\n let windowHeight = window.innerHeight-150;\n // Calculating the window ratio to adapt the frame\n let windowRatio = windowWidth / windowHeight;\n // Calculating the game ratio to adapt it to the window\n let gameRatio = game.config.width / game.config.height;\n // Adapting the sizes with the ratios\n if(windowRatio < gameRatio){\n canvas.style.width = windowWidth + \"px\";\n canvas.style.height = (windowWidth / gameRatio) + \"px\";\n div.style.width = windowWidth + \"px\";\n div.style.height = (windowWidth / gameRatio) + \"px\";\n }\n else{\n canvas.style.width = (windowHeight * gameRatio) + \"px\";\n canvas.style.height = windowHeight + \"px\";\n div.style.width = (windowHeight * gameRatio) + \"px\";\n div.style.height = windowHeight + \"px\";\n }\n }\n\n // Function called when a player touches an item in the game\n function collectItem (player, item)\n {\n // First the item gets removed from the game\n item.disableBody(true, true);\n // Increase the score\n score++;\n // Add it to the score text displayed in the game\n scoreText.setText('Score: ' + score);\n\n // Grabbed this line from the Phaser library example to place the items in different heights\n let x = (player.x < 400) ? Phaser.Math.Between(400, 800) : Phaser.Math.Between(0, 400);\n\n // Checking if all item have been collected\n if (items.countActive(true) === 0) {\n items.children.iterate(function (child) {\n\n child.enableBody(true, child.x, 0, true, true);\n\n });\n // Adding the enemy to a random x value at the top of the screen\n let enemy = enemies.create(x, 16, 'enemy');\n enemy.setBounce(1);\n enemy.setCollideWorldBounds(true);\n // The velocity of the enemy is 'randomized'\n enemy.setVelocity(Phaser.Math.Between(-200, 200), 20);\n // Enemy has no gravity so it can bounce around the world\n enemy.allowGravity = false;\n }\n }\n\n // Function called when the player touches the enemy\n function hitEnemy (player, enemy)\n {\n // Pause the game so the player can't move anymore\n this.physics.pause();\n // Set the player tint as red\n player.setTint(0xff0000);\n\n gameOver = true;\n }\n}", "function selectButton(e){\n \t//A Player vamos agregando en el array las Posicion(o seas el Turno de los Players)\n \tvar currentPlayer = listPlayers[turno];\n \tif(hasPositionByButton(e)){\n\t \tcurrentPlayer.addNewPosition(e);\n\t \t//Que imprima en el input el turno que le toca\n\t \tsetTurnOnView();\n\t \t//Para Dibujar en el Button\n\t \tdrawButton(e);\n\t \t//Para Validar si hay un ganador\n\t \tValidateWinner(currentPlayer); \t\n\t //Cambiamos el Turno, al que le toca\n\t changeTurn();\n\t }\n }", "function initGame() {\n // Assign variables\n gridSize = formGridSize.value;\n isXFirst = formFirstMove.value;\n oName = formOpponentSelection.value;\n inputX = \"❌\";\n inputO = \"⭕\";\n currentMark = inputX;\n oName === \"Player 2\" ? (isComputerActive = false) : (isComputerActive = true);\n\n // Change text based on inputs\n titleDesc.textContent = ` ${gridSize}x${gridSize} board`;\n p2Title.textContent = oName;\n p1Desc.textContent = `${inputX}'s`;\n if (isComputerActive) {\n p2Avatar.style.backgroundImage =\n \"url('https://images.vexels.com/media/users/3/157318/isolated/preview/2782b0b66efa5815b12c9c637322aff3-desktop-computer-icon-computer-by-vexels.png')\";\n }\n p2Desc.textContent = `${inputO}'s`;\n currentPlayerMessage = `${xName} (${inputX})`;\n\n // Hide/Unhide\n modal.classList.add(\"hide\");\n modalContainer.classList.add(\"hide\");\n content.classList.remove(\"hide\");\n\n // Creation\n createGrid(gridSize);\n addMainFunction();\n createBoardInstance(); // push empty board to gridHistory\n if (isXFirst == 0) {\n // switch to let O go first\n playerOMovesFirst();\n }\n}", "function onClickGameName() {\n stopGame();\n\n socket.send({action: \"exit_game\"});\n $(\"#game\").hide(); \n $(\"#game_choose\").show(); \n\n initHome();\n }", "function startButton() {\r\n\tif (letters.length == 0){\r\n\t\trunGame();\r\n\t\t\r\n\t}\r\n\telse{\r\n\t\tstopGame();\r\n\t}\r\n}", "function p2SelectPhase() {\n if (playerNumber == 1) {\n // What Player 1 sees\n\n // Their own selection in Player 1 area\n\n // Waiting message in Player 2 area\n $(\"#player2Selection\").empty().text(\"Opponent is choosing\")\n } else if (playerNumber == 2) {\n // What Player 2 sees\n \n // Waiting message in Player 1 area\n $(\"#player1Selection\").empty().text(\"Opponent has chosen\")\n\n // Make buttons in Player 2 area\n makeRPSbuttons( $(\"#player2Selection\") )\n }\n\n}", "function startPlayer() {\r\n\t\r\n\t\r\n\tif(currentState == 0 ) {\r\n\t\talert(\"Please load a trip first.\");\r\n\t\treturn;\t\r\n\t} else if (currentState == 3 ) {\t\t\r\n\t\talert(\"The player is already playing! Please reset first.\");\r\n\t\treturn;\t\r\n\t} else {\r\n\t\tcurrentState = 3;\r\n\t\tupdateDisplay();\r\n\t}//fi\r\n\r\n\t\r\n}//fi", "function playGame(cellID){\n\tplayButtonEffect();\n\tvar radioGroup = document.getElementsByName('radioNum');\n\n\t//validate an input before continue\n\tvar isRadioValid = validatRadio(radioGroup);\n\tif(isRadioValid){\n\tif(count<9){\n\t\tsetValueToCell(cellID);\n\t}\n\telse{\n\t\talert('Tie!!!');\n\t\tresetAll();\n\t\t\t}//end else\n\t\t}\n\t\telse{\n\t\t\tResult.render('alert', '<p><span style=\"font-weight:bold color:red\">Please select a value!</span></p>');\n\t\t\treturn false;\n\t\t}\n\n}", "function OnCorrectChoice() {\n //Gets player name input: executes once\n if (!nameInputted) {\n if ($(\"name\").value !== \"\") {\n name = $(\"name\").value;\n //If inputted value is null, the character's name remains the default\n }\n nameInputted = true;\n }\n \n //Progresses game, executes for all stages of the game\n progressGame(tracker);\n}", "function btnClick(e) {\n\n // Variables for storing mouse position on click\n var mx = e.pageX,\n my = e.pageY;\n // If the game is over, reset\n if (over == 1) {\n submit = 0;\n over = 0;\n // only post it once -- ignores additional clicks\n // post score and submit form\n // NOTE: if you changed the form fields in the view, change the fields set here to match\n document.forms[\"gameOver\"].Score.value = points;\n document.forms[\"gameOver\"].timeStamp.value = Date();\n document.gameOver.submit();\n } else // Click start button if submit not underway already\n if (submit == 1)\n {\n animloop();\n // Delete the start button after clicking it\n startBtn = {};\n }\n\n}", "function playerNames() {\n gameType = \"\";\n hideClassById(\"playerOneName\");\n hideClassById(\"playerTwoName\");\n hideClassById(\"startButton\");\n if (document.getElementsByName(\"gameType\")[0].checked) {\n gameType = \"PvP\";\n showClassById(\"playerOneName\");\n showClassById(\"playerTwoName\");\n } else if (document.getElementsByName(\"gameType\")[1].checked) {\n gameType = \"PvCEasy\";\n showClassById(\"playerOneName\");\n } else if (document.getElementsByName(\"gameType\")[2].checked) {\n gameType = \"PvCMedium\";\n showClassById(\"playerOneName\");\n }\n showClassById(\"startButton\");\n} //playerNames()", "function easyGame() {\n\tdocument.getElementById('input1').value = 10 ;\n\tdocument.getElementById('input2').value = 10 ;\n\tdocument.getElementById('input3').value = 8 ;\n\n}", "static choosingOpponent(){\n //console.info(\"step5\")\n KB.listen([\n {key: Const.KEYBOARD_INT, callback: Lands.choiceQttOst}, // 0-9\n {key: Const.KEYBOARD_RETURN, callback: IA.do}, // ↩\n ]);\n\n Party.refreshWithTemplates([tpl_5_base, tpl_5]);\n }", "function newGame() { // funkcja zawierająca w sobie to, co się stanie po kliknięciu w przycisk 'new game'\n rounds.number = prompt('How many rounds would you like to play?', 'Type number of rounds here'); // pojawia się okienko z pytaniem o liczbę rund\n if (isNaN(rounds.number)) {\n alert('Wrong value! Please type a number') // jesli odpowiedź nie jest liczbą pojawia się alert\n rounds.number = prompt('How many rounds would you like to play?', 'Type number of rounds here');\n }\n player.name = prompt('What is your name?', 'Player'); // kolejne okienko - tym razem z pytaniem o imię\n if (player.name) { // po podaniu imienia gra zmienia status na 'started'\n player.score = computer.score = 0;\n gameState = 'started';\n setGameElements();\n\n playerNameElem.innerHTML = player.name; // wyświetla się imię gracza wpisane w okienko\n setGamePoints(); // funkcja, która aktualizuje wynik gry\n }\n\n}", "function playButton() {\n if (!sound || !sound.playing) {\n form.fillOnly('rgba(0,0,0,.2)').circle( Circle.fromCenter( space.center, 30 ) );\n form.fillOnly('#fff').polygon( Triangle.fromCenter( space.center, 15 ).rotate2D( Const.half_pi, space.center ) );\n \n }\n }", "function getTournie() {\n\tdocument.getElementById(\"askTournament\").style.display = \"inline\";\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> please accept/decline quest by clicking below\"\n\tif (isAI) {\n\t\tvar data = JSON.stringify({\n\t\t\t'AICommand' : \"AskTournament\",\n\t\t\t'name': PlayerName\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t\tdocument.getElementById(\"askTournament\").style.display = \"none\";\n\t\tserverMsg.value += \"\\n> wait for other players...\";\n\t}\n\n}", "function startNewGame(evt) {\n 'use strict';\n document.getElementById(\"gameDiv\").innerHTML = \"\";\n var menuDiv = document.getElementById(\"menuControls\");\n \n /* Variables for current player & last play to reset */\n var lastPlayDisplay = document.getElementById(\"lastPlayMade\");\n var currentPlayerDisp = document.getElementById('currentPlayer');\n lastPlayDisplay.innerHTML = \"\";\n currentPlayerDisp.innerHTML = \"\";\n \n menuDiv.innerHTML = \"<button id=\\\"startGameBtn\\\" type=\\\"button\\\">Start Game</button>\";\n document.getElementById(\"gameStatus\").style.display = \"none\";\n \n var newGameEntry = document.getElementById(\"userEntry\");\n newGameEntry.innerHTML = \"Player One Designation: <input id=\\\"plyrOneName\\\" type=\\\"text\\\" name=\\\"playerOneName\\\" value=\\\"Player One\\\"/><br/>\";\n newGameEntry.innerHTML += \"Player Two Designation: <input id=\\\"plyrTwoName\\\" type=\\\"text\\\" name=\\\"playerTwoName\\\" value=\\\"Player Two\\\"/><br/>\";\n \n var plyrOneName = document.getElementById(\"plyrOneName\");\n var plyrTwoName = document.getElementById(\"plyrTwoName\");\n addHandler(plyrOneName, 'input', playerNameChange);\n addHandler(plyrTwoName, 'input', playerNameChange);\n \n var startGameBtn = document.getElementById(\"startGameBtn\");\n addHandler(startGameBtn, 'click', generateGameGrid);\n}", "function enableStartGameBtn() {\n const startGameBtn = document.querySelector(\".start-game\");\n const usernameField = document.querySelector(\".username-field\");\n if (usernameField.value) {\n startGameBtn.classList.remove(\"disabled\");\n } else {\n startGameBtn.classList.add(\"disabled\");\n }\n}", "function startTest1() {\n startGame();\n\n let name = document.getElementById(\"playerName\");\n let playerNum = document.getElementById(\"amtPlayers\");\n console.log(\"Amt players: \" + playerNum.value);\n console.log(\"Player name: \" + name.value);\n if (name.classList.value == \"form-control is-invalid\") {\n return true;\n } else {\n return false;\n }\n}", "function submitPlayer(e) {\n\t\te.preventDefault();\n\t\tvar form = $(this);\n\t\tvar playerName = form.find('#name').val();\n\t\tif (playerName.length === 0) {\n\t\t\terror.html('Vinsamlegast sláðu inn eitthvað nafn');\n\t\t\treturn false;\n\t\t}\n\t\t// Broadcast new player name\n\t\tsocket.emit('New player', playerName);\n\t\tsocket.on('Player name checked', function(valid, gameStarted) {\n\t\t\tif (valid && !gameStarted) {\n\t\t\t\tusername = playerName;\n\t\t\t\terror.html('');\n\t\t\t\t// Remove form\n\t\t\t\tform.hide();\n\t\t\t\t// Display identity area\n\t\t\t\tidentityArea.slideDown();\n\t\t\t\tyourUsername.html('Þitt nafn: ' + playerName);\n\t\t\t\tvar userImage = $('<img class=\"user-image\" alt=\"Mynd af þér\"></img>');\n\t\t\t\tuserImage.attr('src', 'http://i.pravatar.cc/45?u=' + playerName);\n\t\t\t\tidentityArea.append(userImage);\n\t\t\t\t// Display starting area\n\t\t\t\tstartArea.slideDown();\n\t\t\t\t// Enable game start\n\t\t\t\tstartGameForm.submit(startGame);\n\t\t\t}\n\t\t\telse if (gameStarted) error.html('Því miður er leikurinn hafinn. Farðu bara út að leika þér.');\n\t\t\telse error.html('Þetta nafn er því miður frátekið');\n\t\t});\n\t\treturn false;\n\t}", "function startGame() {\n gameState.active = true;\n resetBoard();\n gameState.resetBoard();\n\n var activePlayer = rollForTurn();\n \n // Game has started: enable/disable control buttons accordingly.\n btnDisable(document.getElementById('btnStart'));\n btnEnable(document.getElementById('btnStop'));\n\n var showPlayer = document.getElementById('showPlayer');\n showPlayer.innerHTML = activePlayer;\n showPlayer.style.color = (activePlayer === \"Player 1\") ? \"blue\" : \"red\";\n // The above line, doing anything more would require a pretty sizeable refactor.\n // I guess I could name \"Player 1\" with a constant.\n}", "function readContactForm(){\n\n // Read values from the form input fields\n let player1 = new Player($('#player1_name').val(), $('input[name=player1_type]:checked').val(),'red',1, false);\n let player2 = new Player($('#player2_name').val(), $('input[name=player2_type]:checked').val(),'yellow',0, false);\n window.players = [player1,player2];\n \n // Check if the return of the checkPlayers is true and if so stay on the same page\n let r = checkPlayers(player1.name, player2.name, player1.type, player2.type);\n if(r.stayOnPage){ \n return;\n }\n else {\n location.hash ='#spelar';\n gameInit();\n }\n}", "function login() {\n Player.name = $(\"#login_name\").val();\n $(\"#console\").hide();\n start_game();\n}", "function gsPLAY(){\r\n gameState = PLAY\r\n ServeScreen.visible= false\r\n StartButton.hide();\r\n InfoButton.hide();\r\n InfoIcon.visible = false;\r\n touches = []\r\n Joey.x = StartGround.x\r\n Joey.changeAnimation(\"Jumping\",Jumping_Joey);\r\n SaveName.hide();\r\n displayName.hide();\r\n NameBar.hide();\r\n title.hide();\r\n \r\n }", "function startGame() {\r\n // get the html element corresponding to the button\r\n var startButton = document.getElementById('start');\r\n // hide the button\r\n startButton.style.display = \"none\";\r\n // get the html element corresponding to the number sentence\r\n var question = document.getElementById('numberSentence');\r\n // show the number sentence\r\n question.style.display = \"block\";\r\n displayFactors();\r\n}", "function final(event) {\n if (event.target.classList.contains('rematch')) {\n deck = new Deck\n player.unshift(player[1])\n player.unshift(player[0])\n gameStart = Math.round(Date.now()/1000)\n game()\n }\n if (event.target.classList.contains('new')) {\n gameStart = Math.round(Date.now()/1000)\n deck = new Deck\n document.querySelector('.game-start').innerHTML =\n `<section class=\"text-center game-start-info\">\n <input type=\"text\" name=\"player1\" value=\"\" maxlength=\"32\" placeholder=\"PLAYER 1\"> <input type=\"text\" name=\"player2\" value=\"\" maxlength=\"32\" placeholder=\"PLAYER 2\">\n <div class=\"inputs\">\n <span class=\"names\">PLAYER 1</span><span class=\"names\">PLAYER 2</span>\n </div>\n <span class=\"error-1 hide\">Both Players Must Enter A Name</span>\n <button type=\"button\" name=\"button\" class=\"play-game\" disabled=\"true\">PLAY GAME</button>\n </section>`\n }\n }", "function displayGameover() {\n\t$btnStart.innerHTML = \"RESTART\";\n\tif (modeGOT) {\n\t\t$txt.style.color = \"skyblue\";\n\t\t$txt.innerHTML = \"V. Morghulis\".toUpperCase();\n\t\t$gotOstMain.pause();\n\t\t$gotOstGameover.play();\n\t} else {\n\t\t$txt.style.color = \"red\";\n\t\t$txt.innerHTML = \"Oh non...\".toUpperCase();\n\t\t$ostMain.pause();\n\t\t$ostGameover.play();\n\t}\n}", "function submitHandler() {\n\tconst index = selectedPianoKey();\n\tif (index < 0) return;\n\tanswer['shown'] = true;\n\tpianoKeys[answer['index']].classList.add('correct');\n\tconst distance = answerDistance(index);\n\tif (distance == 0) {\n\t\tresultText.textContent = 'Correct!';\n\t\tconst scale = Math.round(100 * (1 - ramp));\n\t\tdetailsText.textContent = `Next one will be ${scale}% harder`;\n\t\tsetError(false);\n\t\tcontinueButton.classList.remove('hidden');\n\t\tcontinueButton.focus();\n\t} else {\n\t\tresultText.textContent = 'Game Over';\n\t\tcheckHighScore();\n\t\tpianoKeys[index].classList.add('incorrect');\n\t\ttryAgainButton.classList.remove('hidden');\n\t}\n\tsubmitButton.disabled = true;\n\tsubmitButton.classList.add('hidden');\n}", "function button_one_click() {\n var choice = document.getElementById(\"button_one\").innerHTML;\n game_end(correct, choice);\n}", "function set_pa1() {\n\t\t\t\tif (pArr[0].value === false && incrementor < 3) {\n\t\t\tlet x = document.getElementById(\"pa1\");\n\t\t\tx.className = \"set\";\t\t\t\n\t\t\tpArr[0].value = true;\n incrementor ++;\n if (incrementor === 3) {\n\t\tplayGame();}\n\t\t\t}}", "function newGame() {\n if(confirm(\"Voulez-vous vraiment recommençer la partie ?\")){\n // Remise à 0 des valeurs\n globalPlayer1.textContent = 0;\n globalPlayer2.textContent = 0;\n currentPlayer1.textContent = 0;\n currentPlayer2.textContent = 0;\n // Réinitialisation de l'affichage du dé\n resetImage() \n // Position du sélecteur\n selecteurP1.classList.replace(\"hide\",\"show\");\n selecteurP2.classList.replace(\"show\",\"hide\");\n // Réinitialiser affichage gagnant\n winnerPlayer1.classList.replace(\"show\",\"hide\");\n winnerPlayer2.classList.replace(\"show\",\"hide\");\n // Réinitialisation du style des scores\n globalPlayer1.setAttribute(\"style\",\"font-weight:300\");\n globalPlayer2.setAttribute(\"style\",\"font-weight:300\");\n namePlayer1.setAttribute(\"style\",\"font-weight:500; color: rgb(150, 150, 150);\");\n namePlayer2.setAttribute(\"style\",\"font-weight:500; color: rgb(150, 150, 150);\");\n //Réinitialisation du Bouton New Game\n btnNewGame.setAttribute(\"style\", \"font-weight:400; color: rgb(150, 150, 150)\");\n //Réinitialisation de l'élément d'indication du joueur en cours\n playerTurn.setAttribute(\"style\", \"background: linear-gradient(to left, white 50%, rgb(210, 210, 210) 50%)\");\n // Activation des boutons si une fin de partie à eu lieu\n btnRollDice.disabled = false;\n btnHold.disabled = false;\n }\n}", "function playGame(){\n createTimer();\n juego.resetScore();\n juego.resetCorrectLabel();\n juego.setStatePlaying(true);\n disablePlayButton();\n juego.updateExpression();\n enableSendResultButton();\n resetClasses();\n}", "function manageEndGamePower4() {\n endGame = true;\n success.style.display = \"block\";\n success.innerHTML = \"<p id='msgSuccess'>Partie terminé le gagnant est : J\" + playerTurn + \"</p>\";\n success.innerHTML += \"<button type='button' class='btnPower4' onclick='initTabPower4()'>Restart</button> \";\n if(playerTurn===1) {\n scoreJ1++;\n } else {\n scoreJ2++;\n }\n}", "function sendName() {\n\tvar clientMsg = document.getElementById('enterName');\n\tif (clientMsg.value) {\n\t\tPlayerName = clientMsg.value;\n\t\tvar data = JSON.stringify({\n\t\t\t'newName' : $(\"#enterName\").val()\n\t\t})\n\t\tsocketConn.send(data);\n\t\tdocument.getElementById('title').innerHTML = \"Welcome to the Quest of The Round Table - \"\n\t\t\t\t+ clientMsg.value + \"'s View\";\n\t\tchangeColor();\n\t\tdocument.getElementById('nameparagraph').style.display = \"none\";\n\t\tdocument.getElementById('send').style.display = \"none\";\n\t\tdocument.getElementById('rigger').style.display = \"none\";\n\t\tdocument.getElementById('riggerAI').style.display = \"none\";\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value = \"> waiting for other players \\n> to create AI player(s), open a new browser window and click AI Player button\";\n\t}\n}", "function getName() {\n\n\t\t$(\".submitBtn\").off();\n\t\t$(\"#initialsModal\").modal('show');\n\t\tsounds.woosh();\n\n\t\tsetTimeout(function() { \n\n\t\t\t$(\"#initial-input\").focus() ;\n\n\t\t}, 500);\n\n\t\t$(\"#initial-input\").keydown(function(event) {\n\n\t\t\tif (event.keyCode === 13) {\n\n\t\t\t\t$(\".saver\").click();\n\n\t\t\t}\n\n\t\t});\n\n\t\t$(\"#initial-input\").keydown(function(event) {\n\n\t\t\tif(event.keyCode == 16) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tsounds.click();\n\n\t\t});\n\n\t\t$(\".saver\").click(sounds.scoreGong).click(logScore);\n\t\t$(\".submitBtn\").text(\"FINAL SCORE : \" + finalScore + \"% CLICK TO RETRY\").click(sounds.click).click(newGame);\n\n\t}", "function next_button() {\n clear_answer();\n clear_question_result();\n round++;\n document.getElementById(\"submitter\").style.visibility=\"visible\";\n if (is_game_over() === true) {\n final_total();\n } else {\n next_question();\n }\n}", "function playGame() {\n let myMove = this.children[0].innerHTML.toLowerCase();\n \n let url = \"https://webster.cs.washington.edu/pokedex/game.php\";\n let data = new FormData();\n data.append(\"guid\",gameID);\n data.append(\"pid\",playerID);\n data.append(\"move\", myMove);\n \n $(\"loading\").classList.remove(\"hidden\");\n \n fetch(url, {method:\"POST\", body:data})\n .then(checkStatus)\n .then(JSON.parse)\n .then(playMove);\n \n $(\"loading\").classList.add(\"hidden\");\n }", "function handleStart() {\n // create new game instance\n const game = new Game();\n\n // hide the form\n document.querySelector(\".form-container\").style.display = \"none\";\n\n // start the game\n game.start();\n\n // show the board\n document.querySelector(\".board-container\").style.display = \"flex\";\n}", "function handleNewGame(i) {\r\n const channelName = document.getElementById('channel-name').value\r\n // console.log(channelName)\r\n localStorage.clear();\r\n if (i === 1) {\r\n localStorage.setItem(\"igrac2\", \"Rem0tePlayer_\");\r\n localStorage.setItem(\"real_player\", 1)\r\n localStorage.setItem(\"flagIgrac\", 1);\r\n localStorage.setItem(\"channel_name\", channelName)\r\n document.getElementById('create-btn').style.display = 'none'\r\n document.getElementById('player-two-name-input').style.display = 'none'\r\n document.getElementById('myform').style.display = 'block'\r\n\r\n }else if (i === 2){\r\n localStorage.setItem(\"igrac1\", \"Rem0tePlayer_\");\r\n localStorage.setItem(\"real_player\", 2)\r\n localStorage.setItem(\"flagIgrac\", 2);\r\n localStorage.setItem(\"channel_name\", channelName)\r\n document.getElementById('create-btn').style.display = 'none'\r\n document.getElementById('player-one-name-input').style.display = 'none'\r\n document.getElementById('myform').style.display = 'block'\r\n }\r\n}", "function handleNewPlay (e) {\n $('body').on('click', '.js-new-play', (function(e) {\n let foo = $(e.currentTarget).closest('.js-bgame').attr('id');\n $('#updatePlayForm').find('input[type=hidden]').val(`${foo}`);\n }));\n}", "function pauseGame(){\n var pauseButton = document.getElementById(\"pauseButton\");\n //Toggle button text and add/remove processTurn from core game timer as necessary\n switch(pauseButton.value){\n case \"Pause\":\n pauseButton.value = \"Resume\"\n game.time.events.removeAll();\n break;\n case \"Resume\":\n pauseButton.value = \"Pause\"\n processTurnTimerEvent = game.time.events.loop(TIME_TO_NEXT_UPDATE, processTurn, this);\n break;\n default:\n break;\n } \n}", "function confirmPlayers(){\n\t//Get number of players\n\te = document.getElementById(\"playerNumber\");\n\tplayerNumber = e.options[e.selectedIndex].value;\n\t\n\t//Remove form\n\tdocument.getElementById(\"playerNumberSelect\").style.visibility=\"hidden\";\n\t//Add Name form\n\tnameForm = document.createElement('div');\n\tnameForm.id = \"nameForm\";\n\t\n\tfor (var x = 0; x < playerNumber; x++){\n\t\tvar y = x + 1;\n\t\tnameForm.innerHTML = nameForm.innerHTML + \"<input type='text' id='name\" + x +\"' value='Player \"+ y +\"'><br>\";\n\t}\n\tnameForm.innerHTML = nameForm.innerHTML + \"<input type='submit' id='nameSubmit' onclick='initialize()'><br>\";\n\t\n\tdocument.getElementsByTagName('body')[0].appendChild(nameForm);\n}", "function onPlayPauseButtonPressed() {\n if (window.playGame === true) {\n window.playGame = false;\n $('#playPauseButton').text('Play');\n } else {\n window.playGame = true;\n $('#playPauseButton').text('Pause');\n }\n}", "function actionAfterClickPlay() {\n // @todo checkin rate (alert if none or too high)\n createButtonAfterPlay();\n createResultsArea();\n createRateArea();\n createCardArea();\n gameAfterPlay();\n removeElementsAfterPlay();\n\n}", "function gamePlay(p1, p2) {\n const messageBox = document.querySelector('.messageBox');\n const roundsToPlay = document.querySelector('#currentRound');\n roundsToPlay.innerHTML = roundCounter;\n const selectorOptions = document.querySelectorAll('.selectorOption');\n // If the game hasn't played enough rounds, reactivate the buttons and restart the sequence\n if (roundCounter < rounds) {\n // trigger selector\n /* eslint-disable no-restricted-syntax, no-undef */\n for (selector of selectorOptions) {\n if (selector.hasAttribute('disabled')) {\n selector.removeAttribute('disabled');\n }\n }\n /* eslint-enable no-restricted-syntax, no-undef */\n // Show the button selector\n TweenLite.to('.selector', 1, {\n bottom: '10px',\n delay: 1\n });\n roundCounter += 1;\n // If both players have the same number of wins after the rounds, do a tiebreaker until someone wins\n } else if (p1.wins === p2.wins) {\n // tiebreaker round\n /* eslint-disable no-restricted-syntax, no-undef */\n for (selector of selectorOptions) {\n if (selector.hasAttribute('disabled')) {\n selector.removeAttribute('disabled');\n }\n }\n /* eslint-enable no-restricted-syntax, no-undef */\n messageBox.innerHTML = `\n <h1 class=\"lgLabel\">It's a tie!<br>\n Prepare for a<br>tiebreaker round!</h1>\n `;\n // trigger selector again\n TweenLite.to('.selector', 1, {\n bottom: '10px',\n delay: 1\n });\n // Once someone has more wins at the end, announce the winner and display a button to restart the game\n } else if (p1.wins > p2.wins) {\n messageBox.innerHTML = `\n <div class=\"woodBackground playAgainContainer\"><span class=\"fullWidth\"><h1 class=\"lgLabel\">${p1.name} wins the game!</h1></span>\n <a href=\"#\" id=\"playAgainButton\" class=\"enterNameButton\" onClick=\"getRoundsToPlay()\">Play Again!</a></div>\n `;\n } else {\n messageBox.innerHTML = `\n <div class=\"woodBackground playAgainContainer\"><span class=\"fullWidth\"><h1 class=\"lgLabel\">${p2.name} wins the game!</h1></span>\n <a href=\"#\" id=\"playAgainButton\" class=\"enterNameButton\" onClick=\"getRoundsToPlay()\">Play Again!</a></div>\n `;\n }\n}", "function startGame(){\n\t$( \"#button_game0\" ).click(function() {selectGame(0)});\n\t$( \"#button_game1\" ).click(function() {selectGame(1)});\n\t$( \"#button_game2\" ).click(function() {selectGame(2)});\n\tloadRound();\n}", "function playAgain(){\n playerOne.value = '';\n playerOneScore.innerText = '';\n playerOneCurrentScore = 0;\n playerTwo.value = '';\n playerTwoScore.innerText = '';\n playerTwoCurrentScore = 0;\n timeRemaining = 60;\n game.removeChild(endGameMessage);\n game.removeChild(playAgainButton);\n game.appendChild(introTitle);\n game.appendChild(form);\n}", "function hardGame() {\n\tdocument.getElementById('input1').value = 20 ;\n\tdocument.getElementById('input2').value = 30 ;\n\tdocument.getElementById('input3').value = 100 ;\n\n}", "function playGameBtn() {\n menu.style.display = \"none\";\n mainButton.style.display = \"\";\n document.getElementById(\"board\").style.display = \"grid\";\n document.getElementById(\"restart\").style.display = \"block\"\n mainButton.addEventListener(\"click\", playAudioBtn);\n mainButton.addEventListener(\"click\", menuBtn);\n}", "function activePlayer(btn) {\n if (status === \"over\") {\n $(\"button.\" + btn).removeClass(\"active\");\n $(\"button.\" + btn).addClass(\"disabled\");\n $(\"p\").css(\"display\", \"none\");\n return;\n }\n if (count < 9) {\n if (btn === \"X\") {\n $(\"button.X\").removeClass(\"disabled\");\n $(\"button.X\").addClass(\"active\");\n $(\"button.O\").removeClass(\"active\");\n $(\"button.O\").addClass(\"disabled\");\n } else {\n $(\"button.O\").removeClass(\"disabled\");\n $(\"button.O\").addClass(\"active\");\n $(\"button.X\").removeClass(\"active\");\n $(\"button.X\").addClass(\"disabled\");\n }\n $(\"p\").text(\"Next move by : \" + btn);\n }\n}" ]
[ "0.6582282", "0.6444199", "0.64441746", "0.6383212", "0.6270252", "0.6174314", "0.6131005", "0.612444", "0.6100325", "0.607094", "0.6068918", "0.60669", "0.6047232", "0.6041285", "0.6019319", "0.60120225", "0.6003888", "0.59661067", "0.5956309", "0.59561616", "0.591975", "0.5911745", "0.5910782", "0.59057796", "0.5899853", "0.58879936", "0.5883283", "0.5878504", "0.58690333", "0.5864965", "0.5858156", "0.58343774", "0.5829513", "0.58205837", "0.5814688", "0.5814453", "0.57946354", "0.5792138", "0.5783443", "0.5775979", "0.5773871", "0.57715625", "0.57714915", "0.57669735", "0.5766682", "0.5765514", "0.5754814", "0.5754689", "0.5752416", "0.57484215", "0.57434446", "0.57415664", "0.57117313", "0.56976414", "0.56972176", "0.5692839", "0.5687784", "0.56860924", "0.5679289", "0.5667665", "0.5661348", "0.566103", "0.5656166", "0.5655183", "0.56496215", "0.5644057", "0.56412715", "0.56310314", "0.5630861", "0.5627473", "0.5621108", "0.5618552", "0.5615144", "0.5612723", "0.561259", "0.56125486", "0.5606905", "0.5606082", "0.5602096", "0.55957717", "0.55957633", "0.55939025", "0.5590942", "0.5590622", "0.55883884", "0.5587918", "0.5586173", "0.5584341", "0.5584276", "0.5583953", "0.5580099", "0.557832", "0.5571642", "0.55665696", "0.55662376", "0.556458", "0.55641824", "0.55637765", "0.55577725", "0.55540836", "0.5553657" ]
0.0
-1
================================================================================== Completion box ==================================================================================
function check_text(focused) { if(!focused) { document.getElementById("cmpltions").style.height=0; document.getElementById("cmpltions").style.opacity=0; document.getElementById("hider1").style.height="25px"; return } var tmp=completions.filter(function(element, index, array) { return (element.toString().toLowerCase().search(document.getElementById("texttest").value.toLowerCase())>-1) }); console.log(tmp); var tmphtml="" var c_count=0; /*limit max amount of completions*/ for(i in tmp) { tmphtml+='<div class="completion" onclick="complete(\''+tmp[i]+'\');">'+tmp[i]+'</div>'; if(++c_count>=15) break; } document.getElementById("cmpltions").innerHTML=tmphtml; document.getElementById("cmpltions").style.height=20*c_count; document.getElementById("hider1").style.height=20*c_count+27+"px"; if(tmp.length==0) { document.getElementById("cmpltions").style.opacity=0; } else { document.getElementById("cmpltions").style.opacity=1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_text(focused)\n{\n\tif(!focused)\n\t{\n// \t\tdocument.getElementById(\"cmpltions\").style.height=0;\n// \t\tdocument.getElementById(\"cmpltions\").style.opacity=0;\n// \t\tdocument.getElementById(\"hider1\").style.height=\"25px\";\n\t\treturn\n\t}\n\tvar tmp=completions.filter(function(element, index, array)\n\t{\n\t\treturn (element.toString().toLowerCase().search(document.getElementById(\"texttest\").value.toLowerCase())>-1)\n\t});\n\tconsole.log(tmp);\n\t\n\tvar tmphtml=\"\"\n\n\tvar c_count=0; /*limit max amount of completions*/\n\t\n\tfor(i in tmp)\n\t{\n\t\ttmphtml+='<div class=\"completion\" onclick=\"complete(\\''+tmp[i]+'\\');\">'+tmp[i]+'</div>';\n\t\tif(++c_count>=15) break;\n\t}\n\t\n\tdocument.getElementById(\"cmpltions\").innerHTML=tmphtml;\n\t\n\tdocument.getElementById(\"cmpltions\").style.height=20*c_count;\n\t\n\tdocument.getElementById(\"hider1\").style.height=20*c_count+27+\"px\";\n\t\n\tif(tmp.length==0)\n\t{\n\t\tdocument.getElementById(\"cmpltions\").style.opacity=0;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(\"cmpltions\").style.opacity=1;\n\t}\n}", "getOptionCompletion( cat ) {\n return `${ cat.id }`;\n }", "get completion_status() { return this._completion_status; }", "get completion_status() { return this._completion_status; }", "function Completer(options, components) {\n this.requisition = components.requisition;\n this.scratchpad = options.scratchpad;\n this.input = { typed: '', cursor: { start: 0, end: 0 } };\n this.choice = 0;\n\n this.element = components.element;\n this.element.classList.add('gcli-in-complete');\n this.element.setAttribute('tabindex', '-1');\n this.element.setAttribute('aria-live', 'polite');\n\n this.document = this.element.ownerDocument;\n\n this.inputter = components.inputter;\n\n this.inputter.onInputChange.add(this.update, this);\n this.inputter.onAssignmentChange.add(this.update, this);\n this.inputter.onChoiceChange.add(this.update, this);\n\n if (components.autoResize) {\n this.inputter.onResize.add(this.resized, this);\n\n var dimensions = this.inputter.getDimensions();\n if (dimensions) {\n this.resized(dimensions);\n }\n }\n\n this.template = util.toDom(this.document, completerHtml);\n // We want the spans to line up without the spaces in the template\n util.removeWhitespace(this.template, true);\n\n this.update();\n}", "function toggleCompletion () {\n\t\n\t\tvar oldLabel = this.parentNode;\n\t\tvar item = oldLabel.innerHTML;\n\t\toldLabel.nextElementSibling.parentNode.removeChild(oldLabel.nextElementSibling);\n\t\toldLabel.nextElementSibling.parentNode.removeChild(oldLabel.nextElementSibling);\n\t\toldLabel.parentNode.removeChild(oldLabel);\n\t\tvar newEditButton = addNewEditButton();\n\t\tvar newDeleteButton = addNewDeleteButton();\n\t\n\tif (this.checked) { //Mark task as complete\n\t\t\n\t\titem = item.slice(49);\n\t\tvar newLabel = addNewLabel(item, this);\n\t\tinsertAfter(newLabel, h6List[2]);\n\t\t\n\t} else {//Mark task as incomplete\n\t\t\n\t\titem = item.slice(67);\n\t\tvar newLabel = addNewLabel(item, this);\n\t\tinsertAfter(newLabel, h6List[1]);\n\t\t\n\t}\n\t\t\n\t\tinsertAfter(newEditButton, newLabel);\n\t\tinsertAfter(newDeleteButton, newEditButton);\n\t\n\t\t//Attaching the event handlers to the new elements\n\t\tnewLabel.firstChild.onclick = toggleCompletion;\n\t\tnewEditButton.onclick = toggleEdit;\n\t\tnewDeleteButton.onclick = deleteItem;\n}", "_handleCompletion() {\n const that = this;\n\n if (that.$.completeButton) {\n if (that.value >= that.max) {\n that.$completeButton.removeClass('jqx-visibility-hidden');\n that.$progressBar.addClass('jqx-visibility-hidden');\n }\n else {\n that.$completeButton.addClass('jqx-visibility-hidden');\n that.$progressBar.removeClass('jqx-visibility-hidden');\n }\n }\n }", "function FCKeditor_OnComplete(editorInstance) {editorInstance.Focus();}", "function FCKeditor_OnComplete(editorInstance) {editorInstance.Focus();}", "function fnSetCompletion ()\r\n{\r\n\tif(SetCompletioStatus == false)\r\n\t{\r\n\t\tset_val(\"cmi.core.lesson_status\",\"completed\");\r\n\t\tSetCompletioStatus = true;\t\t\t\t\r\n\t}\r\n}", "complete() {}", "function SetComplete (){\n\tstoreDataValue( \"cmi.completion_status\", \"completed\" );\n}", "isComplete() {\n return this.selection != null;\n }", "isComplete() {\n return this.selection != null;\n }", "function async_completed() {\n\tasync_completions += 1;\n\tD.log(\"completions: \" + async_completions + \" out of \" + async_completions_waiting);\n\tif ( async_completions == async_completions_waiting ) {\n\t completion();\n\t}\n }", "onEditComplete() {}", "onEditComplete() {}", "function done() {\n const mutateCursor = getCursorToMutate('dangerous');\n if (mutateCursor) {\n clickTaskDone(mutateCursor);\n } else {\n withUnique(\n openMoreMenu(),\n 'li[data-action-hint=\"multi-select-toolbar-overflow-menu-complete\"]',\n click,\n );\n }\n }", "function populateComplete() {\n var complete = document.getElementById(\"complete-column\");\n\n for (var i = 1; i < 3; ++i) {\n var taskBox = createTaskBox();\n var taskName = document.createTextNode(\"Task name: Test task \" + i);\n var dueDate = document.createTextNode(\"Due date: placeholder\");\n\n textToTaskBox(taskBox, taskName, dueDate, complete);\n complete.appendChild(taskBox);\n }\n}", "function checkCompletion() {\n\tif (levelCompleted()) {\n\t\tincreasePoints();\n\t\tinitLevel(currentLevel + 1);\n\t\tinitValues();\n\t\tinitCells();\n\t}\n}", "function initCompletionItems() {\n $.get(completionItemsUrl,function (data) {\n data = unpackResult(data);\n gdata.completionItems = data.data;\n })\n}", "function rl_complete(count, key) {\n if (_rl_last_func != rl_complete) {\n _rl_completion_state = -2;\n _rl_completion_start = _rl_find_completion_word();\n var text = rl_line_buffer.substring(_rl_completion_start, rl_point);\n _rl_completion_matches = (\n rl_completion_matches(text, rl_completion_entry_function)\n );\n }\n\n // abort if no match is found\n if (_rl_completion_matches.length == 0) {\n return;\n }\n\n // choose the substitution\n var substitution;\n if (_rl_completion_state == -2) { // partial completion\n substitution = compute_lcd_of_matches(_rl_completion_matches);\n } else if (_rl_completion_state == -1) { // list of matches\n display_matches(_rl_completion_matches);\n _rl_completion_state++;\n return;\n } else { // cycles through matches\n substitution = _rl_completion_matches[_rl_completion_state];\n }\n\n // apply it\n rl_replace_text(_rl_completion_start, rl_point, substitution);\n\n _rl_completion_state++;\n if (_rl_completion_state >= _rl_completion_matches.length) {\n _rl_completion_state = 0;\n }\n}", "function completion(uri) {\n const defList = buffers[uri].defList;\n const result = [];\n\n for (let i = 0; i < defList.length; i++) {\n result.push({label: defList[i].text})\n }\n\n return result;\n}", "_complete() {\n this.wrapperEl.addClass(this.options.classes.completed);\n this.element.addClass(this.options.classes.completed);\n this.element.trigger(SnapPuzzleEvents.complete, this);\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "function selectedCompletion(state) {\n var _a;\n let open = (_a = state.field(completionState, false)) === null || _a === void 0 ? void 0 : _a.open;\n return open && !open.disabled && open.selected >= 0 ? open.options[open.selected].completion : null;\n}", "function finalizeSelection(){\n\n\tvar len = cliptext.value.length\n\tif(len > 5) cliptext.selectionStart = 3\n\telse cliptext.selectionStart = defaultStart\n\tcliptext.selectionEnd = len - 2\n}", "function showComplete(event) {\n event.preventDefault();\n var currentCollection = parseLocalStorage();\n prependComplete(currentCollection);\n disableCompleteTaskBtn();\n}", "function showCompleteMessage() {\n var dialog = $(\"<div>\")\n .attr({\n \"class\":\"completeDialog d-flex flex-column align-item-center justify-content-center\",\n \"id\":\"completionDialog\"\n });\n var message = $(\"<div>\")\n .attr({\n \"class\":\"card rounded d-inline-block m-4\"\n })\n .html(\n `<div class=\"card-header\">`\n +`<h2 class=\"card-title\">Simulation Complete</h2>`\n +`</div>`\n +`<div class=\"card-body\">`\n +`<p class=\"lead\">All viruses were eliminated by the white blood cells.</p>`\n +`</div>`\n +`<div class=\"card-footer\">`\n +`<div class=\"btn-group w-100\">`\n +`<button class=\"btn btn-warning\" id=\"dialogOptionsButton\">Options</button>`\n +`<button id=\"dialogRestartButton\" class=\"btn btn-info\">Restart</button>`\n +`</div>`\n +`</div>`\n )\n $(dialog).hide();\n $(message).appendTo(dialog);\n $(dialog).appendTo(\"body\");\n $(dialog).fadeIn();\n }", "complete () {\n this.detailBox.innerHTML = 'Click to begin'\n this.container.addEventListener('click', this.begin.bind(this))\n }", "onEditComplete() {\n const me = this,\n { record, dataField, inputField, oldValue, lastAlignSpec } = me,\n { target } = lastAlignSpec,\n { value } = inputField;\n\n if (!me.isFinishing) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n\n if (record) {\n const setterName = `set${StringHelper.capitalizeFirstLetter(dataField)}`;\n if (record[setterName]) {\n record[setterName](value);\n } else {\n record[dataField] = value;\n }\n }\n me.trigger('complete', { value, oldValue });\n if (target.nodeType === 1) {\n target.classList.remove('b-editing');\n }\n\n me.isFinishing = false;\n }\n }", "function checkCompletion() {\r\n if (completeStatus == \"completed\") {\r\n setTimeout(function() {\r\n var modules = courseStructure.course.module;\r\n for (var i_mod = 0; i_mod < Number(modules.length); i_mod++) {\r\n var topics = modules[i_mod].topic;\r\n for (var i_top = 0; i_top < topics.length; i_top++) {\r\n for (var i_scr = 0; i_scr < topics[i_top].screen.length; i_scr++) {\r\n arrayScorm[i_mod][i_top][i_scr] = '1';\r\n }\r\n $(\".accordion .menu-container\").find('#panel' + i_mod).find('.' + i_mod + '-' + i_top).find('.completed').css('display', 'inline');\r\n }\r\n $(\".accordion .menu-container\").eq(i_mod).find('a').find('.completed').css('display', 'inline');\r\n }\r\n\r\n }, 1500);\r\n\r\n } else {\r\n\r\n setTimeout(function() {\r\n\r\n //completedModule=[0,11,2]\r\n if (moduleStr != \"\" && moduleStr != undefined && moduleStr != null) {\r\n for (var i_mod = 0; i_mod < completedModule.length; i_mod++) {\r\n $(\".accordion .menu-container\").eq(completedModule[i_mod]).find('a').find('.completed').css('display', 'inline');\r\n }\r\n }\r\n var firstIndexOfTopic = new Array()\r\n var lastIndexOfTopic = new Array()\r\n for (var i_top = 0; i_top < completedTopic.length; i_top++) {\r\n firstTopicIndex = String(completedTopic[i_top]).split(\"_\");\r\n lastTopicIndex = String(completedTopic[i_top]).split(\"_\");\r\n \r\n $(\".accordion .menu-container\").find('#panel' + firstTopicIndex[0]).find('.' + firstTopicIndex[0] + '-' + lastTopicIndex[1]).find('.completed').css('display', 'inline')\r\n }\r\n\r\n\r\n }, 1500);\r\n\r\n }\r\n }", "function displayTextTLComplete(){\r\r\n quoteLargeSplit.revert();\r\r\n }", "autocomplete(range, options = {}) {\n const completionPlaceholder = this.autocompleter.getCompletionPlaceholder();\n if (completionPlaceholder) {\n this.editor.insertText(range.index, completionPlaceholder + ' ', 'user');\n this.editor.setSelection(\n range.index + completionPlaceholder.length + 1,\n 0,\n 'user'\n );\n this.autocompleter.cancel();\n } else if (options.fallbackBehavior) {\n options.fallbackBehavior();\n }\n }", "function checkIfComplete(){\n\t\tif(isComplete == false){\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = ' SEGUNDO ';\n\t\t}\n\t}", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "onCompletion() {\n this.close();\n\n return this.answers;\n }", "function getTextCompletionQuestions() {\n \n $.get(\"/api/textcompletionq\", function(data) {\n textcompletionquestions = data;\n textcompletionquestionsoriginal = data;\n \n //loop through questions to get the correct answers\n displayQuestions();\n getCorrectAnswers();\n });\n }", "onEditComplete() {\n const me = this,\n {\n record,\n dataField,\n inputField,\n oldValue,\n lastAlignSpec\n } = me,\n {\n target\n } = lastAlignSpec,\n {\n value\n } = inputField;\n\n if (!me.isFinishing) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n\n if (record) {\n const setterName = `set${StringHelper.capitalize(dataField)}`;\n\n if (record[setterName]) {\n record[setterName](value);\n } else {\n record[dataField] = value;\n }\n }\n\n me.trigger('complete', {\n value,\n oldValue\n });\n\n if (target.nodeType === 1) {\n target.classList.remove('b-editing');\n target.classList.remove('b-hide-visibility');\n }\n\n me.isFinishing = false;\n }\n }", "function complete(bot, command) {\n return function () {\n inp.val(bot + command);\n clearHints();\n };\n }", "function showDone(){\n $('#meaning').val('');\n $('#hint').html('It took ' + (wordCounter + 1) + \" tries\");\n $('#lemma').html('All Correct!').addClass('text-success');\n}", "is_done() {\n return this.box[0];\n }", "function memberCompletions() {\n var hints = [], from = -1, to = -1;\n var label = previousToken.string.trim();\n for (var i = 0; i < lastMessage.hints[\"set\"].length; i++) {\n if (lastMessage.hints[\"set\"][i].text == label) {\n hints = lastMessage.hints[\"set\"][i].options\n .map(function (item) {\n return {\n text: item,\n displayText: item\n };\n });\n from = CodeMirror.Pos(cursor.line, token.end);\n to = CodeMirror.Pos(cursor.line, token.end);\n break;\n }\n }\n return {\n list: hints,\n from: from,\n to: to\n };\n }", "function onAutoCompleteSuccess() {\n\tclearOldSuggestions();\n \t// In this context, 'this' means the XMLHttpRequest itself.\n \taddSuggestionsToPanel(this.response);\n}", "function onClick() {\n\t\tshowAllSuggestions();\n\t\tsetSelectionToCurrentValue();\n\t}", "function displaySuggestions(data) {\n if (data && data.status) {\n // if getting suggestions successfully\n // display suggested words\n var words = data.words;\n var len = words.length;\n var i = 0;\n var html = '';\n\n for(i = 0; i < len; i++) {\n html += getSuggestionItem(words[i].word);\n }\n $('#suggest-box').css({\"display\": \"block\"});\n $('#suggest-box').html(html);\n }\n }", "_bindingCompleteHandler() {\n const that = this;\n\n if (!that.$.listBox) {\n return;\n }\n\n requestAnimationFrame(() => {\n that._setDropDownSize();\n that._positionDetection.checkBrowserBounds();\n });\n }", "function completer(line) {\n var completions = [\n 'exit',\n 'getTopLevelAccessors()',\n 'help',\n 'instantiate(',\n 'provideInput(',\n 'setParameter(',\n 'quit',\n ];\n var hits = completions.filter(function (candidate) {\n // FIXME: need a better filter.\n return candidate.indexOf(line) === 0;\n });\n // show all completions if none found\n return [hits.length ? hits : completions, line];\n }", "result(index) {\n const result = this.resultsList[index]\n const name = result.name\n\n // Open the file if the job isn't waiting\n const filename = dirs.results(this.epoch, name)\n if(result.state == 'waiting')\n return\n\n const contents = fs.readFileSync(filename).toString()\n\n this.resultBox = blessed.box({\n top: 'center',\n left: 'center',\n width: '100%',\n height: '100%',\n label: name,\n content: contents,\n tags: true,\n border: {\n type: 'line'\n },\n scrollable: true,\n keys: true,\n vi: true,\n input: true\n });\n\n this.screen.append(this.resultBox);\n this.resultBox.focus()\n this.screen.render();\n }", "function complete(res, context, game_name) {\n firstCBCount++;\n if (firstCBCount >= totalFirstCB) {\n addConsolesGames(res, mysql, context, totalConsoles, totalGenres, game_name, addCGComplete, datetime);\n }\n }", "_applySelection() {\n const that = this;\n\n if (that.selectionDisplayMode === 'placeholder' || that.selectedIndexes.length === 0) {\n that.$.actionButton.innerHTML = that.placeholder;\n return;\n }\n\n if (!that.$.listBox._items || that.$.listBox._items.length === 0) {\n return;\n }\n\n that.$.actionButton.innerHTML = '';\n that.$.actionButton.appendChild(that._createToken());\n }", "function complete() {\n\tconsole.log('Completed');\n}", "function check_for_completion()\n{\n\tvar $btn_complete = $(\"#btn-complete\"),\n\t\t$tasks = $(\"#project .tasks li.task\"),\n\t\t$complete_tasks = $(\"#project .tasks li.task.complete\"),\n\t\ttask_len = $tasks.length,\n\t\tcomplete_task_len = $complete_tasks.length,\n\t\tis_complete = false;\n\t\t\n\tif(complete_task_len >= task_len)\n\t{\n\t\t$btn_complete.removeClass(\"disable\");\n\t\tis_complete = true;\n\t}\n\telse\n\t{\n\t\t$btn_complete.addClass(\"disable\");\n\t\tis_complete = false;\n\t}\n\t\n\treturn is_complete;\n}", "function messageTextComplete() {\n var variable_list = common_data['variable_list'];\n $('.text_group .input_text_type, .textarea_box .readonly, textarea.terms_of_user_content').textcomplete([\n {\n match: /@(\\w*)$/,\n search: function (term, callback) {\n callback($.map(variable_list, function (element) {\n return element.indexOf(term) === 0 ? element : null;\n }));\n },\n index: 1,\n replace: function (element) {\n return ['\\{\\{' + element + '}}', ''];\n }\n }\n ], {\n maxCount: 1000\n }).on({\n 'textComplete:hide': function (e) {\n // getDataFromInput();\n if(message_type_bot) {\n getDataFromInput();\n } else {\n getDataUserFromInput();\n }\n }\n });\n}", "function ctt_popupbox() { ct_popupbox(\"err\", \"Test popup box. The quick brown fox jumps over the lazy dog. Something something that is really long. Sprinkles on kittens and raindrops on noses something idk. Test popup box. The quick brown fox jumps over the lazy dog. Something something that is really long. Sprinkles on kittens and raindrops on noses something idk. Test popup box. The quick brown fox jumps over the lazy dog. Something something that is really long. Sprinkles on kittens and raindrops on noses something idk.\") }", "function checkQuestCompletion(quest) {\n searchResult = _.findWhere(quest.objectives, {\"status\": constants.quest.status.INCOMPLETE});\n\n if (searchResult === undefined) {\n quest.status = constants.quest.status.COMPLETE;\n }\n }", "function returnedTagsHandler(returnedTags) {\n // If there is no suggest box yet, draw it\n\n if ($('#suggestBox').length == 0) {\n $('#tagSelection').after(\"<div id=\\\"suggestBox\\\"></div>\");\n }\n\n $('#suggestBox').show();\n\n // Clear the existing contents of the suggest box\n $('#suggestBox').empty();\n\n for (var i in returnedTags) {\n var tag = returnedTags[i];\n $('#suggestBox').append(\"<a href='#' id='\" + tag.id + \"'>\" + tag.name + \"</a>\");\n }\n\n $('#suggestBox a').click(function(event) {\n event.preventDefault();\n });\n\n $('#suggestBox a').click(tagSuggestionClickHandler);\n\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "function complete() {\n Y.log('complete');\n }", "statusCompletion() {\n this.setState({completed: !this.state.completed});\n }", "getCompletions(editor, session, position, prefix, callback) {\n const suggestCompletions = this._suggestCompletions;\n if (!suggestCompletions) return callback(null, []);\n\n let promise;\n try {\n promise = run(() => suggestCompletions(editor, session, position, prefix));\n } catch (error) {\n promise = Ember.RSVP.reject(error);\n }\n\n Ember.RSVP.resolve(promise).then(results => callback(null, results)).catch(error => callback(error));\n }", "function displayFinishMessage () {\n $('#finishedBox').css({\"display\": \"block\"})\n}", "function SetIncomplete (){\n\tretrieveDataValue( \"cmi.completion_status\" );\n\tif (status != \"completed\"){\n\t\tstoreDataValue( \"cmi.completion_status\", \"incomplete\" );\n\t}\n}", "_bindingCompleteHandler() {\n const that = this;\n\n if (!that.$.listBox) {\n return;\n }\n\n that._setDropDownSize();\n that._positionDetection.checkBrowserBounds();\n }", "getCompletions(editor, session, position, prefix, callback) {\n const suggestCompletions = this._suggestCompletions;\n if (!suggestCompletions) return callback(null, []);\n\n let promise;\n try {\n promise = Ember.run(() => suggestCompletions(editor, session, position, prefix));\n } catch (error) {\n promise = Ember.RSVP.reject(error);\n }\n\n Ember.RSVP.resolve(promise).then(results => callback(null, results)).catch(error => callback(error));\n }", "_bindingCompleteHandler() {\n const that = this;\n\n that._queryItems();\n that._setDropDownSize();\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "function waitingCursor() {\n\t\t\t\tvar texts = ['/', '-', '\\\\', '|'],\n\t\t\t\t $c = me.$body.find('.cursor.waiting');\n\t\t\t\tif ($c.length > 0) {\n\t\t\t\t\t$c.each(function() {\n\t\t\t\t\t\tvar $this = $(this),\n\t\t\t\t\t\t text = $this.text(),\n\t\t\t\t\t\t index = texts.indexOf(text) + 1;\n\t\t\t\t\t\tif (index === texts.length) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.text(texts[index]);\n\t\t\t\t\t});\n\t\t\t\t\tview.waitingCursorTimeoutId = window.setTimeout(waitingCursor, 100);\n\t\t\t\t} else {\n\t\t\t\t\tdelete view.waitingCursorTimeoutId;\n\t\t\t\t}\n\t\t\t}", "function suggestion_lb() {\n\t$J.blockUI({ message: $J('#suggestion_lb'),\n css: { top: '10%', width: '40%', color: '#fff',background: '#000', cursor: 'default'}\n });\n //$.blockUI.defaults.css.cursor = 'pointer';\n $J.blockUI.defaults.overlayCSS = {}; \n $J('.blockOverlay').attr('title','Click to close').click($J.unblockUI);\n\t\n\t\n}", "function doApplicationCompletion(field) {\n\tAid = getURLParameter(\"AID\");\n\tUser = getURLParameter(\"User\");\n\t// alert(Aid+\" \"+User);\n\tconnect(\"/hiwi/Clerk/js/doApplicationCompletion\", \"aid=\" + Aid + \"&User=\"\n\t\t\t+ User, handleApplicationCompletion);\n}", "function coauthors_autosuggest_select() {\n\t\t$this = jQuery( this );\n\t\tvar vals = this.value.split( '|' );\n\n\t\tvar author = {}\n\t\tauthor.id = jQuery.trim( vals[0] );\n\t\tauthor.name = jQuery.trim( vals[1] );\n\n\t\t// Decode user-nicename if it has special characters in it.\n\t\tauthor.nicename = decodeURIComponent( jQuery.trim( vals[2] ) );\n\n\t\tif ( author.id=='New' ) {\n\t\t\tcoauthors_new_author_display( name );\n\t\t} else {\n\t\t\tcoauthors_add_coauthor( author, $this );\n\t\t\t// Show the delete button if we now have more than one co-author\n\t\t\tif ( jQuery( '#coauthors-list .coauthor-row .coauthor-tag' ).length > 1 )\n\t\t\t\tjQuery( '#coauthors-list .coauthor-row .coauthors-author-options' ).removeClass( 'hidden' );\n\t\t}\n\t}", "function EasyComplete(opt) {\n this.opt = opt;\n this.ipt = $('#' + opt.id);\n this.delay = opt.delay || 200;\n this.term = '';\n this.init();\n }", "function complete(number) {\n if (number >= list.length) {\n console.log(`\\nInvalid Number\\n`);\n view()\n } else {\n list[number].done = true\n console.log(`\\nCompleted ${list[number].task}\\n`)\n menu();\n }\n}", "function closeCompletionPage() {\n document.getElementById('completion-page').style.display = 'none';\n createGrid();\n}", "function completePath()\n{\n\tvar locationInformation = collectDetailsAboutTheCurrentSelection();\n\n\t//showObject(locationInformation);\n\n\t// If in primary argument to input, include, includegraphics or similar, \n\t// complete filename.\n\tvar words;\n\twords = locateMatchingFilenames(locationInformation.extractedWord);\n\n\tif(words.length == 0)\n\t{\n\t\tsuggestEnvironment(locationInformation);\n\t\treturn;\n\t}\n\n\tinsertSuggestion(words, locationInformation);\n}", "function completePlan () {\n return autocomplete.words(['dev', 's', 'm', 'l', 'xl', 'xxl']);\n}", "completed(data) {}", "function completeDOMTask(event, list = inbox) {\n // detectar que se hizo click en el input\n if (event.target.tagName === 'INPUT') {\n // Completar tarea de la lista, (se necesita el índice)\n list.tasks[getTaskIndex(event)].complete(); \n event.target.parentElement.classList.toggle('complete');\n // console.table(list.tasks);\n }\n}", "updateCompleterOnChange(file) {\r\n fs.readFile(file).then(buffer => buffer.toString()).then(content => this.updateCompleter(file, content));\r\n this.extension.completer.input.getGraphicsPath(file);\r\n }", "onSubmit() {\n\t\tconst valid = this.checkValidSelection()\n\t\tif (!valid) {\n\t\t\tthis.invalidSelection = true;\n\t\t\tthis.renderCurrentDirectory()\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t \n\t\t\tthis.status = 'answered';\n\n\t\t\tthis.renderCurrentDirectory();\n\n\t\t\tthis.screen.done();\n\t\t\tcliCursor.show();\n\t\t\tthis.done(this.selected.fullPath);\n\t\t}\n\t}", "async function markAsComplete(target, value, style) {\n const url = \"http://localhost:8080/api/todoitems/\" + target.parentElement.id;\n const requestOptions = {\n method: 'PUT',\n body: JSON.stringify({\n completed: value\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n }\n }\n try {\n const response = await fetch(url, requestOptions);\n if(response.ok) {\n target.style.textDecoration = style;\n const jsonResponse = await response.json();\n console.log(jsonResponse.message);\n } else {\n throw new Error('Request failed!');\n }\n } catch (error) {\n console.log(error)\n }\n}", "review() {\n if (this.complete) {\n this.complete = !this.complete;\n }\n }", "function completeItems() {\n for (var i = 0; i < listComponent.selected.length; i++) {\n var itemJson = JSON.parse(listComponent.selected[i].dataset.item);\n\n // Find uncompleted item that matches\n for (var j = 0; j < listComponent.unCompleted.length; j++) {\n if (listComponent.unCompleted[j].content == itemJson.content\n && listComponent.unCompleted[j].timeCreated == itemJson.timeCreated) {\n\n var item = listComponent.unCompleted[j];\n listComponent.completed.push(item);\n listComponent.unCompleted.splice(j, 1);\n\n listComponent.timeCompleted = new Date().toGMTString();\n break;\n }\n }\n }\n listComponent.updateController();\n }", "_autoComplete(noSelectionRefresh) {\n const that = this;\n\n if (that.autoComplete === 'list') {\n return;\n }\n\n if (that.$.listBox._items.length === 0 && typeof that.dataSource !== 'function') {\n that.close();\n return;\n }\n\n const value = that.$.input.value.length < that.minLength ? '' :\n (that.displayMode === 'escaped' ? that._toDefaultDisplayMode(that.$.input.value) : that.$.input.value), //displayMode is a jqxTextBox property\n isItemFocused = function (items) {\n for (let i = 0; i < items.length; i++) {\n if (items[i]._focused && items[i].hasAttribute('focus')) {\n return true;\n }\n }\n };\n\n let selectedItem;\n\n if (that.$.listBox.selectedValues.length === 1) {\n selectedItem = that.$.listBox.getItem(that.$.listBox.selectedValues[0]);\n }\n\n that.$.autoCompleteString.textContent = '';\n that.$.listBox.$.filterInput.value = that.autoComplete === 'none' || that.$.input.value.length < that.minLength ? '' : value;\n\n const queryCallback = function () {\n if (!that.$.listBox.isAttached || !that.$.input) {\n return;\n }\n\n const activeElement = that.enableShadowDOM ? that.shadowRoot.activeElement : document.activeElement;\n\n that._setDropDownSize();\n\n if (that.opened) {\n that._positionDetection.positionDropDown();\n that._positionDetection.checkBrowserBounds();\n }\n\n if (that.$.listBox._filteredItems && that.$.listBox._filteredItems.length > 0) {\n that.$.listBox._scrollView.scrollTop = that.$.listBox._filteredItems[0].offsetTop;\n\n if (that.autoComplete !== 'none' && that.$.input.value.length >= that.minLength && !isItemFocused(that.$.listBox._filteredItems)) {\n that._focus(that.$.listBox._filteredItems[0]);\n }\n\n if (activeElement === that.$.input && that.autoComplete === 'inline' && that.$.input.value.length >= that.minLength) {\n that._updateAutoCompleteHelper();\n }\n\n if (selectedItem && selectedItem[that.inputMember] === that.$.listBox._filteredItems[0][that.inputMember] && selectedItem.value === that.$.listBox._filteredItems[0].value) {\n that.$.listBox.context = that.$.listBox;\n that.$.listBox._select(that.$.listBox._filteredItems[0], true);\n that.$.listBox.context = listBoxContext;\n }\n\n if (value !== that.$.listBox._filteredItems[0][that.inputMember] || (JQX.TextBox && that instanceof JQX.TextBox && that.dropDownOpenMode === 'auto')) {\n if (that._closedFromKeyCombination) {\n that._closedFromKeyCombination = false;\n return;\n }\n\n if (value.length < that.minLength && !(JQX.TextBox && that instanceof JQX.TextBox && that.dropDownOpenMode === 'auto')) {\n that.close();\n return;\n }\n\n if (that.isCompleted && that.dropDownOpenMode !== 'none' && activeElement === that.$.input) {\n that.open();\n }\n }\n\n return;\n }\n\n that.close();\n }\n\n //Context Fix\n let listBoxContext = that.$.listBox.context;\n\n that.$.listBox.context = that.$.listBox;\n that.$.listBox._filterItems(noSelectionRefresh ? true : false, queryCallback, JQX.TextBox && that instanceof JQX.TextBox && that.dropDownOpenMode === 'auto');\n that.$.listBox.context = listBoxContext;\n\n }", "function finalQuest() {\n $(\"#question\").children().hide();\n $(\"#choices\").children().hide();\n $(\"#timer\").children().hide();\n $(\"#result\").children().hide();\n $(\"#answer\").empty()\n var answerResult = $(\"<h1>\");\n answerResult.css(\"margin-top\", \"60px\")\n answerResult.append(resultText.complete);\n $(\"#answer\").append(answerResult);\n printResult();\n\n }", "function AskComplete(selectedBlItem) {\n document.getElementById(\"addedtoexperiences1\").style.display = \"block\";\n document.getElementById(\"addedtoexperiences1_2\").style.display = \"none\";\n document.getElementById(\"addedtoexperiences1_3\").style.display = \"none\"; \n document.getElementById(\"deleted1\").style.display = \"none\";\n document.getElementById(\"deleted2\").style.display = \"none\";\n localStorage.setItem('item', selectedBlItem); // Key is item and value is \"selectedBlItem\"\n document.getElementById(\"uploadValue\").value = selectedBlItem; // The upload value gets exactly the value of what is between the brackets in the Ask Complete function of the respective BL item\n}", "onEditComplete() {\n super.onEditComplete();\n this.autoClosePicker();\n }", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "function addCGComplete(res, game_name) {\n secondCBCount++;\n if (secondCBCount >= totalConsoles) {\n addGenresGames(res, mysql, context, totalGenres, game_name, addGGComplete, datetime);\n }\n }", "function calculateCompletion(contentObjectModel) {\n\n var viewType = contentObjectModel.get('_type'),\n nonAssessmentComponentsTotal = 0,\n nonAssessmentComponentsCompleted = 0,\n assessmentComponentsTotal = 0,\n assessmentComponentsCompleted = 0,\n subProgressCompleted = 0,\n subProgressTotal = 0,\n isComplete = contentObjectModel.get(\"_isComplete\") ? 1 : 0;\n\n // If it's a page\n if (viewType == 'page') {\n var children = _.filter(contentObjectModel.findDescendantModels('components'), function(comp) {\n return comp.get('_isAvailable') === true && comp.get('_isOptional') === false;\n });\n\n var availableChildren = filterAvailableChildren(children);\n var components = getPageLevelProgressEnabledModels(availableChildren);\n\n var nonAssessmentComponents = getNonAssessmentComponents(components);\n\n nonAssessmentComponentsTotal = nonAssessmentComponents.length | 0,\n nonAssessmentComponentsCompleted = getComponentsCompleted(nonAssessmentComponents).length;\n\n var assessmentComponents = getAssessmentComponents(components);\n\n assessmentComponentsTotal = assessmentComponents.length | 0,\n assessmentComponentsCompleted = getComponentsInteractionCompleted(assessmentComponents).length;\n\n subProgressCompleted = contentObjectModel.get(\"_subProgressComplete\") || 0;\n subProgressTotal = contentObjectModel.get(\"_subProgressTotal\") || 0;\n\n var pageCompletion = {\n \"subProgressCompleted\": subProgressCompleted,\n \"subProgressTotal\": subProgressTotal,\n \"nonAssessmentCompleted\": nonAssessmentComponentsCompleted,\n \"nonAssessmentTotal\": nonAssessmentComponentsTotal,\n \"assessmentCompleted\": assessmentComponentsCompleted,\n \"assessmentTotal\": assessmentComponentsTotal\n };\n\n if (contentObjectModel.get(\"_pageLevelProgress\") && contentObjectModel.get(\"_pageLevelProgress\")._showPageCompletion !== false \n && Adapt.course.get(\"_pageLevelProgress\") && Adapt.course.get(\"_pageLevelProgress\")._showPageCompletion !== false) {\n //optionally add one point extra for page completion to eliminate incomplete pages and full progress bars\n // if _showPageCompletion is true then the progress bar should also consider it so add 1 to nonAssessmentTotal\n pageCompletion.nonAssessmentCompleted += isComplete;\n pageCompletion.nonAssessmentTotal += 1;\n }\n\n return pageCompletion;\n }\n // If it's a sub-menu\n else if (viewType == 'menu') {\n\n _.each(contentObjectModel.get('_children').models, function(contentObject) {\n var completionObject = calculateCompletion(contentObject);\n subProgressCompleted += contentObjectModel.subProgressCompleted || 0;\n subProgressTotal += contentObjectModel.subProgressTotal || 0;\n nonAssessmentComponentsTotal += completionObject.nonAssessmentTotal;\n nonAssessmentComponentsCompleted += completionObject.nonAssessmentCompleted;\n assessmentComponentsTotal += completionObject.assessmentTotal;\n assessmentComponentsCompleted += completionObject.assessmentCompleted;\n });\n\n return {\n \"subProgressCompleted\": subProgressCompleted,\n \"subProgressTotal\" : subProgressTotal,\n \"nonAssessmentCompleted\": nonAssessmentComponentsCompleted,\n \"nonAssessmentTotal\": nonAssessmentComponentsTotal,\n \"assessmentCompleted\": assessmentComponentsCompleted,\n \"assessmentTotal\": assessmentComponentsTotal,\n };\n }\n }", "function calculateCompletion(contentObjectModel) {\n\n var viewType = contentObjectModel.get('_type'),\n nonAssessmentComponentsTotal = 0,\n nonAssessmentComponentsCompleted = 0,\n assessmentComponentsTotal = 0,\n assessmentComponentsCompleted = 0,\n subProgressCompleted = 0,\n subProgressTotal = 0,\n isComplete = contentObjectModel.get(\"_isComplete\") ? 1 : 0;\n\n // If it's a page\n if (viewType == 'page') {\n var children = _.filter(contentObjectModel.findDescendantModels('components'), function(comp) {\n return comp.get('_isAvailable') === true && comp.get('_isOptional') === false;\n });\n\n var availableChildren = filterAvailableChildren(children);\n var components = getPageLevelProgressEnabledModels(availableChildren);\n\n var nonAssessmentComponents = getNonAssessmentComponents(components);\n\n nonAssessmentComponentsTotal = nonAssessmentComponents.length | 0,\n nonAssessmentComponentsCompleted = getComponentsCompleted(nonAssessmentComponents).length;\n\n var assessmentComponents = getAssessmentComponents(components);\n\n assessmentComponentsTotal = assessmentComponents.length | 0,\n assessmentComponentsCompleted = getComponentsInteractionCompleted(assessmentComponents).length;\n\n subProgressCompleted = contentObjectModel.get(\"_subProgressComplete\") || 0;\n subProgressTotal = contentObjectModel.get(\"_subProgressTotal\") || 0;\n\n var pageCompletion = {\n \"subProgressCompleted\": subProgressCompleted,\n \"subProgressTotal\": subProgressTotal,\n \"nonAssessmentCompleted\": nonAssessmentComponentsCompleted,\n \"nonAssessmentTotal\": nonAssessmentComponentsTotal,\n \"assessmentCompleted\": assessmentComponentsCompleted,\n \"assessmentTotal\": assessmentComponentsTotal\n };\n\n if (contentObjectModel.get(\"_pageLevelProgress\") && contentObjectModel.get(\"_pageLevelProgress\")._showPageCompletion !== false \n && Adapt.course.get(\"_pageLevelProgress\") && Adapt.course.get(\"_pageLevelProgress\")._showPageCompletion !== false) {\n //optionally add one point extra for page completion to eliminate incomplete pages and full progress bars\n // if _showPageCompletion is true then the progress bar should also consider it so add 1 to nonAssessmentTotal\n pageCompletion.nonAssessmentCompleted += isComplete;\n pageCompletion.nonAssessmentTotal += 1;\n }\n\n return pageCompletion;\n }\n // If it's a sub-menu\n else if (viewType == 'menu') {\n\n _.each(contentObjectModel.get('_children').models, function(contentObject) {\n var completionObject = calculateCompletion(contentObject);\n subProgressCompleted += contentObjectModel.subProgressCompleted || 0;\n subProgressTotal += contentObjectModel.subProgressTotal || 0;\n nonAssessmentComponentsTotal += completionObject.nonAssessmentTotal;\n nonAssessmentComponentsCompleted += completionObject.nonAssessmentCompleted;\n assessmentComponentsTotal += completionObject.assessmentTotal;\n assessmentComponentsCompleted += completionObject.assessmentCompleted;\n });\n\n return {\n \"subProgressCompleted\": subProgressCompleted,\n \"subProgressTotal\" : subProgressTotal,\n \"nonAssessmentCompleted\": nonAssessmentComponentsCompleted,\n \"nonAssessmentTotal\": nonAssessmentComponentsTotal,\n \"assessmentCompleted\": assessmentComponentsCompleted,\n \"assessmentTotal\": assessmentComponentsTotal,\n };\n }\n }", "function create_select_function(autocompletion_widget_id) {\n return function(event, ui) {\n // Prevent the value (the id number) of the item selected from\n // displaying after a selection has been made ...\n event.preventDefault();\n\n // ... and display the *label* of the item selected instead ...\n jQuery(this).val(ui.item.label);\n\n // ... but store the value of the item selected in a hidden field.\n jQuery('#' + completion_fields[autocompletion_widget_id].hidden_field_id).val(ui.item.value);\n }\n}", "_applySelection(mode, details) {\n const that = this;\n\n function createSelectionTags() {\n while (that.$.selectionField.firstElementChild.nodeName === 'SPAN') {\n that.$.selectionField.removeChild(that.$.selectionField.firstElementChild)\n }\n\n let fragment = document.createDocumentFragment(), element, icon;\n\n if (that.selectionDisplayMode === 'tokens') {\n if (that.selectedIndexes.length === 1 && (that.selectionMode === 'oneOrManyExtended' || that.selectionMode === 'oneOrMany')) {\n icon = '';\n }\n else {\n icon = '&#10006'\n }\n }\n else {\n icon = ',';\n }\n\n that.selectedIndexes.map(index => {\n element = that._applyTokenTemplate(that.$.listBox._items[index][that.inputMember], icon);\n element._value = that.$.listBox._items[index].value;\n fragment.appendChild(element);\n });\n\n that.$.selectionField.insertBefore(fragment, that.$.input);\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that.$.container.setAttribute('has-value', '');\n that._oldValue = that.value = that._currentSelection.toString();\n that._positionDetection.positionDropDown();\n }\n\n that.$.autoCompleteString.textContent = '';\n\n if (that.selectedIndexes.length === 0) {\n that._clearSelection(details && details.index > -1 && that.$.input.value === that.$.listBox._items[details.index][that.inputMember]);\n return;\n }\n\n if (!that.$.listBox._items || that.$.listBox._items.length === 0) {\n return;\n }\n\n if (that.selectionMode === 'one' || that.selectionMode === 'zeroOrOne' || that.selectionMode === 'radioButton') {\n if (that._currentSelection && that._currentSelection.length > that.selectedIndexes.length) {\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that.$.input.value = that._currentSelection.toString();\n that._oldValue = that.value = that._currentSelection.toString();\n return;\n }\n\n that._clearSelection();\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that.$.input.value = that._currentSelection.toString();\n that._oldValue = that.value = that._currentSelection.toString();\n\n that.$.container.setAttribute('has-value', '');\n\n if (that.autoComplete !== 'none' && typeof that.dataSource !== 'function') {\n that._autoComplete(true);\n that.close();\n }\n }\n else {\n that.$.input.value = '';\n that.$.input.placeholder = '';\n that.$.container.setAttribute('has-value', '');\n\n if (!that._currentSelection || that.selectionMode === 'oneOrManyExtended' || (that.selectionMode === 'radioButton' && !that.grouped)) {\n createSelectionTags();\n return;\n }\n\n const selectionTags = that.$.selectionField.getElementsByClassName('jqx-token');\n\n if (that._currentSelection.length < that.selectedIndexes.length) {\n let selectedLabels = that.selectedIndexes.map(index => that.$.listBox._items[index][that.inputMember]);\n\n for (let i = 0; i < selectedLabels.length; i++) {\n if (that._currentSelection.indexOf(selectedLabels[i]) < 0) {\n const item = that.$.listBox._items[that.selectedIndexes[i]];\n let element, icon;\n\n if (that.selectionDisplayMode === 'tokens') {\n if (that.selectedIndexes.length === 1 && (that.selectionMode === 'oneOrManyExtended' || that.selectionMode === 'oneOrMany')) {\n icon = '';\n }\n else {\n icon = '&#10006'\n }\n }\n else {\n icon = ',';\n }\n\n if (that.selectedIndexes.length === 1 && (that.selectionMode === 'oneOrManyExtended' || that.selectionMode === 'oneOrMany')) {\n icon = '';\n }\n\n element = that._applyTokenTemplate(item[that.inputMember], icon);\n element._value = item.value;\n that.$.selectionField.insertBefore(element, that.$.input);\n }\n }\n\n if (that.autoComplete !== 'none' && (that.$.listBox._filteredItems && that.$.listBox._filteredItems.length !== that.$.listBox._items.length)) {\n that._autoComplete(true);\n }\n\n that._positionDetection.positionDropDown();\n }\n else if ((that._currentSelection.length > 0 && selectionTags.length === 0) ||\n (that._currentSelection.length === that.selectedIndexes.length && that._currentSelection.toString() !== that.selectedValues.toString())) {\n createSelectionTags();\n return;\n }\n else {\n if (!details) {\n return;\n }\n\n for (let t = 0; t < selectionTags.length; t++) {\n if (selectionTags[t]._value === details.value) {\n that.$.selectionField.removeChild(selectionTags[t]);\n break;\n }\n }\n }\n\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that._oldValue = that.value = that._currentSelection.toString();\n }\n }", "function setSelectedCompletion(index) {\n return setSelectedEffect.of(index);\n}", "completed() {\n let selected = this.props.todo.selected;\n let input = document.getElementById('input-to-do');\n let val = input.value;\n \n if (selected) {\n this.props.crossOffToDo(selected, this.props.todo.totalToDos);\n }\n }" ]
[ "0.6384563", "0.6103177", "0.6067575", "0.6067575", "0.59841406", "0.59676903", "0.59592575", "0.5954911", "0.5954911", "0.5936218", "0.5904266", "0.58892417", "0.5888883", "0.5888883", "0.57903206", "0.5741161", "0.5741161", "0.572005", "0.5714734", "0.57108605", "0.56636786", "0.5623574", "0.5611713", "0.5587827", "0.5563382", "0.5563382", "0.5554929", "0.5527575", "0.5509493", "0.5473525", "0.5456952", "0.54548985", "0.54398376", "0.5438648", "0.53850186", "0.5373795", "0.5364971", "0.5364971", "0.536491", "0.5360931", "0.5344836", "0.5344041", "0.5341759", "0.53273803", "0.5321407", "0.531871", "0.53042644", "0.5298406", "0.52768165", "0.5274434", "0.5267943", "0.52597433", "0.5246151", "0.524236", "0.52391714", "0.5219077", "0.52144533", "0.52130675", "0.519863", "0.519863", "0.519863", "0.519863", "0.51896775", "0.5187549", "0.5176269", "0.51732594", "0.5162813", "0.5153283", "0.5149646", "0.514746", "0.5141466", "0.51350456", "0.51341075", "0.51337487", "0.51285493", "0.51164234", "0.51042247", "0.509546", "0.5094018", "0.50900257", "0.5089525", "0.5073223", "0.50698817", "0.50626904", "0.50584066", "0.50519246", "0.50481486", "0.5043576", "0.50331783", "0.50326496", "0.50294745", "0.5026474", "0.5016817", "0.5014467", "0.5009944", "0.5009944", "0.50042254", "0.50041693", "0.49995038", "0.49962717" ]
0.6429846
0
================================================================================== Multiple buttons ==================================================================================
function setup_buttons() { var button_containers=document.getElementsByClassName("button_container"); for(var key=0; key<button_containers.length; key++) { var container=button_containers[key]; container.style["line-height"]=container.style.height var h=container.clientHeight, w=container.clientWidth; var chooser=container.getElementsByClassName("chooser")[0]; var buttons=container.getElementsByClassName("button"); chooser.style.width=100.0/buttons.length+"%"; console.log("buttons:"+buttons.length) for(var i=0; i<buttons.length; i++) { buttons[i].style.width=100.0/buttons.length+"%"; if(i==0) { buttons[i].style["border-radius"]="7px 0px 0px 7px"; chooser.style.backgroundColor=buttons[i].dataset.chooser_color; chooser.style["border-radius"]=buttons[i].style["border-radius"]; chooser.style.left=0; } else if(i==buttons.length-1) buttons[i].style["border-radius"]="0px 7px 7px 0px"; else buttons[i].style["border-radius"]="0px"; buttons[i].addEventListener('click', function(e) { get_chooser(e.target).style.backgroundColor=e.target.dataset.chooser_color; get_chooser(e.target).style["border-radius"]=e.target.style["border-radius"]; get_chooser(e.target).style.left=e.target.offsetLeft }) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function commandButtons()\n{\n\t// find the index of the current recordset in MM.rsTypes\n\t//rsIndex = recordsetDialog.searchByType(RECORDSET_TYPE);\n\t\n\tbtnArray = new Array(\n\t\tMM.BTN_OK, \"clickedOK()\", \n MM.BTN_Cancel, \"clickedCancel()\", \n MM.BTN_Test, \"PopUpTestDialog()\");\n\t// add a button for each different rs type\n\tfor (i = 0;i < MM.rsTypes.length;i++) {\n\t\tif(MM.rsTypes[i].single == \"true\") {\n\t\t\tcontinue;\n\t\t}\n \tif (dw.getDocumentDOM().serverModel.getServerName() == MM.rsTypes[i].serverModel) {\n \t\tif (RECORDSET_TYPE.toLowerCase() != MM.rsTypes[i].type.toLowerCase()) {\n\t\t\t\tvar btnLabel = dw.loadString(\"recordsetType/\" + MM.rsTypes[i].type);\n\t\t\t\tif (!btnLabel)\n\t\t\t\t\tbtnLabel = MM.rsTypes[i].type;\n\t\t\t\tbtnArray.push(btnLabel+\"...\");\n\t\t\t\tbtnArray.push(\"clickedChange(\" + i + \")\");\n\t\t\t}\n\t\t}\n\t}\n\tbtnArray.push(MM.BTN_Help);\n\tbtnArray.push(\"displayHelp()\"); \n\treturn btnArray;\n}", "function displayOnMultipleSelection() {\n\t\tvar $detailsPane = $( '.details.pane' );\n\n\t\t$detailsPane.empty().append(\n\t\t\t$( '<div>' )\n\t\t\t\t.addClass( 'actions row' )\n\t\t\t\t.append(\n\t\t\t\t\t$( '<button>' )\n\t\t\t\t\t\t.addClass( 'accept primary green button' )\n\t\t\t\t\t\t.text( mw.msg( 'tsb-accept-all-button-label' ) ),\n\t\t\t\t\t\t// FIXME add api action\n\t\t\t\t\t$( '<button>' )\n\t\t\t\t\t\t.addClass( 'delete destructive button' )\n\t\t\t\t\t\t.text( mw.msg( 'tsb-reject-all-button-label' ) )\n\t\t\t\t\t\t// FIXME add api action\n\t\t\t\t)\n\t\t);\n\t}", "function getButtons() {\n $(\"#buttons-view\").empty();\n for (var i=0; i<topics.length; i++) {\n var btn=$('<button>');\n btn.addClass(\"gif-btn btn btn-primary\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n $(\"#buttons-view\").append(btn);\n }\n }", "function renderButtons() {\n // start by emptying the button-area div every time so that there are no duplicates\n $(\"#button-area\").empty();\n for (var i=0; i < topics.length; i++) {\n // create button element for each array item\n var button = $(\"<button>\");\n // Add classes\n button.addClass(\"btn btn-info tv-show\");\n // Add data attribute\n button.attr(\"data-name\", topics[i]);\n // Add text\n button.text(topics[i]);\n // Append to #button-area\n $(\"#button-area\").append(button);\n } \n }", "createButtons(i) {\n return (\n <ButtonGroup>\n <Button\n onClick={e => this.editButton(e, i)}>\n <Icon type=\"edit\" />\n </Button>\n <Button type=\"danger\"\n onClick={e => this.deleteButton(e, i)}>\n <Icon type=\"close\" />\n </Button>\n </ButtonGroup>\n )\n }", "function buttons() {\n $(\"#display-btns\").empty();\n for (var j = 0; j < initialBtns.length; j++) {\n\n var newBtns = $(\"<button>\")\n newBtns.attr(\"class\", \"btn btn-outline-secondary btn-sm\");\n newBtns.attr(\"id\", \"input\")\n newBtns.attr(\"data-name\", initialBtns[j]);\n newBtns.text(initialBtns[j]);\n\n $(\"#display-btns\").append(newBtns);\n }\n }", "function renderButtons() {\n\t\tcelebButtons.empty();\n\n\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\taddButton = $(\"<button>\");\n\t\t\taddButton.addClass(\"celebrity-button\")\n\t\t\taddButton.attr('data-name', topics[i]);\n\t\t\taddButton.removeClass('btn-success').addClass('btn-primary');\n\t\t\t$(this).addClass('btn-fancy').removeClass('btn-primary');\n\t\t\taddButton.text(topics[i]);\n\t\t\tcelebButtons.append(addButton);\n\n\t\t}\n\t}", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"topicgif\");\n\n a.attr(\"data-name\", topics[i]);\n\n a.text(topics[i]);\n\n $(\"#buttons-view\").append(a);\n }\n }", "function topicsButtons () {\n //empties div so there are no duplicate buttons\n $(\"#buttons-go-here\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button type='button'>\");\n a.addClass(\"btn btn-default\");\n a.addClass(\"dogbreed\")\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#buttons-go-here\").append(a)\n }\n }", "function Buttons() {\n this.list = [];\n this.nonUniqueIndex = 0;\n this.count = 0;\n this.nonUniqueCount = 0;\n }", "function topicButtons() {\n $(\"#buttons\").empty();\n $(\"#topicsCard\").hide();\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button class='btn'>\");\n b.addClass(\"eightiesButton\");\n b.attr(\"data-name\", topics[i]);\n b.text(topics[i]);\n if (b.attr(\"data-click\"))\n b.attr(\"data-click\")\n $(\"#buttons\").append(b);\n $(\"#topic_input\").val(\"80's\");\n }\n }", "function renderButtons() {\n // Deletes the movies prior to adding new movies\n $('.buttons-view').empty();\n // Loops through the array of topics to create buttons for all topics\n for (var i = 0; i < topics.length; i++) {\n var createButtons = $('<button>');\n createButtons.addClass('topic btn btn-success');\n createButtons.attr('data-name', topics[i]);\n createButtons.text(topics[i]);\n $('.buttons-view').append(createButtons);\n }\n }", "createButtons() {\n this.settingsButton = this._createConnectionButton(TEXTURE_NAME_SETTINGS);\n this.deleteButton = this._createConnectionButton(TEXTURE_NAME_DELETE);\n }", "function createBtns() {\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button>\");\n btn.addClass(\"btn btn-outline-light\")\n btn.attr(\"value\", topics[i]);\n btn.text(topics[i]);\n $(\"#gif-btns\").append(btn);\n }\n }", "function renderButtons() {\n $(\"#button-list\").empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"place-button btn btn-outline-secondary btn-block custom-button\");\n button.attr(\"data-name\", topics[i].toUpperCase());\n button.attr(\"type\", \"button\");\n button.text(topics[i].toUpperCase());\n $(\"#button-list\").append(button);\n }\n}", "function buttonRendering() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < animalLists.length; i++) {\n //add a variable with new button\n var animalBtn = $(\"<button>\");\n\n animalBtn.text(animalLists[i]);\n\n animalBtn.addClass(\"animal\").attr(\"data-name\", animalLists[i]);\n\n $(\"#buttons-view\").append(animalBtn);\n\n }\n }", "function generateBtns() {\n for (i = 0; i < selectionsKeys.length; i++) {\n var btn = document.createElement('button')\n btn.type = 'button'\n btn.id = selectionsKeys[i]\n btn.innerText = selectionsKeys[i]\n btn.className = 'btn'\n btnWrapper.appendChild(btn)\n }\n}", "function buttonCreate() {\n // Delete previous buttons to avoid duplicates\n $(\"#buttons-view\").empty();\n $(\"#game-input\").val(\"\");\n\n // Looping through the array of games\n for (var i = 0; i < topics.length; i++) {\n\n // Create a button for each item in the array\n var a = $(\"<button>\");\n // Adding the class 'game' to the button\n a.addClass(\"game\");\n // Adding a data-attribute (this is how the data is passed from the button to the queryURL)\n a.attr(\"data-name\", topics[i]);\n // Providing the button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n\n }\n }", "function renderButtons() {\n // Deleting the buttons prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n // Then dynamically generating buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of animal to our button\n a.addClass(\"animal\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n } // end function renderButtons ", "function renderButtons() {\n\t\t$(\"#buttons\").empty();\n\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\tvar newButton = $(\"<button class='btn btn-default fButton'>\");\n\t\t\tnewButton.attr(\"data-name\", topics[i]);\n\t\t\tnewButton.text(topics[i])\n\t\t\t$(\"#buttons\").append(newButton);\n\t\t};\n\t}", "function displayButtons() {\n $(\"#myButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var newButton = $('<button class=\"btn btn-danger\">');\n newButton.attr(\"id\", \"topic\");\n newButton.attr(\"data-search\", topics[i]);\n newButton.text(topics[i]);\n $(\"#myButtons\").append(newButton);\n }\n }", "function renderButtons() {\n //makes button div empty\n $(\"#button-view\").empty();\n //creates a button for each topic in array, adds class and attribute populate buttons in div\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"music-btn\");\n a.attr(\"data-music-input\", topics[i]);\n a.text(topics[i]);\n $(\"#button-view\").append(a);\n\n }\n }", "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < pokemons.length; i++) {\n var button = $(\"<button>\").addClass(\"gif-btn p-2 m-1 btn btn-dark btn\").attr(\"data-name\", pokemons[i]).text(pokemons[i]);\n $(\"#buttons-view\").append(button);\n }\n }", "function commandButtons()\r\n{\r\n return new Array(MM.BTN_OK, \"clickedOK()\", \r\n MM.BTN_Cancel, \"clickedCancel()\", \r\n MM.BTN_Test, \"clickedTest()\", \r\n MM.BTN_Advanced, \"clickedAdvanced()\", \r\n MM.BTN_Help, \"displayHelp()\"); \r\n}", "function showButtons(){\n\n // for loop to go through the array and create the buttomns\n // need to add class and atributes and name\n // have to append the buttons in the webpage\n $(\"#button-list\").html(\"\"); // cleans the button list before a new buttom is added and showButtons function add back the buttons\n for (var i = 0; i < topics.length; i++) {\n var plugButton = $(\"<button>\");\n\n plugButton.addClass(\"mma\");\n plugButton.attr(\"data-name\", topics[i]);\n plugButton.text(topics[i]);\n $(\"#button-list\").append(plugButton);\n }\n }", "function pushButtons() {\n $(\"#buttons\").empty();\n for (let i = 0; i < buttonChoices.length; i++) {\n $(\"#buttons\").append(`<button type=\"button\" class=\"btn\" onClick=\"buttonClicked(this.id)\" id=\"${buttonChoices[i]}\">${buttonChoices[i]}</button>`);\n };\n}", "function displayButtons() {\n $(\".button-section\").empty();\n for (var i = 0; i < topics.length; i++) {\n $(\".button-section\").append(`<button class=\"btn btn-primary btn-sm mr-1 mb-1\" data-label=\"${topics[i]}\">${topics[i]}</button>`);\n }\n }", "function createButtons () {\n // first we need to empty the current giphs if any...\n $(\"#button-view\").empty();\n\n // now loop through 'topics' array and make a button for each\n for (i =0; i < topics.length; i++) {\n //now create a new button element, assign it a css class, and label it with the array value\n var newButton = $(\"<button>\");\n newButton = newButton.addClass(\"get-superhero btn btn-danger\").text(topics[i]);\n $(\"#button-view\").append(newButton);\n }\n }", "function renderButtons () {\n\t\t$(\".buttons-view\").empty();\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\tvar newButton = $(\"<button>\");\n\t\t\tnewButton.addClass(\"topic btn btn-default\");\n\t\t\tnewButton.attr(\"data-name\", topics[i]);\n\t\t\tnewButton.text(topics[i]);\n\t\t\t$(\".buttons-view\").append(newButton);\n\t\t}\n\t}", "function addButtons() {\n\t\tcreateButton(\"Outdent\");\n\t\tcreateButton(\"Indent\");\n\t}", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < selectionArray.length; i++) {\n var newButton = $(\"<button>\");\n newButton.addClass(\"button\");\n newButton.attr(\"data-name\", selectionArray[i]);\n newButton.text(selectionArray[i]);\n $(\"#buttons-view\").append(newButton);\n }\n }", "function displayButtons() {\n $(\"#myButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $('<button class=\"btn btn-primary\">');\n a.attr(\"id\", \"icon\");\n a.attr(\"data-search\", topics[i]);\n a.text(topics[i]);\n $(\"#myButtons\").append(a);\n\n }\n }", "function addExtraButtons () {\n\tmw.toolbar.addButtons(\n\t{\n\t\t'imageId': 'button-redirect',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_redirect.png', \n\t\t'speedTip': 'Redirect',\n\t\t'tagOpen': '#REDIRECT[[',\n\t\t'tagClose': ']]',\n\t\t'sampleText': 'Target page name'\n\t},\n\t{\n\t\t'imageId': 'button-strike',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_strike.png', \n\t\t'speedTip': 'Strike',\n\t\t'tagOpen': '<s>',\n\t\t'tagClose': '</s>',\n\t\t'sampleText': 'Strike-through text'\n\t},\n\t{\n\t\t'imageId': 'button-enter',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_enter.png', \n\t\t'speedTip': 'Line break',\n\t\t'tagOpen': '<br/>',\n\t\t'tagClose': '',\n\t\t'sampleText': ''\n\t}, \n\t\t'imageId': 'button-hide-comment',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_hide_comment.png', \n\t\t'speedTip': 'Insert hidden Comment',\n\t\t'tagOpen': '<!-- ',\n\t\t'tagClose': ' -->',\n\t\t'sampleText': 'Comment'\n\t}, \n\t{\n\t\t'imageId': 'button-blockquote',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_blockquote.png',\n\t\t'speedTip': 'Insert block of quoted text',\n\t\t'tagOpen': '<blockquote>\\n',\n\t\t'tagClose': '\\n</blockquote>',\n\t\t'sampleText': 'Block quote'\n\t},\n\t{\n\t\t'imageId': 'button-insert-table',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_insert_table.png',\n\t\t'speedTip': 'Insert a table',\n\t\t'tagOpen': '{| class=\"wikitable\"\\n|',\n\t\t'tagClose': '\\n|}',\n\t\t'sampleText': '-\\n! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3'\n\t},\n\t{\n\t\t'imageId': 'button-insert-reflink',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_reflink.png',\n\t\t'speedTip': 'Insert a reference',\n\t\t'tagOpen': '<ref>',\n\t\t'tagClose': '</ref>',\n\t\t'sampleText': 'Insert footnote text here'\n\t}\n\t);\n}", "function displaysButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button class='gifBtn'>\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n $(\"#buttons-view\").append(btn)\n\n }\n }", "function commandButtons()\n{ \n return new Array(MM.BTN_OK, \"okClicked()\",\n MM.BTN_Cancel, \"cancelClicked()\",\n MM.BTN_Help, \"displayHelp()\" );\n}", "function renderButtons() {\n\n // Delete the content inside the movies-view div prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n\n $(\"#animalButtons\").empty();\n\n\n // Loop through the array of animals, then generate buttons for each animal in the array\n\n for (i = 0; i < animals.length; i++) {\n var $input = $('<input type=\"button\" class=\"animalButton\" data-playon=\"click\" value=\"'+animals[i]+'\"data-name=\"'+animals[i]+'\" />');\n $input.appendTo($(\"#animalButtons\"));\n }\n }", "function renderButtons() {\n \n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button>\");\n b.addClass(\"topic-btn btn btn-info border\");\n b.attr(\"data-name\", topics[i]);\n b.text(topics[i]);\n $(\"#buttons-view\").append(b);\n }\n}", "function iMakeButtons() {\n $(\"#button-field\").empty();\n for (i = 0; i < topics.length; i++) {\n var but = $(\"<button>\")\n but.attr(\"data-name\", topics[i]);\n but.text(topics[i]);\n but.attr(\"class\", \"getGiphies\");\n but.appendTo(\"#button-field\");\n }\n }", "function generateButtons(){\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\tvar cityButtons = $(\"<button class= city-button value=\" + topics[i] + \">\" + topics[i] + \"</button>\");\n\t\t$(\"#buttons-div\").append(cityButtons);\n\t\t\t}\n\t}", "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < memes.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"meme\");\n // Adding a data-attribute\n a.attr(\"data-name\", memes[i]);\n // Providing the initial button text\n a.text(memes[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function addAnswerBtns() {\n\t\tfor (let k = 0; k < randAnswers.length; k++) {\n\t\t\t$(\"#answerArea\").append('<button class=\"btn btn-kelly answerBtn\"><li>' + randAnswers[k] + '</li></button>');\n\t\t\t// console.log(randAnswers[k]);\n\t\t}\n\t}", "function renderButtons() {\n\n //Empty the buttons. \n $(\"#buttons-view\").empty()\n\n // Loop to create the buttons\n for (var i = 0; i < gifs.length; i++) {\n $(\"#buttons-view\").append(\"<button class='bttn rounded bg-info border-0 text-white' value='\" + gifs[i] + \"'>\" + gifs[i] + \"</button>\")\n }\n}", "function makeButtons() {\n $(\"#buttons\").empty();\n\n //Loop through the array and create a button for each item\n for (var i = 0; i < topics.length; i++) {\n var btnDiv = $(\"<button>\");\n btnDiv.addClass(\"subject\");\n btnDiv.addClass(\"button\");\n btnDiv.attr(\"data-name\", topics[i]);\n btnDiv.text(topics[i]);\n $(\"#buttons\").append(btnDiv);\n }\n }", "function renderButtons () { \n\n\t\t// loops through the array of topics\n\t\tfor (var i = 0; i < topics.length; i++) {\n\n\t\t var a = $('<button>')\n\t\t a.addClass('topic button'); // add a class \n\t\t a.attr('data-name', topics[i]); // adds a data-attribute\n\t\t a.text(topics[i]); // initial button text\n\t\t $('#buttonsDiv').append(a); // add button to the HTML\n\t\t}\n\t}", "function createButtons() {\n\t$(\"#api-buttons\").empty();\n\tfor (i = 0; i < musicalInstruments.length; i++) {\n\t\tvar newButton = $(\"<button class='btn' id='new-button'>\");\n\t\tnewButton.text(musicalInstruments[i]);\n\t\tnewButton.attr(\"name\", musicalInstruments[i]);\n\t\t$(\"#api-buttons\").append(newButton);\n\t}\n}", "function renderButtons() {\n $(\"#buttons-view\").empty();\n for (i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"superheroes\");\n a.attr(\"data-name\", topics[i]);\n a.text(topics[i]);\n $(\"#buttons-view\").append(a);\n }\n}", "function renderButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n\n // Adding a class\n a.addClass(\"movie\");\n // Adding a data-attribute with a value of the topics at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the topics at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#buttons-view\").append(a);\n }\n}", "function buttonExpress(){\n $('#buttonsView').empty();\n \n for ( var i=0; i < topics.length; i++) {\n // the lines below are needed because we are making the buttons and what they will be doing\n var a = $('<button>');\n a.addClass('expression');\n a.attr('data-name', topics[i]);\n a.text(topics[i]);\n $('#buttonsView').append(a);\n }\n }", "function loadButtons(arrayOfTopics) {\n $(\".buttonArea\").empty();\n\n arrayOfTopics.forEach(function(arrayItem) {\n $(\".buttonArea\").append(\n $(\"<button>\", {\n type: \"button\",\n class: \"btn btn-success btn-sm m-3 animalButton\",\n text: arrayItem.toUpperCase()\n }).on(\"click\", function() {\n // console.log(\"Clicked Animal Button : \" + $(this).text());\n getGifs($(this).text());\n })\n );\n });\n }", "function renderButtons(){ \n $(\"#animal-buttons\").empty();\n for (var i = 0; i < topics.length; i++){\n var newButton = $(\"<button>\") \n newButton.attr(\"class\", \"btn btn-default\");\n newButton.attr(\"id\", \"input\") \n newButton.attr(\"data-name\", topics[i]); \n newButton.text(topics[i]); \n $(\"#animal-buttons\").append(newButton); \n }\n }", "function buttonClicked(index) {\n var button = vm.buttons[index];\n if (vm.buttons.length > 1) {\n angular.forEach(vm.buttons, function (value) {\n value.selected = false;\n });\n button.selected = true;\n } else {\n button.selected = !button.selected;\n }\n if (button.onClickCallback) {\n button.onClickCallback(button.selected);\n }\n }", "function renderButtons(savedButtons) {\n $(\"#api-list\").empty();\n // Looping through the array of topics\n for (var i = 0; i < savedButtons.length; i++){\n $(\"#api-list\").append(\n addObj({\n type: \"button\"\n ,class: \"classApi\"\n ,text: savedButtons[i].name\n ,attr: [\n { a: \"api-name\", v: savedButtons[i].name}\n , { a: \"api-description\", v: savedButtons[i].description}\n , { a: \"api-owner\", v: savedButtons[i].owner}\n , { a: \"api-authors\", v: savedButtons[i].authors}\n , { a: \"api-docurl\", v: savedButtons[i].docurl}\n , { a: \"api-url\", v: savedButtons[i].url}\n , { a: \"api-param\", v: savedButtons[i].param}\n , { a: \"api-sample\", v: savedButtons[i].sample}\n , { a: \"api-index\", v: i}\n ]\n }\n )\n\n )}\n }", "function renderButtons() {\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie-btn to our button\n a.addClass(\"movie-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n console.log(buttonId);\n\n\t //$(this).closest(\"form\").submit();\n \n });\n}", "function createBtns() {\n console.log(\"hi\");\n\t\tfor(var i = 0; i < 4; i++) {\n var btn = $(\"<button>\");\n\t\t\tbtn.addClass(\"btn btn-warning\");\n\t\t\tbtn.addClass(\"choice\");\n\t\t\tbtn.attr(\"type\", \"button\");\n\t\t\tbtn.val(i);\n\t\t\tbtn.text(questions[index].choices[i]);\n console.log(\"btn\");\n\t\t\t$(\"#choices\").append(btn);\n\t\t}\n\t}", "function setBtns () {\n //wipe the div clean\n $(\"#buttonRow\").html(\"\");\n //then repopulate buttons\n for (i=0; i<topicArray.length; i++) {\n //console.log(topicArray[i]);\n var topicBtn = $('<button/>').attr(\"id\", topicArray[i]).attr(\"class\", \"select btnStyle\").text(topicArray[i]);\n $(\"#buttonRow\").append(topicBtn);\n };\n }", "function renderButtons() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"movie\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n\n $(\"#game-input\").val(\"\");\n\n $(\"#games-viewer\").empty();\n\n for (let i = 0; i < topics.length; i++) {\n var newBtn = $(\"<button>\");\n newBtn.text(topics[i]);\n newBtn.attr(\"data-name\", topics[i]);\n newBtn.addClass(\"gameBtn\");\n $(\"#games-viewer\").append(newBtn);\n }\n\n } /// renderButtons();", "function renderButtons() {\n\n // Deletes the gif prior to adding new ones\n $(\"#buttons-view\").empty();\n // Loops through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n var newButton = $(\"<button>\");\n \n newButton.addClass(\"sports\");\n \n newButton.attr(\"data-name\", topics[i]);\n \n newButton.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(newButton);\n }\n }", "function renderButtons() {\n\n // Deletes the topics prior to adding a new topic\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n _.each(topics, function (element) {\n // Then dynamicaly generates buttons for each topic in the array\n // console.log(topics);\n var btn = $(\"<button>\");\n btn.addClass(\"btn btn-primary btn-md topic-btn\");\n btn.attr(\"data-name\", element);\n btn.text(element);\n $(\"#buttons-view\").append(btn);\n });\n }", "function renderButtons() {\n $(\"#animal-btns\").empty();\n \n // Goes through Array to create each individual button\n for (var j = 0; j < topics.length; j++) {\n var newBtn = $(\"<button>\");\n newBtn.addClass(\"animal-btn\");\n newBtn.attr(\"data-animal\", topics[j]);\n newBtn.text(topics[j]);\n\n // addes button to the DOM to be displayed\n $(\"#animal-btns\").append(newBtn);\n }\n }", "function renderButtons() {\n $(\"#queryButtons\").empty();\n for (var j = 0; j < topics.length; j++) {\n var myButton = $(\"<button class='btn btn-secondary search-button'style=margin:2px;>\");\n $(myButton).text(topics[j]);\n $(myButton).attr(\"value\", topics[j]);\n $(buttonArray).push(myButton);\n $(\"#queryButtons\").append(myButton);\n\n }\n}", "function createButtons() {\n\t\tvar buttonHTML = '<input id=\"CustomNextButton\" class=\"FakeButton Button\" title=\"→\" ' \n\t\t+ 'type=\"button\" name=\"CustomNextButton\" value=\"→\" aria-label=\"Next\">'\n\t\t+ '<input id=\"ShowAnswerButton\" style = \"display:none\" class=\"FakeButton Button\" title=\"Show Answer\" ' \n\t\t+ 'type=\"button\" name=\"ShowAnswerButton\" value=\"Show Answer\" aria-label=\"Show Answer\">'\n\t\t+ '<style>.Total {display: none !important;}</style>';\n\t\tjQuery('#showbuttons').append(buttonHTML);\n\t}", "function renderButtons() {\n $(\"#topics-view\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topic\");\n a.attr(\"data-topic\", topics[i]);\n a.text(topics[i]);\n $(\"#topics-view\").append(a); \n }\n }", "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#gifs-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < gifs.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"movie\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", gifs[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(gifs[i]);\n // Adding the button to the HTML\n $(\"#gifs-view\").append(a);\n }\n }", "listenForButtons() {\n this._qsAll(\".button-link\").forEach((item) => {\n item.addEventListener(\"click\", () => {\n item.classList.remove(\"primary-button\");\n this._qsAll(\".button-link\").forEach((btn) => {\n btn.classList.remove(\"danger-button\");\n });\n item.classList.add(\"danger-button\");\n });\n });\n }", "function renderButtons() {\n\t$(\".moviesButton\").empty();\n\t$(\".moviesButton\").append(\"<h3>Movies Suggestions</h3>\");\n\tfor (var i = 0; i < topics.length; i++){\n\t\tvar newButton = $(\"<button>\").attr(\"data-movie\", topics[i]).attr(\"class\", \"movieButton\" + [i]).html(topics[i]);\n\t\t$(\".moviesButton\").append(newButton);\n\n\t}\n}", "function renderButtons() {\n // empties button area to avoid dups\n $(\"#buttons\").empty();\n\n // iterates thru movies array \n for (var i = 0; i < movies.length; i++) {\n var button = $(\"<button>\");\n button.html(movies[i]);\n\n button.attr({\n id: \"movie-btn\",\n value: movies[i],\n class: \"btn btn-outline-danger\",\n });\n $(\"#buttons\").append(button)\n\n }\n}", "function writeStartButtons() {\n $buttonBox.empty().show().append(\"<h2>Pick Your Topic</h2>\");\n for (var button of startButtons) {\n let newStartButton = $(\"<button>\")\n .attr(\"id\", button.id)\n .attr(\"class\", \"mx-2 rounded p-2\")\n .text(button.text)\n .on(\"click\", loadQuiz);\n $buttonBox.append(newStartButton);\n }\n }", "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttonspace\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"topic\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\"#buttonspace\").append(a);\n\n \n }\n }", "function renderButtons() {\r\n // Prevent repeat buttons\r\n $(\"#buttons-view\").empty();\r\n // Loop through superHeroes array\r\n for (var i = 0; i < superHeroes.length; i++) {\r\n // Assign variable to create <button> tag\r\n var hero = $(\"<a>\");\r\n // Add attributes and classes\r\n $(hero).attr(\"id\", \"hero-button\");\r\n hero.addClass(\"hero collection-item waves-effect yellow btn-medium hoverable\");\r\n $(hero).attr(\"type\", \"submit\");\r\n hero.attr(\"data-name\", superHeroes[i]);\r\n hero.text(superHeroes[i]);\r\n // Add buttons to HTML\r\n $(\"#buttons-view\").append(hero);\r\n }\r\n }", "function createButtons () {\n\n $(\"#buttonGroup\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n\n var buttons = $(\"<button>\");\n\n buttons.addClass(\"music btn-primary\");\n\n buttons.attr(\"data-name\", topics[i]);\n\n buttons.text(topics[i]);\n\n $(\"#buttonGroup\").append(buttons);\n\n }\n\n }", "function renderButtons() {\n // Deleting the buttons prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of cities\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly generating buttons for each city in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of gif to our button\n a.addClass(\"gif_button btn btn-outline-info \");\n \n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n };\n}", "function renderButtons() {\n\n // Deleting the topics prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons):\n $(\"#buttons-view\").empty();\n\n // Looping through the array of topics:\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each topic in the array.\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of topic-btn to our button\n a.addClass(\"topic-btn\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topic.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"gif\");\n\n a.attr(\"data-name\", topic[i]);\n\n a.text(topic[i]);\n\n $(\"#buttons-view\").append(a);\n }\n}", "function createButtons() {\n\n //Empty the buttons div so we don't create duplicate sets when adding new buttons\n $('#memeButtonsDiv').empty();\n\n //for loop to go through each item of the topics array and creating a button for that item\n\n for (i = 0; i < topics.length; i++) {\n var memeButton = $('<button>'); \n memeButton.addClass('btn btn-info memeButtonClass'); //adding classes for CSS\n memeButton.attr('data-memename', topics[i]); //adding a memeName data attribute which will be the search item\n\n memeButton.text(topics[i]); \n $(\"#memeButtonsDiv\").append(memeButton); //appending to our HTML div\n }\n }", "function renderButtons() {\n\n // Deleting the buttons prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < movies.length; i++) {\n\n // Then dynamicaly generating buttons for each movie in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of movie to our button\n a.addClass(\"movie\");\n // Adding a data-attribute\n a.attr(\"data-name\", movies[i]);\n // Providing the initial button text\n a.text(movies[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n }", "function renderButtons() {\n \n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#animals\").empty();\n // Looping through the array of movies\n for (var i = 0; i < animals.length; i++) {\n // Then dynamicaly generating buttons for each movie in the array.\n // This code $(\"<button>\") is all jQuery needs to create the start and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"animal-button\");\n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", animals[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(animals[i]);\n // Adding the button to the HTML\n $(\"#animals\").append(a);\n }\n }", "function renderButtons() {\n\n // Deleting the buttons prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#topics-container\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamically generating buttons for each topic in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of topic to our button\n a.addClass(\"topic\");\n a.addClass(\"btn btn-success\");\n // Adding a data-attribute\n a.attr(\"data-search-item\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#topics-container\").append(a);\n }\n }", "function addMainButonsMultiple(){\n var obj = $(tdpersonnalised.mainButtonDiv);\n\n obj.append(\"<button disabled title='\"+tdpersonnalised.ToSavetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.ToSaveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.ToSaveglyph +\"\\\" aria-hidden=\\\"true\\\">\"+tdpersonnalised.ToSavetext+\"</span></button>\");\n\n\n }", "function renderButtons() {\n\n // Clear all of the buttons so that buttons don't repeat\n $(\".buttons\").empty();\n\n // Looping through the array of pokemon\n for (var i = 0; i < pokemon.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"btn btn-info poke-btn\");\n a.attr(\"data-name\", pokemon[i]);\n a.text(pokemon[i]);\n\n $(\".buttons\").append(a);\n }\n }", "async process_button_actions() {\n\n if (!this._blockkit_conifg.block_kit.actions && this._blockkit_conifg.block_kit.actions.length === 0){\n return null;\n }\n\n const actions_template = this._blockkit_conifg.block_kit.actions;\n\n const result = {};\n result.type = \"actions\";\n result.elements = [];\n\n for (const template_index in actions_template) {\n const template_value = actions_template[template_index];\n\n result.elements.push({\n type: \"button\",\n text: {\n type: \"plain_text\",\n emoji: true,\n text: template_value.text\n },\n style: template_value.style,\n value: template_value.value\n })\n }\n\n return result;\n }", "function renderButtons() {\n\n // Deletes the animal prior to adding new animals\n $(\"#animalButtons\").empty();\n\n // Loops through the array of animals\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generates buttons for each animal in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n\n // Adds a class of animals to our button\n a.addClass(\"animals\");\n\n // Added a data-attribute\n a.attr(\"data-name\", topics[i]);\n\n // Provided the initial button text\n a.text(topics[i]);\n\n // Added the button to the buttons-view div\n $(\"#animalButtons\").append(a);\n\n }\n }", "function BeatlesButtons(beatlesList)\n{\n for (var i = 0; i < beatlesList.length; i++) {\n buttonBox.innerHTML += \"<button onClick=\"+beatlesList[i][1]+\">\" + beatlesList[i][0] + \"</button>\";\n };\n}", "function renderButtons() {\n\n // Deletes the athletes prior to adding new athletes\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n for(var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generates buttons for each athlete in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var athleteAdd = $(\"<button>\");\n // Adds a class of athlete to our button\n athleteAdd.addClass(\"athlete\");\n // Added a data-attribute\n athleteAdd.attr(\"data-name\", topics[i]);\n // Provided the initial button text\n athleteAdd.text(topics[i]);\n // Added the button to the buttons-view div\n $(\"#buttons-view\").append(athleteAdd);\n }\n }", "function multiClicked(ticket_id, test_id, q, aid, gid, fid, sid) {\n\t\n\tvar a = prepareValueMulti(gid, aid);\n\tvar ja = JSON.stringify( a );\n\n\t// observe and submit all buttons values in one go\n\tsubmitMulti(q, ja, ticket_id, test_id, sid);\n\talignValue(fid, q, a);\n\n}", "function renderButtons(){ \n\n\t\t// Deletes the movies prior to adding new movies (this is necessary otherwise you will have repeat buttons)\n\t\t$('#moviesView').empty();\n\n\t\t// Loops through the array of movies\n\t\tfor (var i = 0; i < movies.length; i++){\n\n\t\t\t// Then dynamicaly generates buttons for each movie in the array\n\n\t\t\t// Note the jQUery syntax here... \n\t\t var a = $('<button>') // This code $('<button>') is all jQuery needs to create the beginning and end tag. (<button></button>)\n\t\t a.addClass('movie'); // Added a class \n\t\t a.attr('data-name', movies[i]); // Added a data-attribute\n\t\t a.text(movies[i]); // Provided the initial button text\n\t\t $('#moviesView').append(a); // Added the button to the HTML\n\t\t}\n\t}", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function renderButtons() {\n\n // Deleting buttons prior to adding movies\n // or you will have topics that repeat themselves\n $(\"#buttons-view\").empty();\n\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamically generating buttons for each topic in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of to our button\n a.addClass(\"topic\");\n // Adding a data-attribute\n a.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(a);\n }\n}", "function makeButtons() {\n\t\t//remove comment wbelow\n // Delete the content inside the movies-view div prior to adding new movies\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons\").empty();\n\n\n // use a loop that appends a button for each string in the array\n for (var i = topics.length - 1; i >= 0; i--) { // or var i = 0; i < topics.length; i++\n console.log(topics[i]);\n $(\"#buttons\").append(\"<button>\" + topics[i] + \"</button>\");\n }\n }", "function renderButtons(){\n $('#cities').empty();\n for (var index = 0; index < cities.length; index++) {\n var a = $('<button>');\n a.addClass(\"city\");\n a.attr(\"data-name\", cities[i]);\n a.text(cities[i]);\n $(\"#cities\").append(a);\n }\n }", "function commandButtons()\r\n{\r\n return new Array(MM.BTN_OK, \"clickedOK()\",\r\n MM.BTN_Cancel, \"window.close()\",\r\n MM.BTN_Help, \"displayHelp()\");\r\n}", "function renderButtons() {\n\n // Deleting the movie buttons prior to adding new movie buttons\n // (this is necessary otherwise we will have repeat buttons)\n $(\".movie-buttons-view\").empty();\n\n // Looping through the array of movies\n for (var i = 0; i < topics.length; i++) {\n\n // Dynamicaly generate buttons for each movie in the array.\n \n var a = $(\"<button>\");\n // Adding a class\n a.addClass(\"movie\");\n \n // Adding a data-attribute with a value of the movie at index i\n a.attr(\"data-name\", topics[i]);\n // Providing the button's text with a value of the movie at index i\n a.text(topics[i]);\n // Adding the button to the HTML\n $(\".movie-buttons-view\").append(a);\n // console.log(topics[i]);\n }\n }", "function createBtn() {\n for (i = 0; i < topics.length; i++) {\n buttonsDiv.append(\"<button tvShow='\" + topics[i] + \"'>\" + topics[i] + \"</button>\");\n }\n}", "function addButtonLine(){\n var obj = tdpersonnalised.myTable.find(tdpersonnalised.actionCell);\n $.each(obj,function(){\n $(this).append(\"<button title='\"+tdpersonnalised.modifiedtitle+\"' class=\\\"\"+ tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.modifiedclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.modifiedglyph +\"\\\" aria-hidden=\\\"true\\\"></span></button>\");\n\n $(this).append(\"<button title='\"+tdpersonnalised.ToSavetitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.ToSaveclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.ToSaveglyph +\"\\\" aria-hidden=\\\"true\\\"></span></button>\");\n\n $(this).append(\"<button title='\"+tdpersonnalised.canceltitle+\"' class=\\\"\" + tdpersonnalised.buttunClass+ \" \" + tdpersonnalised.cancelclass +\"\\\"><span class=\\\"\"+ tdpersonnalised.cancelglyph +\"\\\" aria-hidden=\\\"true\\\"></span></button>\");\n });\n\n obj.children(\"button:nth-child(2),button:nth-child(3)\").hide();\n\n }", "function renderButtons() {\n\t//clears the array so they don't duplicate.\n\t$(\"#topicButtons\").empty();\n\n\t//runs loop so that buttons are created for each new item in the array\n\tfor (var i=0; i< topics.length; i++) {\n\t\t$(\"<button>\").addClass(\"foods\")\n\t\t.attr(\"id\", topics[i])\n\t\t.text(topics[i])\n\t\t.appendTo(\"#topicButtons\")\n\t}\n}", "function questionsAnswers (arr) {\n for (i = 0; i < arr.length; i++) {\n var button = $(\"<button>\");;\n button.text(arr[i]);\n button.addClass(\"button\");\n button.attr({\"selection\": arr[i]});\n $(\"#choices\").append(button);\n \n }\n}", "function addButtons() {\n const docFrag = document.createDocumentFragment();\n const li = document.createElement('li');\n\n for (let i = 0; i < cars.length; i++) {\n li.appendChild(createButton(cars[i].name));\n docFrag.appendChild(li);\n }\n\n mainMenu.appendChild(docFrag);\n }", "function renderButtons() {\n // Deletes the animal prior to adding new animal\n $('#animal-btn').empty();\n \n // Display current animals button\n for (let i=0; i< animals.length; i++){\n $('#animal-btn').append(\n `\n <td><button type=\"button\" class=\"btn btn-info animalbtn\" data-value=\"${animals[i]}\">${animals[i]}</button></td>\n `\n )\n } \n}", "function createButtons() {\n $(\"#newButton\").empty();\n\n for (i = 0; i < pokemonArray.length; i++) {\n\n var butt = $(\"<button>\");\n butt.addClass(anime);\n butt.attr(\"data-type\", pokemonArray[i]);\n butt.text(pokemonArray[i]);\n $(\"#newButton\").append(butt);\n\n }\n }", "function makeButtons() {\n\n\t\t// clear the div\n\t\t$(\"#buttons-view\").empty();\n\n\t\t// Looping through the array of movies\n\t\tfor (var i = 0; i < buttons.length; i++) {\n\n\t\t\t// let's make some buttons!!\n\t\t var newButton = $(\"<button>\");\n\t\t // Adding a class of movie to our button\n\t\t newButton.addClass(\"animals\");\n\t\t // Adding a data-attribute\n\t\t newButton.attr(\"data-name\", buttons[i]);\n\t\t // Providing the initial button text\n\t\t newButton.text(buttons[i]);\n\t\t // Adding the button to the buttons-view div\n\t\t $(\"#buttons-view\").append(newButton);\n\t\t}\n\t}" ]
[ "0.70928854", "0.67460716", "0.6719908", "0.6683398", "0.6661771", "0.66613513", "0.66190964", "0.66090167", "0.65979743", "0.6593504", "0.65918374", "0.65796083", "0.65647703", "0.6556902", "0.6543043", "0.65369725", "0.6535326", "0.65278953", "0.6520761", "0.6519906", "0.650356", "0.6499949", "0.64997166", "0.6499034", "0.6492356", "0.6489318", "0.64777535", "0.6476192", "0.6470431", "0.64677763", "0.64599895", "0.6456186", "0.6453961", "0.6450412", "0.6449341", "0.64448494", "0.6442457", "0.64369804", "0.64261043", "0.6413583", "0.6408991", "0.640659", "0.63977337", "0.6395722", "0.6393845", "0.6386898", "0.638599", "0.63855964", "0.6384262", "0.63790995", "0.637543", "0.6374773", "0.63744265", "0.6374233", "0.6370401", "0.63681656", "0.63641965", "0.6362346", "0.6355174", "0.6350808", "0.6350071", "0.63478607", "0.634779", "0.6344252", "0.63405377", "0.6336147", "0.6333836", "0.63335586", "0.63243556", "0.63239735", "0.6317461", "0.63134694", "0.6313331", "0.6311426", "0.6307181", "0.63070744", "0.6306653", "0.63019246", "0.63016576", "0.6300078", "0.6300056", "0.62915474", "0.6280446", "0.6270911", "0.626785", "0.6267759", "0.6266252", "0.6265819", "0.62649024", "0.62645406", "0.6258461", "0.6254061", "0.6253191", "0.62519765", "0.6248507", "0.62474865", "0.6245748", "0.62451947", "0.6243756", "0.62431526", "0.624139" ]
0.0
-1
Lists the configurations. url: the search endpoint.
function listConfigurations(url){ if (!url) { // default search endpoint url = Config.CONFIGURATION_URL; } $.ajax({ url: url, cache: false, }) .done(function(data, textStatus, jqXHR){ // generate pagination on UI paginate(jqXHR); // clear the existing data on results table and add new page var tbody = $('table#configurations tbody'); var table = $('table#configurations').DataTable(); table.clear(); table.rows.add(data).draw(); $('div#spinner').css('display', 'none'); $('div#search-config').css('display', 'block').fadeIn(1500); // set message if no results returned from this url.. $('td.dataTables_empty').html('No configuration files found.'); // enable checkboxes on selections $(selections).each(function(idx, selection){ $('input[id="' + selection.uid + '"]').prop('checked', true); toggleCheckboxes(selection, true); }); // bind a listener to the selection checkboxes $('input[name="config"]').on('change', function(e){ var isSelected = $(e.target).is(':checked'); var uid = e.target.id; var type = e.target.getAttribute('data-type'); var filename = e.target.getAttribute('data-filename'); var published = e.target.getAttribute('data-published') === true ? 'Published' : 'Private'; if (isSelected) { var selection = {} selection['uid'] = uid; selection['config_type'] = type; selection['filename'] = filename; selection['published'] = published; selections.push(selection); toggleCheckboxes(selection, true); if (type === 'PRESET') { $(document).trigger({type: 'preset:selected', source: 'config-browser'}); } } else { $(selections).each(function(idx, selection){ if (selection.uid === e.target.id) { selections.splice(idx, 1); toggleCheckboxes(selection, false); } }); if (type === 'PRESET') { $(document).trigger({type: 'preset:deselected', source: 'config-browser'}); } } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listConfigurations(url){\n if (!url) {\n // default search endpoint\n url = Config.CONFIGURATION_URL;\n }\n $.ajax({\n url: url,\n cache: false,\n })\n .done(function(data, textStatus, jqXHR){\n // generate pagination on UI\n paginate(jqXHR);\n\n // clear the existing data on results table and add new page\n var tbody = $('table#configurations tbody');\n var table = $('table#configurations').DataTable();\n table.clear();\n table.rows.add(data).draw();\n $('div#spinner').css('display', 'none');\n $('div#search-config').css('display', 'block').fadeIn(1500);\n // set message if no results returned from this url..\n $('td.dataTables_empty').html('No configuration files found.');\n\n // handle delete events on table rows..\n $('.delete-file').bind('click', function(e){\n var that = $(this);\n var data = new FormData();\n data.append('_method', 'DELETE');\n var uid = e.target.id;\n console.log(uid);\n $.ajax({\n url: Config.CONFIGURATION_URL + '/' + uid,\n type: 'POST',\n data: data,\n contentType: false,\n processData: false,\n beforeSend: function(jqxhr){\n // set the crsf token header for authentication\n var csrftoken = $('input[name=\"csrfmiddlewaretoken\"]').val();\n jqxhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n },\n success: function(result, textStatus, jqxhr) {\n // handle deletion on the table..\n var row = table.row('#' + uid);\n $(row.node()).css('background-color', '#f2dede');\n $(row.node()).fadeOut(400, function(){\n runSearch();\n });\n row.remove();\n }\n });\n });\n });\n }", "function runSearch(){\n var url = Config.CONFIGURATION_URL + '?';\n url += searchForm.serialize();\n listConfigurations(url); // update results table\n }", "function runSearch(){\n var url = Config.CONFIGURATION_URL + '?';\n url += searchForm.serialize();\n listConfigurations(url); // update results table\n }", "function config (url) {\n const requests = []\n const _url = new URL('http://example.com' + url)\n\n // Configure the requests\n switch (_url.pathname) {\n case '/assets':\n requests.push({ key: 'assets', config: configRequest('/0/public/Assets') })\n break\n\n // https://www.kraken.com/features/api#get-ohlc-data\n case '/history': {\n const params = {\n pair: _url.searchParams.get('symbol') + 'USD',\n interval: _url.searchParams.get('interval'),\n }\n requests.push({ key: 'history', config: configRequest('/0/public/OHLC', params) })\n break\n }\n\n default:\n console.error(url)\n }\n return requests\n}", "function list(appName, callback) {\n var uri = format('/%s/apps/%s/config/', deis.version, appName);\n commons.get(uri, function onListResponse(err, result) {\n callback(err, result ? result.values : null);\n });\n }", "function config (url) {\n const requests = []\n const _url = new URL('http://example.com' + url)\n\n // Configure the requests\n switch (_url.pathname) {\n // https://docs.bitfinex.com/reference#rest-public-candles\n case '/candles': {\n const timeframe = '1m' // '1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1D', '7D', '14D', '1M'\n const section = 'hist' // 'hist', 'last'\n const symbol = _url.searchParams.get('symbol')\n const pair = symbol + 'USD'\n const params = {\n // limit: 3,\n }\n requests.push({\n key: 'candles',\n config: configRequest(`/candles/trade:${timeframe}:t${pair}/${section}`, params),\n })\n break\n }\n\n default:\n console.error(url)\n }\n return requests\n}", "getAll() {\n let urlFull = this.controler;\n return BaseAPIConfig.get(urlFull);\n }", "function renderConfigList(req, res) {\n\tvar httpout = \"\";\n\t//res.set('Content-Type', 'text/html');\n\tfs.readdir(\"config/\", function(err, files) {\n\t\tfiles.forEach(function(file) {\n\t\t\thttpout += ((file == configFileName) ? \"<b>\" : (\"<a href=\\\"\" + file + \"\\\">\"))\n\t\t\t\t+ file \n\t\t\t\t+ ((file == configFileName) ? \"</b>\" : \"</a>\")\n\t\t\t\t+ \"<br>\";\n\t\t});\n\t\tsendResponse(res, 200, \"text/html\", \"h1>Avaiable configs:</h1>\" + httpout);\n\t});\n}", "function configuration($stateProvider, $urlRouterProvider) {\n $urlRouterProvider.otherwise(\"/\");\n\n $stateProvider\n .state('search', {\n url: '',\n templateUrl: 'partials/search.html'\n })\n .state('list', {\n url: '/results?s',\n templateUrl: 'partials/list.html',\n controller: 'AppController as ctrl'\n })\n\n}", "list() {\n let config = this.readSteamerConfig();\n\n for (let key in config) {\n if (config.hasOwnProperty(key)) {\n this.info(key + '=' + config[key] || '');\n }\n }\n\n }", "async function getUrlConfigsArray(address){\r\n _address = address;\r\n //online query..\r\n var numHolders = await getNumberOfHolders(address);\r\n \r\n var numPages = Math.floor(numHolders / 40); //Also 'result.page.totalVotes'\r\n var url_configs = [];\r\n for(var i=0 ; i<=numPages; i++){ \r\n url_configs.push(composeRequestConfig(i*40, address)); //will be added as url parameter: ...&start=i*40...\r\n } \r\n //console.log(JSON.stringify(url_configs));\r\n return { \"_url_configs\": url_configs, \"total\": numHolders};\r\n}", "function getUrlParameters() {\n var params = location.search.slice(1).split('&');\n\n var targetUrl = \"\";\n var configUrl = \"\";\n\n for (var i =0; i < params.length; i++) {\n var param = params[i];\n if (param.split('=')[0] == 'target') {targetUrl = param.split('=')[1]}\n if (param.split('=')[0] == 'config') {configUrl = param.split('=')[1]}\n }\n\n // read default configuration\n $.ajax({\n type: \"GET\",\n url: \"config/default.json\",\n dataType: \"json\",\n async: false,\n success: function(data) {\n setConfig(data);\n },\n error: function() {\n alert(\"Could not read default configuration. Consult the administrator.\");\n }\n });\n\n if (configUrl != \"\") {\n $.ajax({\n type: \"GET\",\n url: configUrl,\n dataType: \"json\",\n crossDomain: true,\n success: function(data) {\n setConfig(data);\n getAnnotationFrom(targetUrl);\n },\n error: function() {\n alert('could not read the configuration from the location you specified.');\n }\n });\n } else {\n getAnnotationFrom(targetUrl);\n }\n }", "get configs() {\n\t\treturn this._configs;\n\t}", "function configureSearch(state) {\n var configFile = state.environment.path.concat(['build', 'client', 'search', 'config.json']).join('/');\n return fs.readJson(configFile,\n function (err, config) {\n var target = state.config.targets.deploy;\n config.setup = target;\n return fs.outputJson(configFile, config);\n }\n );\n}", "function expressGETConfig(){\r\n app.get('/api/config',(req,res) =>{\r\n res.json(currentConfig.TAG_LIST);\r\n });\r\n //console.log(\"2a. GET to Server\");\r\n}", "get(url, config = {}) {\n return this.request({\n ...this.model.globalJsonApiConfig,\n ...this.model.jsonApiConfig,\n method: 'get', url,\n ...config,\n });\n }", "function getConfig(){\n $.get('/config', function(data){\n config = data;\n }).done(function(){getList();});\n}", "config() {\n this.router.get('/', domiciliosController_1.domiciliosController.list);\n this.router.get('/:id', domiciliosController_1.domiciliosController.getOne);\n this.router.post('/', domiciliosController_1.domiciliosController.create);\n this.router.delete('/:id', domiciliosController_1.domiciliosController.delete);\n this.router.put('/:id', domiciliosController_1.domiciliosController.update);\n }", "getComscoreSites(cb) {\n //get all sites /sites\n let self = this;\n this.getGlobalConfig((err) => {\n if (err) cb(err);\n let sites = [];\n self.services.forEach((row) => {\n sites.push('/sites/' + row.site);\n });\n cb(null, sites);\n });\n }", "function search(config) {\n var settings = config.settings,\n filters = config.filters;\n\n historyView.displayThrobber();\n\n EHistory.search({\n text: settings.text || '',\n startTime: new Date(settings.startTime || 0).getTime() ,\n endTime: new Date(settings.endTime || Date.now()).getTime(),\n maxResults: historyModel.pageSize\n }, filters, function(results){\n historyModel.append(results);\n });\n }", "function getList(){\n\t$.get('/hosts', function(hostList){\n\t\thosts = hostList;\n\t\t$('#pages').empty();\n for(var key in hostList){\n \tvar ports = hostList[key]['port'];\n \tif(typeof hostList[key]['port'] === 'string') ports = hostList[key]['port'].split(', ');\n \tfor(var port in ports) {\n var div = $('<div id=' + hostList[key]['ip'] + '-' + ports[port] + ' class=\"host\"><p>' + hostList[key]['reverse'] + '</p></div>');\n if (hostList[key]['thumbnails']) addThumbnail(div, ports[port], hostList[key]['thumbnails'], key);\n $(div).click(redirect);\n $('#pages').append($(div));\n }\n }\n\t})\n\t\t.done(function(){\n\t\t\twriteConfig();\n\t\t});\n}", "_fetchConfig() {\n $.getJSON('assets/autocomplete/commandAutocompleteConfig.json')\n .done((response) => this.onConfigFetchedHandler(response))\n .fail((jqXHR) => console.error(`Failed to load autocomplete configuration: ${jqXHR.status}: ${jqXHR.statusText}`));\n }", "async function getPathConfig(url) {\n let promises = [getPageConfig(url)];\n for (const fileName of LITE_FILES) {\n promises.unshift(getLiteConfig(url, fileName));\n }\n return Promise.all(promises);\n}", "async getEvents(config) {\n return this.list(config);\n }", "async function getList (url) {\n const options = {\n uri: url,\n transform: (body) => {\n return cheerio.load(body);\n }\n };\n let list = [];\n await rp(options)\n .then(async ($) => {\n\n // get libraries\n $('.im-title').each((i, element) => {\n const href = $(element.children[1]).attr('href').split('/')[1];\n list.push(href);\n });\n\n // navigate to next page\n const next = $('.search-nav').children().last();\n if (!next.hasClass('current')) {\n const nextPage = next.children().last().attr('href');\n list = list.concat(await getList(repository + nextPage));\n }\n });\n\n return list;\n}", "async function getList (url) {\n const options = {\n uri: url,\n transform: (body) => {\n return cheerio.load(body);\n }\n };\n let list = [];\n await rp(options)\n .then(async ($) => {\n\n // get libraries\n $('.im-title').each((i, element) => {\n const href = $(element.children[1]).attr('href').split('/')[1];\n list.push(href);\n });\n\n // navigate to next page\n const next = $('.search-nav').children().last();\n if (!next.hasClass('current')) {\n const nextPage = next.children().last().attr('href');\n list = list.concat(await getList(repository + nextPage));\n }\n });\n\n return list;\n}", "function getConfig(cb) {\n\t\tvar url = '/config_'+(nodeIndex+1).toString();\n\t\t$.get(url, function(data, status){\n\t\t\tif(status == 'success'){\n\t\t\t\tcb(null, data);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log('[Error] /config API return status :'+status);\n\t\t\t\tcb({error: status}, null);\n\t\t\t}\n\t\t});\n\t}", "function listAllConfigs() {\n\n\t// list the title\n\tconsole.log( \"Available .gitconfig files:\\n\" );\n\n\t// return the symbolic link value\n\tfs.readlink( GITCONFIG, ( err, linkString ) => {\n\n\t\t// get the symbolic link value\n\t\t// -- returns the actual file name\n\t\tlinkString = linkString && path.basename( linkString );\n\n\t\t// read the contents of the directory\n\t\tfs.readdirSync( GITCONFIGS ).forEach( ( configurations ) => {\n\t\t\tif( configurations[ 0 ] !== '.' ) {\n\n\t\t\t\t// list the file names\n\t\t\t\t// -- if the active config mark it\n\t\t\t\tconsole.log(\n\t\t\t\t\t' %s %s',\n\t\t\t\t\tlinkString == configurations ? '>' : ' ',\n\t\t\t\t\tconfigurations\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t});\n}", "@GET(\"/list/:type\")\n\tlist(req, res)\n\t{\n\t\tlet type = req.params.type;\n\n\t\tTrackingSites.find({type: type, user: req.user._id}).then( result => {\n\t\t\tres.json({success: true, trackings: result});\n\t\t}).catch( error => {\n\t\t\tres.serverError(error);\n\t\t});\n\t}", "function ConfigurationItem(url,viewBoxSize){this.url=url;this.viewBoxSize=viewBoxSize||config.defaultViewBoxSize;}", "function viewConfiguration() {\n // public API\n this.configName = ''; // @public readonly\n this.where = ''; // @public readonly contains the SQL where-clause (if any)\n this.orderBy = ''; // @public readonly contains the SQL order by-clause (if any)\n this.createFullDOM = false; // @public\n this.skipSortArrows = false; // @public\n this.useOuterScroll = false; // @public @todo - possibly implement this\n\n // internal API (used internally and by interface files)\n this.initializing = true; // @public\n this.showTotals = false; // @internal\n this.cssFiles = []; // @internal\n this.dataStores = []; // @internal\n this.restrictToCategory = null; // @internal empty strings are a valid value, so null is used for default\n this.baseColumnConfigs = []; // @internal\n this.columnConfigs = []; // @internal\n this.filterHierarchy = []; // @internal\n\n // private\n this.lookupBaseColumns = []; // for performance. send itemName, get title\n this.dbPath = ''; // base path of the main datastore. used when excel-printing\n\n // shell functions that can be overridden\n this.convertDisplayValue = function () { }\n this.convertFilterOptionText = function () { }\n this.handleFilterOptions = function () { }\n this.overrideActiveFilterValue = function () { }\n this.refreshSummary = function () { }\n this.refreshBackgroundRows = function () { }\n this.refreshProgress = function () { }\n // misc callbacks\n this.preprocessData = null;\n this.translateWord = null;\n\n /* @public api */\n this.addColumns = function (columns) {\n var isArray = (Object.prototype.toString.call(columns) === '[object Array]');\n if (isArray) {\n for (var i = 0, l = columns.length; i < l; i++) {\n this.addColumnConfig(new columnConfig(columns[i]));\n }\n }\n else {\n this.addColumnConfig(new columnConfig(columns));\n }\n }\n /* @internal api */\n this.addBaseColumnConfig = function (cfg) { \n this.baseColumnConfigs.push(cfg);\n this.lookupBaseColumns[cfg.itemName] = cfg.title;\n }\n /* @private */\n this.addColumnConfig = function (cfg) {\n this.columnConfigs.push(cfg);\n //console.log(\"added a cfg. current qty: \" + this.columnConfigs.length);\n }\n /* @internal api */\n this.getColumnConfig = function (title) {\n title = title.toLowerCase();\n for (var i = 0, l = this.columnConfigs.length; i < l; i++) {\n if (this.columnConfigs[i].title.toLowerCase() === title)\n return this.columnConfigs[i];\n }\n return null;\n }\n /* @internal api */\n this.getBaseColumnTitleFromItemName = function (itemName) { \n return this.lookupBaseColumns[itemName];\n }\n\n /* @public api */\n this.addFilter = function (fieldName, filterValue) {\t\t// filterValue can be a value or an array of values\n if (fieldName === '') {\n console.log('<warning>filter must have a valid id. skipping');\n return;\n }\n var hierarchyIndex = 0;\n var filterObject = [{ FieldName: fieldName, FieldValue: filterValue }];\n hierarchyIndex++;\n alasql('SELECT * INTO filters FROM ?', [filterObject]);\n\n var index = this.filterHierarchy.indexOf(fieldName);\n if (index === -1) { // browser support for indexOf is limited; it is not supported in Internet Explorer 7 and 8.\n this.filterHierarchy.push(fieldName);\n }\n else {\n // fieldName already exists in the hierarchy list. do nothing\n }\n //printFilters();\n }\n\n /* @internal api */\n this.replaceFilter = function (fieldName, filterValue) {\t\t// filterValue can be a value or an array of values\n if (fieldName === '') {\n console.log('<warning>filter must have a valid name. skipping');\n return;\n }\n // do not call removeFilter() since that will remove from the filterHierarchy and it will be added last instead of keeping its current position\n var sql = 'DELETE FROM filters WHERE FieldName = \"' + fieldName + '\"';\n alasql(sql);\n this.addFilter(fieldName, filterValue);\n\n // replace can be called without addFilter first being replaced, so add it if missing\n var index = this.filterHierarchy.indexOf(fieldName);\n if (index === -1) {\n this.filterHierarchy.push(fieldName);\n }\n }\n\n /* @internal api */\n this.removeFilter = function (fieldName) {\n var sql = 'DELETE FROM filters WHERE FieldName = \"' + fieldName + '\"';\n alasql(sql);\n var index = this.filterHierarchy.indexOf(fieldName);\n if (index > -1) { // browser support for indexOf is limited; it is not supported in Internet Explorer 7 and 8.\n this.filterHierarchy.splice(index, 1); // removes it from the actual array\n }\n }\n /* @internal api */\n this.clearFilters = function () {\n var sql = 'DELETE FROM filters';\n alasql(sql);\n this.filterHierarchy.length = 0;\n }\n\n // returns an array with separate values (no arrays in the array)\n /* @internal api */\n this.getActiveFilterArray = function (fieldName) {\n var sql = 'SELECT FROM filters WHERE FieldName = \"' + fieldName + '\"';\n // get active filters. note that there can be more than one active filter for a field (if addFilter() has been called more than once)\n var arrFilterValues = alasql(sql);\n var resultsArray = [];\n for (var i = 0, l = arrFilterValues.length; i < l; i++) {\n var fieldValue = arrFilterValues[i].FieldValue; // can be either a string or an array\n var isArray = (Object.prototype.toString.call(fieldValue) === '[object Array]');\n if (isArray) {\n for (var j = 0, m = fieldValue.length; j < m; j++) {\n resultsArray.push(fieldValue[j]);\n }\n }\n else {\n resultsArray.push(fieldValue);\n }\n }\n return resultsArray;\n }\n\n // if alias is used but not category, category must be set to null\n /* @public api */\n this.addDataStore = function (url, category, alias) { // category and alias are optional\n alias = $.trim(alias);\n if (alias === '')\n alias = TABLE_DEFAULT; // set default table name when none is provided\n\n if (typeof category !== 'undefined' && category !== null) {\n this.dataStores.push({ url: url, alias: alias, category: category });\n }\n else {\n this.dataStores.push({ url: url, alias: alias });\n }\n }\n\n /* @public api */\n // used when adding raw data instead of providing a datasource\n this.addData = function (data, alias) {\n alias = $.trim(alias);\n if (alias === '')\n alias = TABLE_DEFAULT; // set default table name when none is provided\n\n this.dataStores.push({ data: data, alias: alias });\n }\n\n /* @public api */\n this.addCss = function (css) {\n this.cssFiles.push(css);\n }\n /* @internal api */\n this.getSourceDbUrl = function (storeIndex) {\n var view = viewConfig.dataStores[storeIndex].url.split(',')[0];\n return view.substring(0, view.lastIndexOf('/'));\n }\n /* @internal api */\n this.getSourceView = function (storeIndex) {\n var view = viewConfig.dataStores[storeIndex].url.split(',')[0];\n return view.substring(view.lastIndexOf('/') + 1);\n }\n\n /* @public api */\n this.setDbPath = function (dbPath) {\n this.dbPath = dbPath;\n }\n /* @public api */\n this.getDbPath = function () {\n return this.dbPath;\n }\n}", "getActiveConfigurations() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield Gestalt_1.Gestalt.get(`/bots/${this.bot.id}/clients/${this.type}`);\n });\n }", "function getConfPagina(conf){\n\ttry{\n\t\tvar lista = conf=='lista';\n\t\tif(conf===undefined) conf = getData('confpag', '');\n\t\tif(conf == 'dis') return null;\n\n\t\tvar url = document.location.href;\n\t\tvar pags = [];\n\t\tvar customs = getData('confpags', {}, 'custompages');\n\n\t\tif(conf && !lista){ //you want a specific one\n\t\t\tif(customs[conf]){\n\t\t\t\tvar pu = conf.substr(3);\n\t\t\t\tif(conf[1] == 'r') eval('pu='+pu);\n\t\t\t\telse pu = strToRegexp(pu);\n\n\t\t\t\tif(url.match(pu)){\n\t\t\t\t\tvar pag = parsearPaginaCustom(customs[conf]);\n\t\t\t\t\tpag.nombre = conf;\n\t\t\t\t\treturn pag;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(var i = 0; i < paginas.length; i++){\n\t\t\t\t\tpag = paginas[i];\n\t\t\t\t\tpu = pag.url;\n\t\t\t\t\tpu = (typeof(pu)=='string' ? 'ds:' : 'dr:') + pu;\n\t\t\t\t\tif(pu == conf){\n\t\t\t\t\t\tpag.nombre = conf;\n\t\t\t\t\t\treturn pag;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//can't find the one requested. If it was the one that had been configured, reset the conf\n\t\t\t//if(conf == getData('confpag', '')) delData('confpag');\n\t\t}\n\n\t\t//if not configured or the desired configuration was not found, first search customs\n\t\tfor(var p in customs){\n\t\t\tpu = p.substr(3);\n\t\t\tif(p[1] == 'r') eval('pu='+pu);\n\t\t\telse pu = strToRegexp(pu);\n\n\t\t\tif(url.match(pu)){\n\t\t\t\tpag = parsearPaginaCustom(customs[p]);\n\t\t\t\tpag.nombre = p;\n\t\t\t\tif(!lista) return pag;\n\t\t\t\tpags.push(p);\n\t\t\t}\n\t\t}\n\n\t\t//if still can't find (or want the list of all the confs that match), keep looking\n\t\tfor(i = 0; i < paginas.length; i++){\n\t\t\tpag = paginas[i];\n\t\t\tpu = pag.url;\n\t\t\tif(typeof(pu)=='string') pu = strToRegexp(pu);\n\n\t\t\tif(url.match(pu)){\n\t\t\t\tp = (typeof(pag.url)=='string' ? 'ds:' : 'dr:') + pag.url;\n\t\t\t\tpag.nombre = p;\n\t\t\t\tif(!lista) return pag;\n\t\t\t\tpags.push(p);\n\t\t\t}\n\t\t}\n\t\tif(!lista) return {nombre:''};\n\t\treturn pags;\n\t}\n\tcatch(e){\n\t\terror('getconfpag: ' , e);\n\t\treturn {};\n\t}\n}", "function getConfigs( args ){\n Y.log('Entering Y.doccirrus.api.incaseconfiguration.getConfigs', 'info', NAME);\n if (args.callback) {\n args.callback = require(`${ process.cwd() }/server/utils/logWrapping.js`)(Y, NAME)\n .wrapAndLogExitAsync(args.callback, 'Exiting Y.doccirrus.api.incaseconfiguration.getConfigs');\n }\n const\n { user, callback } = args,\n async = require( 'async' );\n async.series({\n inCaseConfig( next ){\n Y.doccirrus.api.incaseconfiguration.readConfig({\n user,\n checkPatientNumber: true,\n callback: next\n });\n },\n masterTabConfigs( next ){\n Y.doccirrus.mongodb.runDb({\n user,\n model: 'mastertabconfig',\n action: 'get',\n query: {},\n options: {\n sort: {\n _id: -1\n },\n limit: 2\n }\n }, next );\n }\n }, callback );\n }", "function configurationConfig($stateProvider) {\n\n\t $stateProvider.state(\"admin.configuration\", {\n\t url: \"/configuration\",\n\t template: \"<ui-view></ui-view>\",\n\t controller: \"AdminConfigurationController as AdminConfiguration\"\n\t });\n\t}", "function get_config() {\n $.get(\"/config\")\n .done(function( data ) {\n syncConfig(data);\n });\n}", "get(url) {\n return this.axios\n .get(`/api/v1${url}`, this.requestConfig)\n .catch(this._handleError);\n }", "function consultar_configuracion(){\n\t\t$.ajax({\n\t\t\turl: _base_url+'Asistencia/obtener_configuracion',\n\t\t\tdataType: 'JSON',\n\t\t})\n\t\t.done(function(e) {\n\t\t\t// console.log(\"success\");\n\t\t\tvar _camara = e.camara;\n\t\t\tif( _camara !== _configuracion.camara){ location.reload(true); }\n\t\t})\n\t\t.fail(function() {\n\t\t\t// console.log(\"error\");\n\t\t\tvar _msn = 'Ocurrio un inconveniente al momento de consultar la configuracion actual';\n\t\t\tadd_alert('contenedor_camara','error','fa-ban',_msn);\n\t\t});\n\t\t\n\t}", "status() {\r\n return this.request('GET', 'status/config');\r\n }", "async get(req, res) {\n const { path } = req.params;\n\n const found = await this.configurationService.getByPath(path)\n\n if (found) {\n return res.status(200).json(found)\n }\n\n return res.status(404).json({ msg: 'Not found elements' })\n }", "function get_configurations() {\n\t// get the width and height fields\n\tvar oWidth = $('#width');\n\tvar oHeight = $('#height');\n\n\t// ensure both fields pass the rules for getting configuration data\n\t// if( oWidth.hasClass('has-error') || oHeight.hasClass('has-error') || oWidth.val().length != 4 || oHeight.val().length != 4 || isNaN(oWidth.val()) || isNaN(oHeight.val()) ) {\n\tif( oWidth.hasClass('has-error') || oHeight.hasClass('has-error') || oHeight.val().length != 4 || isNaN(oWidth.val()) || isNaN(oHeight.val()) ) {\n\t\treturn false;\n\n\t// both fields pass rules, get the configurations\n\t} else {\n\t\t// update_price_and_image_step1();\n\t\t\n\t\tvar iWidth = parseInt(oWidth.val());\n\t\tvar iHeight = parseInt(oHeight.val());\n\n\t\t// get the configurations\n\t\tscheme_lookup_handle = $.post(site_url + 'ajax/get_scheme_choices', $('#primaryform').serialize(), function (e) {\n\n\t\t\t// if the styles returned are not already loaded, then update the options\n\n\t\t\tvar oConfig = $('div.configoption');\n\n\t\t\tif (e.status == false) {\n\n\t\t\t\toConfig.html('<div class=\"config-waiting\"><p>Enter your sizes to view further options</p></div>');\n\t\t\t\toConfig.attr('data-loaded-configurations', e.styles);\n\t\t\t\treset_selected_options();\n\n\t\t\t} else {\n\t\t\t\t//if (oConfig.attr('data-loaded-configurations') != e.styles) {\n\t\t\t\t\t// draw configurations\n\t\t\t\t\toConfig.html(e.html);\n\n\t\t\t\t\t// set the styles returned\n\t\t\t\t\toConfig.attr('data-loaded-configurations', e.styles);\n\n\t\t\t\t\t// clear previous settings\n\t\t\t\t\treset_selected_options();\n\t\t\t\t//}\n\t\t\t}\n\t\t});\n\t}\n}", "function makeConfigurationChecklist(basePath, metaData) {\n\tvar deferred = Q.defer();\n\n\tvar content = utils.htmlHead(\"Configuration checklist\");\n\tcontent += utils.htmlHeader(\"Configuration checklist\", 1);\n\n\tvar tableData;\n\t//indicators\n\tif (metaData.indicators && metaData.indicators.length > 0) {\n\t\ttableData = [];\n\t\ttableData.push([\"Name\", \"Configured\"]);\n\n\t\tvar ind;\n\t\tfor (var i = 0; i < metaData.indicators.length; i++) {\n\t\t\tind = metaData.indicators[i];\n\n\t\t\ttableData.push([ind.name, \"▢\"]);\n\t\t}\n\n\t\tutils.htmlHeader(\"Indicators\", 2);\n\t\tcontent += utils.htmlTableFromArray(tableData, true, [85, 15], [\"left\", \"center\"]);\n\t}\n\n\t//category option group sets\n\tif (metaData.categoryOptionGroups && metaData.categoryOptionGroups.length > 0) {\n\t\ttableData = [];\n\t\ttableData.push([\"Name\", \"Configured\"]);\n\n\t\tvar cog;\n\t\tfor (var i = 0; i < metaData.categoryOptionGroups.length; i++) {\n\t\t\tcog = metaData.categoryOptionGroups[i];\n\n\t\t\ttableData.push([cog.name, \"▢\"]);\n\t\t}\n\n\t\tutils.htmlHeader(\"Category Option Groups, 2\");\n\t\tcontent += utils.htmlTableFromArray(tableData, true, [85, 15], [\"left\", \"center\"]);\n\t}\n\n\tcontent += utils.htmlTail();\n\tcontent = pretty(content);\n\n\tfs.writeFile(basePath + \"/configuration.html\", content, function (err) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t\tdeferred.resolve(false);\n\t\t}\n\n\t\tconsole.log(\"✔ Configuration checklist saved\");\n\t\tdeferred.resolve(true);\n\t});\n\n\treturn deferred.promise;\n}", "function reveive_available_hinet_configs(json_object) {\n $(\"#hinet_available_config\").empty();\n var config_names = json_object.result;\n var i;\n for (i = 0; i < config_names.length; i += 1) {\n $(\"#hinet_available_config\").append(\n $(\"<option></option>\").val(config_names[i]).html(config_names[i])\n );\n }\n}", "config() {\n this.router.get('/', medicosEspecialidadesController_1.medicosEspecialidadesController.list);\n this.router.get('/:id', medicosEspecialidadesController_1.medicosEspecialidadesController.getOne);\n this.router.post('/', medicosEspecialidadesController_1.medicosEspecialidadesController.create);\n this.router.delete('/:id', medicosEspecialidadesController_1.medicosEspecialidadesController.delete);\n this.router.put('/:id', medicosEspecialidadesController_1.medicosEspecialidadesController.update);\n }", "function getList(fileUrl) {\n\t\n\tvar i = 0; // Variable i for iteration\n\tbookPages = new Array(); // Empty bookPages array\n\t\n\t// Perform AJAX GET request and parse through config XML file\n\t$.ajax( {\n\t\n\t\tasync: false,\n\t\ttype: \"GET\",\n\t\turl: fileUrl,\n\t\tdataType: \"xml\",\n\t\tsuccess: function(xml) {\n\n\t\t\t// Iterate through each page node and populate arrays\n\t\t\t$(xml).find(\"page\").each(function() {\n\n\t\t\t\tbookPages[i] = $(this).attr(\"filename\");\n\t\t\t\ti = i + 1;\n\t\t\t\n\t\t\t});\n\t\t\t\n\t\t},\n\t\terror: function(error, errorText) {\n\t\t\twindow.location = \"error.html\";\n\t\t}\n\t\t\n\t});\n\t\n}", "function Config($stateProvider, $urlRouterProvider) {\n // unknown/default routes handler\n $urlRouterProvider.otherwise('/list');\n\n $stateProvider\n .state('main', {\n // Layout/shared\n url: '',\n templateUrl: '/shared/main/main.html',\n controller: 'MainController',\n abstract: true,\n })\n .state('main.home', {\n // Home page\n url: '/home',\n templateUrl: '/components/home/home.html',\n controller: 'HomeController',\n })\n .state('main.list', {\n // List page\n url: '/list',\n templateUrl: '/components/list/list.html',\n controller: 'ListController',\n });\n }", "function getConfig(request) {\n return {\n 'configParams': [\n {\n type: 'INFO',\n name: 'Base_Currency_Info',\n text: 'By default Euro is the Base Currency to compare other currencies with.'\n },\n {\n 'type': 'SELECT_SINGLE',\n 'name': 'BASE_CURRENCY',\n 'displayName': 'Select Base Currency:',\n 'helpText': 'Select the Base Currency for comparison.',\n 'options': [\n {label: 'Australian Dollar', value: 'AUD'},\n {label: 'Bulgarian Lev', value: 'BGN'},\n {label: 'Canadian Dollar', value: 'CAD'},\n {label: 'Swiss Franc', value: 'CHF'},\n {label: 'Euro', value: 'EUR'},\n {label: 'US Dollar', value: 'USD'}\n ]\n },\n {\n 'type': 'SELECT_MULTIPLE',\n 'name': 'INTERESTING_CURRENCIES',\n 'displayName': 'Select Currencies to compare:',\n 'helpText': 'Select the list of Currencies you want to compare.',\n 'options': [\n {label: 'Australian Dollar', value: 'AUD'},\n {label: 'Bulgarian Lev', value: 'BGN'},\n {label: 'Canadian Dollar', value: 'CAD'},\n {label: 'Swiss Franc', value: 'CHF'},\n {label: 'Euro', value: 'EUR'},\n {label: 'US Dollar', value: 'USD'}\n ]\n }\n ]\n };\n}", "showConfiguration(configuration) {\n try {\n clear();\n let contracts = configuration.getIncludedContracts()\n this.showIncludedContracts(configuration)\n\n contracts.forEach((contract) => {\n let settings = configuration[contract]\n console.log('\\n')\n console.log(contract.toUpperCase())\n this.showContractSettings(settings)\n this.showSettingsStatus(settings)\n console.log('\\n')\n })\n\n\n }\n catch(e) {\n throw (e);\n }\n }", "function fetchResults(url) {\n fetch(url)\n .then(response => response.json())\n .then(function(body){\n resultTemplate(body.Search);\n pagination(body, body.Search);\n })\n}", "getStatus() {\r\n $.ajax({\r\n url: '/spiritconfigs/get',\r\n type: 'get',\r\n success: (obj) => {\r\n for (let file in obj) {\r\n this.createConfigEditor(file, obj[file]);\r\n }\r\n }\r\n });\r\n }", "makeURLList(){\r\n \r\n this.urls.length = 0;\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://sandipbgt.com/theastrologer/api/horoscope/' + this.sign.toLowerCase()+'/today/');\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://horoscope-api.herokuapp.com/horoscope/today/' + this.sign);\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://widgets.fabulously40.com/horoscope.json?sign=' + this.sign.toLowerCase());\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://ohmanda.com/api/horoscope/' + this.sign.toLowerCase());\r\n \r\n //calling the search function\r\n this.search();\r\n }", "static search(config, query, page, pageSize) {\n return RestBaseUtils.getTDPLookup(config.db, `${config.base}_items`, {\n column: config.entityName,\n species: SpeciesUtils.getSelectedSpecies(),\n query,\n page,\n limit: pageSize,\n });\n }", "function getAlgoList(getAlgoListUrl){\n apiServiceCustom.makeGenericGetAPICall(getAlgoListUrl)\n .then(function(response){\n $scope.algoNames = response.data;\n }, function(err){\n console.log(err);\n });\n }", "List(params) {\n return this.createRequest('', params, 'get');\n }", "function getConfiguration()\n {\n var result = {};\n\n if (undefined == result.beforeShow)\n {\n result.beforeShow = readLinked;\n }\n\n if (undefined == result.onSelect)\n {\n result.onSelect = updateLinked;\n }\n\n return $.extend(true, configuration, result);\n }", "function configure(url) {\n url = url ? url : config.base_url\n let popupUrl = url + getMetaTagContentByName(\"config-page\");\n\n const popupOpts = {\n height: 650,\n width: 630,\n };\n\n /**\n * This is the API call that actually displays the popup extension to the user. The\n * popup is always a modal dialog. The only required parameter is the URL of the popup,\n * which must be the same domain, port, and scheme as the parent extension.\n *\n * The developer can optionally control the initial size of the extension by passing in\n * an object with height and width properties. The developer can also pass a string as the\n * 'initial' payload to the popup extension. This payload is made available immediately to\n * the popup extension. In this example, the value '5' is passed, which will serve as the\n * default interval of refresh.\n */\n\n tableau.extensions.ui.displayDialogAsync(popupUrl, \"\", popupOpts).then((closePayload) => {\n // The promise is resolved when the dialog has been expectedly closed, meaning that\n // the popup extension has called tableau.extensions.ui.closeDialog.\n // $('#inactive').hide();\n // $('#active').show();\n updateStatus();\n\n\n }).catch((error) => {\n // One expected error condition is when the popup is closed by the user (meaning the user\n // clicks the 'X' in the top right of the dialog). This can be checked for like so:\n switch(error.errorCode) {\n case tableau.ErrorCodes.DialogClosedByUser:\n console.log(\"Dialog was closed by user\");\n break;\n case tableau.ErrorCodes.InvalidDomainDialog:\n console.log(\"Invalid domain!\");\n if (config.base_url === url) {\n console.log(\"Trying with the old url...\");\n configure(config.old_url);\n }\n break;\n default:\n console.error(error.message);\n }\n });\n\n }", "async requestSettingsV2() {\n const data = (await (0, axios_1.default)({\n url: `http://${this.ip}/api/v2/configurations`,\n ...this.requestOptions\n })).data;\n this.log.debug(`Configuration received: ${JSON.stringify(data)}`);\n for (const [id, val] of Object.entries(data)) {\n let value = val;\n if (value && !isNaN(Number(value))) {\n value = parseFloat(value);\n }\n await this.setState(`configurations.${id}`, value, true);\n }\n }", "function ConfigurationItem(url, viewBoxSize) {\n this.url = url;\n this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n }", "function ConfigurationItem(url, viewBoxSize) {\n this.url = url;\n this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n }", "readConnections(config) {\n this._items = [];\n let keys = config.getKeys();\n for (let index = 0; index < keys.length; index++) {\n let key = keys[index];\n let value = config.getAsNullableString(key);\n let item = new DiscoveryItem();\n item.key = key;\n item.connection = ConnectionParams_1.ConnectionParams.fromString(value);\n this._items.push(item);\n }\n }", "function loadComponents(url) {\n // add devmode request parameter (otherwise it will return regular HTML)\n url = url + constants.DEV_MODE_PARAM;\n $http.get(url).then(function (response) {\n vm.components = response.data.components;\n vm.pageConfig = response.data;\n });\n }", "function getList() {\n return request(`/WebApi/menu/getlist`);\n}", "constructor() {\n this.params = new URLSearchParams(location.search);\n this.loadConfig();\n }", "async function list(req, res) {\n let data = req.body;\n try {\n let result = await Url.find({ status: true }).lean().exec();\n res.render(\"index\", { urls: result });\n } catch (e) {\n console.log(e);\n let errMsg = `There was Error in viewing ${e}`;\n res.render(\"index\", { err: errMsg });\n }\n}", "function listDatasources() {\n let theUrl = `/api/v${apiVersion}/datasources`;\n let request = $http({\n url: theUrl,\n method: \"GET\"\n });\n return request;\n }", "function getWhiteListConfigurationPage() {\n\t$('#mainContainer').html('<div id=\"WhiteListConfigurationPage\"></div>');\n\tsetLoadImage('WhiteListConfigurationPage', '40px', '500px');\n\tsendHTMLAjaxRequest(false, 'getView/getWhiteListConfigurationPage.html', null, fnDisplayContent, null,'WhiteListConfigurationPage');\n}", "get endpoints() {\n return this.getListAttribute('endpoints');\n }", "function getProgramInfo (urlList) {\n var deferred = $q.defer();\n\n // Fire all http calls\n $q.all(urlList.map(function (_url) {\n return $http({method: 'GET', url: _url});\n })).then(function (results) { \n deferred.resolve(results);\n });\n\n return deferred.promise;\n }", "getList() { return this.api(); }", "function ConfigurationItem(url, viewBoxSize) {\n this.url = url;\n this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n}", "get configuration() {\n return this.config;\n }", "function getOptions() {\n //\t\t\tOption.query({\n //\t\t\t\tpage\n //\t\t\t});\n }", "function loadConfigs() {\n if (allthings.configs !== null) {\n for (let i = 0; i < allthings.configs.length; i++) {\n let opt = `Team:${allthings.configs[i].team} Name:${\n\tallthings.configs[i].name\n }`;\n var el = document.createElement(\"option\");\n el.name = opt;\n el.textContent = opt;\n el.value = opt;\n document.getElementById(\"selectConfig\").appendChild(el);\n }\n }\n}", "function getConfig(request){\n const config = cc.getConfig();\n\n config\n .newTextInput()\n .setId('api_url')\n .setName(\n 'Enter a the url to the json resource'\n )\n .setHelpText('e.g. https://mysite/api/data.json&API_KEY=mykey')\n .setPlaceholder('https://mysite/api/data.json&API_KEY=mykey')\n .setAllowOverride(true);\n\n return config.build();\n}", "function list(req, res, next){\n // Validate params.\n var errors = [];\n\n // Pagination\n const PAGE_SIZE_DEFAULT = 5;\n var page = req.query.page != null ? parseInt(req.query.page) : 1;\n var page_size = req.query.page_size != null ? parseInt(req.query.page_size) : PAGE_SIZE_DEFAULT;\n\n if(!Number.isInteger(page) || page < 1) errors.push(\"'page' must be a positive integer\");\n\n if(!Number.isInteger(page_size) || page_size < 5 || page_size > 20) errors.push(\"'page_size' must be a integer between 5 and 20\");\n\n // Filtering\n var filters_params = [];\n var filters_fields = req.query.filter == null ? [] : req.query.filter.split(';');\n var filters_values = req.query.filter_value == null ? [] : req.query.filter_value.split(';');\n var filters_types = req.query.filter_type == null ? [] : req.query.filter_type.split(';');\n\n // Error if filters parameters doesn't match size.\n if(filters_fields.length != filters_types.length || filters_types.length != filters_values.length)\n errors.push(\"filtering parameters' size mismatch\");\n\n else{\n // Filtering options.\n var allow_filters = [\n {field: 'name', type: 'contains', value: 'string'},\n {field: 'active', type: 'equal', value: 'boolean', admin: true}\n ];\n\n // Check if filter paramenters are valid.\n for(var i = 0, len_params = filters_types.length; i < len_params; i++){\n var inArray = false;\n\n var filter_param = {\n field: filters_fields[i].trim().toLowerCase(),\n value: filters_values[i].trim(),\n type: filters_types[i].trim().toLowerCase()\n }\n\n for(var j = 0, len_allow = allow_filters.length; j < len_allow; j++){\n var allow_filter = allow_filters[j];\n if(filter_param.field == allow_filter.field && filter_param.type == allow_filter.type){\n inArray = true;\n j = len_allow;\n\n // Check if filter is only for admins.\n if(allow_filter.admin != null && req.auth.role != \"admin\") errors.push(\"You are not allow to use filter '\" + filter_param.field + \" \" + filter_param.type + \"'\");\n\n // Check boolean value.\n if(allow_filter.value == \"boolean\"){\n var value = filter_param.value.toLowerCase();\n\n if(value != \"true\" && value != \"false\") errors.push(\"Invalid filter value for '\" + filter_param.field + \" \"+ filter_param.type + \"': must be true or false.\");\n else{\n filter_param.value = value == \"true\" ? true : false;\n }\n }\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid filter: '\" + filter_param.field + \" \"+ filter_param.type + \"'\");\n\n // Else, put it on the filters_params.\n else filters_params.push(filter_param);\n }\n }\n\n // Field selection.\n var field_selection = [];\n\n // Include\n var includes = req.query.include == null ? [] : req.query.include.split(\";\");\n\n var allow_includes = [\n {field: \"stock\", admin: true}\n ];\n\n // Check if include paramenters are valid.\n for(var i = 0, len_params = includes.length; i < len_params; i++){\n var inArray = false;\n var include = includes[i];\n\n for(var j = 0, len_allow = allow_includes.length; j < len_allow; j++){\n var allow_include = allow_includes[j];\n if(include == allow_include.field){\n inArray = true;\n j = len_allow;\n\n // Check if include is only for admins.\n if(allow_include.admin != null && req.auth.role != \"admin\") errors.push(\"You are not allow to use include '\" + include + \"'\");\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid include: '\" + include + \"'\");\n else field_selection.push({field: include, type: 'include'});\n }\n\n // Exclude\n var excludes = req.query.exclude == null ? [] : req.query.exclude.split(\";\");\n\n var allow_excludes = [\n {field: \"popularity\"}\n ];\n\n // Check if exclude paramenters are valid.\n for(var i = 0, len_params = excludes.length; i < len_params; i++){\n var inArray = false;\n var exclude = excludes[i];\n\n for(var j = 0, len_allow = allow_excludes.length; j < len_allow; j++){\n var allow_exclude = allow_excludes[j];\n if(exclude == allow_exclude.field){\n inArray = true;\n j = len_allow;\n\n // Check if exclude is only for admins.\n if(allow_exclude.admin != null && req.auth.role != \"admin\") errors.push(\"You are not allow to use exclude '\" + exclude + \"'\");\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid exclude: '\" + exclude + \"'\");\n else field_selection.push({field: exclude, type: 'exclude'});\n }\n\n // Sorting\n var sorting_params = [];\n var sort_fields = req.query.sort == null ? [] : req.query.sort.split(';');\n var sort_order = req.query.sort_order == null ? [] : req.query.sort_order.split(';');\n\n // Error if sorts parameters doesn't match size.\n if(sort_fields.length != sort_order.length)\n errors.push(\"sorting parameters' size mismatch\");\n\n else{\n // Sorting options.\n var allow_sorts = [\n {by: 'name', order: 'ASC'},\n {by: 'name', order: 'DESC'},\n {by: 'popularity', order: 'ASC'},\n {by: 'popularity', order: 'DESC'}\n ];\n\n // Check if sort paramenters are valid.\n for(var i = 0, len_params = sort_fields.length; i < len_params; i++){\n var inArray = false;\n\n var sort_param = {\n by: sort_fields[i].trim().toLowerCase(),\n order: sort_order[i].trim().toUpperCase()\n }\n\n for(var j = 0, len_allow = allow_sorts.length; j < len_allow; j++){\n var allow_sort = allow_sorts[j];\n if(sort_param.by == allow_sort.by && sort_param.order == allow_sort.order){\n inArray = true;\n j = len_allow;\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid sort: '\" + sort_param.by + \" \"+ sort_param.order + \"'\");\n\n // Else, put it on the sorting_params.\n else sorting_params.push(sort_param);\n }\n }\n\n if(errors.length > 0) next({status: 400, errors: errors});\n // End of params validation.\n\n\n else{\n var pages;\n\n // Filtering.\n var filters = {};\n\n // Only active products.\n filters[\"active\"] = true;\n\n // Add filters of the filtets_params array.\n for(var i = 0, len = filters_params.length; i < len; i++){\n var filter = filters_params[i];\n\n if(filter.type == 'contains') filters[filter.field] = new RegExp(filter.value, 'i');\n if(filter.type == \"equal\") filters[filter.field] = filter.value;\n }\n\n\n // Count all documents that match.\n Product.countDocuments(filters).then(function(count){\n\n // Get page size.\n pages = Math.ceil(count / page_size);\n\n // If no product, pages = 1.\n if(pages == 0) pages = 1;\n\n // Validate page value.\n if(page > pages) return Promise.reject({name: 'InvalidPage'});\n\n\n // Get the products.\n else{\n var default_fields = [\"name\", \"description\", \"price\", \"popularity\"];\n\n for(var i = 0, len = field_selection.length; i < len; i++){\n if(field_selection[i].type == \"include\") default_fields.push(field_selection[i].field);\n else default_fields = default_fields.filter(function(_field){ return _field != this}, field_selection[i].field)\n }\n\n // Field selection.\n var fields = {};\n\n for(var i = 0, len = default_fields.length; i < len; i++){\n fields[default_fields[i]] = 1\n }\n\n // Pagination.\n var options = {\n sort: {},\n skip: (page - 1) * page_size,\n limit: page_size\n }\n\n for(var i = 0, len = sorting_params.length; i < len; i++){\n options.sort[sorting_params[i].by] = sorting_params[i].order == \"ASC\" ? 1 : -1;\n }\n\n if(options.sort.name != -1) options.sort.name = 1;\n\n return Product.find(filters, fields, options);\n }\n }).then(function(products){\n\n // Success response.\n var options = [];\n\n // Sorting\n if(sorting_params.length > 0){\n var sort = [], sort_order = [];\n\n for(var i = 0, len = sorting_params.length; i < len; i++){\n var sorting_param = sorting_params[i];\n sort.push(sorting_param.by);\n sort_order.push(sorting_param.order);\n }\n\n options.push(\"sort=\" + sort.join(\";\"));\n options.push(\"sort_order=\" + sort_order.join(\";\"));\n }\n\n // Filtering\n if(filters_params.length > 0){\n var filter = [], filter_value = [], filter_type = [];\n\n for(var i = 0, len = filters_params.length; i < len; i++){\n var filter_param = filters_params[i];\n filter.push(filter_param.field);\n filter_value.push(filter_param.value);\n filter_type.push(filter_param.type);\n }\n\n options.push(\"filter=\" + filter.join(\";\"));\n options.push(\"filter_value=\" + filter_value.join(\";\"));\n options.push(\"filter_type=\" + filter_type.join(\";\"));\n }\n\n // Field selection\n var includes = [], excludes = [];\n\n for(var i = 0, len = field_selection.length; i < len; i++){\n if(field_selection[i].type == \"include\") includes.push(field_selection[i].field);\n else excludes.push(field_selection[i].field);\n }\n\n if(includes.length > 0) options.push(\"include=\" + includes.join(\";\"));\n if(excludes.length > 0) options.push(\"exclude=\" + excludes.join(\";\"));\n\n var next_page = \"\";\n\n if(page < pages){\n next_page = \"/api/v1/products?page=\" + (page + 1);\n if(page_size != PAGE_SIZE_DEFAULT) next_page += '&page_size=' + page_size;\n if(options.length > 0) next_page += \"&\" + options.join(\"&\");\n }\n\n var previous_page = \"\";\n\n if(page > 1){\n previous_page = \"/api/v1/products?page=\" + (page - 1);\n if(page_size != PAGE_SIZE_DEFAULT) previous_page += '&page_size=' + page_size;\n if(options.length > 0) previous_page += \"&\" + options.join(\"&\");\n }\n\n\n res.status(200).json({\n request: req.object,\n pagination: {\n current: page,\n pages: pages,\n size: page_size,\n next: next_page,\n previous_page: previous_page\n },\n sorting: sorting_params,\n filters: filters_params,\n select: field_selection,\n data_size: products.length,\n data: products\n });\n\n // Catch errors.\n }).catch(function(error){\n if(error.name == 'InvalidPage') next({status:422, errors: [\"page not found\"]});\n else next({status: 500});\n });\n }\n}", "list(request, response, next) {\n SiteModel.find(\n (error, siteDocs) => {\n const sites = siteDocs.reduce((previous, site) => {\n previous[site.title] = site.data;\n return previous;\n }, {});\n response.json({sites});\n }\n );\n }", "showConfigs () {\n const activeConfigs = this.dag.requiredConfigNodes() // returns an array of DagNode references\n console.log('ACTIVE CONFIGS:')\n activeConfigs.forEach(cfg => { console.log(cfg.key(), cfg.value()) })\n }", "function fetchSearchChannels(url) {\n fetch(url).then(function(response) {\n buildChannelCard(response);\n });\n\n}", "function findAllCatalogs() {\n return $http.get(\"/api/catalogs\");\n }", "function configApi(){\n this._url = {\n api: 'http://api.themoviedb.org/3',\n img: 'http://image.tmdb.org/t/p/w185/'\n };\n this.$get = function() {\n return this._url;\n };\n\n /**\n * @param {object} url\n */\n this.setUrl = function(url) {\n this._url = url;\n };\n }", "list() {\n this._followRelService(\"list\", \"List\");\n }", "_showOrHideConfigsList() {\n if (this.list.collection.length > 0) {\n this._$listContainer.show();\n } else {\n this._$listContainer.hide();\n }\n }", "list(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/list`, ...params);\n }", "list(id) {\n const params = new Array();\n if (id != null) {\n params.push(`id=${id}`);\n }\n return this.rest.get(`${this.baseUrl}/list`, ...params);\n }", "function collectionList() {\r\n var href = $('#resources').attr('href');\r\n\r\n //this is a all project search.. so hide the collections button and return\r\n if( typeof href == 'undefined' ){\r\n $('#selected-all').css('display', 'none');\r\n return;\r\n }\r\n\r\n var hrefTemp = href.split('/');\r\n href = hrefTemp.pop();\r\n\r\n if( href == '' ){ //there was a trailing '/'\r\n href = hrefTemp.pop();\r\n }\r\n\r\n if( href.length == 36 ){\r\n $('#resources').css('display', 'block');\r\n $('#collections').css('display', 'block');\r\n $('#selected-all').css('display', 'none');\r\n return;\r\n }\r\n\r\n collectionArray = [];\r\n $.ajax({\r\n url: arcs.baseURL + \"collections/titlesAndIds\",\r\n type: \"get\",\r\n data: {pName: href},\r\n success: function (data) {\r\n data.forEach(function (tempdata) {\r\n var temparray = $.map(tempdata, function (value, index) {\r\n return [value];\r\n });\r\n collectionArray.push(temparray);\r\n })\r\n collectionsSearch();\r\n }\r\n });\r\n}", "async getConfig() {\n return await axios.get(`${globals.apiUrl}/calendar/google-config`);\n }", "static manyFromConfig(config) {\n let result = [];\n let connections = config.getSection(\"connections\");\n if (connections.length() > 0) {\n let connectionSections = connections.getSectionNames();\n for (let index = 0; index < connectionSections.length; index++) {\n let connection = connections.getSection(connectionSections[index]);\n result.push(new ConnectionParams(connection));\n }\n }\n else {\n let connection = config.getSection(\"connection\");\n if (connection.length() > 0)\n result.push(new ConnectionParams(connection));\n }\n return result;\n }", "getAllApiServers() {\n return stores_SettingsStore__WEBPACK_IMPORTED_MODULE_7__[\"default\"].getState().defaults.apiServer.filter(item => {\n // Remove all but the whitelisted ones\n let filteredApiServers = stores_SettingsStore__WEBPACK_IMPORTED_MODULE_7__[\"default\"].getState().settings.get(\"filteredApiServers\", []);\n\n if (filteredApiServers.length > 0) {\n // list may contain urls or regions\n if (filteredApiServers.indexOf(item.url) !== -1) return true;\n if (!!item.region && filteredApiServers.indexOf(item.region) !== -1) return true;\n return false;\n } else {\n return true;\n }\n });\n }", "function getConfiguration()\n {\n var result = {};\n return $.extend(true, configuration, result);\n }", "function getConfiguration()\n {\n var result = {};\n return $.extend(true, configuration, result);\n }", "function getParams(url) {\r\n var i, item, len, key_value_section, params, params_list = {};\r\n\r\n if (typeof url === 'string') {\r\n params = url.match(/\\?(.*)/)[0] || '';\r\n } else {\r\n params = root.location.search;\r\n }\r\n\r\n if (params.substr(0, 1) === '?') {\r\n params = params.substr(1);\r\n }\r\n\r\n params = params.split('&');\r\n len = params.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n key_value_section = params[i];\r\n if (key_value_section.length > 0) {\r\n item = key_value_section.split('=');\r\n params_list[item[0]] = item[1];\r\n }\r\n }\r\n return params_list;\r\n }", "function Config(app) {\n morgan.token('time', (req, res) => new Date().toISOString());\n app.use(morgan('[:time] :remote-addr :method :url :status :res[content-length] :response-time ms'));\n\n app.use(bodyParser.urlencoded({ extended: true }));\n app.use(bodyParser.json());\n app.use(require('./api/v1'));\n\n app.use(function(req, res, next) {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'X-Requested-With');\n res.header('Access-Control-Allow-Headers', 'Content-Type');\n res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');\n next();\n });\n \n app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));\n}", "async requestSettings() {\n if (this.apiVersion === 'v2') {\n return this.requestSettingsV2();\n }\n const rawData = JSON.stringify(await (0, axios_1.default)(`http://${this.ip}:8080/api/configuration`));\n this.log.debug(`[SETTINGS] Configuration received: ${rawData}`);\n await this.setStateAsync(`info.configuration`, rawData, true);\n }", "function fetchPageConfig() {\n return pageConfigService.getPageConfig();\n }", "getConfig() {\n let config = this.trs80.getConfig();\n for (const displayedOption of this.displayedOptions) {\n if (displayedOption.input.checked) {\n config = displayedOption.block.updateConfig(displayedOption.option.value, config);\n }\n }\n return config;\n }", "function getGetConfig() {\n return {\n headers: {\n accept: \"application/json;odata=verbose\"\n }};\n }", "list(req, res) {\n Currency.findAll()\n .then((currencies) => {\n let payload = { status: true, currencies };\n res.status(200).json(payload);\n })\n .catch((err) => {\n console.error(err);\n res.status(500).json(InternalServerErrorPayload);\n });\n }", "function config($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state('manager', {\n url: \"/\",\n template: \"<manager></manager>\"\n })\n .state('add', {\n url: \"/add\",\n template: \"<add></add>\"\n })\n .state('connect', {\n url: \"/connect/:repo\",\n template: \"<connect></connect>\",\n params: {\n credentials: null,\n connection: null,\n error: null\n }\n })\n .state('connecting', {\n url: \"/connecting\",\n template: \"<connecting></connecting>\",\n params: {\n credentials: null,\n connection: null\n }\n })\n .state('other', {\n url: \"/other\",\n template: \"<other></other>\",\n params: {\n type: null\n }\n })\n .state('pentaho', {\n url: \"/pentaho\",\n template: \"<pentaho></pentaho>\"\n })\n .state('database', {\n url: \"/database\",\n template: \"<database></database>\"\n })\n .state('file', {\n url: \"/file\",\n template: \"<file></file>\"\n });\n\n $urlRouterProvider.otherwise(\"/\");\n }", "function getEvents(url){\n\t\t$.getJSON(url)\n\t\t.done(function(data){syncEvents(data);})\n\t\t.fail(function(){console.log(\"Failed to get a list of events.\")})\n\t}", "async getRecords() {\n const sitemap = new sitemapper({\n url: this.sitemapUrl,\n timeout: 120000\n })\n\n const res = await sitemap.fetch();\n\n const excludes = new Set(this.ignoreUrls);\n const fullList = new Set([\n ...res.sites,\n ...this.additionalUrls\n ]).filter(url => !excludes.has(url));\n\n return fullList; \n }" ]
[ "0.77927667", "0.664107", "0.664107", "0.63441676", "0.605083", "0.6038445", "0.6003469", "0.5724904", "0.57085484", "0.55349547", "0.54497546", "0.5418508", "0.5310202", "0.5296163", "0.524107", "0.51933056", "0.5184178", "0.5163106", "0.5152344", "0.51486766", "0.51361126", "0.51343143", "0.5130244", "0.5129863", "0.51148313", "0.51148313", "0.5113514", "0.50892633", "0.5071053", "0.50145054", "0.50128704", "0.49993593", "0.49516487", "0.49445158", "0.4933355", "0.49291894", "0.49068618", "0.48655283", "0.4856852", "0.48382333", "0.48359817", "0.48269227", "0.48252133", "0.4822908", "0.48093602", "0.47907084", "0.47872233", "0.47836727", "0.47822967", "0.47786847", "0.4768898", "0.47682926", "0.4765277", "0.4751604", "0.4741754", "0.47104073", "0.47082713", "0.47070217", "0.47070217", "0.47065443", "0.47057533", "0.47028697", "0.4691065", "0.46882054", "0.4675738", "0.46745908", "0.46695548", "0.46666986", "0.46606636", "0.46546376", "0.46459204", "0.4641405", "0.4640006", "0.463297", "0.46309143", "0.46246776", "0.46242458", "0.46208805", "0.46041334", "0.4602906", "0.4602596", "0.45926157", "0.4589985", "0.4589985", "0.4589135", "0.4583063", "0.45793378", "0.45786178", "0.45779398", "0.45779398", "0.45669115", "0.45658335", "0.45656624", "0.45647976", "0.45508495", "0.454836", "0.45393932", "0.45350897", "0.45332327", "0.45318645" ]
0.79530126
0
Toggles disabled state on configuration types depending on what's currently selected.
function toggleCheckboxes(selection, disable){ var type = selection.config_type; var uid = selection.uid; $('input[data-type="' + type + '"]') .each(function(i, input){ if (disable) { var inputUid = input.id; if (inputUid != uid) { $(input).prop('disabled', true); $(input).closest('tr').css('opacity', .5); } else { // leave the one currently selected enabled $(input).prop('disabled', false); } } else { $(input).prop('disabled', false); $(input).closest('tr').css('opacity', 1); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setDisabledState(isDisabled) {\n if (this.options) {\n this.options.forEach((option) => option.disabled = isDisabled);\n }\n }", "function switchDefaultSet(){\n if(this.checked){\n settingsDisables.forEach(function(element){\n element.disabled = true;\n });\n }\n else{\n settingsDisables.forEach(function(element){\n element.disabled = false;\n });\n }\n}", "toggleEnabled() {\n let { enabled, scheduledRestart } = this.state;\n enabled = !enabled;\n //If the select boxes are no longer enabled, reset the scheduled restart time and call a method on the Actions object.\n //That function will set scheduledRestart to null via the preferences API. But we want our display to look nice, hence the bit where we reset it to the default value.\n if (!enabled) {\n scheduledRestart = DEFAULT_RESTART;\n this.setState({ enabled, scheduledRestart })\n Actions.disableScheduledRestart();\n } else {\n this.setState({ enabled })\n Actions.setScheduledRestart(scheduledRestart);\n }\n }", "function disable() {\n instance.state.isEnabled = false;\n }", "function toggleAllowInput(isEnabled) {\n if (isEnabled) {\n $(\".conf-ctl\").removeClass(\"disabled\");\n $(\".conf-ctl:input\").attr(\"disabled\", false);\n } else {\n $(\".conf-ctl\").addClass(\"disabled\");\n $(\".conf-ctl:input\").attr(\"disabled\", true);\n }\n\n }", "function disable() {\n instance.state.isEnabled = false;\n }", "function toggleDisabled(disable) {\n if (typeof disable === 'boolean') {\n $(input).data(\"settings\").disabled = disable\n } else {\n $(input).data(\"settings\").disabled = !$(input).data(\"settings\").disabled;\n }\n input_box.attr('disabled', $(input).data(\"settings\").disabled);\n token_list.toggleClass($(input).data(\"settings\").classes.disabled, $(input).data(\"settings\").disabled);\n // if there is any token selected we deselect it\n if(selected_token) {\n deselect_token($(selected_token), POSITION.END);\n }\n hidden_input.attr('disabled', $(input).data(\"settings\").disabled);\n }", "function toggleDisabled(disable) {\n if (typeof disable === 'boolean') {\n $(input).data(\"settings\").disabled = disable\n } else {\n $(input).data(\"settings\").disabled = !$(input).data(\"settings\").disabled;\n }\n input_box.attr('disabled', $(input).data(\"settings\").disabled);\n token_list.toggleClass($(input).data(\"settings\").classes.disabled, $(input).data(\"settings\").disabled);\n // if there is any token selected we deselect it\n if(selected_token) {\n deselect_token($(selected_token), POSITION.END);\n }\n hidden_input.attr('disabled', $(input).data(\"settings\").disabled);\n }", "function toggleDisabled(disable) {\n if (typeof disable === 'boolean') {\n $(input).data(\"settings\").disabled = disable;\n } else {\n $(input).data(\"settings\").disabled = !$(input).data(\"settings\").disabled;\n }\n input_box.attr('disabled', $(input).data(\"settings\").disabled);\n token_list.toggleClass($(input).data(\"settings\").classes.disabled, $(input).data(\"settings\").disabled);\n // if there is any token selected we deselect it\n if(selected_token) {\n deselect_token($(selected_token), POSITION.END);\n }\n hidden_input.attr('disabled', $(input).data(\"settings\").disabled);\n }", "function toggleControls(enabled) {\n document.getElementById(\"options\").disabled = (!enabled);\n document.getElementById(\"output\").disabled = (!enabled);\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n }", "updateDisabled_() {\n this.disabled_ = this.settingsDisabled ||\n this.colorModes.length < NUM_REQUIRED_COLOR_MODES;\n }", "function flipDisableOption() {\n\t\t$(\"start_button\").disabled = !$(\"start_button\").disabled;\n\t\t$(\"stop_button\").disabled = !$(\"stop_button\").disabled;\n\t\t$(\"animation-dropbox\").disabled = !$(\"animation-dropbox\").disabled;\n\t}", "_setDisabled(value) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._changeDetector.markForCheck();\n }\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n this._changeDetector.markForCheck();\n }", "set disabled(value) {\n const isDisabled = Boolean(value);\n if (isDisabled)\n this.shadowRoot.getElementById('toggle').setAttribute('disabled', '');\n else\n this.shadowRoot.getElementById('toggle').removeAttribute('disabled');\n }", "updateEnabledOptions() {\n const config = this.getConfig();\n for (const displayedOption of this.displayedOptions) {\n const enabled = displayedOption.block.updateConfig(displayedOption.option.value, config).isValid();\n displayedOption.input.disabled = !enabled;\n }\n this.configureAcceptButton(config);\n }", "setDisabledState(isDisabled) {\n this.setProperty('disabled', isDisabled);\n }", "disable() {\n\t\tthis.toggle(false);\n\t}", "disable() {\n if (!this.isEnabled) return\n this.isEnabled = false\n }", "toggle() {\n this.enabled = !this.enabled;\n }", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }", "function onChange() {\n setDisabled(!disabled);\n }", "function toggleControlButtons(state){\n $(\"#algorithmSpeed\").prop(\"disabled\",state);\n $(\"#generateBars\").prop(\"disabled\",state);\n $(\"#arraySize\").prop(\"disabled\",state);\n $(\"#selectAlgorithm\").prop(\"disabled\",state);\n if (state){\n $(\"#algorithmSpeedDiv\").addClass(\"disabled-div\");\n $(\"#arraySizeDiv\").addClass(\"disabled-div\")\n }else{\n $(\"#algorithmSpeedDiv\").removeClass(\"disabled-div\");\n $(\"#arraySizeDiv\").removeClass(\"disabled-div\")\n }\n}", "function disable_enable_controls(state) {\n if (!options.controls) return;\n options.controls.prop('disabled', state);\n }", "function toggleDisabled( selector ){\n\n\t$( selector ).each( function( ){\n\n\t\tif( $( this ).attr( 'disabled' ) == '' ){\n\t\t\t$( this ).attr( 'disabled', 'disabled' );\n\t\t}\n\t\telse{\n\t\t\t$( this ).removeAttr( 'disabled' );\n\t\t}\n\n\t});\n\n}", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n this._changeDetectorRef.markForCheck();\n }", "function settingsChange(e)\n{\n\n if(mouseSetting.disabled === true)\n {\n mouseSetting.disabled = false;\n keyboardSetting.disabled = true;\n }\n else\n {\n mouseSetting.disabled = true;\n keyboardSetting.disabled = false;\n }\n}", "setDisabledState(isDisabled) {\n this.disabled = isDisabled;\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }", "setDisabledState(isDisabled) {\n this._disabled = isDisabled;\n this.changeDetectorRef.markForCheck();\n }", "function enableDisable()\n{\n\tif(this.checked())\n\t\ttr = true;\n\telse\n\t\ttr = false;\n}", "toggleConfig() {\n this.setState({showConfig: !this.state.showConfig});\n }", "function __setDisabled() {\n setDisabled.apply(this, arguments);\n }", "async toggleConfig(force) {\n await this._vieux.toggle_config(force);\n }", "_enableDisableHandler() {\n const that = this;\n\n if (that.disabled) {\n for (let i = 0; i < that._items.length; i++) {\n that._items[i].disabled = true;\n }\n }\n else {\n for (let i = 0; i < that._items.length; i++) {\n that._items[i].disabled = false;\n }\n }\n }", "function themerMenuOptionsToggle(disable)\n\t{\n\t\tvar o = [themerMenuPositionSelect, themerMenuSizeSelect];\n\t\t$.each(o, function(k,v)\n\t\t{\n\t\t\tv.prop('disabled', disable);\n\t\t\tif (disable === true) v.parent().tooltip({ placement: 'left', title: \"Layout options in this section are disabled\" });\n\t\t});\n\t}", "function toggleConfBool(conf, defval){\n\tvar val = confBool(conf, defval, undefined, true);\n\tsetData(conf, val ? '0' : '1');\n\treturn !val;\n}", "setDisabled (isDisabled) {\n this.disabled = this._toBool(isDisabled)\n let pointEvt = this.disabled ? 'none' : 'auto'\n\n this.getAllSlider().forEach((el) => {\n el.getEle('#sliderKnob').style.pointerEvents = pointEvt\n })\n }", "function disable() {\n enabled = false;\n }", "function passport_fields_toggle(tour_type){\n if(tour_type==\"International\"){\n $('input[name=\"txt_m_passport_no1\"],input[name=\"txt_m_passport_issue_date1\"], input[name=\"txt_m_passport_expiry_date1\"]').prop('disabled', false);\n }\n if(tour_type==\"Domestic\"){\n $('input[name=\"txt_m_passport_no1\"], input[name=\"txt_m_passport_issue_date1\"], input[name=\"txt_m_passport_expiry_date1\"]').prop('disabled', true);\n }\n}", "disable () {\n this.enabled= false;\n }", "function toggleYESEligibility(disable) {\n\t\tif (disable) {\n\t\t\tpreviously_selected_yes = $('#program_yes').prop('checked');\n\t\t\t$('#program_yes').prop('checked', false)\n\t\t\t$('#program_yes').prop('disabled', true);\n\t\t\t$('.program-name .yes').addClass('disabled');\n\t\t\t$('.program-age-limit .yes').addClass('recheck');\n\t\t}\n\t\telse {\n\t\t\tif (previously_selected_yes)\n\t\t\t\t$('#program_yes').prop('checked', true);\n\t\t\telse\n\t\t\t\t$('#program_yes').prop('checked', false);\n\t\t\t$('#program_yes').prop('disabled', false);\n\t\t\t$('.program-name .yes').removeClass('disabled');\n\t\t\t$('.program-age-limit .yes').removeClass('recheck');\n\t\t}\n\t}", "@readOnly\n @computed('formDisabled', 'cellConfig')\n disabled (formDisabled, cellConfig) {\n return formDisabled || get(cellConfig, 'disabled')\n }", "function toggleDisabled(elem,enabled) {\r\n if (enabled == \"disabled\") {\r\n $(elem).addClass(\"disabled\")\r\n } else if (enabled == \"enabled\") {\r\n $(elem).removeClass(\"disabled\");\r\n }\r\n}", "enable() {\n this.disabled = false;\n }", "enable() {\n this.disabled = false;\n }", "enable() {\n this.disabled = false;\n }", "function toggle(configName) {\n return {\n type: TOGGLE_CONFIGS,\n payload: configName };\n\n}", "set disabled(disabled) {\n this[setState]({ disabled });\n }", "disable() {\n this.disabled = true;\n }", "function disableProjectSelect() {\n\n\tif (projectSelect.length) {\n\t\tprojectSelect.disabled = false;\n\t\tdisableButton(goProjectButton, false);\n\t\tdisableButton(delProjectButton, false);\n\t\tprojectSelectLabel.style.color = enabledTextColor;\n\t}\n\telse {\n\t\tprojectSelect.disabled = true;\n\t\tdisableButton(goProjectButton, true);\n\t\tdisableButton(delProjectButton, true);\n\t\tprojectSelectLabel.style.color = disabledTextColor;\n\t}\n\n}", "function switchDefaultMod(){\n console.log(modalDisables);\n if(this.checked){\n modalDisables.forEach(function(element){\n element.disabled = true;\n });\n }\n else{\n modalDisables.forEach(function(element){\n element.disabled = false;\n });\n }\n}", "set disabled(isDisabled) {\n this._disabled = isDisabled !== false;\n this.updateDisabled();\n }", "function setToggleButtonValues(event) {\n //iterates through each element in global settings array\n for (var count = 0; count < settings.length; count++) {\n //if id of clicked element matches with the name of the settings option\n if (event.target.id == settings[count].name) {\n //enable or disable the option\n settings[count].isDisabled = !event.target.checked;\n break;\n }\n }\n}", "disable() {\n this.disabled = true;\n }", "disable() {\n this.disabled = true;\n }", "disable() {\n this.disabled = true;\n }", "updateDisabled_() {\n this.disabled_ =\n this.settingsDisabled || this.sources.length < NUM_REQUIRED_SOURCES;\n }", "setEnabled(enabled) {\n this.enabled_ = enabled;\n if (this.baseEl_) {\n if (enabled) {\n this.baseEl_.removeAttr('disabled');\n } else {\n this.baseEl_.attr('disabled', 'disabled');\n }\n }\n }", "toggleEnabled() {\n this.setState({ enabled: !this.state.enabled });\n }", "function toggleOvernightCalcselect (e){\n e.preventDefault();\n\n var state = $('#deposits-overnight-calcselect').val();\n var disabledMap = [undefined,'#deposits-overnight-interestgain','#deposits-overnight-principal','#deposits-overnight-interest','#deposits-overnight-interestdays'];\n var interesttypeElem = $('#deposits-overnight-interesttype');\n\n disabledMap.forEach(function(ind, value){\n $(ind).prop(\"disabled\", false);\n if (Number(value) === Number(state)){\n $(ind).prop(\"disabled\", true);\n $(ind).val('');\n }\n });\n\n /** show modal if interest rate is computation mode and step interest are chosen (not computable) */\n if(interesttypeElem.val() === 'true' && state === \"3\"){\n $('#deposits-overnight-calcselectModal').modal();\n }\n\n /** turn off period input choice */\n if(state === \"4\"){\n $('#deposits-overnight-periodselect').prop(\"disabled\", true);\n } else {\n $('#deposits-overnight-periodselect').prop(\"disabled\", false);\n }\n\n }", "function toggleSelectSettingsBox( selectedType ) {\n\n if ( $.inArray( selectedType, BPXprofileCFTRAdmin.selectableTypes ) !== -1 ) {\n $selectBox.show();\n } else {\n $selectBox.hide();\n }\n\n }", "function toggleDisabled1(_checked) {\n document.getElementById('opcshw1').disabled = _checked ? false : true;\n }", "set isActiveAndEnabled(value) {}", "set isActiveAndEnabled(value) {}", "set isActiveAndEnabled(value) {}", "disable () {\n this.disabled = true\n }", "function enableDisableSTAP2PBase()\n{\n var enabled = document.getElementById('stap2pDHCPEnable_1').checked; \n \n project.systemFiles.CONFIG_TYPE_IP_CONFIG.STA_IP_MODE = enabled? \"True\" : \"False\";\n saveProjectAPI();\n \n document.getElementById('staipAddrText' ).disabled = enabled;\n document.getElementById('stasubnetMaskText').disabled = enabled;\n document.getElementById('stadgwText' ).disabled = enabled;\n document.getElementById('stadnsText' ).disabled = enabled; \n}", "function toggleSelect() {\n if (glassesOptionElement.checked)\n glassesSelectElement.setAttribute('disabled', '');\n else\n glassesSelectElement.removeAttribute('disabled', '');\n}", "function disabled(){}", "function disabled(){}", "function disabled(){}", "function disabled(){}", "get isEnabled() { return !this.state.disabled }", "function dState(){ if ($(\"#assignClient\").is(\":enabled\")) $(\"#assignClient\").prop(\"disabled\", true); }", "disable () {\n this.getFormElement().setAttribute('disabled', 'true');\n this.getUIElement().classList.add(this.options.disabledClass);\n }", "onDisable() {}", "function _disable() {\n \n // Get toolbar\n var toolbar = $(\"#main-window-toolbar\");\n \n // If toolbar active, deactivate\n if (toolbar.hasClass(\"active\")) {\n toolbar.removeClass(\"active\");\n }\n \n // Set disabled\n _isEnabled = false;\n PreferencesStorage.setValue(\"enabled\", _isEnabled);\n \n // If primary\n if (_isPrimary) {\n // Remove notification\n _removeNotification();\n }\n }", "function setDisable(value) {\n element.children().attr('disabled', value);\n element.find('input').attr('disabled', value);\n }", "function setDisable(value) {\n element.children().attr('disabled', value);\n element.find('input').attr('disabled', value);\n }", "function setDisable(value) {\n element.children().attr('disabled', value);\n element.find('input').attr('disabled', value);\n }", "function setDisabled(disabled) {\n nameBox.disabled = authorBox.disabled = copyrightBox.disabled = disabled\n\n sectionsEditor.disabled = playOrderEditor.disabled = disabled\n\n playTimeEditor.disabled = textEditor.disabled = disabled\n\n duplicateButton.disabled = disabled\n removeButton.disabled = disabled\n}", "toggleSelectedFilterTypes (type) {\n const newState = this.state;\n newState.selectedFilterTypes[type] = !newState.selectedFilterTypes[type];\n this.setState(newState);\n }", "disable() {\n BluetoothSerial.disable()\n .then(res => this.setState({ isEnabled: false }))\n .catch(err => {\n Toast.showShortBottom(err.message);\n BackHandler.exitApp();\n });\n }", "setDisabledState(isDisabled) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', isDisabled);\n }", "set enabled(value) {}", "set enabled(value) {}", "set enabled(value) {}", "set enabled(value) {}", "function printradioDisabled() {\n\n\t$('.record-sections input[type=radio]').on( 'change', function() {\n\n\t\tvar ck = $(\".record-sections input[type=radio]:checked\").val();\n\t\tswitch(ck)\t{\n\t\t\tcase 'printall':\n\t\t\t\t$(\".record-sections input[type=checkbox]\").attr('disabled');\n\t\t\t\treturn;\n\t\t\tcase 'printsome':\n\t\t\t\t$(\".record-sections input[type=checkbox]\").removeAttr('disabled');\n\t\t\t\treturn;\n\t\t}\n\n\n\t\t// if($(this).prop( 'checked', 'checked' )) {\n\t\t// \t$(\".record-sections input[type=checkbox]\").prop('disabled', true);\n\t\t// }\n\t\t// if($(this).prop( 'checked', '' )) {\n\t\t// \t$(\".record-sections input[type=checkbox]\").removeProp('disabled');\n\t\t// }\n\t\t// else {\n\t\t// \t$(\".record-sections input[type=checkbox]\").prop('enabled', true);\n\t\t// }\n\t});\n}", "function setArrayDisabled(arrayToDisable, mode, type, howMany) {\n for (let i = 0; i < arrayToDisable.length; i++) {\n if (type == 'button') {\n if (i < howMany) {\n setButtonDisabled(arrayToDisable[i], mode);\n } else {\n setButtonDisabled(arrayToDisable[i], !mode);\n }\n } else {\n if (i < howMany) {\n arrayToDisable[i].disabled = mode;\n } else {\n arrayToDisable[i].disabled = !mode;\n }\n\n }\n }\n}", "doDisable(disable) {\n const {\n constructor\n } = this,\n cls = 'featureClass' in constructor ? constructor.featureClass : `b-${constructor.$name.toLowerCase()}`; // Some features do not use a cls\n\n if (cls) {\n this.client && this.client.element && this.client.element.classList[disable ? 'remove' : 'add'](cls);\n }\n\n if (!this.isConfiguring) {\n if (disable) {\n /**\n * Fired when the plugin/feature is disabled.\n * @event disable\n * @param {Core.mixin.InstancePlugin} source\n */\n this.trigger('disable');\n } else {\n /**\n * Fired when the plugin/feature is enabled.\n * @event enable\n * @param {Core.mixin.InstancePlugin} source\n */\n this.trigger('enable');\n }\n }\n }", "function enableSettings(inEnable, inPracticeMode){\r\n\tinPracticeMode = inPracticeMode || false;\r\n\t//console.log(`enableSettings :: inPracticeMode=${inPracticeMode}`);\r\n\t$('#setNumCards').prop('disabled', (!inEnable));\r\n\t$('#setLimitThinkingTime').prop('disabled', (!inEnable));\r\n\t$('#chkComputerPlayer').prop('disabled', ((!inEnable)) || inPracticeMode);\r\n\t$('#setMaxHumanPlayers').prop('disabled', ((!inEnable)) || inPracticeMode);\r\n\t//$('#setMaxHumanPlayers').prop('disabled', (!inEnable));\r\n\t\r\n\t//Practice mode: preset obvious options\r\n\t$('#chkComputerPlayer').prop('checked', true);\r\n\t$('#setMaxHumanPlayers').val(\"1\");\r\n}" ]
[ "0.6340964", "0.6200438", "0.6188212", "0.60327375", "0.6007668", "0.60059935", "0.6003571", "0.6003571", "0.59805083", "0.59062713", "0.5861645", "0.5861645", "0.5861645", "0.5861645", "0.5861645", "0.5861645", "0.5861645", "0.5861645", "0.58345854", "0.58214885", "0.5814175", "0.5803021", "0.5802831", "0.5794164", "0.5740945", "0.5721988", "0.5717008", "0.57139117", "0.5711197", "0.57111305", "0.5705507", "0.5684585", "0.5678959", "0.56670177", "0.565047", "0.564572", "0.5623582", "0.5609679", "0.55817264", "0.5572756", "0.55709845", "0.55043596", "0.54965955", "0.54922384", "0.5490338", "0.54774725", "0.5469096", "0.5430463", "0.5429686", "0.5428164", "0.54053503", "0.5389134", "0.5389134", "0.5389134", "0.53877074", "0.5379283", "0.53628004", "0.53481615", "0.5345076", "0.5342628", "0.53408694", "0.532751", "0.532751", "0.532751", "0.53248966", "0.531448", "0.53136045", "0.53125215", "0.52992123", "0.52917874", "0.5286537", "0.5286537", "0.5286537", "0.5281384", "0.52788776", "0.5273557", "0.5245689", "0.5245689", "0.5245689", "0.5245689", "0.5242688", "0.5232805", "0.5227719", "0.5225676", "0.5224816", "0.5224576", "0.5224576", "0.5224576", "0.5224077", "0.5223533", "0.52135795", "0.5211129", "0.5197297", "0.5197297", "0.5197297", "0.5197297", "0.518495", "0.51823217", "0.51812214", "0.5176616" ]
0.6089805
3
handle user config selections
function initSelectionHandler(){ $('button#select').on('click', function(e){ var $filelist = $('#filelist'); // clear the list and add the new selections $filelist.find('tr[data-source="config-browser"]').each(function(idx, tr){ var selection = getSelectionFromTR(tr); $filelist.trigger({type: 'config:removed', source: 'config-browser', selection: selection}); }); $(selections).each(function(idx, selection){ $filelist.trigger({type: 'config:added', source: 'config-browser', selection: selection}); }); selections = []; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postSetGUIConfig() {\n\tvar values = null;\n\tif (values != null) {\n\t\t// initialize defaults\n\t\tbulk_value_edit = false;\n\t\tcell_value_edit = false;\n\t\t$('#enableEdit').css('display', 'none');\n\t\tfile_download = false;\n\t\tview_tags = false;\n\t\tview_URL = false;\n\t\t\n\t\tif (values.contains('bulk_value_edit')) {\n\t\t\tbulk_value_edit = true;\n\t\t}\n\t\tif (values.contains('cell_value_edit')) {\n\t\t\tcell_value_edit = true;\n\t\t\t$('#enableEdit').css('display', '');\n\t\t}\n\t\tif (values.contains('file_download')) {\n\t\t\tfile_download = true;\n\t\t}\n\t\tif (values.contains('view_tags')) {\n\t\t\tview_tags = true;\n\t\t}\n\t\tif (values.contains('view_URL')) {\n\t\t\tview_URL = true;\n\t\t}\n\t} else {\n\t\tbulk_value_edit = true;\n\t\tcell_value_edit = true;\n\t\t$('#enableEdit').css('display', '');\n\t\tfile_download = true;\n\t\tview_tags = true;\n\t\tview_URL = true;\n\t}\n}", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function chooseConfig() {\n\t$(\"#configs\").val(null);\n\tcloseaccordion(\"currentConfigAcc\");\n\tdocument.getElementById(\"chooseConfigDialog\").style.display = \"block\";\n\toptimizeforsource();\n\tshowstep3();\n}", "handleProfileSelection(event) {\n event.stopPropagation();\n this.selectedProfileOption = event.detail.value;\n this.sendSelectedOptions();\n }", "function action_selected_configuration() {\n\t$('div.configoption').on('click', 'a[data-scheme-id]', function(e) {\n\t\te.preventDefault();\n\t\tvar oForm = $('form#primaryform');\n\t\tvar oDoor = $(this);\n\t\tvar oDoorOptions = oDoor.parent('div.configoptionbox');\n\n\t\t// remove pick warning\n\t\t$('span#step3-warning').fadeOut('fast');\n\n\t\t// get the configuration data\n\t\tvar iScheme = oDoor.data('scheme-id');\n\t\tvar sConfiguration = oDoor.data('configuration');\n\t\tvar bUpdateHandlePosition = ( $('input[name=configuration]').val() != sConfiguration ) ? true : false;\n\t\tvar sHardwareOptionGroup = $(this).parent().data('hardware-picker');\n\n\t\t// set initial handle position\n\t\tvar sHandlePosition = oDoor.data('handle-on');\n\t\t// var sSlidingPosition = oDoor.data('slide-to');\n\n\t\t// set the required fields based on the selected door type\n\t\t$('input[name=sliding_door_scheme_id]', oForm).val(iScheme);\n\n\t\t// set the number of panels\n\t\t$('input[name=number_panels]').val(oDoor.data('panels'));\n\n\t\t// set the sliding position\n\t\t// $('input[name=sliding_direction]').val(sSlidingPosition);\n\n\t\t// set the handle position\n\t\t$('input[name=handle_position]').val(sHandlePosition);\n\n\t\t// set the required data for the selected configuration\n\t\t$('.step1configuration .configoption a.active').removeClass('active');\n\t\t$(this).addClass('active');\n\n\t\t/*\n\t\t// show the hover image for the selected scheme\n\t\t$('.step1configuration .configoption a img.normal').removeClass('hidden');\n\t\t$('.step1configuration .configoption a img.hover').addClass('hidden');\n\t\t$('img.hover', $(this)).removeClass('hidden');\n\t\t$('img.normal', $(this)).addClass('hidden');\n\t\t*/\n\n\t\t// show tick on the option selected\n\t\t$('.step1configuration .configoption a img.normal').removeClass('hidden');\n\t\t$('.step1configuration .configoption a img.hover').addClass('hidden');\n\t\t$('img.hover', $(this)).addClass('hidden');\n\t\t$('img.normal', $(this)).removeClass('hidden');\n\n\t\t/*\n\t\t// if we have a handle to choose, get it - not needed for the sliding doors\n\t\tif(typeof $(this).parent('div.configoptionbox').attr('data-handle') !== 'undefined') {\n\t\t\t// prepare the doors to be picked\n\t\t\t$('a.picker.left img').attr('src', base_url+'/assets/images/partials/left-'+ oDoorOptions.data('panels-left') +'.png');\n\t\t\t$('a.picker.right img').attr('src', base_url+'/assets/images/partials/right-'+ oDoorOptions.data('panels-right') +'.png');\n\n\t\t\t// set the handle back to default position if required\n\t\t\tif( bUpdateHandlePosition ) {\n\t\t\t\t$('input[name=handle_position]').val(sHandlePosition);\n\t\t\t}\n\n\t\t\t// return false;\n\t\t\t$('div#step1-1').fadeOut('fast', function() {\n\t\t\t\t// load in the step 1-2 layout\n\t\t\t\t$('div#step1-2').removeClass('hidden').fadeIn('fast', function() {\n\t\t\t\t\t// check if we need to clear the existing door handle selected\n\t\t\t\t\tif($('div.handle-picker-container').attr('data-configuration') != sConfiguration) {\n\t\t\t\t\t\t// clear the selected handle visual\n\t\t\t\t\t\t$('div.handle-picker-container a').removeClass('selected');\n\t\t\t\t\t}\n\n\t\t\t\t\t// assign selected configuration to the handle container\n\t\t\t\t\t$('div.handle-picker-container').attr('data-configuration', sConfiguration);\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\t// set the handle back to default position if required\n\t\t\tif( bUpdateHandlePosition ) {\n\t\t\t\t$('input[name=handle_position]').val(sHandlePosition);\n\t\t\t}\n\t\t}\n\t\t*/\n\n\t\t// show the appropriate hardware options\n\t\t$('div#hardware div.group').addClass('hidden');\n\t\t$('div#hardware div#hardware-content').removeClass('hidden');\n\t\t$('div#hardware div#'+sHardwareOptionGroup).removeClass('hidden');\n\n\t\t// get the price for this configuration\n\t\tupdate_image_and_price();\n\t});\n}", "function userSelection() {\n writeLog(\"Selection: \" + userChoice);\n writeLog(\"Search Item: \" + searchItem);\n switch (userChoice) {\n case \"help\":\n console.log(\"The following options are valid:\");\n console.log(\"-----------------------------------------------------------------------\");\n console.log(\"'node liri concert-this <artist>' --> search bandsintown for the artist\");\n console.log(\"'node liri spotify-this-song <song>' --> search spotify for the song\");\n console.log(\"'node liri movie-this <movie>' --> search omdb for the movie\");\n console.log(\"'node liri do-what-it-says' --> read commands from the random.txt file and execute\");\n break;\n case \"concert-this\":\n doConcertThis(searchItem);\n break;\n case \"spotify-this-song\":\n doSpotifyThisSong(searchItem);\n break;\n case \"movie-this\":\n doMovieThis(searchItem);\n break;\n case \"do-what-it-says\":\n doWhatItSays(searchItem);\n break;\n default:\n writeLog(\"You gave me '\" + userChoice + \"' which is not a valid option. Enter 'node liri help' to display valid options.\");\n }\n}", "function showConfigUser() {\n\n\tdocument.getElementById('sel_editor_font_size').value = v_editor_font_size;\n\tdocument.getElementById('sel_interface_font_size').value = v_interface_font_size;\n\tdocument.getElementById('sel_editor_theme').value = v_theme_id + '/' + v_editor_theme;\n\n\tdocument.getElementById('txt_confirm_new_pwd').value = '';\n\tdocument.getElementById('txt_new_pwd').value = '';\n\n\tdocument.getElementById('chk_enable_chat').checked = ((v_enable_omnichat == 1) ? true : false);\n\n\tdocument.getElementById('sel_csv_encoding').value = v_csv_encoding;\n\tdocument.getElementById('txt_csv_delimiter').value = v_csv_delimiter;\n\n\t$('#div_config_user').addClass('isActive');\n\n}", "function userOptions() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"managerSelection\",\n message: \"What would you like to do?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit\"]\n }\n ])\n .then(function (answer) {\n switch (answer.managerSelection) {\n case 'View Products for Sale':\n viewProducts();\n break;\n case 'View Low Inventory':\n viewLowInventory();\n break;\n case 'Add to Inventory':\n addToInventory();\n break;\n case 'Add New Product':\n addNewProduct();\n break;\n default:\n closeAndExit();\n }\n });\n}", "function loadUserConfig(e) {\n readSingleFile(e, (configString) => {\n try {\n config = JSON.parse(configString)\n loadConfig(config)\n resizeEditorForContent(inputEditor, 20)\n resizeEditorForContent(editor, 40)\n toastr.success('Successfully loaded your saved config', 'Success')\n } catch (e) {\n toastr.error('Your config backup should be a JSON file, is that the right file ?', 'Error')\n }\n })\n}", "function changeConfiguration(e)\r\n\t\t{\r\n\t\t\tvar element = e.target;\r\n\r\n\t\t\tif (element.type == 'checkbox')\r\n\t\t\t{\r\n\t\t\t\tif (element.checked == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tlsSetVal(\"hosts\", element.id, true);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tlsSetVal(\"hosts\", element.id, false);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}", "function options(){\n\n \tswitch(userInput) {\n\n\t\tcase \"my-tweets\": \n\t\tmyTweets(); \n\t\tbreak;\n\n\t\tcase \"spotify-this-song\": \n\t\tspotifyThisSong(); \n\t\tbreak;\n\n\t\tcase \"movie-this\":\n\t\t movieThis(); \n\t\t break;\n\n\t\tcase \"do-what-it-says\": \n\t\tdoWhatItSays(); \n\t\tbreak;\n\t}\n}", "function getUserOptions() {\n\n\t/* READ USER SETTINGS FILE HERE */\t\n\twindow.gBulkDeleteDays = 3;\n\twindow.gMarkReadOnVisit = true;\n\twindow.gFeedOrder = 0;\n\twindow.gDefaultFormats = [ 0, 1, 0];\n\twindow.gFormat = gDefaultFormats[gcSTATUS_UNREAD];\n}", "function handleAccountSelect(option) {\n deselectSelectedItem()\n if (option === 'create-new') {\n if (backendAddress !== null) {\n // Create new account\n var newName = prompt(\"New account name\")\n // Remove whitespace from beginning and end of input\n if (newName !== null) {\n newName = newName.trim()\n if (newName !== null && newName !== \"\") {\n // Create account then switch to that new account - if a duplicate name is entered, enter that account\n createUser(newName, backendAddress, function() {\n // Update list of users\n listUsers(backendAddress, (users) => {\n setUsers(users)\n // Get new user's content - usually empty unless duplicate name used\n getUserContent(newName, backendAddress, function(incomingContent){\n setUsername(newName)\n setContent(formatContent(incomingContent))\n })\n })\n })\n }\n }\n }\n } else if (option === EMPTY_USER) {\n setUsername(EMPTY_USER)\n setContent([])\n } else {\n // Default - switch to an existing user\n var username = option\n getUserContent(username, backendAddress, function(content) {\n setUsername(username)\n setContent(formatContent(content))\n })\n }\n }", "function onchange(){\n var cfg_input = $(this);\n var cfg_vals = config_form.find('.cfg_input, .custom_val').serializeArray();\n var custom_input = config_form.find('#custom_attribute_' + cfg_input.data('oe-id'));\n var value = cfg_input.val();\n\n /* Send all values from the form to backend */\n value_onchange(cfg_vals);\n\n if (cfg_input.is(':checked')) {\n if (cfg_input.attr('type') == 'radio') {\n var radio_inputs = config_form.find(\"input[name='\" + cfg_input.attr('name') + \"']\")\n radio_inputs.each(function(){\n if ($(this) != cfg_input) {\n $(this).parent().removeClass('active');\n }\n });\n }\n cfg_input.parent().addClass('active');\n }\n else {\n $(this).parent().removeClass('active');\n }\n\n if (custom_input && value == 'custom'){\n custom_input.attr('readonly', false);\n custom_input.closest('div.cfg_custom').removeClass('hidden');\n }\n else {\n custom_input.attr('readonly', 'readonly');\n custom_input.closest('div.cfg_custom').addClass('hidden')\n if (cfg_vals && $(this).hasClass('cfg_img_update')){\n update_config_image(cfg_vals);\n }\n }\n }", "function showConfigUser() {\n\n\tdocument.getElementById('sel_interface_font_size').value = v_font_size;\n\tdocument.getElementById('sel_editor_theme').value = v_theme;\n\n\tdocument.getElementById('txt_confirm_new_pwd').value = '';\n\tdocument.getElementById('txt_new_pwd').value = '';\n\n\tdocument.getElementById('sel_csv_encoding').value = v_csv_encoding;\n\tdocument.getElementById('txt_csv_delimiter').value = v_csv_delimiter;\n\n\t$('#modal_config').modal({ backdrop: 'static', keyboard: false });\n\n}", "function Main() {\n configApp(roleSelection);\n}", "function authServerChangeMode(selName){\n var selValue = comboSelectedValueGet (selName);\n if (!selValue) \n return;\n switch (parseInt(selValue, 10)) {\n case 1: /* Local User Database */\n case 3: /* LDAP Server */\n\t\tcase 4: /* POP3 */\n\t\tcase 5: /* Active Directory */\n\t\tcase 6: /* NT Domain */\n\t\t\t fieldStateChangeWr('tf1_authenticationType', '', '', '');\n\t\t\t vidualDisplay('tf1_authenticationType', 'hide');\n\t\t\t vidualDisplay('break_authenticationType', 'hide');\n break;\n case 2: /* Radius Server */\n\t\t\tfieldStateChangeWr('', '', 'tf1_authenticationType', '');\n\t\t\tvidualDisplay('tf1_authenticationType', 'configRow');\n\t\t\tvidualDisplay('break_authenticationType', 'break');\n\t\tbreak;\n }\n}", "function handleOptsClick() {\n let option = this.id;\n log('Handling checkbox change for ' + option);\n switch (option) {\n case \"xedx-loggingEnabled-opt\":\n opt_loggingEnabled = this.checked;\n GM_setValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n debugLoggingEnabled = opt_loggingEnabled;\n debug('Saved value for opt_loggingEnabled');\n break;\n case \"xedx-hidefedded-opt\":\n opt_hidefedded = this.checked;\n GM_setValue(\"opt_hidefedded\", opt_hidefedded);\n debug('Saved value for opt_hidefedded');\n break;\n case \"xedx-hidefallen-opt\":\n opt_hidefallen = this.checked;\n GM_setValue(\"opt_hidefallen\", opt_hidefallen);\n debug('Saved value for opt_hidefallen');\n break;\n case \"xedx-devmode-opt\":\n opt_devmode = this.checked;\n GM_setValue(\"opt_devmode\", opt_devmode);\n hideDevOpts(!opt_devmode);\n debug('Saved value for opt_devmode');\n break;\n case \"xedx-hidetravel-opt\":\n opt_hidetravel = this.checked;\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n debug('Saved value for opt_hidetravel');\n break;\n case \"xedx-showcaymans-opt\":\n opt_showcaymans = this.checked;\n if (opt_showcaymans) {\n $('#xedx-hidetravel-opt').prop(\"checked\", false);\n opt_hidetravel = false;\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n }\n GM_setValue(\"opt_showcaymans\", opt_showcaymans);\n debug('Saved value for opt_showcaymans');\n break;\n case \"xedx-hidehosp-opt\":\n opt_hidehosp = this.checked;\n GM_setValue(\"opt_hidehosp\", opt_hidehosp);\n debug('Saved value for opt_hidehosp');\n break;\n case \"xedx-disabled-opt\":\n opt_disabled = this.checked;\n opt_disabled ? observerOFF() : observerON();\n indicateActive();\n GM_setValue(\"opt_disabled\", opt_disabled);\n debug('Saved value for opt_disabled');\n break;\n case \"xedx-viewcache-btn\":\n displayCache();\n break;\n default:\n debug('Checkbox ID not found!');\n }\n updateUserLevels('handleOptsClick');\n }", "function handleEventType() {\n if (eventType.options[eventType.selectedIndex].value !== '') {\n //check if #event-config is empty, if not clear element.\n clearEventConfig();\n\n //create header\n let selectedTitle = eventType.options[eventType.selectedIndex].text;\n let formGroupTitle = document.createElement('h3');\n formGroupTitle.innerText = selectedTitle;\n\n eventConfig.appendChild(formGroupTitle);\n\n //Load config options\n let selectedOp = eventType.options[eventType.selectedIndex].value;\n let option = types[selectedOp];\n\n //Create Config Elements\n for (let key in option) {\n if (option.hasOwnProperty(key)) {\n let eventConfigInput = new Form(eventConfig, option[key]);\n eventConfigInput.createInput();\n }\n }\n } else {\n clearEventConfig();\n }\n}", "function setOptions() {\n if(user) {\n $scope.options.ignoreEmails = user.emailsToIgnore;\n $scope.options.calendarId = user.managingCalendar;\n } else {\n $http.get('/auth/user')\n .then(\n function(response) {\n //Success\n PropertiesService.set('user', response.data);\n user = PropertiesService.get('user');\n setOptions();\n },\n function() {\n //Error\n console.log(\"No user can be found. Please log out, then try again.\");\n }\n )\n }\n }", "function didReceiveConfigData(event) {\n if(chatTopicsTestMode) { return; }\n\n // Load chat topics\n var $select = $(event.target).find('.chatUI-.middle #chatForm #ccPreSurvey .selectBox');\n $.ajax({\n dataType: 'json',\n url: '/bin/twc/chatQueues.json/' + SOAID,\n success: function(data) { data.length > 0 ? $select.trigger(DID_RECEIVE_DATA, [{items:data}]) : $select.trigger(DID_RECEIVE_DATA_EMPTY); }\n });\n }", "function handleStateChanges(){\n\n /*\n * Handle events on dialog show.\n */\n $('#configSelectionModal').on('show.bs.modal', function(e){\n selections = [];\n $('table#filelist tr.config').each(function(idx, tr){\n var selection = getSelectionFromTR($(tr));\n selections.push(selection);\n });\n runSearch();\n });\n\n /*\n * Listen for remove events on the filelist and update\n * selections accordingly.\n */\n $('table#configurations').on('filelist:removed', function(e){\n $(selections).each(function(idx, selection){\n if (selection.uid === e.selection.uid) {\n selections.splice(idx, 1);\n }\n });\n runSearch();\n });\n\n /*\n * Listen for configurations being added to the filelist\n * and update state on this.\n */\n $('table#configurations').on('config:added', function(e){\n selections.push(e.selection);\n toggleCheckboxes(e.selection, true);\n });\n\n $('table#configurations').on('config:removed', function(e){\n toggleCheckboxes(e.selection, false);\n });\n }", "function loadOptions() {\n\n\t\tvar preferences = controller.getPreferences();\n\n\t\tvar domainParts = preferences.domain.split(\"/\");\n\t\tvar domain = String.format(\"{0}//{1}\", domainParts[0], domainParts[2]);\n\n\t\t$(\"#domain\").val(domain);\n\t\t$(\"#interval\").val(preferences.interval / 1000);\n\t\t$(\"#notificationUsers\").val(preferences.notificationUsers);\n\t\t$(\"#changeset\").val(preferences.changeset);\n\n\t}", "function selectUser(e, ui) {\n\tvar id = ui.item.id,\n\tname = ui.item.value;\n\tif (id) {\n\t\tsearchUsers(id, name);\n\t}\n}", "function selectionsHandler() {\n logger.info('selection handler');\n\n if ($.currentProduct.isProductSelected()) {\n $.store_availability_button.setColor(Alloy.Styles.color.text.mediumdark);\n } else {\n $.store_availability_button.setColor(Alloy.Styles.color.text.light);\n }\n\n $.pdp_header_controller.setProductID($.currentProduct.getSelectedProductId());\n}", "function changeAuthType(selId){\n\tvar selValue = comboSelectedValueGet (selId);\n\tif (!selValue) return;\t\t\n switch (selValue){\n \t\tcase 'local':\t/* local*/\n \t\t\tfieldStateChangeWr ('tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile', '', '', '');\n \t\tvidualDisplay ('tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile','hide');\t \n \t\tvidualDisplay ('break_sslNTDOMAINProfile break_sslActiveDirectoryProfile break_sslLDAPProfile break_sslRadiusProfile','hide'); \t\t\t\n \t\tbreak;\n \t\tcase 'radius_pap':\t/* radius_pap*/\n \t\tcase 'radius_chap':\t/* radius_chap*/\n \t\tcase 'radius_mschap':\t/* radius_mschap*/\n \t\tcase 'radius_mschapv2':\t/* radius_mschapv2*/\n \t\t\tfieldStateChangeWr ('tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile', '', 'tf1_sslRadiusProfile', '');\n \t\tvidualDisplay ('tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile','hide'); \n \t\tvidualDisplay ('break_sslNTDOMAINProfile break_sslActiveDirectoryProfile break_sslLDAPProfile','hide');\n \t\tvidualDisplay ('tf1_sslRadiusProfile','configRow');\t \n \t\tvidualDisplay ('break_sslRadiusProfile','break');\n\t\tbreak;\n \t\tcase 'ntdomain':\t/* ntdomain*/\n \t\t\tfieldStateChangeWr ('tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile', '', 'tf1_sslNTDOMAINProfile', '');\n \t\tvidualDisplay ('tf1_sslActiveDirectoryProfile tf1_sslLDAPProfile tf1_sslRadiusProfile','hide'); \n \t\tvidualDisplay ('break_sslActiveDirectoryProfile break_sslLDAPProfile break_sslRadiusProfile','hide');\n \t\tvidualDisplay ('tf1_sslNTDOMAINProfile','configRow');\t \n \t\tvidualDisplay ('break_sslNTDOMAINProfile','break');\n\t\tbreak; \t\t\t\n \t\tcase 'active-directory':\t/* active-directory*/\n \t\t\tfieldStateChangeWr ('tf1_sslNTDOMAINProfile tf1_sslLDAPProfile tf1_sslRadiusProfile', '', 'tf1_sslActiveDirectoryProfile', '');\n \t\tvidualDisplay ('tf1_sslNTDOMAINProfile tf1_sslLDAPProfile tf1_sslRadiusProfile','hide'); \n \t\tvidualDisplay ('break_sslNTDOMAINProfile break_sslLDAPProfile break_sslRadiusProfile','hide');\n \t\t\n \t\tvidualDisplay ('tf1_sslActiveDirectoryProfile ','configRow');\t \n \t\tvidualDisplay ('break_sslActiveDirectoryProfile','break');\n\t\tbreak;\n \t\tcase 'ldap':\t/* ldap*/\n \t\t\tfieldStateChangeWr ('tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslRadiusProfile', '', 'tf1_sslLDAPProfile', ''); \t\t\t\n \t\t\tvidualDisplay ('tf1_sslNTDOMAINProfile tf1_sslActiveDirectoryProfile tf1_sslRadiusProfile','hide');\t \n \t\tvidualDisplay ('break_sslNTDOMAINProfile break_sslActiveDirectoryProfile break_sslRadiusProfile','hide'); \n \t\t\t\n \t\tvidualDisplay ('tf1_sslLDAPProfile','configRow');\t \n \t\tvidualDisplay ('break_sslLDAPProfile','break');\n \t\tbreak;\n \t}\n}", "function selectUser(user) {\n $rootScope.$emit(\"changeUser\", user);\n }", "handleCommentFormUserUpdate(selection) {\n let name = selection[\"label\"];\n let netids = this.nameToNetID.get(name);\n this.resourceNetIDOptions = [];\n for (let i = 0; i < netids.length; i++) {\n this.resourceNetIDOptions.push({ label: netids[i], value: 1 });\n }\n this.setState({ updatedCommentUser: selection, updatedCommentNetID: \"\", updatedCommentData: \"\" });\n }", "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n }", "function handle_configuration_event (input) {\n var target_val = input.val(),\n target_spec = $('.summary .specs .' + input.attr('name'));\n\n if(target_val.length) {\n update_dedicated_summary(input, target_spec);\n }else{\n target_spec.remove();\n }\n\n update_config_total_price ();\n\n\n }", "function handleChange(event){\n let name = event.target.name;\n let value = event.target.value;\n if(name==='username')setUsername(value)\n if(name==='password')setPassword(value)\n if(name==='comment')setComment(value)\n }", "function handleOptionChange(selection) {\n setFieldValue(props.name, selection)\n props.onValueChange && props.onValueChange()\n }", "function selectionChangedHandler() {\n var flex = $scope.ctx.flex;\n var current = flex.collectionView ? flex.collectionView.currentItem : null;\n if (current != null) {\n $scope.selectedTaskId = current.taskId;\n $scope.selectedUserName = current.userName;\n } else {\n $scope.selectedTaskId = -1;\n $scope.selectedUserName = \"\";\n }\n manageActions();\n }", "function MatSelectConfig() { }", "function loadConfig(session) {\n console.debug(\"Loading user config\")\n\n inputEditor.getSession().setValue(session.input_data, -1)\n $('#custom_logstash_patterns_input').val(session.custom_logstash_patterns)\n $('#filter_regex_enabled').prop('checked', session.filter_regex_enabled)\n $('#filter_reverse_match_enabled').prop('checked', session.filter_reverse_match_enabled)\n $('#filter_display').val(session.filter_display)\n $(\"#number_lines_display option[data-value='\" + session.number_lines_display + \"']\").attr(\"selected\", \"selected\");\n editor.getSession().setValue(session.logstash_filter, -1)\n applyFieldsAttributes(session.input_fields)\n if (session.custom_codec != \"\") {\n enableMultilineCodec(session.custom_codec)\n } else {\n disableMultilineCodec()\n }\n if (session.remote_file_hash != undefined) {\n fileUploadEnabled(session.remote_file_hash)\n checkRemoteFile()\n } else {\n fileUploadDisabled()\n }\n}", "function handleDropdownSelection(e) {\n var $a = (0, _jquery2.default)(e.target);\n var value = $a.attr('data-value');\n updateOption(this, value, $a.hasClass('aui-dropdown2-checked'));\n}", "function run(userSelection) {\n\n switch (userSelection) {\n case \"spotify-this-song\":\n\n if (userInputConcat.length != 0) {\n search_track(userInputConcat.trim());\n } else if (textSong.length != 0) {\n search_track(textSong.trim());\n } else {\n search_track(\"The Sign Ace of Base\");\n }\n break;\n case \"concert-this\":\n\n getConcertInfo(userInputConcat);\n\n break;\n\n case \"movie-this\":\n\n if (userInputConcat.length != 0) {\n getMovieInfo(userInputConcat.trim(), displayNobodyInfo);\n\n } else {\n displayNobodyInfo = true;\n getMovieInfo(\"Mr. Nobody\", displayNobodyInfo);\n }\n break;\n case \"do-what-it-says\":\n readFile();\n break;\n default:\n break;\n\n }\n}", "function commandConfig(cliParams, configGenerator, helper, userConfigFlag) {\n\n // switch the number of sub-commands\n switch (cliParams.slice(1).length) {\n\n case 0:\n // list all config options\n console.log(userConfigFlag ? '** not yet implemented for userconfig **' : configGenerator.list());\n break;\n\n case 1:\n // list config option specified in first sub-command\n console.log(userConfigFlag ? '** not yet implemented for userconfig **' : configGenerator(cliParams[1]));\n break;\n\n case 2:\n // if first sub-command is `remove` then remove from config, key specified in second sub-command\n // else set key/value as first/second sub-command\n if (cliParams[1] === 'remove') {\n helper.promptYesNo('Are you sure you want to write new config to disk? [Yn]', function () {\n configGenerator(cliParams[2], null, userConfigFlag);\n }, helper.chalk.red('aborted config change'), 'y');\n } else {\n helper.promptYesNo('Are you sure you want to write new config to disk? [Yn]', function () {\n configGenerator(cliParams[1], cliParams[2], userConfigFlag);\n }, helper.chalk.red('aborted config change'), 'y');\n }\n break;\n }\n }", "function main(){\n init_config_form();\n K.ui.bind_action(A);\n }", "function handleThisChange(e, value){\n console.log(value)\n selectedCourses = value\n console.log(selectedCourses)\n}", "function handleSelection(value) {\n setCategory(value);\n setVisible(false);\n }", "function MatSelectConfig() {}", "function option_changed (input) {\n var panel = input.closest('.panel'),\n specs = $('.summary .specs'),\n label = input.closest('li').find('label');\n\n var add_ons = $('.server-configurator .summary .specs ul'),\n target = add_ons.find('.' + input.attr('name'));\n\n if(target.length < 1) {\n var data_target = input.closest('[data-target]');\n\n if (data_target.length) {\n data_target = data_target.attr('data-target');\n\n target = $('ul.' + data_target).find('.' + input.attr('name'));\n }\n }\n\n if(input.attr('type') == 'checkbox'){\n handle_checkbox_addon(input, target, add_ons, label);\n }else{\n handle_radio_addon(input, target, add_ons, label);\n }\n\n if(add_ons.find('li').length > 1){\n $('#no_add_ons').hide();\n }else{\n $('#no_add_ons').show();\n }\n\n update_config_total_price();\n }", "function handleSelectEvent(event) {\n var selectedElement = event.target;\n \n var targetURL = selectedElement.getAttribute(\"selectTargetURL\");\n if (!targetURL) {\n return;\n }\n \n if(targetURL == \"backend/templates/featured.xml\")\n refreshFlag = true;\n else\n refreshFlag = false;\n \n targetURL = baseURL + targetURL;\n\n \n if (selectedElement.tagName == \"menuItem\") {\n updateMenuItem(selectedElement, targetURL);\n }\n else {\n pushPage(targetURL);\n }\n}", "function selectOrgHandler() {\n var orgID;\n\n // reset the current form\n clearForm();\n\n // Get the selected org ID\n orgID = $(\"#cbOrg\").find('option:selected').val();\n // Check to see if the current org is valid\n if (orgID > 0)\n {\n // Get the organizaiton record for the current org selection\n currentOrg = getCurrentOrganization(orgID, Organizations);\n // Make sure a valid organizaiotn was found\n if (currentOrg != undefined) {\n\n loadFormData();\n }\n }\n else {\n refreshForm();\n\n }\n // Make sure the new controls are still not editable\n setEditMode(false,false);\n }", "function config_selectionBox(label, id, op_labels, op_values, dflt) {\n\t\n\tthis.label = label;\n\tthis.id = id;\n\tthis.currentValue = GM_getValue(id, dflt);\n\tthis.defaultVal = dflt;\n\tthis.options = op_labels;\n\tthis.values = op_values;\n\tthis.list;\n\t\n\tthis.draw = function (parentNode) {\n\t\tvar disp = $create(\"p\", {\n\t\t\ttextContent : this.label + \": \",\n\t\t\tclassName : \"confLbl\"\n\t\t});\n\t\tthis.list = $create(\"select\", {\n\t\t\tname : this.id,\n\t\t\tclassName : \"opli\"\n\t\t});\n\t\tvar SR = this;\n\t\tthis.list.addEventListener(\"change\", function(event) { \n\t\t\tGM_setValue(SR.list.name, SR.list.value);\n\t\t}, true);\n\t\t// Creates the desired Options with the given values and ids\n\t\tfor (var lo = 0; lo < this.options.length; lo++) {\n\t\t\tvar op = $create(\"option\", {\n\t\t\t\ttextContent : this.options[lo],\n\t\t\t\tvalue : this.values[lo],\n\t\t\t\tid : this.id + \"_\" + lo\n\t\t\t});\n\t\t\tif (this.values[lo] == this.currentValue) {\n\t\t\t\top.selected = true;\n\t\t\t}\n\t\t\tthis.list.appendChild(op);\n\t\t}\n\t\t\n\t\tvar hldr = $create('div', {\n\t\t\tclassName : 'config_option'\n\t\t});\n\t\t\n\t\thldr.appendChild(disp);\n\t\thldr.appendChild(this.list);\n\t\tparentNode.appendChild(hldr);\n\t};\n\t\n\tthis.setDefault = function () {\n\t\tif (this.list) {\n\t\t\tthis.list.value = this.defaultVal;\n\t\t\tGM_setValue(this.id, this.defaultVal);\n\t\t}\n\t};\n}", "function selectionChanged(evt) {\n\t\tvar ctx = evt.data;\n\t\tvar $allSelected = $(this).find(':selected');\n\t\tvar value = $allSelected.attr('value');\n\t\tvar $selectedOptions = ctx.$options.find('[data-value=\"' + value + '\"]');\n\t\tselectUpdateValue(ctx, $selectedOptions, undefined, false);\n\t}", "async get_user_config(uuid) {\n\n var config = await this.database.select('settings', {uuid: uuid, mainkey: 'config'});\n if (config.length == 0) \n return false;\n var result = {}\n config.forEach(item => {\n result[item.subkey] = JSON.parse(item.value);\n })\n return result;\n\n }", "function itemSelected (app) {\n const param = app.getSelectedOption();\n console.log('USER SELECTED: ' + param);\n if (!param) {\n app.ask('Sorry, was that?');\n } else if (param === SELECTION_KEY_INTERFACE) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here\\'s android interface')\n .addSimpleResponse('Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard..`)\n .setTitle('Android Interface')\n .addButton('Read more')\n .setImage('http://www.conceptdraw.com/solution-park/resource/images/solutions/android-user-interface/Software-development-Android-User-Interface-Design-Elements-Android-Tabs61.png', 'Android Interface')\n)\n);\n } else {\n app.ask('Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard. Now tell me if there\\'s anything else you want to know about Android. Maybe android version history or What is stack overflow.');\n}\n } else if (param === SELECTION_KEY_VIRTUAL) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. The platform is built into Android starting with Android Nougat, differentiating from standalone support for VR capabilities. The software is available for developers, and was released in 2016..`)\n .setTitle('Virtual reality')\n .addButton('Read more')\n .setImage('http://www.androidos.in/wp-content/uploads/2015/03/google-cardboard-1.jpg', 'Memory')\n)\n);\n } else {\n app.ask('At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. Now tell me if there\\'s anything else you want to know about Android. Maybe android history or Android Memory management');\n}\n } else if (param === SELECTION_KEY_APPLICATION) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Java may be combined with C/C++, together with a choice of non-default runtimes that allow better C++ support. The Go programming language is also supported, although with a limited set of application programming interfaces (API). In May 2017, Google announced support for Android app development in the Kotlin programming language..`)\n .setTitle('Android Application')\n .addButton('Read more')\n .setImage('http://cdn2.ubergizmo.com/wp-content/uploads/2015/03/Android-Applications.jpg', 'Application')\n)\n);\n } else {\n app.ask('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s anything else you want to know about Android. Maybe should need to know about Android kernel or What is stack overflow.');\n}\n } else if (param === SELECTION_KEY_MEMORY) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Since Android devices are usually battery-powered, Android is designed to manage processes to keep power consumption at a minimum. Now tell me if there\\'s something else that might you interested about Android?. Maybe android version history or what is android AOSP')\n .addBasicCard(app.buildBasicCard(`When an application is not in use the system suspends its operation so that, while available for immediate use rather than closed, it does not use battery power or CPU resources.[94][95] Android manages the applications stored in memory automatically: when memory is low, the system will begin invisibly and automatically closing inactive processes, starting with those that have been inactive for longest...`)\n .setTitle('Memory management')\n .addButton('Read more')\n .setImage('https://mobworld.files.wordpress.com/2010/07/processimage.jpg?w=500', 'Memory management')\n)\n);\n } else {\n app.ask('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s something else that might you interested about Android?. Maybe android version history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_GINGERBREAD) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Gingerbread\\'s user interface was refined in many ways, making it easier use, and more power-efficient. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`Gingerbread'\\s user interface was refined in many ways, making it easier to master, faster to use, and more power-efficient. A simplified color scheme with a black background gave vividness and contrast to the notification bar, menus, and other user interface components. Improvements in menus and settings resulted in easier navigation and system control.`)\n .setTitle('Gingerbread')\n .addButton('Read more')\n .setImage('https://www.technobuffalo.com/wp-content/uploads/2011/04/android-2-3-gingerbread.png', 'Gingerbread')\n)\n);\n } else {\n app.ask('Gingerbread\\'s user interface was refined in many ways, making it easier to use, and more power-efficient. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is Github ');\n}\n } else if (param === SELECTION_KEY_HONEYCOMB) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Honeycomb debuted with the Motorola Xoom in February 2011`)\n .setTitle('HoneyComb')\n .addButton('Read more')\n .setImage('https://i.amz.mshcdn.com/CencC65482MTabHzEy4F9EQqxrs=/356x205/2012%2F12%2F04%2Fe5%2Fintelpromis.bNW.jpg', 'HoneyComb')\n)\n);\n } else {\n app.ask('Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP ');\n}\n } else if (param === SELECTION_KEY_ICE_CREAM) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Ice Cream Sandwich\" is a codename for the Android mobile operating system developed by Google, that is no longer supported. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`The Ice Cream Sandwich release also introduced a number of other new features, including a refreshed home screen, near-field communication (NFC) support and the ability to \"beam\" content to another user using the technology, an updated web browser, a new contacts manager with social network integration, the ability to access the camera and control music playback from the lock screen, visual voicemail support, face recognition for device unlocking (\"Face Unlock\"), the ability to monitor and limit mobile data usage, and other internal improvements.`)\n .setTitle('Ice Cream Sandwich')\n .addButton('Read more')\n .setImage('http://cache.gawkerassets.com/assets/images/17/2011/05/icecreamsandwich.jpg', 'Ice Cream Sandwich')\n)\n);\n } else {\n app.ask('Android \"Ice Cream Sandwich\" is a codename for the Android mobile operating system developed by Google, that is no longer supported. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android features');\n}\n } else if (param === SELECTION_KEY_JELLBEAN) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Jelly Bean\" is the codename given to three major point releases of the Android mobile operating system developed by Google, spanning versions between 4.1 and 4.3.1, that are no longer supported. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('The first of these three, 4.1, was unveiled at Google\\'s I/O developer conference in June 2012, focusing on performance improvements designed to give the operating system a smoother and more responsive feel, improvements to the notification system allowing for \"expandable\" notifications with action buttons, and other internal changes. Two more releases were made under the Jelly Bean name in October 2012 and July 2013 respectively, including 4.2—which included further optimizations, multi-user support for tablets, lock screen widgets, quick settings, and screen savers, and 4.3—contained further improvements and updates to the underlying Android platform.')\n .setTitle('Jelly Bean')\n .addButton('Read more')\n .setImage('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcShdeTjcbZyQNNYfJodHgvpAMSFlPBFf63nne9oxdR4E1TOsazC', 'JellyBean')\n)\n);\n } else {\n app.ask('Android \"Jelly Bean\" is the codename given to three major point releases of the Android mobile operating system developed by Google, spanning versions between 4.1 and 4.3.1, that are no longer supported. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android Kernel ');\n}\n } else if (param === SELECTION_KEY_KITKAT) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Unveiled on September 3, 2013, KitKat focused primarily on optimizing the operating system for improved performance on entry-level devices with limited resources. Each Android OS has a title referring to a sweet treat.')\n .setTitle('Kitkat')\n .addButton('Read more')\n .setImage('http://d2rormqr1qwzpz.cloudfront.net/photos/2013/11/01/54929-jpeg.jpg', 'Kitkat')\n)\n);\n } else {\n app.ask('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_LOLLIPOP) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Lollipop\" is a codename for the Android mobile operating system developed by Google, spanning versions between 5.0 and 5.1.1, that is supported with security patches only. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Gingerbread\\'s user interface was refined in many ways, making it easier to master, faster to use, and more power-efficient. A simplified color scheme with a black background gave vividness and contrast to the notification bar, menus, and other user interface components. Improvements in menus and settings resulted in easier navigation and system control.')\n .setTitle('Lollipop')\n .addButton('Read more')\n .setImage('https://www.technobuffalo.com/wp-content/uploads/2011/04/android-2-3-gingerbread.png', 'Lollipop')\n)\n);\n } else {\n app.ask('Android \"Lollipop\" is a codename for the Android mobile operating system developed by Google, spanning versions between 5.0 and 5.1.1, that is supported with security patches only. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_MARSHMALLOW) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Marshmallow\" (codenamed Android M during development) is the sixth major version of the Android operating system. First released as a beta build on May 28, 2015, it was officially released on October 5, 2015, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android.?')\n .addBasicCard(app.buildBasicCard('Marshmallow primarily focuses on improving the overall user experience of its predecessor, Lollipop. It introduced a new permissions architecture, new APIs for contextual assistants (first used by a new feature \"Now on Tap\" to provide context-sensitive search results), a new power management system that reduces background activity when a device is not being physically handled, native support for fingerprint recognition and USB Type-C connectors, the ability to migrate data and applications to a microSD card, and other internal changes.')\n .setTitle('Marshmallow')\n .addButton('Read more')\n .setImage('https://www.androidcentral.com/sites/androidcentral.com/files/styles/w400h225crop/public/article_images/2015/12/android-marshmallow-4_0.jpg?itok=GsKySY9O&timestamp=1449673415', 'Marshmallow')\n)\n);\n } else {\n app.ask('Android \"Marshmallow\" (codenamed Android M during development) is the sixth major version of the Android operating system. First released as a beta build on May 28, 2015, it was officially released on October 5, 2015, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_NOUGAT) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Nougat\" (codenamed Android N during development) is the seventh major version of the Android operating system. First released as an alpha test version on March 9, 2016, it was officially released on August 22, 2016, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Nougat introduces notable changes to the operating system and its development platform, including the ability to display multiple apps on-screen at once in a split-screen view, support for inline replies to notifications, and an expanded \"Doze\" power-saving mode that restricts device functionality once the screen has been off for a period of time. Additionally, the platform switched to an OpenJDK-based Java environment and received support for the Vulkan graphics rendering API, and \"seamless\" system updates on supported devices.')\n .setTitle('Nougat')\n .addButton('Read more')\n .setImage('https://9to5google.files.wordpress.com/2016/07/nougat.jpg?quality=82&strip=all&w=1000', 'Nougat')\n)\n);\n } else {\n app.ask('Android \"Nougat\" (codenamed Android N during development) is the seventh major version of the Android operating system. First released as an alpha test version on March 9, 2016, it was officially released on August 22, 2016, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_O) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API. Now tell me if there\\'s something else that might you interested about Android?.')\n .addBasicCard(app.buildBasicCard('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API')\n .setTitle('Android O')\n .addButton('Read more')\n .setImage('https://www1-lw.xda-cdn.com/files/2017/03/android-o-logo1.png', 'Android O')\n)\n);\n } else {\n app.ask('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API. Now tell me if there\\'s something else that might you interested about Android?. Maybe android history or what is android AOSP');\n}\n } else {\n app.ask('Sorry but You selected an unknown item');\n } \n}", "function showUserSettingsDialog() {\n\tvar dispatcher = tp.dialogs.showDialog(\"userSettingsDialog\", \"#user-settings\");\n\taddEventHandlerUserSettingsDialog();\n\tvar languageElement = d3.select(\"input[name=language]\");\n\tvar currentLanguage = languageElement.property(\"value\");\n\tdispatcher\n\t\t.on(\"ok\", function() {\n\t\t\tvar newLanguage = languageElement.property(\"value\");\n\t\t\ttp.session.storeSettings('user.settings', { lang: newLanguage }, function(error, data) {\n\t\t\t\tif(error) {\n\t\t\t\t\tconsole.error(error, data);\n\t\t\t\t\ttp.dialogs.closeDialogWithMessage(dispatcher.target, \"errorDialog\", \"#store-settings-failed\");\n\t\t\t\t} else {\n\t\t\t\t\ttp.lang.setDefault(newLanguage);\t// Use chosen language for following dialogs\n\t\t\t\t\ttp.dialogs.closeDialog(dispatcher.target);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn false;\n\t\t})\n\t\t.on(\"cancel\", function() {\n\t\t\ttp.lang.setDefault(currentLanguage);\n\t\t})\n\t;\n}", "async function chooseWhatToHandle()\n{\n\n\tlet txt = \"Que voulez vous gèrer ? : \"\n\tlet choice = [\n\t{\n\t\tname: \"Gestions des droits utilisateurs.\",\n\t\tvalue: 0\n\t},\n\t{\n\t\tname: \"Gestions des channel\",\n\t\tvalue: 1\n\t},\n\t{\n\t\tname: \"Retour à la liste des serveurs\",\n\t\tvalue: -1\n\t}]\n\n\tlet response = await ask([\n\t{\n\t\ttype: \"list\",\n\t\tmessage: txt,\n\t\tname: \"selected\",\n\t\tchoices: choice\n\t}])\n\n\tif (response.selected == -1)\n\t{\n\t\tchooseServer()\n\t\treturn true\n\t}\n\telse if (response.selected == 0)\n\t{\n\t\tmanageUser()\n\t}\n\telse if (response.selected == 1)\n\t{\n\t\taskWhatToDoChan()\n\t}\n}", "handleChangeSelection(option) {\n const sidebar = document.querySelector('aside.sidebar');\n const results = this.props.options.filter((opt) => opt.option === option);\n const { type, key } = results[0];\n\n sidebar.classList.remove('nfl', 'mlb', 'nba', 'nhl');\n sidebar.classList.add(key);\n\n this.props.onChangeSelection(option, type, key);\n this.handleMenuLeave();\n this.setState({ userSelectedOption: true });\n }", "function selectUser ( user ) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n self.toggleList();\n self.loadDataFromFirebase();\n // console.log(self.selected);\n }", "function handleSelectionAccountList(e) {\n\tif (currentPage == \"corp/account/finalize/acc_finalize\") {\n\t\thandleSelectionAccountListClose();\n\t\t\n\t\tif ((e.selectedValue1 != undefined) && (e.selectedValue1 != null)) {\n\t\t\tdocument.getElementById(\"id.accountno\").value = e.selectedValue1;\n\t\t}\n\t}\n}", "_selectionHandler(activeProject) {\n for (projectElement of this.projects) {\n projectElement.markUnchecked();\n }\n activeProject.markChecked();\n this.emitter.emit('did-change-path-selection', activeProject.path);\n }", "function mySelectEvent() {\n let val = sel.value();\n if (val == 'square') {\n bgCol = new p5.Oscillator('square');\n } else if (val == 'triangle') {\n bgCol = new p5.Oscillator('triangle');\n } else if (val == 'sine') {\n bgCol = new p5.Oscillator('sine');\n }\n }", "function options() {\n\tstorage.getf().then((props) => {\n\t\tjira.profile(props.url).then((profile) => {\n\t\t\tdirect.speak(S(MENU_OPTION_INITIAL).template({\n\t\t\t\tname: profile.displayName\n\t\t\t}).s);\n\n\t\t\tdefineOption1(props.url, props.project);\n\t\t\tdefineOption2(props.url, props.project);\n\t\t}, (error) => {\n\t\t\tcommands = {};\n\t\t\tdirect.speak(jira.errors(error));\n\t\t});\n\t});\n}", "function enableOptions(arg) {\n var appearance = document.getElementById(\"propertypanel\");\n var selectedElement = document.getElementsByClassName(\"e-remove-selection\");\n if (arg.newValue) {\n if (arg.newValue[0] instanceof ej2_react_diagrams_1.Node) {\n selectedElement[0].classList.remove(\"e-remove-selection\");\n }\n else {\n if (!appearance.classList.contains(\"e-remove-selection\")) {\n appearance.classList.add(\"e-remove-selection\");\n }\n }\n }\n}", "_dispatchSelectionChange(isUserInput = false) {\n this.selectionChange.emit({\n source: this,\n isUserInput,\n selected: this.selected\n });\n }", "function handleBoundryChange(){\n var object = {};\n\n object['boundry-region-1'] = document.getElementById('admin-region-1').checked;\n object['boundry-region-2'] = document.getElementById('admin-region-2').checked;\n\n handleGisMenuChange(object);\n}", "function bindBtnMe() {\n $(\"#userNameTimesheet option\").filter(function () {\n return $(this).text() === $(\".loggedUser\").text();\n }).prop('selected', true).trigger('change');\n}", "function selectEntryToExamine(item) {\n\tvar selectionList = [item.user]\n\tconsole.log(\"geomap selection:\",selectionList)\n\tvar outObject = {'user':selectionList}\n\tOWF.Eventing.publish(\"entity.selection\",selectionList)\n}", "handleSelect(value) {\n\t\tthis.setValue(value, true)\n\t}", "function handleSaveUserPreferences() {\n\t\t\tvar version = $('#extendedVersionPrefs').find(\":selected\").text();\n\t\t\tvar language = $('#languagePrefs').find(\":selected\").text();\n\t\t\tvar routingLanguage = $('#routingLanguagePrefs').find(\":selected\").text();\n\t\t\tvar distanceUnit = $('#unitPrefs').find(\":selected\").text();\n\n\t\t\t//version: one of list.version\n\t\t\tversion = preferences.reverseTranslate(version);\n\n\t\t\t//language: one of list.languages\n\t\t\tlanguage = preferences.reverseTranslate(language);\n\n\t\t\t//routing language: one of list.routingLanguages\n\t\t\troutingLanguage = preferences.reverseTranslate(routingLanguage);\n\n\t\t\t//units: one of list.distanceUnitsInPopup\n\t\t\tdistanceUnit = distanceUnit.split(' / ');\n\t\t\tfor (var i = 0; i < distanceUnit.length; i++) {\n\t\t\t\tfor (var j = 0; j < list.distanceUnitsPreferences.length; j++) {\n\t\t\t\t\tif (distanceUnit[i] === list.distanceUnitsPreferences[j]) {\n\t\t\t\t\t\tdistanceUnit = list.distanceUnitsPreferences[j];\n\t\t\t\t\t\ti = distanceUnit.length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttheInterface.emit('ui:saveUserPreferences', {\n\t\t\t\tversion : version,\n\t\t\t\tlanguage : language,\n\t\t\t\troutingLanguage : routingLanguage,\n\t\t\t\tdistanceUnit : distanceUnit\n\t\t\t});\n\n\t\t\t//hide preferences window\n\t\t\t$('#sitePrefsModal').modal('hide');\n\t\t}", "function setUserPreferences(version, language, routingLanguage, distanceUnit) {\n\t\t\t//setting version\n\t\t\tvar container = $('#extendedVersionPrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.version.length; i++) {\n\t\t\t\tif (list.version[i] === version) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//setting language\n\t\t\tcontainer = $('#languagePrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.languages.length; i++) {\n\t\t\t\tif (list.languages[i] === language) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//setting routingLanguage\n\t\t\tcontainer = $('#routingLanguagePrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.routingLanguages.length; i++) {\n\t\t\t\tif (list.routingLanguages[i] === routingLanguage) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//setting distanceUnit\n\t\t\tcontainer = $('#unitPrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.distanceUnitsPreferences.length; i++) {\n\t\t\t\tif (list.distanceUnitsPreferences[i] === distanceUnit) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "handleSelect(event) {\n\t\tthis.setState({\n\t\t\tselectedValue: event.target.value\n\t\t}, () => {\n\t\t\tthis.themeChanged(true);\n\t\t});\n\t}", "function optionChanged(){\n init();\n}", "function selectUser(event) {\n var editBtn = $(event.target);\n editIndex = editBtn.attr(\"id\").split('-')[1];\n selectedUserId = users[editIndex]._id;\n try {\n userService.findUserById(selectedUserId)\n .then(function (userInfo) {\n console.log(\"userInfo from findUserById\", userInfo);\n $usernameFld.val(userInfo.username);\n $passwordFld.val(userInfo.password);\n $firstNameFld.val(userInfo.firstName);\n $lastNameFld.val(userInfo.lastName);\n $roleFld.val(userInfo.role);\n selectedUser = userInfo;\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "function evtHandler() {\n // console.log(\"event handler initialized\");\n //jQuery('#editbox').dialog({'autoOpen': false});\n\n jQuery('#list-usePref li').click(function () {\n\n resetClass(jQuery(this), 'active');\n jQuery(this).addClass('active');\n // console.log(\"colorSelector: \",colorSelector);\n triggerViz(styleVal);\n\n });\n\n }", "handleSelectionChange(event) {\n console.log(`Selected assignee: ${event.detail}`);\n this.assignedTo = event.detail[0]; //task can only handle 1 assignee, so no multiple selection handling needed\n }", "handleColor(newState) {\n\t\tconsole.log(\"Cor selecionada: \" + newState.selected);\n\n\t\t// when selecting \"Qualquer\" pass a null so backend do not verify\n\t\tif(newState.selected == \"Qualquer\") {\n\t\t\tthis.setState({ selectedColor: \"\" });\n\t\t}\n\t\telse {\n\t\t\t// save selected genre\n\t\t\tthis.setState({ selectedColor: newState.selected });\n\t\t}\n\n\t\t// give options for next step\n\t\tthis.setState({ optionsSizes: sizes });\n\t}", "function loadUserOptions() {\r\n\r\n var username = getMyName();\r\n \r\n Highlight_Neutral_Traits = GM_getValue(username + \".highlight_traits\");\r\n \r\n Highlight_Neutral_Traits = (Highlight_Neutral_Traits == null) ? [] : Highlight_Neutral_Traits.split(\",\");\r\n\r\n Highlight_Good_Traits = GM_getValue(username + \".highlight_good_traits\");\r\n \r\n Highlight_Good_Traits = (Highlight_Good_Traits == null) ? [] : Highlight_Good_Traits.split(\",\");\r\n\r\n Highlight_Bad_Traits = GM_getValue(username + \".highlight_bad_traits\");\r\n \r\n Highlight_Bad_Traits = (Highlight_Bad_Traits == null) ? [] : Highlight_Bad_Traits.split(\",\");\r\n\r\n}", "function onChangeSelect(){\n app.activeSoftware = [];\n selected = d3.select(this) // select the select\n .selectAll(\"option:checked\") // select the selected values\n .each(function() { \n app.activeSoftware.push(this.value);\n }); // for each of those, get its value\n createTable();\n}", "function saveAndDismissConfig(event) {\n // This function may also be called when the user presses the 'enter' key while focused in a text field\n if (event && event.which !== 13) { // 13 is the key code for the 'enter' key\n return;\n }\n \n // Register site settings and dismiss \n compiler.register(vm.configParams).then(\n function(response) {\n dismissConfig();\n \n // Update properties that pertain to the \"compiler receipt\"\n vm.compilerMeta = response;\n vm.compilerOutput = '';\n vm.receiptActive = true;\n \n // Update 'selectedSite' label based on available data (either the response or the 'sitename' from the config params)\n vm.selectedSite = ((response && response.Project) || compiler.get('sitename'));\n vm.selectedTemplate = compiler.get('template');\n },\n function(response) {\n alert(response);\n }\n );\n }", "function saveDefaultOptions() {\n var prj = document.getElementById('project').value = 'Sunshine';\n var usr = document.getElementById('user').value = 'nyx.linden';\n saveOptions();\n}", "function selectionMade()\n{\n\t//Get value currently selected\n\tvar e = document.getElementById(\"selector\");\n\tvar value = e.options[e.selectedIndex].value;\n\n //Enter neccessary function\n\tif(value == \"income\"){ setup(); }\n if(value == \"marijuana\"){ marijuana(); }\n}", "function selectUser(user) {\n self.selected = angular.isNumber(user) ? $scope.users[user] : user;\n self.toggleList();\n\n appContextService.setselectedService(self.selected);\n\n $location.path(user.url);\n\n }", "function captivePortalChangeMode(selName){\n var selValue = comboSelectedValueGet (selName);\n if (!selValue) \n return;\n $(\"#tf1_configurationName\").show();\n $('#tf1_configurationName').prop('disabled', false);\n $(\"#tf1_configurationName_billing\").hide();\n $('#tf1_configurationName_billing').prop('disabled', 'disabled');\n\n\n switch (parseInt(selValue, 10)) {\n case 1: /* Free */\n fieldStateChangeWr('tf1_configurationNameSla tf1_configurationName tf1_enableRedirect tf1_UrlName tf1_authenticationServer tf1_captivePortalProfileSlaBlock tf1_captivePortalProfileBlock', '', '', '');\n vidualDisplay('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock tf1_enableRedirect tf1_UrlName tf1_authenticationServer tf1_configurationName tf1_captivePortalProfileBlock', 'hide');\n vidualDisplay('break_enableRedirect break_UrlName break_configurationNameSla', 'hide');\n\tbreak;\n case 2: /* SLA */\n fieldStateChangeWr('tf1_authenticationServer tf1_configurationName tf1_authenticationType tf1_configurationName_billing tf1_configurationName tf1_captivePortalProfileBlock', '', 'tf1_enableRedirect tf1_UrlName tf1_configurationNameSla', '');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_configurationName tf1_captivePortalProfileBlock tf1_configurationName', 'hide');\n vidualDisplay('break_authenticationServer break_authenticationType break_configurationName break_captivePortalProfileBlock', 'hide');\n vidualDisplay('tf1_enableRedirect tf1_UrlName tf1_configurationNameSla tf1_captivePortalProfileSlaBlock', 'configRow');\n vidualDisplay('break_enableRedirect break_UrlName', 'break');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n break;\n case 3: /* Permanent User */\n fieldStateChangeWr('tf1_configurationName_billing tf1_configurationNameSla', '', 'tf1_authenticationServer tf1_authenticationType tf1_configurationName tf1_captivePortalProfileSlaBlock tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', '');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName tf1_configurationName', 'configRow');\n vidualDisplay('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock', 'hide');\n vidualDisplay('break_authenticationServer break_configurationNameSla break_authenticationType break_configurationName break_captivePortalProfileBlock break_enableRedirect break_UrlName', 'break');\n authServerChangeMode('tf1_authenticationServer');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n break;\n case 4: /* Temporary User */\n fieldStateChangeWr('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock tf1_configurationName_billing tf1_authenticationServer tf1_authenticationType', '', 'tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', '');\n vidualDisplay('tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', 'configRow');\n vidualDisplay('break_configurationName break_configurationNameSla break_captivePortalProfileBlock break_enableRedirect break_UrlName', 'break');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_captivePortalProfileSlaBlock', 'hide');\n vidualDisplay('break_authenticationServer break_authenticationType', 'hide');\n authServerChangeMode('tf1_authenticationServer');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n break; \n case 5: /* Billing */\n fieldStateChangeWr('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock tf1_authenticationServer tf1_authenticationType tf1_configurationName', '', 'tf1_configurationName_billing tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', '');\n vidualDisplay('tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', 'configRow');\n vidualDisplay('break_configurationName break_configurationNameSla break_captivePortalProfileBlock break_enableRedirect break_UrlName', 'break');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_captivePortalProfileSlaBlock', 'hide');\n vidualDisplay('break_authenticationServer break_authenticationType', 'hide');\n authServerChangeMode('tf1_authenticationServer');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n $(\"#tf1_configurationName_billing\").show();\n $('#tf1_configurationName_billing').prop('disabled', false);\n $(\"#tf1_configurationName\").hide();\n $('#tf1_configurationName').prop('disabled', 'disabled');\n }\n}", "function action_configuration_options() {\n\t$('ul.click-options > li').click(function() {\n\t\tvar oSelectedOption = $(this);\n\t\tvar oContainer = oSelectedOption.parent();\n\t\tvar sTarget = oSelectedOption.parent().data('target');\n\t\tvar message = '';\n\n\t\t// if this option cannot be clicked, do not process the click\n\t\tif(oSelectedOption.hasClass('unclickable')) return;\n\n\t\t// clear selected option from this group and add selected to the chosen option\n\t\t$('li', oContainer).removeClass('selected');\n\t\toSelectedOption.addClass('selected');\n\n\t\t// set the value of the selected to option to the bound field\n\t\t$('input[name='+ sTarget +']').val(oSelectedOption.data('value'));\n\n\n\t\t// -- rules\n\n\t\t// check if we need to show the threshold warning message\n\t\tif(oContainer.attr('data-target') == 'threshold_id' && oContainer.data('warning-shown') == false && oSelectedOption.data('value') == '2') {\n\t\t\toContainer.data('warning-shown', true);\n\t\t\tmessage = '<small>Whilst a low threshold is available we highly recommend choosing a standard threshold for various technical and relevant reasons.</small>';\n\t\t\t$('div.modal div#warning-message').html(message);\n\t\t\t$('div.warning-message').modal('show');\n\t\t}\n\n\t\t// rules for the cill option\n\t\tif(oContainer.attr('data-target') == 'cill') {\n\t\t\tif(oSelectedOption.data('value') == '1' || oSelectedOption.data('value') == '2') {\n\t\t\t\t$('div.threshold ul li').removeClass('selected');\n\t\t\t\t$('div.threshold ul li[data-value=1]').addClass('selected');\n\t\t\t\t$('div.threshold ul li[data-value=2]').addClass('faded').addClass('unclickable');\n\t\t\t\t$('input[name=threshold_id]').val('1');\n\t\t\t} else {\n\t\t\t\t$('div.threshold ul li[data-value=2]').removeClass('faded').removeClass('unclickable');\n\t\t\t}\n\t\t}\n\n\n\t\t// update the image and price\n\t\tupdate_image_and_price();\n\t});\n}", "function updateUserProfileSelections()\n{\t\t\n\t//Check Boardings/Deboardings selections\n\tif(document.getElementById(\"boardings\").checked && document.getElementById(\"deboardings\").checked)\n\t\tuser.boardingDeboarding = 3;\n\telse if(document.getElementById(\"boardings\").checked)\n\t\tuser.boardingDeboarding = 1;\n\telse if(document.getElementById(\"deboardings\").checked)\n\t\tuser.boardingDeboarding = 2;\n\telse\n\t\tuser.boardingDeboarding = 0;\n\n\t//bus lines\n\tvar buslineSelectList = document.getElementById(\"buslines\"); //get the selected element\n\tvar allBusLineOptions = buslineSelectList && buslineSelectList.options; //extract all of its options\n\tvar selectedBusLineOptions = new Array();\t\n\tfor(i = 1; i < allBusLineOptions.length; i++)\n\t{\n\t\tif(allBusLineOptions[i].selected)\n\t\t\tselectedBusLineOptions.push(allBusLineOptions[i].value);\n\t}\n\tuser.buslines = selectedBusLineOptions;\t\n\n\t//days\n\tvar daysSelectList = document.getElementById(\"days\"); //get the selected element\n\tvar allDaysOptions = daysSelectList && daysSelectList.options; //extract all of its options\n\tvar selectedDaysOptions = new Array();\t\n\tfor(i = 1; i < allDaysOptions.length; i++)\n\t{\n\t\tif(allDaysOptions[i].selected)\n\t\t\tselectedDaysOptions.push(allDaysOptions[i].value);\n\t}\n\tuser.currentTime.days = selectedDaysOptions;\n\n\t//days of the week\n\tvar daysOfWeekSelectList = document.getElementById(\"daysOfWeek\"); //get the selected element\n\tvar allDaysOfWeekOptions = daysOfWeekSelectList && daysOfWeekSelectList.options; //extract all of its options\n\tvar selectedDaysOfWeekOptions = new Array();\t\n\tfor(i = 1; i < allDaysOfWeekOptions.length; i++)\n\t{\n\t\tif(allDaysOfWeekOptions[i].selected)\n\t\t\tselectedDaysOfWeekOptions.push(parseInt(allDaysOfWeekOptions[i].value));\n\t}\t\n\n\tif(selectedDaysOfWeekOptions.length > 0) //filter currently selected days with days of the week that were selected\n\t{\n\t\tvar newDays = new Array();\n\n\t\tif(user.currentTime.days.length > 0)\n\t\t{\n\t\t\tfor(i = 0; i < user.currentTime.days.length; i++) //days\n\t\t\t{\n\t\t\t\tvar day = user.currentTime.days[i];\n\t\t\t\tvar date = new Date(user.currentTime.year, user.currentTime.month, day);\n\t\t\t\t\n\t\t\t\tif(selectedDaysOfWeekOptions.indexOf(date.getDay()) != -1)\n\t\t\t\t\tnewDays.push(day);\n\t\t\t}\n\t\t}\n\t\tif(user.currentTime.days.length == 0)\n\t\t{\n\t\t\tfor(i = 1; i <= 31; i++) //days\n\t\t\t{\n\t\t\t\tvar day = i;\n\t\t\t\tvar date = new Date(user.currentTime.year, user.currentTime.month, day);\n\n\t\t\t\tif(selectedDaysOfWeekOptions.indexOf(date.getDay()) != -1)\n\t\t\t\t\tnewDays.push(day);\n\t\t\t}\n\t\t}\n\n\t\tuser.currentTime.days = newDays;\n\t}\n\n\t//hours\n\tvar hoursSelectList = document.getElementById(\"hours\"); //get the selected element\n\tvar allHoursOptions = hoursSelectList && hoursSelectList.options; //extract all of its options\n\tvar selectedHoursOptions = new Array();\t\n\tfor(i = 1; i < allHoursOptions.length; i++)\n\t{\n\t\tif(allHoursOptions[i].selected)\n\t\t\tselectedHoursOptions.push(allHoursOptions[i].value);\n\t}\n\tuser.currentTime.hours = selectedHoursOptions;\t\n\n\t//stops\n\tvar stopsSelectList = document.getElementById(\"stops\"); //get the selected element\n\tvar allStopsOptions = stopsSelectList && stopsSelectList.options; //extract all of its options\n\tvar selectedStopsOptions = new Array();\t\n\tfor(i = 1; i < allStopsOptions.length; i++)\n\t{\n\t\tif(allStopsOptions[i].selected)\n\t\t\tselectedStopsOptions.push(allStopsOptions[i].text);\n\t}\n\tuser.busStops = selectedStopsOptions;\t\t\t\n\n\tif(user.busStops.length == 0)\n\t\tprocessSelectionData();\n\telse\n\t\tprocessStopSelectionData();\n}", "handleSelect(event){\n const selected = event.detail.name;\n this.selectedItem = selected; \n if(selected == 'upload'){\n this.uploadFileModal = true;\n }else { \n this.uploadFileModal = false;\n }\n if(selected == 'isNewfolder'){\n this.closedModel = true;\n }else{\n this.closedModel = false;\n } \n }", "handlePick() {\n const randomNumber = Math.floor(Math.random() * this.state.options.length);\n const option = this.state.options[randomNumber];\n }", "function add_new_user_selection(type){\n\tif(type==0){\n\t\t$(\"#add_professor_option\").prop(\"checked\", false);\n\t\t$(\"#aem_tr\").show();\n\t\t$(\"#add_user_type\").val('0');\n\t}else{\n\t\t$(\"#add_student_option\").prop(\"checked\", false);\n\t\t$(\"#aem_tr\").hide();\n\t\t$(\"#add_user_type\").val('1');\n\t}\n}", "handleSelection(event) {\n this.pollEverySec(this.interval);\n const eventData = event.detail;\n const fields = {\n Name: eventData.name,\n EventType: eventData.type,\n PrimaryPersonId: this.contactId,\n EventDate: new Date().toISOString()\n };\n this.showNewLifeEventPage(fields, \"new\");\n }", "function companySelectHandler(event) {\n var companyID;\n // Declare a local variable to store the ID of the current company\n companyID = $(\"#formCompanyList\").find('option:selected').val();\n // orgID = $(\"#orgList\").find('option:selected').val();\n localCompany = getCurrentCompany(companyID);\n\n loadForm(localCompany);\n\n // Load the master roles to use when defining the current org roles\n loadMasterRolesByCompany(localCompany.CompanyID,populateMasterRoles, errorHandler);\n\n // Set the current company\n// setCompany(companyID);\n }", "onoptionChange(e) {\n\n this.setState({\n user_owes: e,\n })\n }", "function mainOptions() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View\",\n \"Add\",\n \"Delete\",\n \"Update\"\n ]\n })\n .then(function (answer) {\n switch (answer.action) {\n\n case \"View\":\n viewChoice();\n break;\n\n case \"Add\":\n addChoice();\n break;\n\n case \"Delete\":\n deleteChoice()\n break;\n\n case \"Update\":\n updateChoice()\n break;\n\n\n }\n });\n\n}", "function setingDirectOptions() {\n switch (vm.getCurrentUser().role) {\n case 'cda':\n vm.addUser = true;\n vm.addClient = true;\n vm.addVehicle = true;\n break;\n case 'admin':\n vm.addUser = true;\n vm.addClient = true;\n vm.addVehicle = true;\n break;\n case 'sede':\n vm.addUser = true;\n vm.addClient = true;\n vm.addVehicle = true;\n break;\n case 'flota':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = true;\n break;\n case 'tecnico':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = true;\n break;\n case 'tecnico flota':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = true;\n break;\n case 'country Manager':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = false;\n vm.showIcon = false;\n break;\n case 'provider_app':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = false;\n vm.showIcon = false;\n break;\n default:\n\n }\n }", "function handleUserMealPreferences() {\n $('#meal-plan').removeClass('d-none');\n mealPlanDisplay.empty();\n totalNutrientsChart.empty();\n location.href = '#meal-plan-container';\n fetchMealPlan();\n // save user's diet preference and intolerances being used to fetch meal plan so when they return to the page later, the selected will also load accordingly to the saved meal plan\n saveToLocalStorage('userDiet', diet);\n saveToLocalStorage('userIntolerances', intolerances);\n}", "processSelection(){\n //let popupText = this.popup.optionEntered();\n let popupText = this.world.getTop().optionEntered();\n if(!popupText) return;\n\n console.log(\"enter \"+popupText);\n //this guy has to do the lifting for the options\n switch(popupText){\n case 'Resume Game':\n this.resumeGame();\n break;\n case 'Restart Episode':\n this.resumeGame();//need to unpause the game before change state\n this.state.start('ep2');\n break;\n case 'Instructions':\n this.popupInstruction = new Popup(this.game,this.camera.x,this.camera.y,3);\n let instruction = this.cache.getJSON('config').popup.instructions;\n this.popupInstruction.setTitle(instruction['title']);\n this.popupInstruction.setDescription(instruction['description'],0);\n\n this.world.removeChild(this.popup);\n this.world.addChild(this.popupInstruction);\n this.enableCursorKeys(false);\n break;\n case 'Got it!':\n this.enableCursorKeys(true);\n this.resumeGame();\n break;\n case 'Quit to Main Menu':\n this.resumeGame();\n this.state.start('menu');\n break;\n case 'Mute Music':\n console.log(\"muting music \");\n Tools.storeData('mutetheme',true);\n Tools.muteOrPlay(this.theme,true);\n break;\n case 'Mute Sound':\n console.log(\"muting sound\");\n Tools.storeData('mutesound',true);\n Tools.muteOrPlay(this.sfx,true);\n break;\n case 'Play Music':\n console.log(\"playing music\");\n Tools.storeData('mutetheme',false);\n Tools.muteOrPlay(this.theme,false);\n break;\n case 'Play Sound':\n console.log(\"playing sound\");\n Tools.storeData('mutesound',false);\n Tools.muteOrPlay(this.sfx,false);\n break;\n }\n }", "function generateOption() {\n //generate option list of current user\n //styling each list\n //setup first record id and table title\n var execFunc = function() {\n $.get(\"../../apps/data/upload/access\",{uid: $(\"#uid\").text()},function(data,status) {\n if(status === \"success\") {\n //identify user authorization has been set\n if(data.length === 0) {\n $(\"#mdl-common #myModalLabel\").html(\"<h3><span style='color: yellow' class='glyphicon glyphicon-exclamation-sign'>&nbsp;Warning</span></h3>\");\n $(\"#mdl-common #content\").text(\"You have no table access to upload\");\n $(\"#mdl-common\").modal(\"show\"); \n $(\"#uploadSelect, #uploadData, #userMenu ul li:not('#idLogout,#idHome')\").hide();\n loadingStateChange(\"hide\");\n return false; \n }\n for(var idx = 0; idx < data.length; idx++) {\n var addDataArr = [\n {objName:\"schema-name\",objVal:data[idx].schemaName},\n {objName:\"db-link\",objVal:data[idx].dbLink}\n ];\n if(idx === 0) {\n tableName = data[idx].tableName;\n schemaName = data[idx].schemaName;\n dbLink = data[idx].dbLink;\n clearUploadFile();\n createListWithAddData(\"upload\",data[idx].tableName,data[idx].name,true,addDataArr);\n } else {\n createListWithAddData(\"upload\",data[idx].tableName,data[idx].name,false,addDataArr);\n }\n }\n setTabelTitle();\n generateData();\n } else {\n modalCommonShow(3,\"Get user access unsuccessfully: status = \" + status);\n }\n }).error(function (d) {\n modalCommonShow(1,\"Error get user access : \", d);\n }).fail(function(d) {\n modalCommonShow(2,\"Failed to get user access : \", d);\n }); \n };\n checkCurrSessAndExec(execFunc);\n }", "function dropDownOptions(){\n inquire.prompt([{\n type:'list',\n choices:['View Products','View Low Inventory','Update Inventory','Add Product'],\n message:\"Please pick from the following\",\n name:'dropDownQuestion'\n }]).then(function(answers){\n console.log(answers.dropDownQuestion);\n switch(answers.dropDownQuestion){\n case 'View Products':\n queryProductsTable().then(function(err){\n connection.end();\n });\n break;\n case 'View Low Inventory':\n viewLowInventory();\n break;\n case 'Update Inventory':\n addToInventory();\n break;\n case 'Add Product':\n addProductToTable();\n break;\n default:\n console.log('something went wrong');\n }\n });\n}", "function selectUsersWithSets() {\n\t\tvar user = jQuery(\"#selectUser\").val();\n\t\tshowSetsByUser(user);\n\t}", "function selchange(lang) {\r\n let i = comboSel.value;\r\n if (i == -1) return;\r\n\r\n let obj = apitool.comboList[i];\r\n let inputText = obj.input;\r\n _activateInput(inputText);\r\n _showInfo(obj.info[lang]);\r\n }", "function setValuesForPage(applicationConfig) {\n\n var applicationConfigTemp = {\n public: {},\n private: {}\n };\n\n // for cases when we get existing users' data\n\n if (applicationConfig.constructor === Array) {\n for (let i = 0; i < applicationConfig.length; i++) {\n if (applicationConfig[i].key !== 'public') {\n applicationConfigTemp.private[applicationConfig[i].key] = applicationConfig[i].value;\n } else {\n applicationConfigTemp[applicationConfig[i].key] = applicationConfig[i].value;\n }\n }\n applicationConfig = applicationConfigTemp;\n }\n\n if(typeof applicationConfig.public === 'string') {\n applicationConfig.public = JSON.parse(applicationConfig.public);\n }\n var allInputs = document.querySelectorAll('input, select, textarea');\n\n // Set values from config for input, select, textarea elements\n\n for (let i = 0; i < allInputs.length; i++) {\n var fieldVisibility = allInputs[i].dataset.visibility;\n\n if (fieldVisibility !== undefined && applicationConfig[fieldVisibility][allInputs[i].dataset.name] !== undefined) {\n if (allInputs[i].tagName == \"INPUT\") {\n\n if (allInputs[i].type == 'checkbox' || allInputs[i].type == 'radio') {\n allInputs[i].checked = (applicationConfig[fieldVisibility][allInputs[i].dataset.name] == \"true\");\n checkFieldChange(allInputs[i]);\n }\n if (allInputs[i].type == 'text' || allInputs[i].type == 'number' || allInputs[i].type == 'date') {\n allInputs[i].value = applicationConfig[fieldVisibility][allInputs[i].dataset.name];\n checkFieldChange(allInputs[i]);\n }\n }\n if (allInputs[i].tagName == \"SELECT\" || allInputs[i].tagName == \"TEXTAREA\") {\n allInputs[i].value = applicationConfig[fieldVisibility][allInputs[i].dataset.name];\n checkFieldChange(allInputs[i]);\n }\n }\n }\n}", "function saveUserOptions() {\r\n\r\n var username = getMyName();\r\n \r\n var aliases = GM_getValue(username + \".aliases\");\r\n \r\n aliases = (aliases == null) ? [] : aliases.split(\",\");\r\n \r\n aliases.push(username);\r\n \r\n for(var i = 0; i < aliases.length; i++) {\r\n\r\n if (Highlight_Neutral_Traits.length == 0) GM_deleteValue(aliases[i] + \".highlight_traits\");\r\n \r\n else GM_setValue(aliases[i] + \".highlight_traits\", Highlight_Neutral_Traits.toString());\r\n\t\r\n if (Highlight_Good_Traits.length == 0) GM_deleteValue(aliases[i] + \".highlight_good_traits\");\r\n \r\n else GM_setValue(aliases[i] + \".highlight_good_traits\", Highlight_Good_Traits.toString());\r\n\t\r\n if (Highlight_Bad_Traits.length == 0) GM_deleteValue(aliases[i] + \".highlight_bad_traits\");\r\n \r\n else GM_setValue(aliases[i] + \".highlight_bad_traits\", Highlight_Bad_Traits.toString());\r\n\t\r\n };\r\n}", "current() {\n for (let path in menus) {\n menus[path].options.map(item => item.selected = item.url != '/' && ('#' + $location.path()).indexOf(item.url) != -1);\n }\n }", "defineOptionEvent(e) {\n this.defineOption(e.detail);\n }", "function handleSelection(actObj, angScope){\n // example : actObj = [{controller: \"controllerSNA\", func:\"onContactSelected\", params: objInfo}]\n for (var i = 0; i < actObj.length; i++) {\n var resObj = window[actObj[i].controller][\"handleSelections\"](actObj[i].func, actObj[i].params);\n\n switch (resObj.actionType) {\n case \"updateInfoSec\":\n updateInfoSecMenu(resObj);\n genInfos(angScope);\n break;\n case \"upgradeInfoSec\":\n upgradeInfoSec(resObj);\n break;\n }\n }\n }" ]
[ "0.6096637", "0.58878154", "0.58878154", "0.5819564", "0.5805585", "0.56923854", "0.56842524", "0.56129223", "0.5605773", "0.55865854", "0.5564584", "0.5459827", "0.5441249", "0.5400136", "0.5372644", "0.53691435", "0.53385794", "0.5336441", "0.5329891", "0.53042054", "0.52338946", "0.5227526", "0.52268803", "0.5223102", "0.5220763", "0.5214341", "0.5212393", "0.52080303", "0.5206723", "0.52043104", "0.51978624", "0.5189241", "0.5183942", "0.518322", "0.51755786", "0.5167165", "0.51656485", "0.51654303", "0.5156879", "0.51502275", "0.51380163", "0.5124462", "0.5123557", "0.51222974", "0.5121959", "0.51207197", "0.5112649", "0.51120377", "0.51100767", "0.5101047", "0.5082289", "0.50787544", "0.5072386", "0.5072164", "0.5071944", "0.50644994", "0.5055722", "0.5055135", "0.50487393", "0.5048428", "0.5040274", "0.5038525", "0.5034601", "0.503209", "0.50302047", "0.5028234", "0.50211567", "0.5020873", "0.50153196", "0.5011793", "0.5010102", "0.50051844", "0.5003683", "0.5000751", "0.49988782", "0.49907556", "0.49851033", "0.4978748", "0.49700314", "0.49659756", "0.49651915", "0.49615753", "0.495518", "0.49517956", "0.49497068", "0.4948323", "0.49445787", "0.49441302", "0.49437314", "0.49431133", "0.4943099", "0.49418867", "0.49403182", "0.49385178", "0.4935415", "0.49349102", "0.4933934", "0.49234518", "0.49212345", "0.49174893" ]
0.5772082
5
builds a selection object from an entry in the filelist.
function getSelectionFromTR(tr){ var selection = {}; selection['uid'] = $(tr).attr('id'); selection['filename'] = $(tr).attr('data-filename'); selection['config_type'] = $(tr).attr('data-type'); selection['published'] = $(tr).attr('data-published'); return selection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectEntry (filename) {\n const max = entries.length - 1\n let index = entries.findIndex(entry => entry.file === filename)\n index = Math.min(Math.max(index > -1 ? index : max ,0), max)\n const { file, author, link } = entries[index]\n\n updateNavigationUI(index, entries)\n updateAuthorUI(author, link)\n location.hash = file\n\n return entries[index]\n}", "function initFileSelection() {\n // If there is an entry, set the pointer to the first entry.\n if (filelist.children.length > 0) { // If there is at least one entry…\n pointer = 0; // … set the pointer to the first item.\n }\n\n // Populate slots.\n initSlots();\n\n // Set the event listener.\n addEventListener('keydown', keyListener, false);\n}", "function prepareAttachmentListOnScreen(list, fileList) {\r\n var selectList = list;\r\n selectList.length = 0;\r\n if (fileList == null) {\r\n return;\r\n }\r\n var files = fileList.split(\";\");\r\n for ( var i = 0; i < files.length; i++) {\r\n selectList[i] = new Option(files[i]);\r\n selectList[i].text = files[i];\r\n selectList[i].value = files[i];\r\n }\r\n}", "function onFileSelect(event) {\n\n fileList = event.fileList;\n\n $('#SelectedFiles').empty();\n\n\n for (var i in fileList) {\n $('#SelectedFiles').append(fileList[i].name + ' <span id=\"' + fileList[i].id + '\"></span><br />');\n }\n}", "function clickList(ev) {\n\t\n\tvar sel = elList.selection.file_object;\n\tif(sel instanceof File) {\n\t\tpreview.image = thumbPath(sel);\n\t} else if(sel instanceof Folder) {\n\t\tsearch.text = \"\";\n\t\tcurrentFolder = sel;\n\t\tloadSubElements(sel);\n\t}\n\n}", "function displaySingleSelection(fileName) {\n var baseName = fileName.replace(/^.*[\\/\\\\]/, \"\");\n $(\".upload-filelist\").empty();\n $(\".upload-filelist\").append($(\"<li/>\").text(baseName));\n }", "function PostProcessing_createSelection() {\n var opts = [\"type\", \"title\", \"description\", /*\"start\", \"end\", */ \"tags\" /*, \"key\"*/];\n var sel = document.createElement(\"select\");\n for (var _i = 0, opts_1 = opts; _i < opts_1.length; _i++) {\n var opt = opts_1[_i];\n var optElm = document.createElement(\"option\");\n optElm.value = opt;\n optElm.innerHTML = opt;\n sel.appendChild(optElm);\n }\n return sel;\n }", "function spreadsheetSearchPopulateItem(file) {\n\tvar $item = $(\"<button>\").text(file.name).addClass(\"list-group-item spreadSheetIDBtn\").val(file.id);\n\tif (file.id == SPREADSHEET_ID) {\n \t$item.addClass(\"active\");\n }\n $(\"#fileSelector\").append($item);\n}", "add_bingo_list(filename) {\n this.bingoLists.push(filename)\n this.drawSelect()\n }", "function getFileInfoDropdown(){\n\t\tvar currentField = this;\n\t\tvar val = this.value; //filename\n\t\tdropdownAdd(val);\n\t\tshowAlarms(val);\n}", "function highlightFileItem(index) {\n\t\t// Get all elements\n\t\tvar\n\t\t\tfileItemsElements = (view_type != 'table') ? file_list_element.getElementsByTagName('li') : file_list_element.getElementsByTagName('tr'),\n\t\t\ti\n\t\t;\n\n\t\t// Clear exist selection\n\t\tfor (i = fileItemsElements.length; i-- > 0;) {\n\t\t\tif (fileItemsElements[i].className == 'selected') {\n\t\t\t\tfileItemsElements[i].className = '';\n\t\t\t}\n\t\t}\n\n\t\tif (!index && index != 0) return;\n\n\t\t// Select the items\n\t\tfor (i = fileItemsElements.length; i-- > 0;) {\n\t\t\tif ((fileItemsElements[i].itemType == 2) && (fileItemsElements[i].index == index)) {\n\t\t\t\tfileItemsElements[i].className = 'selected';\n\t\t\t}\n\t\t}\n\t}", "function selectEntryToExamine(item) {\n\tvar selectionList = [item.user]\n\tconsole.log(\"geomap selection:\",selectionList)\n\tvar outObject = {'user':selectionList}\n\tOWF.Eventing.publish(\"entity.selection\",selectionList)\n}", "function initSelectionHandler(){\n $('button#select').on('click', function(e){\n var $filelist = $('#filelist');\n // clear the list and add the new selections\n $filelist.find('tr[data-source=\"config-browser\"]').each(function(idx, tr){\n var selection = getSelectionFromTR(tr);\n $filelist.trigger({type: 'config:removed', source: 'config-browser', selection: selection});\n });\n $(selections).each(function(idx, selection){\n $filelist.trigger({type: 'config:added', source: 'config-browser', selection: selection});\n });\n selections = [];\n });\n }", "function handleFileSelect(mEvent) {\n mEvent.stopPropagation();\n mEvent.preventDefault();\n\n files = mEvent.dataTransfer.files; // FileList object.\n\n //List some properties.\n document.getElementById('list').innerHTML =\n '<p><strong>' + files[0].name + '</strong> - ' +\n files[0].size + ' bytes, last modified: ' +\n (files[0].lastModifiedDate ? files[0].lastModifiedDate.toLocaleDateString() : 'n/a') +\n '</p>';\n\n var add = addElements();\n\n startDrawing = true;\n\n}", "function MultiSelector(list_target, max) {\n this.list_target = list_target;this.count = 0;this.id = 0;if( max ){this.max = max;} else {this.max = -1;};this.addElement = function( element ){if( element.tagName == 'INPUT' && element.type == 'file' ){element.name = 'attachment[file_' + (this.id++) + ']';element.multi_selector = this;element.onchange = function(){var new_element = document.createElement( 'input' );new_element.type = 'file';this.parentNode.insertBefore( new_element, this );this.multi_selector.addElement( new_element );this.multi_selector.addListRow( this );this.style.position = 'absolute';this.style.left = '-1000px';};if( this.max != -1 && this.count >= this.max ){element.disabled = true;};this.count++;this.current_element = element;} else {alert( 'Error: not a file input element' );};};this.addListRow = function( element ){var new_row = document.createElement('li');var new_row_button = document.createElement( 'a' );new_row_button.title = 'Remove This Image';new_row_button.href = '#';new_row_button.innerHTML = 'Remove';new_row.element = element;new_row_button.onclick= function(){this.parentNode.element.parentNode.removeChild( this.parentNode.element );this.parentNode.parentNode.removeChild( this.parentNode );this.parentNode.element.multi_selector.count--;this.parentNode.element.multi_selector.current_element.disabled = false;return false;};new_row.innerHTML = element.value.split('/')[element.value.split('/').length - 1];new_row.appendChild( new_row_button );this.list_target.appendChild( new_row );};\n}", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n var output = [];\n for (var i = 0; i < files.length; i++) {\n f = files[i];\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\n f.size, ' bytes, last modified: ',\n f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',\n '</li>');\n var reader = new FileReader();\n \n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n //var span = document.createElement('span');\n //span.innerHTML = '<p>';\n ls = e.target.result.split('\\n');\n for (i = 1; i < ls.length; i++) {\n //span.innerHTML = span.innerHTML + '<br>' + ls[i];\n rnaStruct.push(ls[i].split(' '));\n }\n //span.innerHTML = span.innerHTML + '</p>';\n //document.getElementById('list').insertBefore(span, null);\n //drawLinearDiagram(\"auto\");\n drawCircularDiagram(\"auto\");\n };\n })(f);\n \n reader.readAsText(f);\n }\n document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';\n}", "selectFile(callback) {\n\t\tconst input = document.createElement('input');\n\t\tinput.type = 'file';\n\t\tinput.multiple = false;\n\t\tinput.onchange = (ev) => {\n\t\t\tconst { files } = ev.target;\n\t\t\tcallback.call(UploadFS, files[0]);\n\t\t};\n\t\t// Fix for iOS/Safari\n\t\tconst div = document.createElement('div');\n\t\tdiv.className = 'ufs-file-selector';\n\t\tdiv.style = 'display:none; height:0; width:0; overflow: hidden;';\n\t\tdiv.appendChild(input);\n\t\tdocument.body.appendChild(div);\n\t\t// Trigger file selection\n\t\tinput.click();\n\t}", "function selectFile(evt) {\n\t\tvar last_file = {};\n\t\tif (context_element && (context_element.type == 2)) {\n\t\t\tlast_file = context_element;\n\t\t}\n\t\tcontext_element = getElProp(evt);\n\t\tif (context_element.type == 1) {\n\t\t\t// If select directory then open the directory\n\t\t\t// if index >= 0 then select subfolde, if index < 0 - then select up folder\n\t\t\tif (context_element.index >= 0) {\n\t\t\t\tgetDirContent(cur_path + context_element.name + '/');\n\t\t\t} else {\n\t\t\t\tvar\n\t\t\t\t\tpath = '',\n\t\t\t\t\ti\n\t\t\t\t;\n\t\t\t\tfor (i = dir_content.path.length + context_element.index; i >= 0; i--) {\n\t\t\t\t\tpath = dir_content.path[i] + '/' + path;\n\t\t\t\t}\n\t\t\t\tgetDirContent('/' + path);\n\t\t\t}\n\t\t} else if (context_element.type == 2) {\n\t\t\t// Іf select the file then highlight and execute the external functions with the file properties\n\t\t\thighlightFileItem(context_element.index);\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_select || on_dblselect) {\n\t\t\t\tvar file = dir_content.files[context_element.index];\n\t\t\t\t// Generate additional field\n\t\t\t\tfile.path = cur_path + file.name;\n\t\t\t\tfile.wwwPath = getURIEncPath(HTMLDecode(upload_path + cur_path + file.name));\n\t\t\t\t// If thumbnail exist, set the www path to him\n\t\t\t\tif (file.thumb && file.thumb !== '') {\n\t\t\t\t\tfile.wwwThumbPath = getURIEncPath(HTMLDecode(upload_path + file.thumb));\n\t\t\t\t}\n\t\t\t\tif (on_select) {\n\t\t\t\t\ton_select(file);\n\t\t\t\t}\n\t\t\t\t// If double click on file then chose them by on_dblselect() function\n\t\t\t\tif ( on_dblselect &&(last_file.index == context_element.index) && ((context_element.time - last_file.time) < dbclick_delay) ) {\n\t\t\t\t\ton_dblselect(file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No selections\n\t\t\t// Clean the highlight\n\t\t\thighlightFileItem();\n\t\t\t// Hide the tooltips\n\t\t\thideTooltips();\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_deselect) {\n\t\t\t\ton_deselect();\n\t\t\t}\n\t\t}\n\t}", "function handleFileSelect(evt) { \n \n // A FileList\n var files = evt.target.files;\n // Show some properties\n for (var i = 0; i < files.length; i++) {\n var f = files[i];\n var file = createElement('li',f.name + ' ' + f.type + ' ' + f.size + ' bytes');\n file.parent(list);\n \n // Read the file and process the result\n var reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n // Render thumbnail\n var img = createImg(e.target.result);\n img.parent(container);\n img.class('thumb');\n \n loadImage(e.target.result, gotImage);\n };\n })(f);\n\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }", "function MultiSelector( list_target, max ){\n\n\t// Where to write the list\n\tthis.list_target = list_target;\n\t// How many elements?\n\tthis.count = 0;\n\t// How many elements?\n\tthis.id = 0;\n\t// Is there a maximum?\n\tif( max ){\n\t\tthis.max = max;\n\t} else {\n\t\tthis.max = -1;\n\t};\n\t\n\t/**\n\t * Add a new file input element\n\t */\n\tthis.addElement = function( element ){\n\n\t\t// Make sure it's a file input element\n\t\tif( element.tagName == 'INPUT' && element.type == 'file' ){\n\n\t\t\t// Element name -- what number am I?\n\t\t\telement.name = 'upfile_' + this.id++;\n\n\t\t\t// Add reference to this object\n\t\t\telement.multi_selector = this;\n\n\t\t\t// What to do when a file is selected\n\t\t\telement.onchange = function(){\n\n\t\t\t\t// New file input\n\t\t\t\tvar new_element = document.createElement( 'input' );\n\t\t\t\tnew_element.type = 'file';\n\n\t\t\t\t// Add new element\n\t\t\t\tthis.parentNode.insertBefore( new_element, this );\n\n\t\t\t\t// Apply 'update' to element\n\t\t\t\tthis.multi_selector.addElement( new_element );\n\n\t\t\t\t// Update list\n\t\t\t\tthis.multi_selector.addListRow( this );\n\n\t\t\t\t// Hide this: we can't use display:none because Safari doesn't like it\n\t\t\t\tthis.style.position = 'absolute';\n\t\t\t\tthis.style.left = '-1000px';\n\n\t\t\t};\n\t\t\t// If we've reached maximum number, disable input element\n\t\t\tif( this.max != -1 && this.count >= this.max ){\n\t\t\t\telement.disabled = true;\n\t\t\t};\n\n\t\t\t// File element counter\n\t\t\tthis.count++;\n\t\t\t// Most recent element\n\t\t\tthis.current_element = element;\n\t\t\t\n\t\t} else {\n\t\t\t// This can only be applied to file input elements!\n\t\t\talert( 'Error: not a file input element' );\n\t\t};\n\n\t};\n\n\t/**\n\t * Add a new row to the list of files\n\t */\n\tthis.addListRow = function( element ){\n\n\t\t// Row div\n\t\tvar new_row = document.createElement( 'span' );\n\t\tnew_row.setAttribute(\"className\", \"totals\");\n\t\tnew_row.setAttribute(\"class\", \"totals\");\n\t\tnew_row.style.clear = \"left\";\n\t\tnew_row.style.cssFloat = \"left\";\n\t\tnew_row.style.marginRight = \"0.4em\";\n\n\t\t// Delete button\n\t\tvar new_row_button = document.createElement( 'input' );\n\t\tnew_row_button.type = 'button';\n\t\tnew_row_button.value = 'Remove';\n\n\t\t// References\n\t\tnew_row.element = element;\n\n\t\t// Delete function\n\t\tnew_row_button.onclick= function(){\n\n\t\t\t// Remove element from form\n\t\t\tthis.parentNode.element.parentNode.removeChild( this.parentNode.element );\n\n\t\t\t// Remove this row from the list\n\t\t\tthis.parentNode.parentNode.removeChild( this.parentNode );\n\n\t\t\t// Decrement counter\n\t\t\tthis.parentNode.element.multi_selector.count--;\n\n\t\t\t// Re-enable input element (if it's disabled)\n\t\t\tthis.parentNode.element.multi_selector.current_element.disabled = false;\n\n\t\t\t// Appease Safari\n\t\t\t// without it Safari wants to reload the browser window\n\t\t\t// which nixes your already queued uploads\n\t\t\treturn false;\n\t\t};\n\n\t\t// Set row value\n\t\tnew_row.innerHTML = element.value;\n\n\t\t// Add button\n\t\tnew_row.appendChild( new_row_button );\n\n\t\t// Add it to the list\n\t\tthis.list_target.appendChild( new_row );\n\t\t\n\t};\n\n}", "function calibration_menu_load()\n{\n inc_busy();\n var selBox = document.getElementById(\"CalibrationFileList\");\n var existingFiles = callback_get(\"/API/Calibration.getAll\");\n selBox.innerHTML = \"\";\n var list = existingFiles.split(\"\\n\");\n for (var i = 0; i< list.length -1; i++)\n {\n filename = list[i].split(\",\")[0];\n title = list[i].split(\",\")[1];\n var option = document.createElement(\"option\");\n option.text = title;\n option.value = filename;\n selBox.add(option,selBox[1]);\n }\n var o1 = document.createElement(\"option\");\n o1.text = \"-----------------------------\";\n o1.value = \"None\";\n selBox.add(o1,selBox[0]);\n var o2 = document.createElement(\"option\");\n o2.text = \"Create New\";\n o2.value = \"Action_New\";\n selBox.add(o2,selBox[0]);\n var o3 = document.createElement(\"option\");\n o3.text = \"Select A File To Load:\";\n o3.value = \"None\";\n selBox.add(o3,selBox[0]);\n dec_busy();\n}", "function displayMultiSelection(files) {\n $(\".upload-filelist\").empty();\n for (var i=0; i<files.length; i++) {\n $(\".upload-filelist\").append($(\"<li/>\").text(files[i].name));\n }\n }", "function MultiSelector( list_target, field_name, max, new_element_html, delete_text, new_file_input ){\n\n // Where to write the list\n this.list_target = list_target;\n // Field name\n this.field_name = field_name;\n // How many elements?\n this.count = 0;\n // How many elements?\n this.id = 0;\n // Is there a maximum?\n if( max ){\n this.max = max;\n } else {\n this.max = -1;\n };\n this.new_element_html = new_element_html;\n this.delete_text = delete_text;\n this.new_file_input = new_file_input;\n\n /**\n * Add a new file input element\n */\n this.addElement = function( element ){\n\n // Make sure it's a file input element\n if( element.tagName == 'INPUT' && element.type == 'file' ){\n\n // Element name -- what number am I?\n // element.name = 'file_' + this.id++;\n this.id++;\n element.name = this.field_name + '[]';\n\n // Add reference to this object\n element.multi_selector = this;\n\n // What to do when a file is selected\n element.onchange = function(){\n\n // New file input\n var new_element = document.createElement( 'input' );\n new_element.type = 'file';\n\n // Add new element\n this.parentNode.insertBefore( new_element, this );\n\n // Apply 'update' to element\n this.multi_selector.addElement( new_element );\n\n // Update list\n this.multi_selector.addListRow( this );\n\n // Hide this: we can't use display:none because Safari doesn't like it\n this.style.position = 'absolute';\n this.style.left = '-1000px';\n\n };\n // If we've reached maximum number, disable input element\n if( this.max != -1 && this.count >= this.max ){\n element.disabled = true;\n };\n\n // File element counter\n this.count++;\n // Most recent element\n this.current_element = element;\n\n } else {\n // This can only be applied to file input elements!\n alert( 'Error: not a file input element' );\n };\n\n };\n\n /**\n * Add a new row to the list of files\n */\n this.addListRow = function( element ){\n\n/*\n // Row div\n var new_row = document.createElement( 'div' );\n*/\n\n // Sort order input\n var new_row_input = document.createElement( 'input' );\n new_row_input.type = 'text';\n new_row_input.name = 'general[position_new][]';\n new_row_input.size = '3';\n new_row_input.value = '0';\n\n // Delete button\n var new_row_button = document.createElement( 'input' );\n new_row_button.type = 'checkbox';\n new_row_button.value = 'Delete';\n\n var new_row_span = document.createElement( 'span' );\n new_row_span.innerHTML = this.delete_text;\n\n table = this.list_target;\n\n // no of rows in the table:\n noOfRows = table.rows.length;\n\n // no of columns in the pre-last row:\n noOfCols = table.rows[noOfRows-2].cells.length;\n\n // insert row at pre-last:\n var x=table.insertRow(noOfRows-1);\n\n // insert cells in row.\n for (var j = 0; j < noOfCols; j++) {\n\n newCell = x.insertCell(j);\n newCell.align = \"center\";\n newCell.valign = \"middle\";\n\n// if (j==0) {\n// newCell.innerHTML = this.new_element_html.replace(/%file%/g, element.value).replace(/%id%/g, this.id).replace(/%j%/g, j)\n// + this.new_file_input.replace(/%file%/g, element.value).replace(/%id%/g, this.id).replace(/%j%/g, j);\n// }\n if (j==3) {\n newCell.appendChild( new_row_input );\n }\n else if (j==4) {\n newCell.appendChild( new_row_button );\n }\n else {\n// newCell.innerHTML = this.new_file_input.replace(/%file%/g, element.value).replace(/%id%/g, this.id).replace(/%j%/g, j);\n newCell.innerHTML = this.new_file_input.replace(/%id%/g, this.id).replace(/%j%/g, j);\n }\n\n// newCell.innerHTML=\"NEW CELL\" + j;\n\n }\n\n // References\n//\t\tnew_row.element = element;\n\n // Delete function\n new_row_button.onclick= function(){\n\n // Remove element from form\n this.parentNode.element.parentNode.removeChild( this.parentNode.element );\n\n // Remove this row from the list\n this.parentNode.parentNode.removeChild( this.parentNode );\n\n // Decrement counter\n this.parentNode.element.multi_selector.count--;\n\n // Re-enable input element (if it's disabled)\n this.parentNode.element.multi_selector.current_element.disabled = false;\n\n // Appease Safari\n // without it Safari wants to reload the browser window\n // which nixes your already queued uploads\n return false;\n };\n\n // Set row value\n//\t\tnew_row.innerHTML = this.new_element_html.replace(/%file%/g, element.value).replace(/%id%/g, this.id);\n\n // Add button\n//\t\tnew_row.appendChild( new_row_button );\n//\t\tnew_row.appendChild( new_row_span );\n\n // Add it to the list\n//\t\tthis.list_target.appendChild( new_row );\n\n };\n\n // Insert row into table.\n this.insRowLast = function ( table ){\n\n // noOfRpws in table.\n noOfRows = table.rows.length;\n // no of columns of last row.\n noOfCols = table.rows[noOfRows-1].cells.length;\n\n // insert row at last.\n var x=table.insertRow(noOfRows);\n\n // insert cells in row.\n for (var j = 0; j < noOfCols; j++) {\n newCell = x.insertCell(j);\n newCell.innerHTML=\"NEW CELL\" + j;\n }\n\n };\n\n //delete row\n this.deleteRow = function ( table, row ){\n\n table.deleteRow(row);\n\n };\n\n //delete last row\n this.deleteRow = function ( table ){\n\n noOfRows = table.rows.length;\n table.deleteRow(noOfRows-1);\n\n };\n\n\n}", "function fileRef(item, network, bucket, selected){\n\n\t\tthis.els = [];\n\t\tthis.selected = false;\n\n\t\tthis.item = {};\n\n\t\t// Item contents change\n\t\tthis.update = function(item){\n\t\t\tif(!item){\n\t\t\t\treturn this.item;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Merge the two together\n\t\t\t\tthis.item = hello.utils.merge(this.item, item);\n\t\t\t}\n\n\t\t\t// Loop through the elements and update their content\n\t\t\tfor(var i=0;i<this.els.length;i++){\n\t\t\t\tthis.els[i].getElementsByTagName('span')[0].innerHTML = this.item.name;\n\t\t\t\tif(this.item.thumbnail){\n\t\t\t\t\tthis.els[i].getElementsByTagName('img')[0].src = this.item.thumbnail;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Create an element in the given bucket,\n\t\t// adding on click event handlers\n\t\tthis.create = function(bucket){\n\t\t\tvar item = this.item;\n\t\t\tvar self = this;\n\t\t\tvar el = doc.createElement('li');\n\t\t\tel.title = item.name;\n\t\t\tel.innerHTML = \"<img \"+(item.thumbnail?\"src='\"+item.thumbnail+\"'\":\"\")+\"/>\"\n\t\t\t\t\t\t\t+\"<span>\"+(item.name||'')+\"</span>\";\n\t\t\tel.onclick = function(){\n\t\t\t\t// Is this a folder?\n\t\t\t\tif(item.type==='folder'||item.type==='album'){\n\t\t\t\t\tgetBucket(network+\":\"+(item.files?item.files:item.id+\"/files\"), item.name, bucket.id );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Toggle selected\n\t\t\t\t\tself.toggleSelect();\n\t\t\t\t}\n\t\t\t};\n\t\t\t// Add to bucket\n\t\t\tbucket.appendChild(el);\n\n\t\t\t// Add to local store\n\t\t\tthis.els.push(el);\n\n\t\t\treturn el;\n\t\t};\n\n\n\t\tthis.toggleSelect = function(bool){\n\n\t\t\tif(bool===this.selected){\n\t\t\t\t// nothing\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// else change\n\n\t\t\t// toggle\n\t\t\tthis.selected = !this.selected;\n\n\t\t\t// Selected\n\t\t\tif(this.selected){\n\t\t\t\t// Does the element exist within the local bucket\n\t\t\t\tvar local = false;\n\t\t\t\tfor(i=0;i<this.els.length;i++){\n\t\t\t\t\tif( this.els[i].parentNode === select_el ){\n\t\t\t\t\t\tlocal=true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!local){\n\t\t\t\t\t// create it\n\t\t\t\t\tthis.create(select_el);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Loop through the elements and update their content\n\t\t\tfor(i=0;i<this.els.length;i++){\n\t\t\t\tthis.els[i].className = this.selected ? \"select\" : \"\";\n\t\t\t}\n\n\t\t\t// get the number of selected items in ref and update\n\t\t\tinfo_el.innerHTML = ( this.selected ? ++global_counter : --global_counter );\n\t\t};\n\n\t\t// Create the initial element\n\t\tthis.update(item);\n\t\tthis.create(bucket);\n\n\t\t// if this is selected\n\t\tif(selected){\n\t\t\tthis.toggleSelect();\n\t\t}\n\t}", "function _uc_file_delete_list_populate() {\n jQuery('.affected-file-name').empty().append(uc_file_list[jQuery('#edit-recurse-directories').attr('checked')]);\n}", "function sfmb_select(cp_selected){\n if (cp_selected.length != 1) return false; // Make sure we only have one selected\n\n var l = $(cp_selected[0]);\n var link = l.find('.action .link a');\n var file;\n if(!l.hasClass('file')) {file = getDirFromUrl(link.attr('href'));}\n else {file = link.attr('href');}\n // Do something with file\n var window_manager = parent.window.opener.window_manager;\n window_manager.callback(file);\n}", "function ProjFileList() {\n\tthis._project = \"\";\n\tthis._team = null;\n\n\t//allow for an auto refresh\n\tthis._timeout = null;\n\t//how often to retry an auto update -- this only occurs if an update failed, in seconds\n\tthis._refresh_delay = 3;\n\t//when was it 'born', milliseconds since epoch\n\tthis._birth = new Date().valueOf();\n\n\t//prompt when it errors during an update\n\tthis._err_prompt = null;\n\n\t// the project revision we're displaying\n\t// can be integer or \"HEAD\"\n\tthis.rev = \"HEAD\";\n\n\t// whether or not there's a robot.py file\n\tthis.robot = false;\n\n\t// The files/folders that are currently selected\n\tthis.selection = [];\n\t// Files/folders that have tried to be selected while we were updating the list\n\tthis._deferred_selection = [];\n\n\t// Member functions:\n\t// Public:\n\t// - change_rev: change the file list revision, uses current project and team info to update\n\t// - update: Update the file list to the given project and team\n\t// Private:\n\t// - _received: handler for receiving the file list\n\t// - _nested_divs: Returns N nested divs.\n\t// - _dir: Returns the DOM object for a directory entry\n\t// - _onclick: The onclick handler for a line in the listing\n\t// - _hide: Hide the filelist\n\t// - _show: Show the filelist\n}", "function main(args){\r\n\r\n var selectedItem = args.DOC_REF.selection[0];\r\n var selectionName;\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n selectionName = selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n selectionName = selectedItem.typename; \r\n }\r\n \r\n\r\n\r\n var myDialog = sfDialogFactory(mainDialog(selectionName));\r\n \r\n myDialog.show();\r\n}", "function loadDirEntry(_chosenEntry) {\r\n chosenEntry = _chosenEntry;\r\n if (chosenEntry.isDirectory) {\r\n var dirReader = chosenEntry.createReader();\r\n var entries = [];\r\n\r\n // Call the reader.readEntries() until no more results are returned.\r\n var readEntries = function() {\r\n dirReader.readEntries (function(results) {\r\n if (!results.length) {\r\n //textarea.value = entries.join(\"\\n\"); /// Disabled Nate, fix baud rate issue. \r\n saveFileButton.disabled = true; // don't allow saving of the list\r\n displayEntryData(chosenEntry);\r\n } \r\n else {\r\n results.forEach(function(item) { \r\n entries = entries.concat(item.fullPath);\r\n });\r\n readEntries();\r\n }\r\n }, errorHandler);\r\n };\r\n\r\n readEntries(); // Start reading dirs. \r\n }\r\n}", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n evt.srcElement.classList.remove(\"dragover\");\n\n var files = evt.dataTransfer.files; // FileList object.\n\n var ul = document.createElement(\"ul\");\n\n const promises = [];\n const zip = new Zip();\n\n //FIXME: support font-size\n Array.prototype.forEach.call(files, function(file) {\n promises.push(\n file.text().then(text => {\n let ttml = new Ttml(text);\n zip.file(\n `${file.name.replace(/\\.ttml$/, \"\")}.srt`,\n Srt.parse(ttml.tokenize())\n );\n })\n );\n\n let li = document.createElement(\"li\");\n let strong = document.createElement(\"strong\");\n strong.innerText = file.name;\n let text = document.createTextNode(\"\");\n text.textContent = ` (${file.type || \"n/a\"}) - ${\n file.size\n } bytes, last modified: ${\n file.lastModifiedDate ? file.lastModifiedDate.toLocaleDateString() : \"n/a\"\n }`;\n li.append(strong, text);\n ul.appendChild(li);\n });\n\n Promise.all(promises)\n .then(() => {\n zip.generateAsync({ type: \"blob\" }).then(function(content) {\n // see FileSaver.js\n saveAs(content, window.location.host + \".zip\");\n });\n })\n .catch(e => {\n // Handle errors here\n });\n\n document.getElementById(\"list\").appendChild(ul);\n}", "function handleFileSelect(e) {\r\n var file = e.target.files[0];\r\n\r\n Papa.parse(file, {\r\n header: true,\r\n dynamictyping: true,\r\n complete: function (results) {\r\n var parsedCsv = results.data[0];\r\n //console.log(parsedCsv);\r\n\r\n $.each(parsedCsv, function (key, val) {\r\n $('#pool').append('<li class=\"list-group-item\">' + val + '</li>'); \r\n });\r\n //save the state of the unordered list for future reset\r\n unOrderedList = $(\"#pool\").html(); \r\n },\r\n error: function (err) {\r\n alert(err);\r\n }\r\n });\r\n }", "function getList(listName) {\n var transaction = db.transaction([collection], \"readonly\"),\n store = transaction.objectStore(collection),\n theList = [],\n tagIndex, tagCursor;\n\n // tagIndex = store.index(listName),\n // range = IDBKeyRange.bound('A', 'z\\uffff'),\n // tagCursor = tagIndex.openCursor();\n if(listName == \"id\") {\n \ttagCursor = store.openCursor();\n }\n else {\n \ttagIndex = store.index(listName);\n \ttagCursor = tagIndex.openCursor();\n }\n \n\n\n tagCursor.onsuccess = function(event) {\n var cursor = event.target.result;\n if(cursor) {\n // check whether the tag is already included\n if( !theList.some(function(elem){return elem == cursor.key}) ) {\n // console.log( \"going to add '\" + cursor.key + \"'\" );\n theList.push(cursor.key);\n }\n cursor.continue();\n }\n }; // end tagCursor.onsuccess\n\n transaction.oncomplete = function(event) {\n \tvar fragment = document.createDocumentFragment();\n\n // only construct an options list for dropdowns\n if( listName == \"author\" || listName == \"tags\") { \n for(var i =0, len = theList.length; i < len; i += 1) {\n var element = document.createElement(\"option\");\n element.value = theList[i];\n element.innerHTML = theList[i];\n fragment.appendChild(element);\n } \n }\n\n if(listName == \"tags\") {\n \tupdateElement(pageElements.tagSelect, fragment);\n }\n else if(listName == \"author\") {\n updateElement(pageElements.authorSelect, fragment);\n }\n else {\n \trandomChoices(theList, 5);\n }\n }; //end oncomplete\n\n }", "function handleFileSelect(evt){\n var f = evt.target.files[0]; // FileList object\n window.reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function(theFile){\n return function(e){\n editor.setData(e.target.result);\n evt.target.value = null; // allow reload\n };\n })(f);\n // Read file as text\n reader.readAsText(f);\n thisDoc = f.name;\n }", "function setResults(list, matches) {\n // Remember selected match if it remains in the new set of matches.\n var selected = list.querySelector('li.selected');\n if(selected) {\n selected = selected.getAttribute('title');\n } else {\n selected = '';\n }\n\n list.innerHTML = '';\n\n matches.map(function(match, i) {\n var relative = match.dir + match.file;\n var absolute = match.shared + relative;\n\n // Nameless element means it's not a real result.\n if(!relative) {\n return;\n }\n\n var result = createElement('li', match.rendered, {\n title: absolute,\n 'data-relative': relative,\n tabindex: i\n });\n\n if(absolute === selected) {\n result.classList.add('selected');\n }\n\n list.appendChild(result);\n });\n }", "function newListEntry(entry) {\n var listEntry = newElement('li');\n var listText = newElement('span');\n var actionContainer = newElement('div');\n var runButton = createIconButton('power-off', true, null, entry, _run);\n var editButton = createIconButton('edit', true, null, entry, _edit);\n var deleteButton = createIconButton('trash', true, null, entry, _delete);\n listText.innerHTML = entry.name;\n actionContainer.appendChild(runButton);\n actionContainer.appendChild(editButton);\n actionContainer.appendChild(deleteButton);\n listEntry.appendChild(listText);\n listEntry.appendChild(actionContainer);\n return listEntry;\n}", "function creaSelect(list)\n{\n\t//crea un menu per la resta de resultats\n\tvar select=document.createElement('select');\n\tselect.style.display='block';\n\tlist.items.forEach(function(item)\n\t{\n\t\tvar id = item.id.videoId;\n\t\tvar canal = item.snippet.channelTitle;\n\t\tvar titol = item.snippet.title;\n\t\t//new option\n\t\tvar option=document.createElement('option');\n\t\tselect.appendChild(option)\n\t\toption.value=id;\n\t\tvar text=canal+\": \"+titol;\n\t\tif(text.length>=47) text=text.substring(0,44)+\"...\";\n\t\toption.innerHTML=text;\n\t});\n\treturn select;\n}", "function filenamesMenu(){\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", \"/recipes/\");\n\txhr.addEventListener('load', function(){\n\t\trecipeNames = JSON.parse(xhr.responseText);\n\t\t\n\t\tselect = document.getElementById('recipesDrop');\n\t\tfor (r in recipeNames){\n\t\t\tselect.add(new Option(recipeNames[r].replace(/_/g,\" \").replace(\".json\", \"\"), recipeNames[r]));\n\t\t}\n\t});\n\txhr.send();\n}", "function buildList(dropdown, list) {\n let divisionPicked = sessionStorage.getItem(\"divisionPick\");\n\n for(let i = 0; i < list.length; i++) {\n if(divisionPicked == list[i].Code) {\n let element = $(\"<option>\", {text: list[i].Name, value: list[i].Code, selected: \"selected\"});\n dropdown.append(element);\n }\n else {\n let element = $(\"<option>\", {text: list[i].Name, value: list[i].Code});\n dropdown.append(element);\n }\n }\n}", "function mj_setSimpleOptions(selid,thelist,selection)\n{\n writeConsole(\"mj_setSimpleOptions: selid[\"+selid+\"] selection[\"+selection+\"]\");\n var sel = document.getElementById(selid);\n\n sel.length = 0;\n sel.add(new Option(\"All Categories\", \"0\"));\n\n for (var ii = 0; ii < thelist.length; ii++)\n {\n key = thelist[ii];\n writeConsole(\" key[\"+key+\"]\");\n sel.add(new Option(key, key));\n }\n if (undefined != selection) mjselect(sel,selection);\n}", "function handleFileSelect(evt) {\r\n\t\"use strict\";\t\r\n var files = evt.target.files;\r\n\r\n // files is a FileList of File objects. List some properties.\r\n var output = [];\r\n for (var i = 0, f; f = files[i]; i++) {\r\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\r\n f.size, ' bytes, last modified: ',\r\n f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',\r\n '</li>');\r\n }\r\n\t\r\n\tupdateBGfromFile();\r\n\t\r\n\tBGNAME = escape(f.name);\r\n document.getElementById('file_output').innerHTML = '<ul>' + output.join('') + '</ul>';\r\n }", "function eventMakeSelection(d) {\n selected.push(d.elemNum) // Store clicked node's elemNum to \"selected\" array.\n\n if (layout.properties.selectionMode == \"parent\") {\n parent_id = d.parent_id;\n } else if (layout.properties.selectionMode == \"child\" ) {\n my_id = d.id;\n } else {\n // do nothing\n }\n\n if (layout.properties.clearAll) {\n //clear selections\n app.clearAll();\n self.paint($element);\n } else {\n self.paint($element, layout)\n }\n }", "function populate_dropdown(entries) {\r\n entries = entries.slice(0, _settings.limit);\r\n\r\n var list = $('<ul></ul>').addClass('list-group');\r\n entries.forEach(function(entry) {\r\n list.append($('<li></li>').text(entry).data('id', entry).addClass('list-group-item'));\r\n });\r\n\r\n $dropdown.html(list).show(_settings.fade_time, function() {\r\n // Reset dropdown selected index\r\n $dropdown.data('selected_index', 0);\r\n var options = $dropdown.find('li');\r\n options.removeAttr('selected');\r\n options.eq(0).attr('selected', 'selected');\r\n });\r\n }", "function gotList(thelist) {\n \n println(\"List of Serial Ports:\");\n\n\n menu = createSelect();\n var title = createElement('option', 'Choose a port:');\n menu.child(title);\n menu.position(windowWidth/2, windowHeight-50);\n menu.changed(openPort);\n\n for (var i = 0; i < thelist.length; i++) {\n var thisOption = createElement('option', thelist[i]);\n thisOption.value = thelist[i];\n menu.child(thisOption);\n println(i + \" \" + thelist[i]);\n }\n}", "function handleFileSelect(evt) {\n\n var files = evt.target.files; // FileList object\n\n console.log(files);\n console.log(files[0]);\n\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = function() {\n //console.log(reader.result);\n\n var fileContent =reader.result;\n\n parsearArchivo( fileContent );\n pintarLaberinto();\n //alert('termino de paresear');\n $('#ingresoPosicion').show();\n $('#contSolucion').hide();\n $('#solucion').html('');\n }\n\n reader.readAsText(files[0]);\n}", "function makeSoundListSelector() {\n\t\t\tvar i;\n\t\t\tvar currOptionName;\n\n\n\t\t\t//$.getJSON(\"soundList/TestModelDescriptors\", function(data){\n\t\t\t$.getJSON(soundServer+\"soundList/ModelDescriptors\", function(data){\n\n\t\t\tsoundList = data.jsonItems;\n\t\t\t//console.log(\"Yip! sound list is \" + soundList);\n\t\t\tsoundSelectorElem.options.length=0;\n\t\t\tsoundSelectorElem.add(new Option('Choose Sound'));\n\t\t\tfor (i = 0; i < soundList.length; i += 1) {\n\t\t\t\tcurrOptionName = soundList[i].displayName || \"\";\n\t\t\t\t\t//Add option to end of list\n\t\t\t\t\tsoundSelectorElem.add(new Option(currOptionName));\n\t\t\t\t}\n\t\t\t\tsoundSelectorElem.options[0].selected=\"true\";\n\t\t\t});\n\t\t}", "function constructOptionList(topList, args){\n if(topList == \"movies\") {\n args = [args[1], args[0], args[2], args[3]];\n }\n \n var i = 0;\n for(let trigger of mediaTriggers){\n trigger.textContent = \"\";\n trigger.className = \"\";\n trigger.id = i;\n trigger.textContent = args[i].name + \" \";\n const innerSpanEl = document.createElement(\"span\");\n innerSpanEl.textContent = args[i].number;\n trigger.appendChild(innerSpanEl);\n ++i;\n \n trigger.addEventListener(\"click\", ()=>{\n mediaTriggers.forEach(element =>{element.className = \"\"}); //I clear the classes for the all the options\n trigger.className = \"selected\";\n pageNumber = 1;\n currentList = args[trigger.id].list;\n currentType = args[trigger.id].name;\n controlContentList(currentType);\n })\n }\n \n mediaTriggers[0].className = \"selected\";\n}", "function select (idx) {\n updatedLineNumbers(idx)\n List.select(idx)\n }", "function fillFileSystemNavList(entries){\n //check for mp3 regex\n var regex_mp3 = /^[^\\.].*mp3$/i;\n //check for not stating with . regex\n var regex_dot = /^[^\\.]/i;\n for(var i=0; i<entries.length; i++){\n if(entries[i].isFile && regex_mp3.test(entries[i].name)){\n /* its an .mp3 file */\n $('<li class=\"file\"><img src=\"img/headphones.png\"><h2>'+entries[i].name+'</h2></li>').appendTo('#filesystem_navigation_list');\n }\n if(entries[i].isDirectory && regex_dot.test(entries[i].name)){\n /* its a directory */\n $('<li class=\"directory\"><img src=\"img/folder.png\"><h2>'+entries[i].name+'</h2></li>').appendTo('#filesystem_navigation_list');\n }\n }\n}", "function selectFile(obj, folder) {\n urlobj = obj;\n\n if (folder == undefined) {\n folder = '';\n }\n\n var finder = new CKFinder();\n finder.basePath = '/assets/vendor/custom/ck/ckfinder/';\t// The path for the installation of CKFinder (default = \"/ckfinder/\").\n finder.startupPath = \"Files:\" + folder;\n finder.startupFolderExpanded = true;\n finder.selectActionData = obj;\n finder.selectActionFunction = SamuraiCms_finderSelectCallback;\n finder.popup();\n\n }", "function open_dir(dir){\r\n $('body').addClass('loading');\r\n manager.get_dir(dir,function(files){\r\n \r\n global.total_selected=0;\r\n $('#edit').hide();\r\n html='';\r\n for(var i=0;i<files.length;i++){\r\n html+='<div data-file=\"'+files[i].rel_filename+'\" class=\"file '+files[i].type+'\"'+\r\n 'title=\"'+files[i].filename+'\" data-i=\"'+i+'\" data-type=\"'+files[i].type+'\">'+\r\n '<div class=\"icon\"><i class=\"fa fa-'+files[i].icon+'\"></i></div>'+\r\n '<div class=\"name\">'+files[i].filename+'</div>'+\r\n '<div class=\"type\">'+files[i].type+'</div>'+\r\n '<div class=\"filedate\" data-date=\"'+files[i].modified_timestamp+'\">'+files[i].date+'</div>'+\r\n '<div class=\"filesize\" data-size=\"'+files[i].raw_size+'\">'+files[i].filesize+'</div>'+\r\n '</div>';\r\n }\r\n $('.file').remove();\r\n $('#files').html(html);\r\n $('#info').text(files.length+' file(s)');\r\n\r\n //remove selection\r\n $('#files').off('click').on('click',function(event) { \r\n if(!$(event.target).closest('.file').length) {\r\n $('.selected').removeClass('selected');\r\n $('#info').text(files.length+' file(s)');\r\n $('#edit').hide();\r\n } \r\n })\r\n\r\n //select files\r\n $('.file').on('click',function(e){\r\n var index=parseInt($(this).data('i')),\r\n text='';\r\n \r\n if(!e.ctrlKey){\r\n if($(this).hasClass('selected')) return; //kill if already selected\r\n $('.selected').removeClass('selected');\r\n }\r\n if(e.shiftKey){ //select multiples\r\n\r\n if(index > global.last_selected){\r\n while(index >= global.last_selected){\r\n $('.file[data-i=\"'+index+'\"]').addClass('selected');\r\n index--;\r\n }\r\n }\r\n else{\r\n while(index <= global.last_selected){\r\n $('.file[data-i=\"'+index+'\"]').addClass('selected');\r\n index++;\r\n }\r\n }\r\n $(this).addClass('selected');\r\n global.total_selected=$('.selected').length;\r\n\r\n text=global.total_selected+' files selected';\r\n }\r\n else if(e.ctrlKey){\r\n if($(this).hasClass('selected'))\r\n $(this).removeClass('selected');\r\n else\r\n $(this).addClass('selected');\r\n global.total_selected=$('.selected').length;\r\n text=global.total_selected+' files selected';\r\n }\r\n else{ //deselect everything except this one\r\n global.last_selected=index;\r\n $(this).addClass('selected');\r\n global.total_selected=1;\r\n console.log(manager.files[index]);\r\n text=manager.files[index].rel_filename;\r\n if(manager.files[index].type!=='dir')\r\n text+=' - Size:'+manager.files[index].filesize;\r\n text+=' - Modified:'+manager.files[index].modified;\r\n }\r\n $('#info').text(text);\r\n \r\n if(global.total_selected === 1){\r\n $('#edit .single').show();\r\n }\r\n else{\r\n $('#edit .single').hide();\r\n }\r\n if(global.total_selected > 0){\r\n $('#edit').show();\r\n }\r\n else{\r\n $('#edit').hide();\r\n }\r\n });\r\n \r\n //open the file\r\n $('.file[data-type!=\"dir\"]').on('dblclick',function(){\r\n var index=$(this).data('i');\r\n if(typeof index==='undefined')return;\r\n var file=manager.files[index];\r\n $('#image').html('');\r\n $('#text textarea').html('');\r\n manager.get_file(index,function(file){\r\n if(!file){\r\n error('This type of file is not permitted.');\r\n }\r\n else{\r\n console.log(file);\r\n $('#image').hide();\r\n $('#text').hide();\r\n $('#iframe').hide();\r\n if(file.action=='view'){\r\n if(file.type==='jpg' || file.type==='gif' || file.type==='png'){\r\n $('#image').html('<img src=\"'+global.base_url+file.rel_filename+'\">');\r\n $('#image').show();\r\n lightbox.show(file.filename);\r\n }\r\n else{\r\n console.log(global.base_url+encodeURIComponent(file.rel_filename));\r\n window.open(global.base_url+encodeURIComponent(file.rel_filename));\r\n //$('#iframe iframe').attr('src',global.base_url+encodeURIComponent(file.rel_filename));\r\n }\r\n }\r\n else if(file.action=='edit'){\r\n $('#text textarea').text(file.contents);\r\n $('#text').show();\r\n lightbox.show(file.filename);\r\n }\r\n else{\r\n $('#iframe iframe').attr('src','download.php?file='+encodeURIComponent(file.rel_filename));\r\n }\r\n }\r\n });\r\n \r\n });\r\n\r\n $('.dir').on('dblclick',function(){open_dir($(this).data('file'));});\r\n\r\n manager.get_breadcrumbs(function(nav){\r\n html='';\r\n for(var i=0;i<nav.length;i++){\r\n html+='<li><a data-path=\"'+nav[i].rel_path+'\">'+nav[i].name+'</a></li>';\r\n }\r\n $('.breadcrumb li').remove();\r\n $('.breadcrumb').html(html);\r\n $('.breadcrumb li a').on('click',function(){open_dir($(this).data('path'));});\r\n $('body').removeClass('loading');\r\n });\r\n });\r\n //window.location.href=window.location.origin+window.location.pathname+'?dir='+$(this).data('file');\r\n}", "function selectById(idSel, gList, target) {\n target[idSel.name] = gList[idSel.name];\n }", "function Select() {\r\n setButtonDisable(add, true);\r\n setButtonDisable(edit, true);\r\n\r\n if (!list.selectedItem) {\r\n setButtonDisable(del, true);\r\n return false;\r\n }\r\n entry.value = list.selectedItem.getAttribute(\"label\");\r\n setButtonDisable(del, false);\r\n return true;\r\n}", "buildSelect() {\n // Build html select\n this.select = document.createElement('select')\n this.select.classList.add(this.selectClass)\n // Create all options from li\n const items = this.element.querySelectorAll('li')\n ;[].forEach.call(items, item => {\n const option = document.createElement('option')\n option.innerText = item.innerText\n option.value = item.querySelector('a').href\n if (item.classList.contains('active')) {\n option.selected = true\n }\n this.select.appendChild(option)\n })\n // Clean parent and append select\n this.parent.innerHTML = ''\n this.parent.appendChild(this.select)\n this.select.addEventListener('change', this.handleSelectAsLink)\n }", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n // Pode-se receber varios arquivos. \n files = evt.dataTransfer.files; // Objeto FileList\n console.log(files)\n var output = [];\n for (var i = 0, f; f = files[i]; i++) {\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\n f.size, ' kb, last modified: ',\n f.lastModifiedDate.toLocaleDateString(), '</li>');\n }\n document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';\n\n } else {\n swal({\n title: 'Navegador não suportado: ' + navigator.appVersion,\n text: 'Atualize seu navegador!',\n timer: 2000,\n showConfirmButton: false\n });\n }\n }//", "function handleFileSelect() {\n //Check File API support\n if (window.File && window.FileList && window.FileReader) {\n\n var files = event.target.files; //FileList object\n var output = document.getElementById(\"result\");\n\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n //Only pics\n if (!file.type.match('image')) continue;\n\n var picReader = new FileReader();\n picReader.addEventListener(\"load\", function (event) {\n var picFile = event.target;\n var li = document.createElement(\"li\");\n li.className ='list'\n\n li.innerHTML = \"<img class='thumbnail small_image' src='\" + picFile.result + \"'\" + \"title='\" + picFile.name + \"'/>\";\n\n output.insertBefore(li, null);\n\n });\n //Read the image\n picReader.readAsDataURL(file);\n }\n } else {\n console.log(\"Your browser does not support File API\");\n }\n}", "selectFiles(callback) {\n\t\tconst input = document.createElement('input');\n\t\tinput.type = 'file';\n\t\tinput.multiple = true;\n\t\tinput.onchange = (ev) => {\n\t\t\tconst { files } = ev.target;\n\n\t\t\tfor (let i = 0; i < files.length; i += 1) {\n\t\t\t\tcallback.call(UploadFS, files[i]);\n\t\t\t}\n\t\t};\n\t\t// Fix for iOS/Safari\n\t\tconst div = document.createElement('div');\n\t\tdiv.className = 'ufs-file-selector';\n\t\tdiv.style = 'display:none; height:0; width:0; overflow: hidden;';\n\t\tdiv.appendChild(input);\n\t\tdocument.body.appendChild(div);\n\t\t// Trigger file selection\n\t\tinput.click();\n\t}", "selectFile(file) {\n let [{ id }] = findElementWithAssert(this);\n let renderedInstance = this.context.container.lookup('-view-registry:main')[id];\n\n let mockEvent = { target: { files: [file] } };\n renderedInstance.change(mockEvent);\n }", "function select(state) {\n return {\n visibleTodos: selectTodos(state.todos, state.visibilityFilter),\n visibilityFilter: state.visibilityFilter,\n tickets: state.tickets,\n winningNumbers: state.winningNumbers,\n fileNames: state.fileNames\n }\n}", "function loadFileEntry(_chosenEntry) {\r\n chosenEntry = _chosenEntry;\r\n chosenEntry.file(function(file) {\r\n readAsText(chosenEntry, function(result) {\r\n\t\t//\r\n\t\tdocument.getElementById('file_path').value = result;\r\n //textarea.value = result; /// NEED TO REPLACE NATE\r\n });\r\n // Update display.\r\n saveFileButton.disabled = false; // allow the user to save the content\r\n displayEntryData(chosenEntry);\r\n });\r\n}", "function f_select (ev) {\n\t\tif (!_allowed ('write','control'))\n\t\t\treturn false;\n\n\t\tvar _val = get_map_entry(ev);\n\t\tvar file = ev.target.files[0];\n\t\tvar reader = new FileReader();\n\t\tif (!file) {\n\t\t\teditor.focus();\n\t\t\treturn;\n\t\t}\n\n\t\treader.onload = function (f) {\n\t\t\tload_file(f, _val, file);\n\t\t};\n\t\treader.readAsText(file);\n\t}", "function openFilePicker(selection) {\n\n var srcType = Camera.PictureSourceType.SAVEDPHOTOALBUM;\n var options = setOptions(srcType);\n var func = createNewFileEntry;\n\n navigator.camera.getPicture(function cameraSuccess(imageUri) {\n displayImage(imageUri);\n }, function cameraError(error) {\n console.debug(\"Unable to obtain picture: \" + error, \"app\");\n }, options);\n}", "function addSelectEntry(seq) {\n var input = select[0].selectize;\n input.addOption({value:seq,text:seq + \" (found CRISPR sequence)\"});\n input.refreshOptions();\n}", "function FileEntry(entry) {\n FileEntry.__super__.constructor.apply(this, arguments);\n }", "function receiveSelection(){\n\t\n\t$.ajax({\n\t\ttype: 'GET',\n\t\turl: 'temp/selectiondata.json',\n\t\tdatatype: 'application/json',\n\t\tsuccess: function(content){\n \n\t\t\t// add options to dropdown menu\n\t\t\tfor(var i = 0; i < content.selectiondata.length; i++){\n\t\t\t\tn = content.selectiondata[i].name;\n\t\t\t\t$('#fileSelection').append($('<option></option>').val(n).html(n).attr(\"type\", content.selectiondata[i].type).attr(\"count\", content.selectiondata[i].count));\n\t\t\t}\t\n\t\t\t\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(\"jq: \" + JSON.stringify(jqXHR));\n\t\t\tconsole.log(\"textStatus: \" + textStatus);\n\t\t\tconsole.log(\"errorThrown:\" + errorThrown);\n\t\t\tconsole.log('failed to load gaze data');\t\t\t\n\t\t}\n\t});\t\t\n}", "function updateSelect() {\n var option = $('#feature').val();\n var rows = $('#lines_table tr.option[option=\"' + option + '\"]');\n $('#info').empty().append(\n $('td', rows.eq(1)).eq(0).children().clone()\n );\n $('#main_list .entry').empty().addClass('unsupported');\n $.each(DemoList, function (idx, opts) {\n if (opts.parentOption === option) {\n var entry = $('#main_list .entry').eq(opts.parentPosition - 1);\n entry.removeClass('unsupported').append(opts.parentHref);\n }\n });\n updateDemos();\n}", "onListContentChanged_() {\n this.updateSubDirectories(false, () => {\n // If no item is selected now, try to select the item corresponding to\n // current directory because the current directory might have been\n // populated in this tree in previous updateSubDirectories().\n if (!this.selectedItem) {\n const currentDir = this.directoryModel_.getCurrentDirEntry();\n if (currentDir) {\n this.selectByEntry(currentDir);\n }\n }\n });\n }", "function fetchObjs(){\n\tvar files = [\"head\", \"teapot\", \"teddy\"];\n\tvar objList = document.getElementById(\"obj-list\");\n\tdocument.getElementById(\"item-rendered\").innerHTML = files[0];\n\tfiles.forEach(function (i){\n\t\tobjList.innerHTML += \"<div class='dropdown-item choice'>\" + i + \"</div>\";\n\t});\n}", "function select(dsid) {\n // Ignore if this isn't a different list.\n if (selectedDsid === dsid) { return; }\n\n // Close sharing modal.\n $('#sharing-modal').removeClass('md-show');\n\n // Remember the selected DSID.\n selectedDsid = dsid;\n\n // If there's no selection, clear UI.\n if (!dsid) {\n $('#project-data ul').empty();\n $('#project-data h2').text('');\n $('#project-data').hide();\n $('#project-list li').removeClass('selected');\n if (datastore !== null) {\n datastore.close();\n datastore = null;\n }\n return;\n }\n\n // Update selection class.\n $('#project-list li').removeClass('selected');\n $(escapeID(dsid)).addClass('selected');\n\n // If this represents a change from the current datastore\n if (datastore === null || datastore.getId() !== dsid) {\n // Clear the right-hand side of the page.\n $('#project-data ul').empty();\n $('#project-data h2').text('');\n\n // Open the datastore\n datastoreManager.openDatastore(dsid, function (err, ds) {\n if (err) {\n alert('Error opening list. Make sure you have the permission.');\n return;\n }\n\n $('#project-data').show();\n\n // If the selection has already changed, ignore.\n if (ds.getId() !== selectedDsid) {\n ds.close();\n return;\n }\n\n // If there's an existing open datastore, close it.\n if (datastore !== null && datastore.getId() !== ds.getId()) {\n datastore.close();\n datastore = null;\n }\n\n // Store a pointer to the new open datastore.\n datastore = ds;\n\n // Update the UI with items from this datastore.\n populateItems();\n getPictureUrl();\n });\n }\n }", "onFileSelected(event) {\n this.selectedFiles = event.target.files;\n }", "_applySelection(mode, details) {\n const that = this;\n\n function createSelectionTags() {\n while (that.$.selectionField.firstElementChild.nodeName === 'SPAN') {\n that.$.selectionField.removeChild(that.$.selectionField.firstElementChild)\n }\n\n let fragment = document.createDocumentFragment(), element, icon;\n\n if (that.selectionDisplayMode === 'tokens') {\n if (that.selectedIndexes.length === 1 && (that.selectionMode === 'oneOrManyExtended' || that.selectionMode === 'oneOrMany')) {\n icon = '';\n }\n else {\n icon = '&#10006'\n }\n }\n else {\n icon = ',';\n }\n\n that.selectedIndexes.map(index => {\n element = that._applyTokenTemplate(that.$.listBox._items[index][that.inputMember], icon);\n element._value = that.$.listBox._items[index].value;\n fragment.appendChild(element);\n });\n\n that.$.selectionField.insertBefore(fragment, that.$.input);\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that.$.container.setAttribute('has-value', '');\n that._oldValue = that.value = that._currentSelection.toString();\n that._positionDetection.positionDropDown();\n }\n\n that.$.autoCompleteString.textContent = '';\n\n if (that.selectedIndexes.length === 0) {\n that._clearSelection(details && details.index > -1 && that.$.input.value === that.$.listBox._items[details.index][that.inputMember]);\n return;\n }\n\n if (!that.$.listBox._items || that.$.listBox._items.length === 0) {\n return;\n }\n\n if (that.selectionMode === 'one' || that.selectionMode === 'zeroOrOne' || that.selectionMode === 'radioButton') {\n if (that._currentSelection && that._currentSelection.length > that.selectedIndexes.length) {\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that.$.input.value = that._currentSelection.toString();\n that._oldValue = that.value = that._currentSelection.toString();\n return;\n }\n\n that._clearSelection();\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that.$.input.value = that._currentSelection.toString();\n that._oldValue = that.value = that._currentSelection.toString();\n\n that.$.container.setAttribute('has-value', '');\n\n if (that.autoComplete !== 'none' && typeof that.dataSource !== 'function') {\n that._autoComplete(true);\n that.close();\n }\n }\n else {\n that.$.input.value = '';\n that.$.input.placeholder = '';\n that.$.container.setAttribute('has-value', '');\n\n if (!that._currentSelection || that.selectionMode === 'oneOrManyExtended' || (that.selectionMode === 'radioButton' && !that.grouped)) {\n createSelectionTags();\n return;\n }\n\n const selectionTags = that.$.selectionField.getElementsByClassName('jqx-token');\n\n if (that._currentSelection.length < that.selectedIndexes.length) {\n let selectedLabels = that.selectedIndexes.map(index => that.$.listBox._items[index][that.inputMember]);\n\n for (let i = 0; i < selectedLabels.length; i++) {\n if (that._currentSelection.indexOf(selectedLabels[i]) < 0) {\n const item = that.$.listBox._items[that.selectedIndexes[i]];\n let element, icon;\n\n if (that.selectionDisplayMode === 'tokens') {\n if (that.selectedIndexes.length === 1 && (that.selectionMode === 'oneOrManyExtended' || that.selectionMode === 'oneOrMany')) {\n icon = '';\n }\n else {\n icon = '&#10006'\n }\n }\n else {\n icon = ',';\n }\n\n if (that.selectedIndexes.length === 1 && (that.selectionMode === 'oneOrManyExtended' || that.selectionMode === 'oneOrMany')) {\n icon = '';\n }\n\n element = that._applyTokenTemplate(item[that.inputMember], icon);\n element._value = item.value;\n that.$.selectionField.insertBefore(element, that.$.input);\n }\n }\n\n if (that.autoComplete !== 'none' && (that.$.listBox._filteredItems && that.$.listBox._filteredItems.length !== that.$.listBox._items.length)) {\n that._autoComplete(true);\n }\n\n that._positionDetection.positionDropDown();\n }\n else if ((that._currentSelection.length > 0 && selectionTags.length === 0) ||\n (that._currentSelection.length === that.selectedIndexes.length && that._currentSelection.toString() !== that.selectedValues.toString())) {\n createSelectionTags();\n return;\n }\n else {\n if (!details) {\n return;\n }\n\n for (let t = 0; t < selectionTags.length; t++) {\n if (selectionTags[t]._value === details.value) {\n that.$.selectionField.removeChild(selectionTags[t]);\n break;\n }\n }\n }\n\n that._currentSelection = that.selectedIndexes.map(i => that.$.listBox._items[i][that.inputMember]);\n that._oldValue = that.value = that._currentSelection.toString();\n }\n }", "function updateList() {\n let input = document.getElementById('attachment');\n if (input && input.files){\n // read selected file\n for (let i = 0; i < input.files.length; ++i) {\n updateListItems.push(input.files.item(i));\n }\n }\n displayAttachments();\n }", "function populateTreeSelection(xmlList){\n var treeSelector = document.getElementById(\"treeSelector\");\n\n //clear the selection list\n for (var count = treeSelector.options.length-1; count >-1; count--){\n treeSelector.options[count] = null;\n }\n\n //get the relevant xml elements in an array liike format\n var trees = xmlList.getElementsByTagName('tree');\n\n //add the request to select a tree to the drop down\n defaultItem = new Option(\"Select navigation tree\");\n treeSelector.options[treeSelector.length] = defaultItem;\n\n //cycle round the xml elements, populating the drop down as we go\n var textValue;\n var startPoint;\n for (var x = 0; x < trees.length; x ++){\n textValue = GetInnerText(trees[x]);\n startPoint = trees[x].getAttribute(\"start\");\n optionItem = new Option( textValue, startPoint, false, false);\n treeSelector.options[treeSelector.length] = optionItem;\n }\n\n\n}", "function gotDistFile(xmlDoc)\n{\n if(!xmlDoc)\n {\n alert(\"ReqUpdatePages.js: gotDistFile: unable to retrieve districts file: \" + xmlName);\n return;\n }\n\n var distSelect = document.distForm.District;\n distSelect.options.length = 1; // clear the list\n\n // get the list of districts from the XML file\n var newOptions = xmlDoc.getElementsByTagName(\"option\");\n\n // add the options to the Select\n for (var i = 0; i < newOptions.length; ++i)\n {\n // get the source \"option\" node\n // note that although this has the same contents and appearance as an\n // HTML \"option\" statement, it is an XML Element object, not an HTML\n // Option object.\n var node = newOptions[i];\n\n // get the text value to display to the user\n var text = node.textContent;\n\n // get the \"value\" attribute\n var value = node.getAttribute(\"value\");\n if ((value == null) || (value.length == 0))\n { // cover our ass\n value = text;\n } // cover our ass\n\n // create a new HTML Option object and add it to the Select\n text += \" [dist \" + value + \"]\";\n addOption(distSelect, text, value);\n } // loop through source \"option\" nodes\n\n // if required select a specific district \n DistSet();\n}", "function FileRefList(theDocURL) {\r this.docURL = theDocURL;\r this.list = new Array();\r}", "function genfilelistentry(data)\n{\n var res=document.createElement(\"div\");\n\n data.modtime=new Date(data.modtime*1000);\n data.modtime=`${data.modtime.toISOString().slice(0,10)} ${data.modtime.toTimeString().slice(0,8)}`;\n\n // res.innerHTML=`<dl><dt>${data.name}</dt><dd>${data.size}</dd><dd class=\"type\">${data.type}</dd><dd class=\"mod-time\">${data.modtime}</dd><dd class=\"delete\"><span>delete</span></dd></dl>`;\n res.innerHTML=`<a href=\"webp2.php?fileget=${data.id}\"><dl><dt>${data.name}</dt><dd>${data.size}</dd><dd class=\"type\">${data.type}</dd><dd class=\"mod-time\">${data.modtime}</dd><dd class=\"delete\"><span>delete</span></dd></dl></a>`;\n\n var deletebutton=res.firstChild.querySelector(\".delete span\");\n\n deletebutton.fileid=data.id;\n\n deletebutton.addEventListener(\"click\",(e)=>{\n e.preventDefault();\n\n deleteid(e.currentTarget.fileid);\n\n _filelist.removeChild(e.currentTarget.parentElement.parentElement.parentElement);\n });\n\n return res.firstChild;\n}", "function filesSelected(event) {\n processImport(event.target.files, 0);\n}", "function fileChange() {\n\tcount++;\n\tif (count > 1) {\n\t\tvar num = count - 1;\n\t\t$(\"div#file\" + num).removeClass(\"highlightFile\");\n\t}\n\t// FileList Object existing of input with ID \"fileA\"\n\tvar fileList = document.getElementById(\"fileA\").files;\n\n\t// File Object (first element of FileList)\n\tfile = fileList[0];\n\n\tfileArr.push(file);\n\t// File Object not available = no data chosen\n\tif (!file) {\n\t\treturn;\n\t}\n\n\t$(\"div#wrapFiles\")\n\t\t\t.append(\n\t\t\t\t\t\"<div id='file\"\n\t\t\t\t\t\t\t+ count\n\t\t\t\t\t\t\t+ \"' class='singleFile' onClick='setFile(\"\n\t\t\t\t\t\t\t+ count\n\t\t\t\t\t\t\t+ \")'> <span class='fileName'></span><span class='fileSize'></span> <br> <div id='prog' class='progress-bar blue stripes'><span style='width: 0%'></span> </div> </div>\");\n\n\t$(\"div#file\" + count + \" span.fileName\").html(\"Name: \" + file.name);\n\t$(\"div#file\" + count + \" span.fileSize\").html(\"Size: \" + file.size + \"B\");\n\t$(\"div#file\" + count).addClass(\"highlightFile\");\n\n}", "function handleFileSelect1(evt) {\r\n\t\tevt.stopPropagation();\r\n\t\tevt.preventDefault();\r\n\r\n\t\tvar files = evt.dataTransfer.files; // FileList object.\r\n\r\n\t\tif(typeof(currentFiles.Coords) !== \"undefined\"){\r\n\t\t\tvar r = confirm(\"Override existing File?\"); // ask User\r\n\t\t\tif(r == true){\r\n\t\t\t\tconsole.log(\"Override File\");\r\n\t\t\t\t// now clear all old options from Coords- and Match-ID-Selection\r\n\t\t\t\tvar select = document.getElementById(\"xSelect\");\r\n\t\t\t\tvar select2 = document.getElementById(\"coordIDSelect\");\r\n\t\t\t\tvar select3 = document.getElementById(\"ySelect\");\r\n\t\t\t\tvar length = select.options.length; // the 2 selects should have same options\r\n\t\t\t\tfor (i = 0; i < length; i++) {\r\n\t\t\t\t select.options[0] = null;\r\n\t\t\t\t select2.options[0] = null;\r\n\t\t\t\t select3.options[0] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tconsole.log(\"Do nothing\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// files is a FileList of File objects. List some properties.\r\n\t\tvar output = [];\r\n\t\tf = files[0];\r\n\r\n\t\toutput.push('<li><strong>', escape(f.name), '</strong> - ',\r\n\t\tf.size, ' bytes, last modified: ',\r\n\t\tf.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a','</li>');\r\n\t\tcurrentFiles.Coords = f.name;\r\n\r\n\t\tcoords_json ={};\r\n\t\tvar reader = new FileReader(); // to read the FileList object\r\n\t\treader.onload = function(event){ // Reader ist asynchron, wenn reader mit operation fertig ist, soll das hier (JSON.parse) ausgeführt werden, sonst ist es noch null\r\n\t\t\tvar columnNames = [];\r\n\t\t\tif (f.name.substr(f.name.length - 3) ===\"csv\"){ // check if filetiype is csv\r\n\t\t\t\tcurrentFiles.CoordsFileType = \"csv\";\r\n\t\t\t\tcolumnNames = getColumnNames(reader.result);\r\n\t\t\t\twindow.csv = reader.result; // temporary save reader.result into global variable, until geoJSON can be created with user-inputs\r\n\t\t\t\taskFields2(columnNames, 1);\r\n\t\t\t}\r\n\t\t\telse if (f.name.substr(f.name.length - 4) ===\"json\"){\r\n\t\t\t\tcurrentFiles.CoordsFileType = \"JSON\";\r\n\t\t\t\tcoords_json = JSON.parse(reader.result);\r\n\t\t\t\taskFields2(columnNames, 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\talert(\"Unrecognized Filetype. Please Check your input (only .csv or .json allowed)\");\r\n\t\t\t}\r\n\r\n\t\t\tdocument.getElementById(\"hideCoordSelection\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"choseFieldDiv1\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"renderCoordinatesButton\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"hideSelectionHolder\").style.visibility = \"visible\";\r\n\r\n\t\t\t//askFields(coords_json.features[0], 1); // only first feature is needed for property names\r\n\t\t\tdocument.getElementById(\"renderCoordinatesButton\").addEventListener('click', function(){add_zaehlstellen(coords_json);}, false);\r\n\t\t\t//console.log('added Event Listener to apply button');\r\n\t\t\t//add_zaehlstellen(coords_json);\r\n\t\t};\r\n\t\treader.readAsText(f,\"UTF-8\");\r\n\r\n\t\tdocument.getElementById('list_coords').innerHTML = '<ul style=\"margin: 0px;\">' + output.join('') + '</ul>';\r\n\t}", "function doFileSelect(fileObj) {\n\n\t\t\tif (!(typeof fileObj.attr === 'string' || typeof fileObj.date === 'string' || typeof fileObj.dir === 'string' || typeof fileObj.ext === 'string' || typeof fileObj.fullpath === 'string' || typeof fileObj.mime === 'string' || typeof fileObj.height === 'string' || typeof fileObj.height === 'number' || typeof fileObj.name !== 'string' || typeof fileObj.size !== 'number' || typeof fileObj.type !== 'string' || typeof fileObj.width === 'string' || typeof fileObj.width === 'number')) {\n\n\t\t\t\t// debug the file selection settings (if debug is turned on and console is available)\n\t\t\t\tif (sys.debug) {\n\t\t\t\t\tconsole.log(fileObj);\n\t\t\t\t}\n\n\t\t\t\tdisplayDialog({\n\t\t\t\t\ttype: 'throw',\n\t\t\t\t\tstate: 'show',\n\t\t\t\t\tlabel: 'Oops! There was a problem',\n\t\t\t\t\tcontent: 'There was a problem reading file selection information.'\n\t\t\t\t});\n\n\t\t\t} else if (typeof tinyMCE !== 'undefined' && typeof tinyMCEPopup !== 'undefined') {\n\t\t\t\tvar win = tinyMCEPopup.getWindowArg('window'),\n\t\t\t\t\trelPath = fileObj.dir + fileObj.name;\n\n\t\t\t\t// insert information into the tinyMCE window\n\t\t\t\twin.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = relPath;\n\n\t\t\t\t// for image browsers: update image dimensions\n\t\t\t\tif (win.ImageDialog) {\n\t\t\t\t\tif (win.ImageDialog.getImageData) {\n\t\t\t\t\t\twin.ImageDialog.getImageData();\n\t\t\t\t\t}\n\t\t\t\t\tif (win.ImageDialog.showPreviewImage) {\n\t\t\t\t\t\twin.ImageDialog.showPreviewImage(relPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// close popup window\n\t\t\t\ttinyMCEPopup.close();\n\n\t\t\t} else {\n\n\t\t\t\t// We are a standalone mode. What to do, is up to you...\n\t\t\t\tif (opts.callBack !== null) {\n\n\t\t\t\t\t// user passed a callback function\n\t\t\t\t\topts.callBack(fileObj);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// just do a simple throw\n\t\t\t\t\tdisplayDialog({\n\t\t\t\t\t\ttype: 'throw',\n\t\t\t\t\t\tstate: 'show',\n\t\t\t\t\t\tlabel: 'Standalone Mode Message',\n\t\t\t\t\t\tcontent: 'You selected' + (fileObj.dir + fileObj.name) + '<br />' + fileObj.fullpath\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "function addSearchResult(verse) {\n //Each result found runs through here:\n var result = document.createElement(\"div\");\n result.setAttribute(\"class\", \"search-result\");\n\n //get which collection we're in\n var i = myData.collections.findIndex((obj) => obj.folder === verse.folder);\n\n //Get the font name each colletion should be displayed in\n searchFontNameWithExtension = myData.collections[i].searchFont;\n searchFontName = searchFontNameWithExtension.substr(\n 0,\n searchFontNameWithExtension.indexOf(\".\")\n );\n\n result.setAttribute(\"data-file\", verse.file);\n result.setAttribute(\"data-folder\", verse.folder);\n result.setAttribute(\"data-id\", verse.id);\n result.setAttribute(\"data-verse-number\", verse.verseNumber);\n result.setAttribute(\"data-collection-name\", verse.collectionName);\n resultRefFontSize = myData.collections[i].searchFontSize - 4;\n result.innerHTML = `${verse.verseText}<br><resultRef style=\"font-size:${resultRefFontSize}px\">${verse.bookAndChapter}.${verse.verseNumber} | ${verse.collectionName}`;\n result.setAttribute(\n \"style\",\n `font-family:${searchFontName}; font-size:${myData.collections[i].searchFontSize}px; direction:${myData.collections[i].textDirection}`\n );\n\n // Attach click handler to select\n result.addEventListener(\"click\", select);\n\n // Attach open doubleclick handler\n result.addEventListener(\"dblclick\", open);\n resultsList.appendChild(result);\n\n // If this is the first item, select it\n if (document.getElementsByClassName(\"search-result\").length === 1) {\n result.classList.add(\"selected\");\n }\n}", "function initMultipleSelection(element) {\n element.on('click', 'li.type-task, li.type-sub-task', function (eventObject) {\n if (!eventObject.ctrlKey) {\n $('li.selected', element).not(this).removeClass('selected');\n }\n $(this).toggleClass('selected');\n eventObject.stopPropagation();\n });\n}", "select (name, path) {\n this.selectedPath = path;\n const directory = this._getDirectory(this._computeBreadCrumbs(this.selectedPath), this.selectedPath);\n const files = directory.children;\n for (let i = 0; i < files.length; i++) {\n if (files[i][this.nameProp] === name) {\n this.selectedIndex = i;\n break;\n }\n }\n }", "function handleFileSelect() {\n // Check for the various File API support.\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n } else {\n alert('The File APIs are not fully supported in this browser.');\n }\n\n var f = event.target.files[0]; // FileList object\n var reader = new FileReader();\n\n reader.onload = function(event) {\n load_d3(event.target.result)\n };\n // Read in the file as a data URL.\n reader.readAsDataURL(f);\n}", "function getSectionContents(bookmarkList,query) {\n var section_root = jQuery('<ol>').addClass('section_content');\n // section contents layout \n for ( var i = 0; i < bookmarkList.length; i++ ){\n if ( query == \"\" || bookmarkList[i].title.indexOf(query) >= 0 ){\n section_root.append(\n jQuery('<li>').attr('class','ui-widget-content').append(\n jQuery('<div>').text(bookmarkList[i].title).css('font-size','1em').add(\n jQuery('<input>').attr('type','hidden').val(bookmarkList[i].url)\n )\n )\n )\n \n }//end of if\n }//end of for.\n section_root.selectable({\n filter:'li',\n selected: function(event, ui) {\n chrome.tabs.create({url:$(ui.selected).find(\"input\").val()})\n }\n });\n return section_root;\n}", "function handleFileSelect(evt) {\n let files = evt.target.files; // FileList object\n \n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n let reader = new FileReader();\n \n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(event) {\n // Render thumbnail.\n let span = document.createElement('span');\n span.innerHTML = ['<img class=\"thumb\" src=\"', event.target.result,\n '\" title=\"', escape(theFile.name), '\"/>'].join('');\n document.getElementById('list').insertBefore(span, null);\n $('#add-post-container .input-field').find('#button').addClass('button-image');\n $('#add-post-container .input-field').find('#description-span').addClass('image-span');\n let $inputContent = $('#first_name').val();\n if ($inputContent && $('#files').val()) {\n $publishButton.removeAttr('disabled');\n } else {\n $publishButton.attr('disabled', true);\n } \n };\n })(f);\n \n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }", "function selectThisEntry() {\n var entries = getEntries();\n for (var n = 0; n < entries.length; n++) {\n if (entries[n] == this) {\n selectEntry(n, false);\n }\n }\n}", "function Selection() {\n this.selection = new LinkedHashMap();\n // The \"focus\" is some information on the previous last element in the selection. It is used for #13\n // Basically, when the selection is cleared, we can record a previous focus which will be used to \n // \"resume\" selection with keyboard arrows\n this.focus = { next:undefined, prev:undefined };\n}", "function spiralizeLoad(e) {\n// check if we've saved any and if so, reload\n if (localStorage.spiralNextPrimaryKey) {\n\n var spiralSavedKey = \"\";\n var select = document.getElementById(\"spiralSavedList\");\n\n for(var i = Number(localStorage.spiralNextPrimaryKey)-1; i >= 1; --i) {\n var option = document.createElement('option');\n\n spiralSavedKey = i.toString();\n spiralSaved[i] = JSON.parse(localStorage.getItem(spiralSavedKey));\n\n console.log(\"OBJ-O\", spiralSaved[i].xOrg);\n option.text = option.value = spiralSaved[i].desc;\n select.add(option, 0);\n }\n } else {\n alert('Oops! No saved data found' );\n }\n\n\n}", "function create_select (ele, create, the_list, clss, empty)\n{\n var optGrp,x,i;\n ele = ele.indexOf('#')!=-1?ele.substr(1):ele;\n var select_field = document.getElementById(ele);\n\n if (empty) the_list[0] = 'Select...';\n if (create)\n {\n edit_element = { id:ele, name:ele, clss:clss, onclick:''};\n select_field = creo(edit_element,'select');\n }/*end if*/\n optGrp = select_field.getElementsByTagName('optgroup');\n if (optGrp.length > 0 ) for (i=optGrp.length-1;i>=0;i--) select_field.removeChild(optGrp[i]);\n if (select_field.length > 0)for (x=select_field.length-1; x>=0; x--) select_field.remove(x);\n\n for (i in the_list)\n {\n if (i=='in_array') continue;/*view the addition of in_array @js.js:158*/\n var option = document.createElement('option');\n option.value = i;\n option.text = the_list[i];\n select_field.add(option,select_field.options[null]);\n /*try {select_field.add(option,select_field.options[null]);} catch(e) { select_field.add(option,null);}*/\n }/*end for*/\n return select_field;\n}", "function get_selection()\n {\n return selection;\n }", "function addNewItem(){\n var newItemtxt;\n var newItem;\n var distName = [\"USFoods\",\"BestMeats\",\"Condiments\"];\n var getItem = document.getElementById(\"dist\");\n // sets the attribute to selected on the BestMeats distributor //\n for (var i=0, j=distName.length; i<j; i++){\n newItem = document.createElement(\"option\");\n newItemtxt = document.createTextNode(distName[i]);\n newItem.appendChild(newItemtxt);\n getItem.appendChild(newItem);\n }\n}", "function handleFileSelect(evt) {\n for(var f=0; f < $('#put_files')[0].files.length; f++)\n allfiles.push($('#put_files')[0].files[f]);\n updateFileList();\n}", "function uploadTermListFile($event) {\n\n\t// process for each txt\n\tvar files = $event.target.files;\n\tfor (let i = 0; i < files.length; i++) {\n\t\tlet reader = new FileReader();\n\t\treader.onload = updateTermList(files[i].name);\n\t\treader.readAsText(files[i]);\n\t}\n\n\t// update input\n\t$('#uploadTermList').replaceWith('<input id=\"uploadTermList\" type=\"file\" accept=\".txt\" style=\"display: none;\" multiple>');\n\tdocument.getElementById('uploadTermList').addEventListener('change', uploadTermListFile, false);\n\n\t// open modal\n\t$('#term-list-edit-button').click();\n}", "function createBookmarkTreeSelect(){\r\n chrome.bookmarks.getTree(function(tree){\r\n window.rootTree = tree;\r\n var option = {text:''};\r\n traverseTree(tree,0,option,'');\r\n _folders = '<select id=\"folder_select\">';\r\n _folders += option.text;\r\n _folders += '</select>';\r\n log('Running createBookmarkTreeSelect()');\r\n });\r\n\r\n }", "function updateSelected(f, a) {\n $('div.feed ul li').removeClass(\"selected\");\n $('div.feed ul li[data-feed=\"' + f + '\"][data-article=\"' + a + '\"]').addClass(\"selected\");\n}", "function doSelect(list){\n var childPath = '';\n inquirer.prompt([\n {\n type: 'list',\n name: 'type',\n message: 'What do you want to do?',\n choices: [\n 'Set Json File',\n 'Get Json File',\n 'Import from DB'\n ]\n }\n ]).then(answers =>{\n var jsonAnswer = JSON.parse(JSON.stringify(answers));\n type = jsonAnswer.type;\n\n list.forEach((item)=>{\n childPath = childPath +item +'/';\n });\n if(childPath == \"\") childPath = '/';\n // console.log(childPath);\n if(type.indexOf('Set') != -1){setJsonToFirebase(childPath)}\n if(type.indexOf('Get') != -1){getJsonFromFirebase(childPath)}\n if(type.indexOf('Import') != -1){importFromDB(childPath)}\n });\n}", "function handleFileSelect2(evt) {\r\n\t\tevt.stopPropagation();\r\n\t\tevt.preventDefault();\r\n\r\n\t\tvar files = evt.dataTransfer.files; // FileList object.\r\n\r\n\t\tif(typeof(currentFiles.Data) !== \"undefined\"){\r\n\t\t\tvar r = confirm(\"Override existing File?\"); // ask User\r\n\t\t\tif(r == true){\r\n\t\t\t\tconsole.log(\"Override File\");\r\n\t\t\t\t// now clear all old options from Data-Selection\r\n\t\t\t\tvar select = document.getElementById(\"dateSelect\");\r\n\t\t\t\tvar length = select.options.length;\r\n\t\t\t\tfor (i = 0; i < length; i++) {\r\n\t\t\t\t select.options[0] = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tconsole.log(\"Do nothing\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// files is a FileList of File objects. List some properties.\r\n\t\tvar output = [];\r\n\t\tf = files[0];\r\n\t\toutput.push('<li><strong>', escape(f.name), '</strong> - ',\r\n\t\tf.size, ' bytes, last modified: ',\r\n\t\tf.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a','</li>');\r\n\r\n\t\tcurrentFiles.Data = f.name;\r\n\r\n\t\tvar reader = new FileReader(); // to read the FileList object\r\n\t\treader.onload = function(event){ // Reader ist asynchron, wenn reader mit operation fertig ist, soll das hier (JSON.parse) ausgeführt werden, sonst ist es noch null\r\n\t\t\tif (f.name.substr(f.name.length - 3) ===\"csv\"){ // check if filetiype is csv\r\n\t\t\t\tzaehlstellen_data = csvToJSON(reader.result);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tzaehlstellen_data = JSON.parse(reader.result); // global, better method?\r\n\t\t\t}\r\n\r\n\t\t\tdocument.getElementById(\"renderDataButton\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"hideDataSelection\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"choseFieldDiv2\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"hideSelectionHolder\").style.visibility = \"visible\";\r\n\r\n\t\t\taskFields2(zaehlstellen_data[0], 2); // only first feature is needed for property names\r\n\t\t\tdocument.getElementById(\"renderDataButton\").addEventListener('click', function(){applyDate();}, false);\r\n\t\t};\r\n\t\treader.readAsText(f);\r\n\r\n\t\t// global variable for selection\r\n\t\tselectedWeekdays = [0,1,2,3,4,5,6]; // select all weekdays before timeslider gets initialized\r\n\t\toldSelectedStreetNames = [] // Array for street names, if same amount of points are selected, but different streetnames -> redraw chart completely\r\n\t\tdocument.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';\r\n\t}", "function populateSampleList(data) {\n\n data = data.sort();\n\n $.each(data, function(key, value) {\n $('#zz')\n .append($(\"<option></option>\")\n .attr(\"value\", value)\n .on(\"click\", addToList)\n .text(value));\n });\n\n\n\n $(\"#zz\").val('-- select projectRun --').trigger(\"chosen:updated\");\n $(\"#loading\").hide();\n\n}", "function listFiles(input, list) {\n var listItem = document.createElement('li');\n listItem.className = 'item-list__item';\n list.innerHTML = '';\n forEach(input.files, function (file) {\n var clone = listItem.cloneNode(true);\n clone.innerHTML = file.name;\n list.appendChild(clone);\n });\n }", "function menuOpenByFileName( theFilename )\r\n{\r\n\t// Due to timing issues, the tree frame may not loaded when the context frame is.\r\n\tif ( !treeReady )\r\n\t{\r\n\t\tsetTimeout(\"menuOpenByFileName('\" + theFilename + \"')\", 500);\r\n\t}\r\n\r\n\t// Sanity check. Replace all spaces with the ^ characters\r\n\ttheFilename = theFilename.replace(/ /gi,'^');\r\n\r\n\t// Find the object based on the file name.\r\n\tvar theNode = TreeFindItemByFilename( theFilename );\r\n\r\n\tmenuExpand ( theNode );\r\n}" ]
[ "0.5972368", "0.5937315", "0.56674963", "0.53517354", "0.530642", "0.530277", "0.52196425", "0.521498", "0.51898575", "0.51544", "0.509878", "0.50817597", "0.50521725", "0.5040008", "0.5005088", "0.50041455", "0.49901798", "0.49779078", "0.4944464", "0.4918643", "0.4910293", "0.48860988", "0.48763838", "0.4873596", "0.48204806", "0.47617573", "0.47511363", "0.4746844", "0.47466642", "0.4726077", "0.47132444", "0.470088", "0.46837318", "0.4680335", "0.46793586", "0.46768188", "0.46763957", "0.467451", "0.46604556", "0.46555603", "0.46374863", "0.4636697", "0.46345535", "0.46319744", "0.462271", "0.46205497", "0.46113074", "0.46101153", "0.4597741", "0.45947883", "0.4568954", "0.45637348", "0.45590067", "0.45466563", "0.4545286", "0.45442265", "0.4544171", "0.45283318", "0.45155218", "0.45119607", "0.45059496", "0.44988453", "0.449877", "0.44868436", "0.44851023", "0.44831452", "0.44586", "0.44576985", "0.4456653", "0.44553983", "0.44520244", "0.44452003", "0.4444301", "0.44434926", "0.4441018", "0.44397056", "0.44395787", "0.44387215", "0.44328886", "0.443281", "0.44189596", "0.4418158", "0.44171205", "0.44169652", "0.44116238", "0.44112715", "0.441086", "0.44059935", "0.44050723", "0.43998146", "0.4399178", "0.43978167", "0.43954957", "0.4390573", "0.43902707", "0.43883106", "0.43836853", "0.4373615", "0.43689135", "0.43671548" ]
0.5277956
6
Listens for state changes. on selected file list.
function handleStateChanges(){ /* * Handle events on dialog show. */ $('#configSelectionModal').on('show.bs.modal', function(e){ selections = []; $('table#filelist tr.config').each(function(idx, tr){ var selection = getSelectionFromTR($(tr)); selections.push(selection); }); runSearch(); }); /* * Listen for remove events on the filelist and update * selections accordingly. */ $('table#configurations').on('filelist:removed', function(e){ $(selections).each(function(idx, selection){ if (selection.uid === e.selection.uid) { selections.splice(idx, 1); } }); runSearch(); }); /* * Listen for configurations being added to the filelist * and update state on this. */ $('table#configurations').on('config:added', function(e){ selections.push(e.selection); toggleCheckboxes(e.selection, true); }); $('table#configurations').on('config:removed', function(e){ toggleCheckboxes(e.selection, false); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onFileSelected(event) {\n this.selectedFiles = event.target.files;\n }", "function onFileSelected(files) {\n for(let file of files) {\n handleSelectedFile(file);\n }\n}", "changeFn(event) {\n var fileList = event.__files_ || (event.target && event.target.files);\n if (!fileList)\n return;\n this.stopEvent(event);\n this.handleFiles(fileList);\n }", "function filesSelected(event) {\n processImport(event.target.files, 0);\n}", "onFileDropped($event) {\n this.prepareFilesList($event);\n }", "function onFileSelected(e)\n\t{\n\t\t//console.log(e.target.files);\n\n\t\tvar files = e.target.files;\n\t\tfor (var i = 0; i < files.length; i++) \n\t\t{\n\t\t\tfile = files[i];\n\t\t\tuploaders.push(new ChunkedUploader(file));\n\t\t\tfile_list.append('<li>' + files[i].name + '(' + files[i].size.formatBytes() + ') <button class=\"pausebutton\" style=\"display:none\">Pause</button> </li>');\n\t\t}\n\n\t\tfile_list.find('button').on('click', onPauseClick);\n\t\tfile_list.show();\n\t\tsubmit_btn.attr('disabled', false);\n\t}", "function onListchange ( event ) {\n alert(\"list changed!\");\n }", "function handleFileSelect(mEvent) {\n mEvent.stopPropagation();\n mEvent.preventDefault();\n\n files = mEvent.dataTransfer.files; // FileList object.\n\n //List some properties.\n document.getElementById('list').innerHTML =\n '<p><strong>' + files[0].name + '</strong> - ' +\n files[0].size + ' bytes, last modified: ' +\n (files[0].lastModifiedDate ? files[0].lastModifiedDate.toLocaleDateString() : 'n/a') +\n '</p>';\n\n var add = addElements();\n\n startDrawing = true;\n\n}", "function handleFileSelect(evt) {\n for(var f=0; f < $('#put_files')[0].files.length; f++)\n allfiles.push($('#put_files')[0].files[f]);\n updateFileList();\n}", "onFileChange(event) {\n // Update the state\n this.setState({ selectedFile: event.target.files[0] });\n }", "fileBrowseHandler(files) {\n this.prepareFilesList(files);\n }", "function onFileChange(event) {\n\n // Update the state\n this.setState({ \n selectedFile: event.target.files[0] \n });\n \n\n}", "function initSelectionHandler(){\n $('button#select').on('click', function(e){\n var $filelist = $('#filelist');\n // clear the list and add the new selections\n $filelist.find('tr[data-source=\"config-browser\"]').each(function(idx, tr){\n var selection = getSelectionFromTR(tr);\n $filelist.trigger({type: 'config:removed', source: 'config-browser', selection: selection});\n });\n $(selections).each(function(idx, selection){\n $filelist.trigger({type: 'config:added', source: 'config-browser', selection: selection});\n });\n selections = [];\n });\n }", "function handleFileSelect(evt) {\n // These are the files\n var files = evt.target.files;\n // Load each one and trigger a callback\n for (var i = 0; i < files.length; i++) {\n var f = files[i];\n _main.default.File._load(f, callback);\n }\n }", "function handleFileSelect(event) {\n // console.log('evt', evt.target.files);\n var files = event.target.files; // FileList object\n playFile(files[0]);\n}", "openChangeStatusClick(fileNumber, newStatus){\n\t this.setState({updateStatus:true});\n\t this.setState({currentFile:fileNumber});\n\t this.setState({currentStatus: newStatus});\n }", "function fileSelected(data, evt) {\n /*jshint validthis: true */\n this.file = evt.target.files[0];\n if (this.file)\n this.filename(this.file.name);\n this.errorMessage('');\n }", "function handleFileSelect(evt) {\r\n\t\"use strict\";\t\r\n var files = evt.target.files;\r\n\r\n // files is a FileList of File objects. List some properties.\r\n var output = [];\r\n for (var i = 0, f; f = files[i]; i++) {\r\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\r\n f.size, ' bytes, last modified: ',\r\n f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',\r\n '</li>');\r\n }\r\n\t\r\n\tupdateBGfromFile();\r\n\t\r\n\tBGNAME = escape(f.name);\r\n document.getElementById('file_output').innerHTML = '<ul>' + output.join('') + '</ul>';\r\n }", "function inputChange(e) {\n for(var i=0;i<e.target.files.length;i++){\n model.addItem(e.target.files[i]);\n }\n previewService.previewFiles();\n }", "function assignmentsFileChange() {\n\tvar idx = assignmentsGetCurrentIdx();\n\tif (idx == -1) return;\n\t\n\tvar filesSelect = document.getElementById(\"filesSelect\");\n\tif (filesSelect.selectedIndex == -1) return;\n\t\n\tvar currentFile = filesSelect.options[filesSelect.selectedIndex].value;\n\t\n\tfor (var j=0; j<assignments[idx].files.length; j++) {\n\t\tif (assignments[idx].files[j].filename == currentFile) {\n\t\t\t//document.getElementById('fileName').value = assignments[idx].files[j].filename;\n\t\t\tassignments[idx].files[j].binary = document.getElementById('fileBinary').checked;\n\t\t\tassignments[idx].files[j].show = document.getElementById('fileShow').checked;\n\t\t\tdocument.getElementById('assignmentChangeMessage').innerHtml = 'File changed';\n\t\t\tdocument.getElementById('assignmentChangeMessage').style.display='block';\n\t\t\tassignmentsSendToServer();\n\t\t}\n\t}\n}", "function clickList(ev) {\n\t\n\tvar sel = elList.selection.file_object;\n\tif(sel instanceof File) {\n\t\tpreview.image = thumbPath(sel);\n\t} else if(sel instanceof Folder) {\n\t\tsearch.text = \"\";\n\t\tcurrentFolder = sel;\n\t\tloadSubElements(sel);\n\t}\n\n}", "function FileSelectHandler(e) {\n // cancel event and hover styling\n FileDragHover(e);\n // fetch FileList object\n var files = e.target.files || e.dataTransfer.files;\n // process all File objects\n for (var i = 0, f; f = files[i]; i++) {\n ParseFile(f);\n UploadFile(f);\n }\n }", "onFileChange(event){\n this.setState({file: event.target.files});\n console.log(event.target.files);\n }", "function onChangeFile(event) {\n var files = event.target.files;\n readFile(files);\n }", "fileSelected(event) {\n let reader = new FileReader();\n this.fileInput = event.target;\n let filename = event.target.value;\n let file = event.target.files[0];\n\n reader.onloadend = () => {\n this.setState({\n currentFile: file,\n currentFilename: filename\n });\n };\n\n reader.readAsDataURL(file);\n }", "handleListUpdate() {\n\n // Add listeners for when the user makes a selection.\n this._$el.find('input.aims-layer-input')\n .click(this.handleChange.bind(this));\n }", "function handlePicked() {\n displayFile(this.files);\n}", "function onSelectedChange() {\n if (onSelectedChange.queued) return;\n onSelectedChange.queued = true;\n\n $scope.$evalAsync(function() {\n $scope.$broadcast(EVENT.TABS_CHANGED, selected);\n onSelectedChange.queued = false;\n });\n }", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n // Get the FileList object that contains the list of files that were dropped\n var files = evt.dataTransfer.files;\n\n // this UI is only built for a single file so just dump the first one\n dumpFile(files[0]);\n }", "onListContentChanged_() {\n this.updateSubDirectories(false, () => {\n // If no item is selected now, try to select the item corresponding to\n // current directory because the current directory might have been\n // populated in this tree in previous updateSubDirectories().\n if (!this.selectedItem) {\n const currentDir = this.directoryModel_.getCurrentDirEntry();\n if (currentDir) {\n this.selectByEntry(currentDir);\n }\n }\n });\n }", "function handleFileSelect(evt){\n var f = evt.target.files[0]; // FileList object\n window.reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function(theFile){\n return function(e){\n editor.setData(e.target.result);\n evt.target.value = null; // allow reload\n };\n })(f);\n // Read file as text\n reader.readAsText(f);\n thisDoc = f.name;\n }", "_onChange() {\n this.setState(getListState());\n }", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n // Pode-se receber varios arquivos. \n files = evt.dataTransfer.files; // Objeto FileList\n console.log(files)\n var output = [];\n for (var i = 0, f; f = files[i]; i++) {\n output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\n f.size, ' kb, last modified: ',\n f.lastModifiedDate.toLocaleDateString(), '</li>');\n }\n document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';\n\n } else {\n swal({\n title: 'Navegador não suportado: ' + navigator.appVersion,\n text: 'Atualize seu navegador!',\n timer: 2000,\n showConfirmButton: false\n });\n }\n }//", "function onFileSelection(e) {\n\tvar files = e.target.files;\n\tvar output = [];\n\ttotFileCount = files.length;\n\ttotFileLength = 0;\n\tfor (var i = 0; i < totFileCount; i++) {\n\t\tvar file = files[i];\n\t\toutput.push(file.name, ' (', file.size, ' bytes, ',\n\t\t\tfile.lastModifiedDate.toLocaleDateString(), ')');\n\t\toutput.push('<br/>');\n\t\tdebug('add ' + file.size);\n\t\ttotFileLength += file.size;\n\t}\n\tdocument.getElementById('selectedFiles').innerHTML = output.join('');\n}", "function fileChanged(){\n \n // default: fit result to screen\n $('input[name=fitToScreen]').attr('checked', true);\n fitted = true;\n \n filechanged = true;\n \n // get filename\n\tvar value = $('#fileSelection').val();\n\t\t\n // manage settings \n\tif(value != \"donothing\"){\n\t\t\n\t\treceiveCanvasContent(value);\n\t\t$('#visTag').show();\n\t\t$('#visSelect').show();\n\t\t$('#saveButton').show();\n $('#fitToScreen').show();\n $('#ftsTag').show();\n\t\t\n // manage settings dialog\n manageSettings($('#visSelect').val());\n \n receiveChanges();\n\t}\n \n // display choose dialog for available probands\n manageProbands($('#fileSelection').find('option:selected').attr('count'), true);\n}", "onDrop(files){\n console.log('Received files: ', files);\n this.setState({\n files: files\n });\n }", "_selectionHandler(activeProject) {\n for (projectElement of this.projects) {\n projectElement.markUnchecked();\n }\n activeProject.markChecked();\n this.emitter.emit('did-change-path-selection', activeProject.path);\n }", "openFile(x,e){\n console.log(x);\n let text = this.VirtualDisk[x.father].getData(x.clusterStart);\n if(x.kind == \"file\"){\n this.setState({\n disks : this.state.disks,\n current : this.state.current,\n mode : 3,\n selected : x,\n nameFile : x.name,\n infoFile : text\n });\n }\n\n }", "function handleSelectedItemChange(selectedItem,previousSelectedItem){selectedItemWatchers.forEach(function(watcher){watcher(selectedItem,previousSelectedItem);});}", "function onSelectTreeDir(path) {\r\n\tcurrent_path = path;\r\n\tselectItems([]);\r\n\t$('#status').html(path);\r\n\tcache.get(path, function(data) {\r\n\t\tconsole.debug(data);\r\n\t\tvar content = {\r\n\t\t\ttotal: data.files.length,\r\n\t\t\trows: data.files\r\n\t\t};\r\n\t\t$('#file_list').datagrid('loadData', content);\r\n\t\t$('#icons_list').datagrid('loadData', content);\r\n\t\t\r\n\t});\r\n}", "function initFileSelection() {\n // If there is an entry, set the pointer to the first entry.\n if (filelist.children.length > 0) { // If there is at least one entry…\n pointer = 0; // … set the pointer to the first item.\n }\n\n // Populate slots.\n initSlots();\n\n // Set the event listener.\n addEventListener('keydown', keyListener, false);\n}", "function handleFileSelect(e) {\n e.stopPropagation();\n e.preventDefault();\n\n var file = null;\n\n if (e.type === \"change\") {\n file = e.target.files[0];\n\n // change label text\n changeContent(file.name);\n\n } else if (e.type === \"drop\") {\n file = e.dataTransfer.files[0];\n\n // change drop area text\n changeContent(file.name);\n }\n\n //Validate input file\n if (fileValidator(file)){\n readContent(file);\n }\n }", "function onChangeEvent() {\n 'use strict';\n\n // retrieve index of selected item\n var start = 'option_'.length;\n var reminder = this.value.substr(start);\n\n // store currently selected class (index of this class) in closure\n classesSelectedIndex = parseInt(reminder);\n }", "constructor() {\n super();\n this.state = {\n files: []\n };\n }", "function onFileSelect(event) {\n jQuery('#uploadHelp').text('The file \"' + event.target.files[0].name + '\" has been selected.');\n \n var reader = new FileReader();\n reader.onload = onReaderLoad;\n reader.readAsText(event.target.files[0]);\n}", "function handleFileSelected(event) {\n // Add file to bundle\n bundle.files = Array.from(document.getElementById(\"securesend_upload_input\").files);\n bundle.permissionsArray = [];\n\n // Load the next page: permissions\n loadPermissions();\n }", "function optionChanged(newsample){readFile(newsample)}", "function selectfiles(files) {\n\t\t// now switch to the viewer\n \t//switchToViewer();\n\t // .. and start the file reading\n\t //alert(files);\n read(files);\n\t}", "onRescanCompleted_() {\n this.updateStore_();\n this.selectionHandler_.onFileSelectionChanged();\n }", "function addFileSelectListener() {\n document.getElementById('file').addEventListener('change', function (e) {\n document.querySelector('.file-name').textContent = this.value;\n });\n }", "function onChange(change) {\r\n\t\t//split up the path to get the file name\r\n\t\tvar splitUpPath = change.path.split('/');\r\n\r\n\t\t//log the file detected\r\n\t\tconsole.log('\"' + splitUpPath[splitUpPath.length - 1] + '\" was ' + change.type);\r\n\t}", "function change(e) {\n\tconst el = document.querySelector(`input[type=checkbox][data-filename='${e.target.dataset.filename}']`);\n\tif (el) {\n\t\tel.checked = !el.checked;\n\t}\n\tcheckStartButtonAndchkAll();\n}", "function FileSelectHandler(e) {\n\n // cancel browser events and remove hover style\n FileDragHover(e);\n\n // gets a FileList object containing dropped files\n var files = e.originalEvent.dataTransfer.files;\n //alert(files.item(0).name.toString());\n \n UploadFile(files.item(0));\n }", "function handleFileSelect(evt) { \n \n // A FileList\n var files = evt.target.files;\n // Show some properties\n for (var i = 0; i < files.length; i++) {\n var f = files[i];\n var file = createElement('li',f.name + ' ' + f.type + ' ' + f.size + ' bytes');\n file.parent(list);\n \n // Read the file and process the result\n var reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n // Render thumbnail\n var img = createImg(e.target.result);\n img.parent(container);\n img.class('thumb');\n \n loadImage(e.target.result, gotImage);\n };\n })(f);\n\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }", "onChange() {\n let input = this.refs.file.getDOMNode();\n\n if (input.files.length > 0) {\n [].forEach.call(input.files, function (file, i) {\n this.fileToURL(file, function (url) {\n this.setState({\n images: this.state.images.concat([url])\n });\n }.bind(this));\n }.bind(this));\n\n this.props.onUpload(input.files);\n }\n }", "function handleFileBrowse(evt){\n\tvar files = evt.target.files;\n\t\n\tvar output = [];\n\tfor (var i=0, f; f = files[i]; i++){\n\t\t//build the HTML list output\n\t\toutput.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',\n\t\tf.size, ' bytes, last modified: ',\n\t\tf.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a', '</li>');\n\t};\n\tdocument.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';\n}", "function handleFileChange(event) {\n file.current = event.target.files[0];\n }", "function fileChange() {\n\tcount++;\n\tif (count > 1) {\n\t\tvar num = count - 1;\n\t\t$(\"div#file\" + num).removeClass(\"highlightFile\");\n\t}\n\t// FileList Object existing of input with ID \"fileA\"\n\tvar fileList = document.getElementById(\"fileA\").files;\n\n\t// File Object (first element of FileList)\n\tfile = fileList[0];\n\n\tfileArr.push(file);\n\t// File Object not available = no data chosen\n\tif (!file) {\n\t\treturn;\n\t}\n\n\t$(\"div#wrapFiles\")\n\t\t\t.append(\n\t\t\t\t\t\"<div id='file\"\n\t\t\t\t\t\t\t+ count\n\t\t\t\t\t\t\t+ \"' class='singleFile' onClick='setFile(\"\n\t\t\t\t\t\t\t+ count\n\t\t\t\t\t\t\t+ \")'> <span class='fileName'></span><span class='fileSize'></span> <br> <div id='prog' class='progress-bar blue stripes'><span style='width: 0%'></span> </div> </div>\");\n\n\t$(\"div#file\" + count + \" span.fileName\").html(\"Name: \" + file.name);\n\t$(\"div#file\" + count + \" span.fileSize\").html(\"Size: \" + file.size + \"B\");\n\t$(\"div#file\" + count).addClass(\"highlightFile\");\n\n}", "_listBoxChangeHandler(event) {\n const that = this;\n\n if ((that.dropDownAppendTo && that.dropDownAppendTo.length > 0) || that.enableShadowDOM) {\n that.$.fireEvent('change', event.detail);\n }\n\n if (that.autoComplete === 'list' && event.detail) {\n const lastSelectedItem = that.$.listBox._items[event.detail.index];\n\n that._lastSelectedItem = lastSelectedItem && lastSelectedItem.selected ? lastSelectedItem : undefined;\n }\n\n that._applySelection(that.selectionMode, event.detail);\n }", "_onFileChanged(sender, change) {\n let path = this._model.path;\n let { sessions } = this.manager.services;\n let { oldValue, newValue } = change;\n let value = oldValue && oldValue.path && coreutils_1.PathExt.dirname(oldValue.path) === path\n ? oldValue\n : newValue && newValue.path && coreutils_1.PathExt.dirname(newValue.path) === path\n ? newValue\n : undefined;\n // If either the old value or the new value is in the current path, update.\n if (value) {\n this._scheduleUpdate();\n this._populateSessions(sessions.running());\n this._fileChanged.emit(change);\n return;\n }\n }", "_selectedFilesClickHandler(event) {\n const that = this;\n\n if (that.disabled) {\n return;\n }\n\n const target = event.target,\n isItemUploadClicked = target.closest('.jqx-item-upload-button'),\n isItemCancelClicked = target.closest('.jqx-item-cancel-button'),\n isItemAbortClicked = target.closest('.jqx-item-pause-button'),\n clickedItem = target.closest('.jqx-file');\n\n if (isItemUploadClicked) {\n that.uploadFile(clickedItem.index);\n }\n else if (isItemCancelClicked) {\n that.cancelFile(clickedItem.index);\n }\n else if (isItemAbortClicked) {\n that.pauseFile(clickedItem.index);\n }\n }", "function onFileSelect(event) {\n\n fileList = event.fileList;\n\n $('#SelectedFiles').empty();\n\n\n for (var i in fileList) {\n $('#SelectedFiles').append(fileList[i].name + ' <span id=\"' + fileList[i].id + '\"></span><br />');\n }\n}", "onChange(changeListener) {\n changeListener.path = this.path;\n privateDataMap.get(this).addListener(changeListener, this.path);\n }", "onChanged(e){}", "_browseInputChangeHandler() {\n const that = this,\n selectedFiles = that._filterNewFiles(Array.from(that.$.browseInput.files));\n let validNewFiles = [];\n\n if (that.disabled || selectedFiles.length === 0) {\n return;\n }\n\n if (that.validateFile && typeof that.validateFile === 'function') {\n validNewFiles = selectedFiles.filter(file => {\n if (that.validateFile(file)) {\n return true;\n }\n\n that.$.fireEvent('validationError', {\n 'filename': file.name,\n 'type': file.type,\n 'size': file.size\n });\n\n return false;\n });\n }\n else {\n validNewFiles = selectedFiles;\n }\n\n that._selectedFiles = that._selectedFiles.concat(validNewFiles);\n\n if (that._selectedFiles.length === 0) {\n return;\n }\n\n that._renderSelectedFiles(validNewFiles);\n that.$.browseButton.disabled = (!that.multiple && that._selectedFiles.length > 0) || that.disabled ? true : false;\n that.$.browseInput.value = '';\n\n if (that.autoUpload) {\n that.uploadAll();\n }\n }", "selectDocument(event) {\n const { attachFile } = this.context;\n\n let file = null;\n if (event.target.files && event.target.files[0]) {\n file = event.target.files[0];\n this.setState({\n file: file\n }, () => attachFile(file));\n }\n }", "watch() {\n fs.readdir(this.watchDir, (err, files) => {\n if (err) throw err;\n for (let index in files) {\n this.emit('process', files[index]);\n }\n });\n }", "function onFileChange(event) {\n // create an ObjectURL\n url = URL.createObjectURL(event.target.files[0]);\n\n // revoke any pre-existing ObjectURL\n if (local_player.src) URL.revokeObjectURL(local_player.src);\n\n // switch to the room player to the local player\n room.switch('LocalPlayer');\n\n // cue local player to load new video\n room.player.loadSRC(url);\n\n // clear file selector value\n event.target.value = '';\n}", "function installFileOnChangeHandler() {\n // Attach handler to process a project file when it is selected in the\n // Import Project File hamburger menu item.\n const selectControl = document.getElementById('selectfile');\n selectControl.addEventListener('change', (event) => {\n selectProjectFile(event)\n .catch( (reject) => {\n logConsoleMessage(`Select project file rejected: ${reject}`);\n closeImportProjectDialog();\n const message =\n `Unable to load the selected project file. The error reported is: \"${reject}.\"`;\n utils.showMessage('Project Load Error', message);\n });\n });\n}", "setSelectFile(flag) {\n this.setState({\n canSelectFile: flag,\n forceSaveFile: false,\n });\n }", "function _onChange(file) {\n resetPlayer();\n setLoading();\n \n // Bootstrapping process to throw an error a single time\n\n workerClient.processAudio(file)\n .then(function (audioEvent) {\n const url = audioEvent.data.url;\n const tags = audioEvent.data.tags;\n setAudio(url, tags, file);\n })\n .catch(function (error) {\n setLoading(true);\n displayError(error);\n });\n}", "notify(){\n /**\n * Informs listeners that file system received new data\n * @event DirService#update\n * @type void\n */\n this.emit( \"update\" );\n }", "handleSelect(e) {\n if (e.target.files.length > 0) {\n this.setState({\n title: e.target.files[0].name,\n size: `${(e.target.files[0].size / 1024).toFixed(2)}KB`,\n });\n this.props.getUnknownFile(e.target.files);\n }\n }", "function fileInputChange(e) {\n /*jshint validthis:true, unused:vars*/\n handleFiles(this.files);\n document.getElementById(\"dropzoneContainer\").classList.remove(\"dragover\");\n document.getElementById(\"dropzoneContainer\").classList.add(\"filled\");\n document.getElementById(\"file-bar\").classList.remove(\"hidden\");\n document.getElementById(\"run-button\").classList.remove(\"hidden\");\n }", "handleSelect(event){\n const selected = event.detail.name;\n this.selectedItem = selected; \n if(selected == 'upload'){\n this.uploadFileModal = true;\n }else { \n this.uploadFileModal = false;\n }\n if(selected == 'isNewfolder'){\n this.closedModel = true;\n }else{\n this.closedModel = false;\n } \n }", "stateChanged(state) {\n this._items = selectedRoomListSelector(state);\n }", "updateList(error, list) {\n\t\tthis.setState({\n\t\t\tisLoading: false,\n\t\t\tfiles: list\n\t\t});\n\t}", "onChange(updatedFile) {\n this.merge();\n }", "onDrop(files) {\n // First clean any memory used by any previous file drops\n this.cleanMemory();\n\n // Set the state to include the dropped files\n this.setState({\n files\n });\n }", "onDrop(files) {\n\n\t\tthis.addFilesToEditPane(files)\n\t\tthis.setState({ saveStatus: 2 });\n\t\t\t\t\t\t\n\t}", "selectLocalMediaFile_() {\n this.fire('select-local-media-file');\n }", "function handleFileSelect(evt) {\n\n var files = evt.target.files; // FileList object\n\n console.log(files);\n console.log(files[0]);\n\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = function() {\n //console.log(reader.result);\n\n var fileContent =reader.result;\n\n parsearArchivo( fileContent );\n pintarLaberinto();\n //alert('termino de paresear');\n $('#ingresoPosicion').show();\n $('#contSolucion').hide();\n $('#solucion').html('');\n }\n\n reader.readAsText(files[0]);\n}", "function selectFile(evt) {\n\t\tvar last_file = {};\n\t\tif (context_element && (context_element.type == 2)) {\n\t\t\tlast_file = context_element;\n\t\t}\n\t\tcontext_element = getElProp(evt);\n\t\tif (context_element.type == 1) {\n\t\t\t// If select directory then open the directory\n\t\t\t// if index >= 0 then select subfolde, if index < 0 - then select up folder\n\t\t\tif (context_element.index >= 0) {\n\t\t\t\tgetDirContent(cur_path + context_element.name + '/');\n\t\t\t} else {\n\t\t\t\tvar\n\t\t\t\t\tpath = '',\n\t\t\t\t\ti\n\t\t\t\t;\n\t\t\t\tfor (i = dir_content.path.length + context_element.index; i >= 0; i--) {\n\t\t\t\t\tpath = dir_content.path[i] + '/' + path;\n\t\t\t\t}\n\t\t\t\tgetDirContent('/' + path);\n\t\t\t}\n\t\t} else if (context_element.type == 2) {\n\t\t\t// Іf select the file then highlight and execute the external functions with the file properties\n\t\t\thighlightFileItem(context_element.index);\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_select || on_dblselect) {\n\t\t\t\tvar file = dir_content.files[context_element.index];\n\t\t\t\t// Generate additional field\n\t\t\t\tfile.path = cur_path + file.name;\n\t\t\t\tfile.wwwPath = getURIEncPath(HTMLDecode(upload_path + cur_path + file.name));\n\t\t\t\t// If thumbnail exist, set the www path to him\n\t\t\t\tif (file.thumb && file.thumb !== '') {\n\t\t\t\t\tfile.wwwThumbPath = getURIEncPath(HTMLDecode(upload_path + file.thumb));\n\t\t\t\t}\n\t\t\t\tif (on_select) {\n\t\t\t\t\ton_select(file);\n\t\t\t\t}\n\t\t\t\t// If double click on file then chose them by on_dblselect() function\n\t\t\t\tif ( on_dblselect &&(last_file.index == context_element.index) && ((context_element.time - last_file.time) < dbclick_delay) ) {\n\t\t\t\t\ton_dblselect(file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No selections\n\t\t\t// Clean the highlight\n\t\t\thighlightFileItem();\n\t\t\t// Hide the tooltips\n\t\t\thideTooltips();\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_deselect) {\n\t\t\t\ton_deselect();\n\t\t\t}\n\t\t}\n\t}", "stateChanged(state) { }", "function observeChangedFiles(pageDom) {\n var event = new ChangesLoadEvent();\n\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function(mutation) {\n mutation.addedNodes.forEach(function (node) {\n console.log(node);\n if (pageDom.isChangedFilesBlock(node)) {\n event.trigger(node);\n }\n });\n });\n });\n\n var config = { attributes: true, childList: true, characterData: true };\n observer.observe(pageDom.getChangesTab(), config);\n\n return event;\n }", "function handleSelectedItemChange (selectedItem, previousSelectedItem) {\n selectedItemWatchers.forEach(function (watcher) { watcher(selectedItem, previousSelectedItem); });\n }", "function handleSelectedItemChange (selectedItem, previousSelectedItem) {\n selectedItemWatchers.forEach(function (watcher) { watcher(selectedItem, previousSelectedItem); });\n }", "function handleSelectedItemChange (selectedItem, previousSelectedItem) {\n selectedItemWatchers.forEach(function (watcher) { watcher(selectedItem, previousSelectedItem); });\n }", "stateChanged(_state) { }", "async onWatchedFileOrFolderChanged(params) {\n // An issue for `@import ...` resources:\n // It's common that we import resources inside `node_modules`,\n // but we can't get notifications when those files changed.\n if (!this.startDataLoaded) {\n return;\n }\n for (let change of params.changes) {\n let uri = change.uri;\n let fsPath = vscode_uri_1.URI.parse(uri).fsPath;\n // New file or folder.\n if (change.type === vscode_languageserver_1.FileChangeType.Created) {\n this.trackFileOrFolder(fsPath);\n }\n // Content changed file or folder.\n else if (change.type === vscode_languageserver_1.FileChangeType.Changed) {\n if (await fs.pathExists(fsPath)) {\n let stat = await fs.stat(fsPath);\n if (stat && stat.isFile()) {\n if (this.shouldTrackFile(fsPath)) {\n this.retrackChangedFile(uri);\n }\n }\n }\n }\n // Deleted file or folder.\n else if (change.type === vscode_languageserver_1.FileChangeType.Deleted) {\n this.untrackDeletedFile(uri);\n }\n }\n }", "function fileSelected(file) {\n // Clear file selection listeners\n const reportSelector = document.getElementById('report_file_input');\n reportSelector.removeEventListener('change', fileInputValueChanged);\n const dropArea = document.getElementById('drop_target');\n dropArea.removeEventListener('dragover', dragoverEvent);\n dropArea.removeEventListener('drop', dropEvent);\n document.getElementById('report_upload').hidden = true;\n document.getElementById('loading').hidden = false;\n document.getElementById('local_file').innerText = file.name;\n const fileReader = new FileReader();\n fileReader.addEventListener('load', () => {\n const statistics = JSON.parse(fileReader.result);\n document.getElementById('loading').hidden = true;\n document.getElementById('viewer').hidden = false;\n allStatistics = statistics;\n reloadStatistics();\n });\n fileReader.readAsText(file);\n}", "onChange(item) {}", "function handleFileSelect(e) {\n // Prevent default behavior (Prevent file from being opened)\n e.stopPropagation()\n e.preventDefault()\n\n var files = e.dataTransfer.files; // FileList object.\n\n // files is a FileList of File objects\n for (var file of files) {\n // Only process image files.\n if (!file.type.match('image.*')) {\n continue\n }\n if (e.currentTarget.id === 'drop_zone_photo') {\n imageManager.source = file \n }\n else {\n imageManager.traceSource = file \n }\n }\n}", "function onChange() {\n\t\t__debug_452( 'Received a change event.' );\n\t\tself.render();\n\t}", "watch() {\n const watcher = this;\n fs.readdir(this.watchDir, function(err, files) {\n if (err) throw err;\n for (let index in files) {\n watcher.emit(\"process\", files[index]);\n }\n });\n }", "function handleFileSelect(evt) {\n \n evt.stopPropagation();\n evt.preventDefault();\n\n // Get the FileList object that contains the list of files that were dropped\n const files = evt.dataTransfer.files;\n\n // this UI is only built for a single file so just dump the first one\n file = files[0];\n const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);\n loadAndViewImage(imageId);\n }", "function onChange() {\n\t\t__debug_330( 'Received a change event.' );\n\t\tself.render();\n\t}", "handleSelected(event) {\n this.setData(event);\n }", "handleSelected(event) {\n this.setData(event);\n }", "onChange(e) {\n this.setState({ file: e.target.files[0] });\n }" ]
[ "0.7302377", "0.69459295", "0.6930699", "0.6592114", "0.6420887", "0.6399675", "0.633315", "0.6313019", "0.6294175", "0.6292436", "0.6271795", "0.62374073", "0.6214559", "0.62126297", "0.6186353", "0.61482215", "0.61020976", "0.6090817", "0.60401714", "0.60391104", "0.6031929", "0.6017425", "0.6016599", "0.60126", "0.6005202", "0.599912", "0.5995674", "0.597291", "0.5967833", "0.5966637", "0.5943719", "0.5937482", "0.5920458", "0.5911", "0.59068656", "0.59045786", "0.5871426", "0.5870677", "0.58534455", "0.5849868", "0.5847995", "0.5842779", "0.58427703", "0.5839615", "0.5838293", "0.58328575", "0.58057094", "0.58003026", "0.57548654", "0.5753696", "0.5728528", "0.57253176", "0.5718833", "0.57049274", "0.5701712", "0.56988513", "0.5695104", "0.569391", "0.56823194", "0.5680866", "0.56782985", "0.5677068", "0.56723094", "0.5668773", "0.5665716", "0.5663287", "0.56586206", "0.56372523", "0.5632982", "0.56291", "0.5629075", "0.5627906", "0.5603951", "0.56032884", "0.56009114", "0.5594489", "0.5594243", "0.5590836", "0.5587885", "0.55865306", "0.55861", "0.5586015", "0.5584845", "0.558187", "0.5579224", "0.5578358", "0.5578358", "0.5578358", "0.5576715", "0.5570956", "0.55707514", "0.5565892", "0.5563392", "0.55633515", "0.5550839", "0.55504936", "0.55466694", "0.5543275", "0.5543275", "0.55431926" ]
0.70282334
1
Creates the pagination links based on the ContentRange and Link headers. jqXHR: the ajax xhr
function paginate(jqXHR){ // get the pagination ul var paginate = $('#pagination ul.pager'); paginate.empty(); var info = $('#info'); info.empty(); // set the content range info var rangeHeader = jqXHR.getResponseHeader('Content-Range'); var total = rangeHeader.split('/')[1]; var range = rangeHeader.split('/')[0].split(' ')[1]; info.append('<span>Displaying ' + range + ' of ' + total + ' results'); // check if we have a link header var a, b; var link = jqXHR.getResponseHeader('Link'); if (link) { var links = link.split(','); a = links[0]; b = links[1]; } else { // no link header so only one page of results returned return; } /* * Configure next/prev links for pagination * and handle pagination events */ if (b) { var url = b.split(';')[0].trim(); url = url.slice(1, url.length -1); var rel = b.split(';')[1].split('=')[1]; rel = rel.slice(1, rel.length -1); paginate.append('<li id="prev" data-url="' + url + '"><a href="#"><span class="glyphicon glyphicon-chevron-left"/> Prev</a></li>&nbsp;'); $('li#prev').on('click', function(){ var u = this.getAttribute('data-url'); u == 'undefined' ? listConfigurations() : listConfigurations(u); }); } if (a) { var url = a.split(';')[0].trim(); url = url.slice(1, url.length -1); var rel = a.split(';')[1].split('=')[1]; rel = rel.slice(1, rel.length -1); if (rel == 'prev') { paginate.append('<li id="prev" data-url="' + url + '"><a href="#"><span class="glyphicon glyphicon-chevron-left"/> Prev</a></li>'); $('li#prev').on('click', function(){ var u = this.getAttribute('data-url'); u == 'undefined' ? listConfigurations() : listConfigurations(u); }); } else { paginate.append('<li id="next" data-url="' + url + '"><a href="#">Next <span class="glyphicon glyphicon-chevron-right"/></a></li>'); $('li#next').on('click', function(){ var u = this.getAttribute('data-url'); u == 'undefined' ? listConfigurations() : listConfigurations(u); }); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paginate(jqXHR){\n\n // get the pagination ul\n var paginate = $('ul.pager');\n paginate.empty();\n var info = $('#info');\n info.empty();\n\n // set the content range info\n var rangeHeader = jqXHR.getResponseHeader('Content-Range');\n var total = rangeHeader.split('/')[1];\n var range = rangeHeader.split('/')[0].split(' ')[1];\n info.append('<span>Displaying ' + range + ' of ' + total + ' results');\n\n // check if we have a link header\n var a, b;\n var link = jqXHR.getResponseHeader('Link');\n if (link) {\n var links = link.split(',');\n a = links[0];\n b = links[1];\n }\n else {\n // no link header so only one page of results returned\n return;\n }\n\n /*\n * Configure next/prev links for pagination\n * and handle pagination events\n */\n if (b) {\n var url = b.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = b.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/>' + gettext(' Prev') + '</a></li>&nbsp;');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n\n if (a) {\n var url = a.split(';')[0].trim();\n url = url.slice(1, url.length -1);\n var rel = a.split(';')[1].split('=')[1];\n rel = rel.slice(1, rel.length -1);\n if (rel == 'prev') {\n paginate.append('<li id=\"prev\" data-url=\"' + url + '\"><a href=\"#\"><span class=\"glyphicon glyphicon-chevron-left\"/>' + gettext('Prev') + '</a></li>');\n $('li#prev').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n else {\n paginate.append('<li id=\"next\" data-url=\"' + url + '\"><a href=\"#\">Next <span class=\"glyphicon glyphicon-chevron-right\"/></a></li>');\n $('li#next').on('click', function(){\n var u = this.getAttribute('data-url');\n u == 'undefined' ? listConfigurations() : listConfigurations(u);\n });\n }\n }\n }", "function setLinkHeadersPagination(collection, xhr) {\n\t try {\n\t var links = parseLinkHeader(xhr.getResponseHeader('link'));\n\t collection[STATE].set(LINK_BY_HEADER, true);\n\t collection.setPagination(links['next'].href);\n\t } catch (e) {\n\t if (collection[STATE].get(LINK_BY_HEADER)) {\n\t collection.setPagination(null);\n\t }\n\t }\n\t }", "function setLinkHeadersPagination(collection, xhr) {\n try {\n var links = parseLinkHeader(xhr.getResponseHeader('link'));\n collection[STATE].set(LINK_BY_HEADER, true);\n collection.setPagination(links['next'].href);\n } catch (e) {\n if (collection[STATE].get(LINK_BY_HEADER)) {\n collection.setPagination(null);\n }\n }\n}", "function ajax_pagination() {\n // setup data-remote for page links\n $('.pagination a').attr('data-remote', 'true');\n\n // onclick setup container for ajax indicator\n $('.pagination a').live(\"click\", function () {\n $(this).html(\".....\");\n });\n}", "function appendPageLinks(paramList) {\r\n if (document.querySelector('div.pagination') != undefined) {\r\n dropPageLinks(); // calls the dropPage Links function so new pagination links can be created from scratch\r\n }\r\n//1. Determine the number of pages that are need for the list by dividing the list items by the max number of items on the page 10\r\n let reqNumberOfPages = Math.ceil(paramList.length / 10); // at least one page must exist\r\n if (reqNumberOfPages > 1) { //only create the pagination pages if more than one page is required\r\n //2. Create a div, give it the pagination class, and append it to the page div\r\n let paginateDiv = document.createElement('div');\r\n paginateDiv.className = 'pagination';\r\n document.querySelector('div.page').appendChild(paginateDiv);\r\n //3. Add a ul to the pagination div to store the pagination appendPageLinks\r\n let paginationList = document.createElement('ul');\r\n paginateDiv.appendChild(paginationList);\r\n //4. for every page, add li and a tags with the page number text\r\n for(let i=0;i < reqNumberOfPages; i+=1) { //this is within the if statement, so it won't run unless there are multiple pages to paginate through\r\n let listitem = document.createElement('li');\r\n let tag = document.createElement('a')\r\n tag.textContent = i+1; //otherwise the first pagenation item returns zero, which just looks weird.\r\n listitem.appendChild(tag);\r\n paginationList.appendChild(listitem);\r\n }\r\n//adding the event handler here, because it will need to be reconstructed every time appendPageLinks are recreated\r\n let listenOnList = document.querySelector('div.pagination').firstElementChild //select the ul selector is the only child of the div\r\n for(let i=0;i< listenOnList.children.length; i+=1) { //for each list item in the array of ul children\r\n listenOnList.children[i].addEventListener('click',(e) => { //add the listener onto the li\r\n showPage(matchedStudents,listenOnList.children[i].firstElementChild.textContent) //get the text from the anchor embedded in the li, passing it to showPage\r\n for(let i=0;i< listenOnList.children.length; i+=1){ //6. Loop over pagination links to remove active class from all appendPageLinks\r\n listenOnList.children[i].firstElementChild.classList.remove('active');\r\n }\r\n e.target.className='active'; //7. Add the active class to the link that was just clicked. You can identify that clicked link using event.target\r\n })\r\n }\r\n }\r\n}", "function appendPageLinks(studentList) {\n\n const studentNumber = studentList.length;\n const maxPageNumber = Math.ceil(studentNumber / 10);\n const $ul = $('div.pagination > ul');\n\t\n // unobtrusive JavaScript design pattern. \n //\t clear all the old html data and dynamiclly add page links based on student number\n $ul.empty();\n $h1.remove();\n\t\n\tfor (i=1; i <= maxPageNumber; i++) {\n\t\tconst $listLink = $('<li><a href=\"#\">' + i + '</a></li>');\n\t\t$ul.append($listLink);\n\t}\n\n\tshowPage(studentList, 1);\n \n // trigger the showPage function when click page links\n\t$('div.pagination > ul > li > a').on('click', function() {\n\t\t$(\"a.active\").removeClass(\"active\");\n\t\tlet pageNumber = $('div.pagination > ul > li > a').index(this) + 1 ;\n\t\tshowPage(studentList, pageNumber);\n\t});\n}", "function pagination(page,aksix,subaksi){ \n var aksi ='aksi='+aksix+'&subaksi='+subaksi+'&starting='+page;\n var cari ='';\n var el,el2;\n\n if(subaksi!=''){ // multi paging \n el = '.'+subaksi+'_cari';\n el2 = '#'+subaksi+'_tbody';\n }else{ // single paging\n el = '.cari';\n el2 = '#tbody';\n }\n\n $(el).each(function(){\n var p = $(this).attr('id');\n var v = $(this).val();\n cari+='&'+p+'='+v;\n });\n\n $.ajax({\n url:dir,\n type:\"post\",\n data: aksi+cari,\n beforeSend:function(){\n $(el2).html('<tr><td align=\"center\" colspan=\"8\"><img src=\"img/w8loader.gif\"></td></tr></center>');\n },success:function(dt){\n setTimeout(function(){\n $(el2).html(dt).fadeIn();\n },1000);\n }\n });\n }", "function generatePagination(){\n $.get(hygieneScript,\n {op : 'pages'},\n function(result) {\n var tmpbtn = $(\"#navButtons\");\n tmpbtn.contents().remove();\n for(var i = 1; i <= result.pages; i++) {\n var btnDisplay = $('<button class=\"buttons\" type=\"btn\" name='+i+'>' + i + '</button>');\n tmpbtn.append(btnDisplay);\n }\n }, \"json\");\n}", "function activatePagination(){\n $('.page-link').click(function(){\n sendFilterRequest($(this));\n return false;\n });\n}", "function ajaxPagination(url,limit){\r\r\n\r\r\n $('#boxLoading').ajaxStart(function() {\r\r\n $(this).show();\r\r\n });\r\r\n \r\r\n $('#boxLoading').ajaxStop(function() {\r\r\n $(this).hide();\r\r\n });\r\r\n\r\r\n $('.next').removeAttr('disabled');\r\r\n $('.last').removeAttr('disabled');\r\r\n $('#curpage_news').val(1);\r\r\n $('#curpage_event').val(1);\r\r\n $('#curpage_dest').val(1);\r\r\n $('#curpage_article').val(1);\r\r\n $('#curpage_gallery').val(1);\r\r\n \r\r\n\r\r\n funcyAction();\r\r\n\r\r\n hideNav();\r\r\n \r\r\n\r\r\n \r\r\n //default active tab\r\r\n $('.content').hide();\r\r\n $('#content_all').show();\r\r\n\r\r\n $('.navigation').hide();\r\r\n \r\r\n $('.tabsearch').click(function(){\r\r\n var id = $(this).attr('id');\r\r\n\r\r\n var content_id = ($(this).attr('id')).substr(4);\r\r\n $('.content').hide();\r\r\n $('.navigation').hide();\r\r\n $('.linkpages').hide();\r\r\n\r\r\n\r\r\n $('#content_'+id).show();\r\r\n \r\r\n \r\r\n $('#tabs li a').removeClass('active');\r\r\n $(this).addClass('active');\r\r\n \r\r\n var allpage = $('#allpage_'+id).val();\r\r\n\r\r\n\r\r\n if(allpage > 1)\r\r\n {\r\r\n $('#nav_'+id).show();\r\r\n $('#linkpage_'+id).show();\r\r\n } \r\r\n if(allpage > 5){\r\r\n $('#first_'+id).show();\r\r\n $('#last_'+id).show();\r\r\n }else{\r\r\n $('#firsts_'+id).hide();\r\r\n $('#last_'+id).hide();\r\r\n }\r\r\n\r\r\n \r\r\n });\r\r\n\r\r\n \r\r\n $('.next').click(function(){\r\r\n \r\r\n var methodAction = ($(this).attr('id')).substr(5);\r\r\n var id = methodAction;\r\r\n \r\r\n $.post(url+methodAction+'paging',\r\r\n {\r\r\n \r\r\n paramOffset: $('#offset_'+id).val(),\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : $('#curpage_'+id).val(),\r\r\n paramLimit : limit,\r\r\n actionQuery: \"next\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n //alert(data.result);\r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //alert(cur_page);\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n\r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#prev_'+id).removeAttr('disabled','disabled');\r\r\n $('#prev_'+id).removeClass('passive');\r\r\n \r\r\n $('#firsts_'+id).removeAttr('disabled','disabled');\r\r\n $('#firsts_'+id).removeClass('passive');\r\r\n \r\r\n if(($('#allpage_'+id).val()) == data.curpages)\r\r\n {\r\r\n $('#next_'+id).attr('disabled','disabled');\r\r\n $('#next_'+id).addClass('passive');\r\r\n \r\r\n $('#last_'+id).attr('disabled','disabled');\r\r\n $('#last_'+id).addClass('passive');\r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n \r\r\n }, \"json\");\r\r\n \r\r\n \r\r\n }) \r\r\n \r\r\n $('.prev').click(function(){\r\r\n \r\r\n var methodAction = ($(this).attr('id')).substr(5);\r\r\n var id = methodAction;\r\r\n \r\r\n $.post(url+methodAction+'paging',\r\r\n {\r\r\n paramOffset: ($('#offset_'+id).val())-(parseInt(limit))*2,\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : $('#curpage_'+id).val(),\r\r\n paramLimit : limit,\r\r\n actionQuery: \"prev\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n \r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n //alert(link_page);\r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#next_'+id).removeAttr('disabled','disabled');\r\r\n $('#next_'+id).removeClass('passive');\r\r\n \r\r\n $('#last_'+id).removeAttr('disabled','disabled');\r\r\n $('#last_'+id).removeClass('passive');\r\r\n \r\r\n if(data.curpages == 1)\r\r\n {\r\r\n $('#prev_'+id).attr('disabled','disabled');\r\r\n $('#prev_'+id).addClass('passive');\r\r\n \r\r\n $('#firsts_'+id).attr('disabled','disabled');\r\r\n $('#firsts_'+id).addClass('passive');\r\r\n \r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n }, \"json\");\r\r\n \r\r\n \r\r\n })\r\r\n\r\r\n\r\r\n $('.first').click(function(){\r\r\n var id = ($(this).attr('id')).substr(7);\r\r\n //alert();\r\r\n \r\r\n $.post(url+id+'paging',\r\r\n {\r\r\n paramOffset: 0,\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : 0,\r\r\n paramLimit : limit,\r\r\n actionQuery: \"\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n \r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n //alert(link_page);\r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#next_'+id).removeAttr('disabled','disabled');\r\r\n $('#next_'+id).removeClass('passive');\r\r\n\r\r\n $('#last_'+id).removeAttr('disabled','disabled');\r\r\n $('#last_'+id).removeClass('passive');\r\r\n \r\r\n if(data.curpages == 1)\r\r\n {\r\r\n $('#prev_'+id).attr('disabled','disabled');\r\r\n $('#prev_'+id).addClass('passive');\r\r\n\r\r\n $('#firsts_'+id).attr('disabled','disabled');\r\r\n $('#firsts_'+id).addClass('passive');\r\r\n\r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n \r\r\n }, \"json\");\r\r\n\r\r\n })\r\r\n\r\r\n\r\r\n $('.last').click(function(){\r\r\n var id = ($(this).attr('id')).substr(5);\r\r\n \r\r\n var tmp_offset = limit;\r\r\n var lastpage = $('#paramlast_'+id).val();\r\r\n var offset = (tmp_offset * lastpage)-tmp_offset;\r\r\n //alert(offset);\r\r\n\r\r\n\r\r\n $.post(url+id+'paging',\r\r\n {\r\r\n \r\r\n paramOffset: offset,\r\r\n paramKey: $('#param_'+id).val(),\r\r\n paramPage : ($('#paramlast_'+id).val())-1,\r\r\n paramLimit : limit,\r\r\n actionQuery: \"next\"\r\r\n },\r\r\n function(data){\r\r\n \r\r\n $('#'+id+'_content').html(data.result);\r\r\n funcyAction();\r\r\n \r\r\n var awal\t\t= data.start;\r\r\n var akhir\t\t= data.end;\r\r\n var per_page\t= data.per_pages;\r\r\n var cur_page\t= data.cur_pages;\r\r\n var link_page\t= '';\r\r\n \r\r\n //GENERATE LINK PAGES\r\r\n for (var loop = awal -1; loop <= akhir; loop++)\r\r\n {\r\r\n var link_offset = (loop * per_page) - per_page;\r\r\n var get_curpage = loop;\r\r\n //var get_curpage = loop - 1;\r\r\n \r\r\n if (link_offset >= 0)\r\r\n {\r\r\n if (cur_page == loop)\r\r\n {\r\r\n link_page += '<div class=\"cur_page\">'+loop+'</div>';\r\r\n }\r\r\n else\r\r\n {\r\r\n var n = (link_offset == 0) ? '' : link_offset;\r\r\n \r\r\n link_page += '<div class=\"pages '+id+'\" title=\"'+get_curpage+'\">'+loop+'</div>';\r\r\n \r\r\n }\r\r\n }\r\r\n }\r\r\n \r\r\n $('#linkpage_'+id).html(link_page);\r\r\n \r\r\n $('#offset_'+id).attr('value',data.offset);\r\r\n $('#curpage_'+id).attr('value',data.curpages);\r\r\n \r\r\n $('#prev_'+id).removeAttr('disabled','disabled');\r\r\n $('#prev_'+id).removeClass('passive');\r\r\n\r\r\n $('#firsts_'+id).removeAttr('disabled','disabled');\r\r\n $('#firsts_'+id).removeClass('passive');\r\r\n \r\r\n if(($('#allpage_'+id).val()) == data.curpages)\r\r\n {\r\r\n $('#next_'+id).attr('disabled','disabled');\r\r\n $('#next_'+id).addClass('passive');\r\r\n\r\r\n $('#last_'+id).attr('disabled','disabled');\r\r\n $('#last_'+id).addClass('passive');\r\r\n }\r\r\n \r\r\n linkPage('',url,limit);\r\r\n \r\r\n }, \"json\");\r\r\n\r\r\n })\r\r\n\r\r\n \r\r\n linkPage('',url,limit);\r\r\n\r\r\n}", "function GetFileItems(sortUrl) {\n ShowLoading();\n if (!sortUrl || 0 === sortUrl.length) {\n sortUrl = '../api/v1.0/FileItems/';\n }\n $.ajax({\n type: \"GET\",\n url: sortUrl\n }).done(function (result, status, jqXHR) { \n var pagingInfo = $.parseJSON(jqXHR.getResponseHeader(\"X-PageInfo\"));\n append.makePagination(pagingInfo)\n Datatype: \"json\";\n ClearDataTable();\n append.appendTable(result);\n getUserAccountInfo();\n }).fail(function (e) {\n console.log(e);\n }).always(function () {\n HideLoading();\n })\n}", "function createPaginationLinks(currentList) {\n if (containerPage[0].lastElementChild.tagName == \"DIV\" || containerPage[0].lastElementChild.tagName == \"H2\") {\n containerPage[0].lastElementChild.remove()\n }\n showPages(currentList, 1)\n let numberOfPages = Math.ceil(currentList.length / 10)\n let newDiv = document.createElement(\"div\")\n newDiv.className = \"pagination\";\n let ul = document.createElement(\"ul\")\n newDiv.appendChild(ul)\n // check if page is correct\n containerPage[0].appendChild(newDiv)\n\n for (i = 0; i < numberOfPages; i++) {\n let newA = document.createElement(\"a\")\n if (i == 0) {\n newA.className = \"active\"\n }\n newA.addEventListener(\"click\", (e) => {\n let listOfElementsToDeactivate = document.getElementsByTagName(\"A\")\n for (i = 0; i < listOfElementsToDeactivate.length; i++) {\n listOfElementsToDeactivate[i].classList.remove(\"active\")\n }\n e.target.className = \"active\"\n // call function to render correct page after click\n showPages(currentList, e.target.innerText)\n })\n\n newA.href = `#`\n let li = document.createElement(\"li\");\n li.appendChild(newA)\n li.id = i + 1\n newA.innerText = i + 1\n ul.appendChild(li)\n\n\n\n }\n}", "function createPaginationLinks(numberOfPages) {\n\tconst paginateDiv = document.createElement('div');\n\tpaginateDiv.className = 'pagination';\n\tpage.appendChild(paginateDiv);\n\n\tif (numberOfPages < 2) {\n\t} else {\n\t\tfor (let i = 0; i < numberOfPages; i++) {\n\t\t\tlet lis = document.createElement('li');\n\t\t\tlet links = document.createElement('a');\n\t\t\tpaginateDiv.appendChild(lis);\n\t\t\tlis.appendChild(links);\n\t\t\tlinks.textContent = i + 1;\n\t\t}\n\t}\n}", "function createPaginationLinks () {\n // Calculates the amount of paginated links based on length of the visibleStudents[] array\n const pageCount = visibleStudents.length / 10.0;\n\n // Removes any current paginated links that may exist on the page already\n if (document.getElementsByClassName('pagination')[0] != null) {\n document.getElementsByClassName('pagination')[0].remove();\n }\n\n // Adds a <div> tag to hold paginated list <ul> tag and page link <li> tags\n // Adds a DOM Element Reference to the newly created <div> tag\n let newPaginationDiv = document.createElement('div');\n newPaginationDiv.className = 'pagination';\n page[0].appendChild(newPaginationDiv);\n const paginationDiv = document.getElementsByClassName('pagination')[0];\n\n // Adds a paginated list <ul> tag to hold page link <li> tags\n // Adds a DOM Element Reference to the newly created <ul> tag\n let newPaginationUl = document.createElement('ul');\n paginationDiv.appendChild(newPaginationUl);\n const paginationUl = paginationDiv.children[0];\n\n // For loop to add page link <li> and nested link <a> tags to paginated list <ul> tag\n // Event Listener is added to each page link <li> nested <a> tag on click to change the set of displayed students\n for (let i = 0; i <= pageCount; i++) {\n let newPaginationLi = document.createElement('li');\n paginationUl.appendChild(newPaginationLi);\n \n let paginationLi = paginationUl.children[i];\n \n let newPaginationLink = document.createElement('a');\n newPaginationLink.href = '#';\n newPaginationLink.textContent = i + 1;\n paginationLi.appendChild(newPaginationLink);\n\n let paginationLink = paginationLi.children[0];\n paginationLink.addEventListener('click', (e) => {\n studentVisibility(parseInt(e.target.textContent));\n }, false);\n }\n\n // Sets the first pagination link to to active once the createPaginationLinks() Function is called\n document.querySelector('a').className = 'active';\n}", "function paginate_lessons()\n {\n \t\t$.ajax(\n \t\t{\n \t\t\t\"type\":\"GET\",\n \t\t\t\"async\":true,\n \t\t\t\"dataType\":\"json\",\n \t\t\t\"url\":\"../api/lessons?pages=true&pageCount=10&pagesize=10\",\n \t\t\tsuccess : function(res)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\t$.each(res,function(idx,val)\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tvar el=$('<div class=\"pagination\">');\n \t\t\t\t\t\t\t\tel.attr('value',val);\n \t\t\t\t\t\t\t\tel.html(idx+1);\n \t\t\t\t\t\t\t\tel.appendTo($(\"#less_page\"));\n \t\t\t\t\t\t\t});\n\n \t\t\t\t\t\t\tgetAllLessons(res[0]);\n\n \t\t\t\t\t\t\t$(\".pagination\").click(function()\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tgetAllLessons($(this).attr('value'));\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t}\n \t\t})\n }", "function appendPageLinks(list){\n\n // create list of links\nconst container = document.createElement('div');\ncontainer.setAttribute('Class','pagination');\nconst containerParent = document.querySelector('.page');\ncontainerParent.appendChild(container);\nconst listOfLinks = document.createElement('ul');\ncontainer.appendChild(listOfLinks);\n \n// calculates required number of links/pages according to size of list\nlet listlenght = list.length/10; // i.e. 54 students /10 = 5.4\nlet Lisroundup = Math.ceil(listlenght); // rounded up = 6 = 5 pages with 10 students and one page with 4 students\n \n// create the required links according to the list lenght\n for(i = 0; i<Lisroundup; i++ ){\n\nconst li = document.createElement('li');\nlistOfLinks.appendChild(li);\nconst link = document.createElement('A');\nlet index = i + 1;\nlink.setAttribute('href', '#');\nlink.textContent = `${index}`;\n\nli.appendChild(link);\n\n// add active class on the first list element link \n// used for unselecting previous link\nif(i === 0){ \n link.setAttribute('class', 'active');\n}\n\nli.appendChild(link);\nlink.addEventListener('click', (event) => { // adds event listener to every link\ndocument.querySelector('.active').className = '';\nevent.target.className = 'active';\nshowPage(list,index); // call showpage function and send the link index\n})\n\n}\n\n\n\n\n }", "function paginationBuilder() {\n //reset paginator\n $(\".paginationHolder\").empty()\n //prev button\n $(\".paginationHolder\").append(\"<li><a id='pgPrev' aria-label='Previous'><span aria-hidden='true'>&laquo;</span></a></li>\");\n totalPages = 0;\n do {\n totalPages++;\n $(\".paginationHolder\").append(\"<li><a data-pagenum='\" + totalPages + \"' class='pgBtn'>\" + totalPages + \"</a></li>\");\n } while (totalPages < Math.ceil(searchResults.length / displayPerPage));\n //next button\n $(\".paginationHolder\").append(\"<li><a id='pgNext' aria-label='Next'><span aria-hidden='true'>&raquo;</span></a></li>\");\n $(\".paginationHolder\").css(\"display\", \"inline-block\");\n }", "function setResHeaders (req, res, result) {\n const totalPages = Math.ceil(result.total / result.perPage)\n if (result.page > 1) {\n res.set('X-Prev-Page', result.page - 1)\n }\n if (result.page < totalPages) {\n res.set('X-Next-Page', result.page + 1)\n }\n res.set('X-Page', result.page)\n res.set('X-Per-Page', result.perPage)\n res.set('X-Total', result.total)\n res.set('X-Total-Pages', totalPages)\n // set Link header\n if (totalPages > 0) {\n let link = `<${getPageLink(req, 1)}>; rel=\"first\", <${getPageLink(req, totalPages)}>; rel=\"last\"`\n if (result.page > 1) {\n link += `, <${getPageLink(req, result.page - 1)}>; rel=\"prev\"`\n }\n if (result.page < totalPages) {\n link += `, <${getPageLink(req, result.page + 1)}>; rel=\"next\"`\n }\n res.set('Link', link)\n }\n}", "function addPages() {\n let ul = $('<ul></ul>'); // Adds the ul tags\n let currentLength = currentList.length;\n let pageCount = Math.ceil(currentLength/studentsperPage); // Calculates page amount based on current list\n for (let i = 1; i <= pageCount; i++) { // Loops to create each link\n let listLink = $('<li><a href=\"#\" class=\"pageLink\">' + i + '</a></li>'); // Produces link html\n $(ul).append(listLink); // Adds link to list\n pagination.append(ul); // Displays links to page\n }\n $('.pageLink').click(function() { // Listens for click on page links\n let pageNumber = event.target.textContent; // Assigns range to function by page\n showPage(pageNumber, currentList); // Calls function for that page and current list\n });\n}", "function loadByScrollBar(pageNumber) {\n var site = $(\"#autocomplete-input\").val();\n $.ajax({\n method: \"GET\",\n url: \"/promocao/list/ajax\",\n data: {\n page: pageNumber,\n site: site,\n },\n\n beforeSend: function () {\n $(\"#loader-img\").show();\n },\n\n success: function (response) {\n // console.log(\"Resposta -> \",response)\n if (response.length > 150) {\n\n $(\".row\").fadeIn(250, function () {\n $(this).append(response);\n });\n } else {\n $(\"#fim-btn\").show();\n $(\"#loader-img\").removeClass(\"loader\");\n }\n\n },\n error: function (xhr) {\n alert(\"Ops!, ocorreu um error: \" + xhr.status + \" - \" + xhr.statusText);\n },\n\n complete: function () {\n $(\"#loader-img\").hide();\n },\n\n });\n}", "function GetResultsAndPagination(ReferralUrl) {\n // DomainName = \"localhost:50444\";\n var URL = \"http://\" + DomainName + \"/SavedSearchsGetSingleSearch\";\n $.ajax({\n cache: false,\n type: \"POST\",\n url: URL,\n data: { \"RefUrl\": ReferralUrl },\n success: function (data) {\n if (data != null) {\n var arr = data.split('$||$');\n if (arr[0] != \"0\") {\n $('.ajax-loading-block-window').css('display', 'none');\n $('.ssResultTopRow h5').show('slow');\n $('.SingleSearchResultCount').html(arr[0]);\n $('.SingleSearchResult').html(arr[1]);\n $('.SingleSearchResultPagination').html(arr[2]);\n }\n else {\n $('.ajax-loading-block-window').css('display', 'none');\n $('.ssResultTopRow h5').css('display', 'none');\n $('.SingleSearchResult').html('<h2>No Results Found.</h2>');\n }\n }\n },\n error: function (ex) {\n ExceptionHandling(ex);\n $('.ajax-loading-block-window').css('display', 'none');\n $('.ssResultTopRow h5').css('display', 'none');\n $('.SingleSearchResult').html('<h2>No Results Found.Please try again later.</h2>');\n }\n //error: function (xhr, ajaxOptions, thrownError) {\n // $('.ajax-loading-block-window').css('display', 'none');\n // $('.ssResultTopRow h5').css('display', 'none');\n // $('.SingleSearchResult').html('<h2>No Results Found.Please try again later.</h2>');\n //}\n });\n return true;\n}", "function qodeInitStandardPaginationLinkChanges(thisHolder, maxNumPages, nextPage, pagRangeLimit) {\n\t\tvar standardPagHolder = thisHolder.find('.qode-news-standard-pagination'),\n\t\t\tstandardPagNumericItem = standardPagHolder.find('li.qode-news-pag-number'),\n\t\t\tstandardPagPrevItem = standardPagHolder.find('li.qode-news-pag-prev a'),\n\t\t\tstandardPagNextItem = standardPagHolder.find('li.qode-news-pag-next a'),\n\t\t\tstandardPagFirstItem = standardPagHolder.find('li.qode-news-pag-first-page a'),\n\t\t\tstandardPagLastItem = standardPagHolder.find('li.qode-news-pag-last-page a'),\n\t\t\ti = 1,\n\t\t\tj = pagRangeLimit,\n\t\t\tmiddle = Math.floor(pagRangeLimit/2)+1;\n\n\t\tif (pagRangeLimit > maxNumPages) {\n\t\t\tpagRangeLimit = maxNumPages;\n\t\t}\n\t\t\n\t\tstandardPagPrevItem.data('paged', nextPage-1);\n\t\tstandardPagNextItem.data('paged', nextPage+1);\n\t\t\n\t\tif(nextPage > 1) {\n\t\t\tstandardPagPrevItem.css({'opacity': '1'});\n\t\t} else {\n\t\t\tstandardPagPrevItem.css({'opacity': '0'});\n\t\t}\n\t\t\n\t\tif(nextPage === maxNumPages) {\n\t\t\tstandardPagNextItem.css({'opacity': '0'});\n\t\t} else {\n\t\t\tstandardPagNextItem.css({'opacity': '1'});\n\t\t}\n\n\t\tif(nextPage > middle) {\n\t\t\tstandardPagFirstItem.css({'opacity': '1'});\n\t\t} else {\n\t\t\tstandardPagFirstItem.css({'opacity': '0'});\n\t\t}\n\n\t\tif(nextPage < maxNumPages - middle + 1) {\n\t\t\tstandardPagLastItem.css({'opacity': '1'});\n\t\t} else {\n\t\t\tstandardPagLastItem.css({'opacity': '0'});\n\t\t}\n\n\n\t\tif (nextPage >= middle && nextPage <= maxNumPages - middle + 1) {\n\t\t\tstandardPagNumericItem.eq(middle - 1).find('a').data('paged', nextPage);\n\t\t\tstandardPagNumericItem.eq(middle - 1).find('a').html(nextPage);\n\t\t\tstandardPagNumericItem.removeClass('qode-news-pag-active');\n\t\t\tstandardPagNumericItem.eq(middle - 1).addClass('qode-news-pag-active');\n\n\t\t\twhile (i < middle) {\n\t\t\t standardPagNumericItem.eq(middle - i - 1 ).find('a').data('paged', nextPage - i);\n\t\t\t standardPagNumericItem.eq(middle - i - 1 ).find('a').html(nextPage - i);\n\t\t\t standardPagNumericItem.eq(middle + i - 1 ).find('a').data('paged', nextPage + i);\n\t\t\t standardPagNumericItem.eq(middle + i - 1 ).find('a').html(nextPage + i);\n\t\t\t i++;\n\t\t\t}\n\n\t\t} else if (nextPage < middle) {\n\t\t\twhile (i <= pagRangeLimit) {\n\t\t\t standardPagNumericItem.eq(i - 1 ).find('a').data('paged', i);\n\t\t\t standardPagNumericItem.eq(i - 1 ).find('a').html(i);\n\t\t\t i++;\n\t\t\t}\n\n\t\t\tstandardPagNumericItem.removeClass('qode-news-pag-active');\n\t\t\tstandardPagNumericItem.eq(nextPage - 1).addClass('qode-news-pag-active');\n\n\t\t} else {\n\t\t\twhile (j > 0) {\n\t\t\t standardPagNumericItem.eq(pagRangeLimit - j).find('a').data('paged', maxNumPages - j + 1);\n\t\t\t standardPagNumericItem.eq(pagRangeLimit - j ).find('a').html(maxNumPages - j + 1);\n\t\t\t j--;\n\t\t\t}\n\n\t\t\tstandardPagNumericItem.removeClass('qode-news-pag-active');\n\t\t\tstandardPagNumericItem.eq(pagRangeLimit - (maxNumPages - nextPage) - 1).addClass('qode-news-pag-active');\n\t\t}\n\t\t\t\n\t}", "function pagiBuild(pageCount){\n console.log(pages + \" pages.\");\n var contDiv = $(\"#pagiContainer\");\n contDiv.html(\"\");\n var link;\n \n //check to see if there is more than one page of results.\n //if there isn't we don't need to do anything\n if(pageCount > 1){\n\n //if you are on first page you don't need a previous link\n if(currentPage > 1){\n //create link\n //create div\n var prevPagi = $(\"<div>\")\n .addClass(\"pagi\")\n .attr(\"id\", \"previous\")\n .attr(\"page\", currentPage - 1)\n .html(\"<div class='txtDiv'><</div>\");\n //place on page \n contDiv.append(prevPagi); \n } else {\n //create div\n var prevPagi = $(\"<div>\")\n .addClass(\"empty\")\n .attr(\"id\", \"previous\")\n\n //place on page \n contDiv.append(prevPagi); \n }\n \n //loop for placing pagination on page\n for(var i = 1; i <= pageCount; i++){\n //if i = the page you are on style the div to show this\n if(i === currentPage){\n //create div\n var pagi = $(\"<div>\")\n .addClass(\"pagi current\")\n .attr(\"page\", i)\n .html(\"<div class='txtDiv'>\"+ i +\"</div>\");\n //place on page\n contDiv.append(pagi);\n } else {\n \n //create div\n var pagi = $(\"<div>\")\n .addClass(\"pagi\")\n .attr(\"page\", i)\n .html(\"<div class='txtDiv'>\"+ i +\"</div>\");\n //place on page\n contDiv.append(pagi);\n }\n\n if(i === pageCount){\n if(currentPage !== pageCount){\n \n //create div\n var nextPagi = $(\"<div>\")\n .addClass(\"pagi\")\n .attr(\"id\", \"next\")\n .attr(\"page\", currentPage + 1)\n .html(\"<div class='txtDiv'>></div>\");\n //place on page \n contDiv.append(nextPagi);\n } else {\n //create div\n var nextPagi = $(\"<div>\")\n .addClass(\"empty\")\n .attr(\"id\", \"next\")\n //place on page \n contDiv.append(nextPagi);\n }\n }\n }\n $(\".pagi\").click(pageClick);\n }\n }", "function placePaginatedLinks(pageNumber) {\n\n // Determines the index to start from in the links\n const startIndex = (pageNumber-1)*10;\n\n // Determines the number of links based on page length\n const numLinks = findNumLinks(startIndex);\n\n // Determines if there are no matching links\n displayIfNoLinks();\n\n // Loops though all links and hides unneeded ones\n displayLinks(startIndex, numLinks);\n\n}", "function appendLinks(studentArray) {\n paginationUL.innerHTML = \"\";\n paginationUL.className = \"pagination\";\n\n let paginations = Math.ceil(studentArray.length / itemsPerPage);\n\n // Generates pagination links\n for(let i = 1; i <= paginations; i++) {\n const paginationLI = document.createElement(\"li\");\n const paginationLink = document.createElement(\"a\");\n\n paginationLink.textContent = i;\n paginationLink.href = \"\";\n\n if(i === currentPage + 1) {\n paginationLink.className = \"active\";\n }\n\n paginationUL.appendChild(paginationLI);\n paginationLI.appendChild(paginationLink);\n }\n\n const paginateToLink = paginationUL.querySelectorAll(\"a\");\n\n // Pagination links functionability\n for(let i = 0; i < paginateToLink.length; i++) {\n paginateToLink[i].addEventListener(\"click\", (event) => {\n event.preventDefault();\n\n let clickedLink = event.target;\n currentPage = clickedLink.textContent - 1;\n \n setIndexes();\n\n const activeLink = paginationUL.querySelector(\".active\");\n activeLink.className = \"\";\n\n clickedLink.className = \"active\";\n\n showPage(pageStartIndex, pageEndIndex, studentArray, studentArray.length);\n });\n }\n\n page.appendChild(paginationUL);\n}", "function setPageLinks() {\n\n\t//clears Button div \n\t$(buttonsUl).empty();\n\n\tgetPageCount();\n\n\tfor (var i = 1; i <= pageCount; i++) {\n let buttonLi = document.createElement('li');\n let buttonLink = document.createElement('a');\n buttonLink.href = '#';\n buttonLink.textContent = i;\n\n //Append the a element to the li element which is appended to the ul element which is appended to the div\n buttonLi.appendChild(buttonLink);\n buttonsUl.appendChild(buttonLi);\n buttonsDiv.appendChild(buttonsUl);\n \n\t}\n\n\t//Appends the buttons to the html page after the student list.\n\t$(buttonsDiv).insertAfter(studentView);\n\n}", "function paginationOnClick() {\n $(\".page\").each(function(){\n $(this).click(function(e) {\n $('#contenu').load($(this).attr(\"href\"), [], paginationOnClick );\n console.log($(this).attr(\"href\"));\n e.preventDefault();\n })\n });\n }", "function appendPageLinks(list) {\n const numberOfPages = Math.ceil(list.length/10); //number of pages to hold the entire list in chunks of 10.\n const mainDiv = document.querySelector('.page');\n const div = document.createElement('div');\n div.className = 'pagination';\n mainDiv.appendChild(div);\n\n const divUl = document.createElement('ul');\n let divLink;\n\n for( let i = 1; i <= numberOfPages; i++ ) {\n let divLi = document.createElement('li');\n divUl.appendChild(divLi);\n divLink = document.createElement('a');\n divLink.href = '#';\n divLink.textContent = i;\n divLi.appendChild(divLink);\n if( i === 1 ) { //The first button will be active when the webpage loads for the first time.\n divLink.className = 'active';\n }\n }\n div.appendChild(divUl); //Pagination buttons will be added to the DOM.\n\n div.addEventListener('click', (e) => {\n let page = parseInt(e.target.textContent); //The text value of the page will be converted to an integer.\n showPage(list, page);\n let link = div.querySelectorAll('a');\n for ( let i = 0; i < numberOfPages; i++ ) {\n link[i].className = 'inactive';\n if( i === (page - 1) ) { //Condition to match page with the index value. Index starts from 0 and page starts from 1.\n e.target.className = 'active'; //The button clicked will be highlighted.\n }\n }\n });\n}", "function appendPageLinks(studentList) {\n\t//defines number of students\n\tvar numberOfStudents = studentList.length;\n\t//calculates how many pages are needed and rounds up \n\tvar numberOfPages = Math.ceil(numberOfStudents / showPerPage);\n\t//if number of students is greater than showPerPage then create page links\n\tif (numberOfStudents > showPerPage) {\n\t\t//appends a pagination div to the end of the opening div tag\n\t\t$('.page').append(\"<div class='pagination'><ul></ul></div>\");\n\t\t//creates a link per page needed\n\t\tfor (let i = 1; i <= numberOfPages; i += 1) {\n\t\t\t$('.pagination ul').append(\"<li><a href='#'>\" + i + \"</a></li>\");\n\t\t}\n\t\t//activates link on first page\n\t\t$('.pagination a:eq(0)').addClass('active');\n\t\t//dispays the first 10 students\n\t\tshowPage(0, studentList);\n\t\t//calls the list of students associated with each page number\n\t\tinitPaginationClick(studentList);\n\t}\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 addAjaxDisplayLink() {\n\t$(\"table.ajax\").each(function (i) {\n\t\tvar table = $(this).attr(\"id\", \"ajaxTable\" + i);\n\t\ttable.find(\".nojs-message\").remove();\n\t\tvar headerLinks = $('<span style=\"float: right;\">').appendTo(table.find('th').first());\n\t\tvar cell = table.find(\"td\").first(), needLink = true;\n\t\tcell.parent().show();\n\t\tif (cell.hasClass(\"showLinkHere\")) {\n\t\t\tvar old = cell.html(), rep = old.replace(/\\[link\\](.*?)\\[\\/link\\]/, '<a href=\"javascript:;\" class=\"ajax-load-link\">$1</a>');\n\t\t\tif (rep != old) {\n\t\t\t\tcell.html(rep);\n\t\t\t\tneedLink = false;\n\t\t\t}\n\t\t}\n\t\tif (needLink) headerLinks.html('[<a href=\"javascript:;\" class=\"ajax-load-link\">show data</a>]');\n\t\ttable.find(\".ajax-load-link\").parent().andSelf().filter('a').click(function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tvar sourceTitle = table.data('ajax-source-page'), baseLink = mw.config.get('wgScript') + '?';\n\t\t\tcell.text('Please wait, the content is being loaded...');\n\t\t\t$.get(baseLink + $.param({ action: 'render', title: sourceTitle }), function (data) {\n\t\t\t\tif (data) {\n\t\t\t\t\tcell.html(data);\n\t\t\t\t\tcell.find('.ajaxHide').remove();\n\t\t\t\t\tcell.find('.terraria').removeClass('terraria');\n\t\t\t\t\tif (cell.find(\"table.sortable\").length) {\n\t\t\t\t\t\tmw.loader.using('jquery.tablesorter', function() {\n\t\t\t\t\t\t\tcell.find(\"table.sortable\").tablesorter();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\theaderLinks.text('[');\n\t\t\t\t\theaderLinks.append($('<a>edit</a>').attr('href', baseLink + $.param({ action: 'edit', title: sourceTitle })));\n\t\t\t\t\theaderLinks.append(document.createTextNode(']\\u00A0['));\n\t\t\t\t\tvar shown = true;\n\t\t\t\t\t$(\"<a href='javascript:;'>hide</a>\").click(function() {\n\t\t\t\t\t\tshown = !shown;\n\t\t\t\t\t\tshown ? cell.show() : cell.hide();\n\t\t\t\t\t\t$(this).text(shown ? \"hide\" : \"show\");\n\t\t\t\t\t}).appendTo(headerLinks);\n\t\t\t\t\theaderLinks.append(document.createTextNode(']'));\n\t\t\t\t}\n\t\t\t}).error(function() {\n\t\t\t\tcell.text('Unable to load table; the source article for it might not exist.');\n\t\t\t});\n\t\t});\n\t});\n}", "function appendPageLinks(studentList) {\r\n\t\tlet totalPages = Math.ceil(studentList / showPerPage);\r\n \tconst listing = document.createElement('ul');\r\n \t$(listing).addClass('pagination');\r\n \tpage.appendChild(listing);\r\n \tfor (i = 1; i <= totalPages; i++) {\r\n \t\tconst pageNum = document.createElement('li');\r\n \t\tpageNum.innerHTML = '<a href=\"#\">' + i + '</a>';\r\n \t\tlisting.appendChild(pageNum);\r\n \t}\r\n\r\n \tlisting.firstChild.firstChild.className = \"active\";\r\n \t$('a').on(\"click\", function() {\r\n \t\t$('a').removeClass('active');\r\n \t\t$(li).hide();\r\n \t\tshowPage(this.textContent, studentList);\r\n \t\t$(this).addClass('active');\r\n });}", "function ajax() {\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"https://jsonplaceholder.typicode.com/posts\", true) //last param is_asyncronous_boolean\n xhr.onload = function () {\n if (this.status === 200) {\n let response = JSON.parse(this.response)\n // console.log(response);\n let page_num = Number(localStorage.getItem(\"PAGE_NUM\"));\n let start;\n let end;\n switch (page_num) {\n case 1: start = 0; end = 20; break;\n case 2: start = 20; end = 40; break;\n case 3: start = 40; end = 60; break;\n case 4: start = 60; end = 80; break;\n case 5: start = 80; end = 100; break;\n }\n document.querySelector(\"#posts\").innerHTML = '';\n for (let i = start; i < end; i++) {\n document.querySelector(\"#posts\").innerHTML += `\n <div class=\"post\">\n <h2>${response[i].title}</h2>\n <p>${response[i].body}</p>\n </div>`;\n }\n }\n }\n xhr.send()\n}", "function cnsRH_montaPaginacao(paginaAtual){\n\t//MONTA AS PAGINAS\n\tvar total = Math.ceil(objTabelaFuncRH.total / CNSRH_LIMITE_REGISTROS);\n\n\tif(total == 1){\n\t\t$('#cnsRH_pagination span').hide();\n\t\treturn;\n\t}\n\n\t$('#cnsRH_pagination').html(\"\");\n\n\n\tvar links = 4;\n\tvar inicio = ((paginaAtual - links) > 1 ? (paginaAtual - links) : 1);\n\tvar fim = ((paginaAtual + links) < total ? ((paginaAtual + links)+1) : total);\n\n\n\tif(paginaAtual >= (links + 2)){\n\t\t$('#cnsRH_pagination').append(\"<span onclick='cnsRH_pagination(\" + 1 + \");' class='cor_padraoInvert_hover'>\" + 1 + \"</span>\");\n\t\t$('#cnsRH_pagination').append(\"<span class='no-border cor_padraoInvert_hover'>...</span>\");\n\t}\n\n\tfor(var i = inicio; i <= fim; i++){\n\t\tif(i == paginaAtual){\n\t\t\t$('#cnsRH_pagination').append(\"<span class='active cor_padrao'>\" + i + \"</span>\");\n\t\t}else{\n\t\t\t$('#cnsRH_pagination').append(\"<span onclick='cnsRH_pagination(\" + i + \");' class='cor_padraoInvert_hover'>\" + i + \"</span>\");\n\t\t}\n\t}\n\tif(paginaAtual <= (total - (links + 2))){\n\t\t$('#cnsRH_pagination').append(\"<span class='no-border cor_padraoInvert_hover'>...</span>\");\n\t\t$('#cnsRH_pagination').append(\"<span onclick='cnsRH_pagination(\" + total + \");' class='cor_padraoInvert_hover'>\" + total + \"</span>\");\n\t}\n}", "function renderLinks(links, pageNumber) {\n pagination.totalBookmarks = links.length;\n pagination.currentPage = pageNumber;\n\n const lowerBound = pageNumber * pagination.limit;\n const upperBound = (pageNumber + 1) * pagination.limit;\n const bookmarkList = document.querySelector('.bookmark-list > ul');\n bookmarkList.innerHTML = ''; // clean list\n\n const generateLinkElement = (text, key) => {\n const anchor = document.createElement('a');\n anchor.appendChild(document.createTextNode(text));\n anchor.setAttribute('data-key', key);\n return anchor;\n };\n\n // render links\n links.slice(lowerBound, upperBound)\n .forEach(link => {\n const listElement = document.createElement('li');\n const name = document.createTextNode(`${link.name} - `);\n const anchor = generateLinkElement(link.url, link.key);\n const deleteLink = generateLinkElement('delete', link.key);\n const editLink = generateLinkElement('edit', link.key);\n\n anchor.setAttribute('title', link.name);\n anchor.setAttribute('href', link.url);\n anchor.setAttribute('target', '_blank');\n deleteLink.classList.add('delete');\n editLink.classList.add('edit');\n listElement.classList.add('bookmark');\n\n listElement.appendChild(name); // text into <li>\n listElement.appendChild(anchor); // <a> into <li>\n listElement.appendChild(document.createTextNode(' - ')); // separator into <li>\n listElement.appendChild(deleteLink); // add <a>delete</a> into <li>\n listElement.appendChild(document.createTextNode(' - ')); // separator into <li>\n listElement.appendChild(editLink); // add <a>edit</a> into <li>\n bookmarkList.appendChild(listElement); // <li> into <ul>\n });\n\n renderPagination();\n}", "function chunkedPrevNext(){\n var toc = $('.toc').first();\n var links = toc.find('a').filter(function () {\n return this.href.match(/.*\\.html?$/);\n });\n\n /* PAL2-7900 there can be more than one prev/next link on a page, and they can be marked with either id or class */\n var nextlink = $('.header-navigation-next,#header-navigation-next');\n var prevlink = $('.header-navigation-prev,#header-navigation-prev');\n\n var next = '';\n var prev = '';\n\n /*ASN: Looping the toc to create correct prev/next navigation corresponding to toc options.*/\n for (var index = 0; index < links.length; index++) {\n var minusone = links[index - 1];\n var plusone = links[index + 1];\n if (typeof minusone !== \"undefined\") {\n if (minusone.classList.contains('active')) {\n var jqueryObj = $(links[index]);\n next = jqueryObj.attr('href');\n nextlink.attr('href', next);\n }\n }\n\n if (typeof plusone !== \"undefined\") {\n if (plusone.classList.contains('active')) {\n var jqueryObj = $(links[index]);\n prev = jqueryObj.attr('href');\n prevlink.attr('href', prev);\n }\n }\n };\n\n\n if (next == '') {\n nextlink.remove();\n }\n}", "function createAjaxPager(pager)\n{\n pager.next('.item-list').hide();\n \n pager_cnt = pager.find('.ajax-pager-cnt');\n pager_cnt.css('display', 'block');\n \n t = pager.find('.ajax-pager');\n \n t.click(function(e) {\n\n pager.addClass(ajax_loader_class);\n var txtCopy = t.text();\n t.text('Loading...');\n e.preventDefault();\n url = t.attr('href');\n join = (url.indexOf('?') < 0) ? '?' : '&';\n \n jQuery.getJSON(url+join+'ajax=1', function(data, status) {\n \n if(status == ajax_success) {\n if(data['status']) {\n if(data['data']) {\n d = jQuery(innerShiv(data['data'],true));\n\t\t\t\t jQuery('#page-content .last').removeClass('last');\n jQuery('#page-content').find('.item-list:last').after(d);\n }\n if(data['pager']) {\n p = jQuery(data['pager']);\n pager.replaceWith(p);\n createAjaxPager(p);\n }\n else {\n t.remove();\n }\n if(data['callback']) {\n for(c in data['callback']) {\n if(data['callback'][c]) {\n param = '\\''+data['callback'][c]+'\\'';\n }\n eval(c+'('+param+')');\n }\n }\n updatePageHistory(url);\n }\n pager.removeClass(ajax_loader_class);\n t.text(txtCopy);\n setTotalShares();//get social media aggregated totals\n }\n });\n });\n}", "function expandBookingsListPagination(pagination) {\n page = pagination.current;\n\n var pagination_container = $('<div>', {\n class: 'booking-list-pagination'\n });\n\n if (pagination.last != 1) {\n var previous = $('a[data-page].hidden.fake').clone(true);\n previous.removeClass('hidden').removeClass('fake').html('&laquo;');\n pagination_container.append(previous.attr('data-page', pagination.previous == null ? '' : pagination.previous));\n\n $.each(\n pagination.range,\n function(key, page_number)\n {\n var link = $('a[data-page].hidden.fake').clone(true);\n link.removeClass('hidden').removeClass('fake').html(page_number);\n link.attr('data-page', page_number);\n\n if (page_number == pagination.current) {\n link.addClass('selected');\n }\n\n pagination_container.append(link);\n }\n );\n\n var next = $('a[data-page].hidden.fake').clone(true);\n next.removeClass('hidden').removeClass('fake').html('&raquo;');\n pagination_container.append(next.attr('data-page', pagination.next == null ? '' : pagination.next));\n }\n\n $('.booking-list-pagination').replaceWith(pagination_container);\n}", "function paginationNav(pages) {\n for(var i = 0; i < pages; i++) {\n header.append('<a href=\"#\" data-page=\"'+i+'\" id=\"page-button\">'+(i+1)+'</a>'); // Adding one to offset the array but to keep math logic for Listener on pagination buttons\n if(i == (pageStart/pagerSize)) {\n $('#page-button').addClass('active');\n }\n }\n paginationButtons = $('#app a#page-button');\n header.prepend('<span><input type=\"checkbox\" id=\"checkbox\" checked />Paginate</span>');\n}", "function buildPagination()\n {\n // 1. split everything out\n var aPagination = sPagination.split(/\\s+/);\n\n // 2. iterate\n aPagination.forEach(function(sPagination)\n {\n // a. load the pagination\n var oPagination = require('slideshow/'+sPagination+'-pagination')(el, aElItems, go);\n\n // b. push it onto the array\n aoPagination.push(oPagination);\n });\n }", "function buildPagination(data) {\n var paginationContainer = '#'+self.settings().containers.pagination;\n $.Casper.pagination(paginationContainer, data.data, function(page) {\n self.onPaging(page);\n });\n }", "function formatLinks() {\n\t$('#allLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('grp')\");\n\t$('#abtLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[0]+\"')\");\n\t$('#invLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[1]+\"')\");\n\t$('#mediaLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[2]+\"')\");\n\t$('#bankLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[3]+\"')\");\n\t$('#susLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[4]+\"')\");\n\t$('#careerLink').attr( \"href\",\"javascript:loadSearchDetailsByGroup('\"+category[5]+\"')\");\n}", "function get_data( type ){\r\n var b=$(\"ul.pagination a.more\");\r\n\tvar c=b.closest(\"ul.buttons_bar\");\r\n\tvar a=c.find(\"li.loader\");\r\n\tvar list = type + \"_list\";\r\n\tvar pagination = type + \"_pagination\";\r\n\tif(b.hasClass(\"disabled\")){return}\r\n\tb.addClass(\"disabled\");\r\n\ta.removeClass(\"no_display\");\r\n\t$.getJSON(b.attr(\"href\"),function(e){\r\n\t\tif(e.status&&e.status==\"OK\"){\r\n\t\t\t$(\"div.column.center ul.\"+type).append(e.content[list]);\r\n\t\t\t$(\"div.column.center ul.pagination\").replaceWith(e.content[pagination])\r\n\t\t}\r\n\t}).complete(function(){\r\n\t\tb.removeClass(\"disabled\");\r\n\t\ta.addClass(\"no_display\");\r\n\t\tbusy = false;\r\n\t})\r\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}", "function getHomeSearchlogs(page) {\n\n var goto = page;\n var pagesize = 10;\n waitFunc('enable');\n $.ajax({\n type: 'post',\n url: aurl + 'logs/homesearch/',\n data: {goto: goto, pagesize: pagesize},\n success: function (data) {\n waitFunc('');\n if (data == 'error') {\n alertFunc('danger', 'Something went wrong, please try again')\n } else {\n //$('.HomeSearchLogs').html(data);\n data = $.parseJSON(data);\n\n var html = \"\";\n $.each(data, function (index, item) {\n client_name = item.city;\n client_profession = item.zip;\n client_phone = (item.vocation == 'null' ? 'Not Specified' : item.vocation);\n client_entrydate = item.created_at;\n\n\n html += \"<tr id='$rand-$id'>\" +\n \"<td>\" + client_name + \"</td>\" +\n \"<td>\" + client_profession + \"</td>\" +\n \"<td>\" + client_phone + \"</td>\" +\n \"<td>\" + client_entrydate + \"</td>\" +\n \"</tr> \";\n });\n\n var pages = 10;\n var prev = goto == 1 ? 1 : parseInt(goto) - 1;\n var next = goto == pages ? pages : parseInt(goto) + 1;\n html += \"<tr><td colspan='8'><ul class='pagination homesearchlog'><li><a data-func='prev' data-pg='\" + prev + \"'>«</a></li>\";\n for (i = 1; i <= pages; i++) {\n active = i == parseInt(goto) ? 'active' : '';\n html += \"<li class='\" + active + \"'><a data-pg='\" + i + \"'>\" + i + \"</a></li>\";\n }\n\n html += \"<li><a data-func='next' data-pg='\" + next + \"'>»</a></li></ul></td></tr>\";\n\n $('.HomeSearchLogs').html(html);\n }\n },\n error: function () {\n waitFunc('');\n alertFunc('info', 'Something went wrong, please try again')\n }\n });\n}", "function appendPageLinks(studentList) {\n numberOfPages = Math.ceil(totalStudents / 10);\n pagLinks = document.createElement('div');\n pagLinks.className = 'pagination';\n pagUL = document.createElement('ul');\n pagUL.setAttribute(\"id\", \"links\");\n pageDiv.appendChild(pagLinks);\n pagLinks.appendChild(pagUL);\n for (let i = 0; i < numberOfPages; i += 1) {\n pagUL.innerHTML += '<li><a href=\"#\" class=\"inactive\">' + [i + 1] + '</a></li>';\n }\n pagUL.addEventListener(\"click\", (e) => {\n showPage((e.target.textContent), studentList);\n for (i = 0; i < numberOfPages; i += 1) {\n anchors[i].className = \"inactive\";\n }\n e.target.className = \"active\";\n });\n}", "function fillReportDisplayLinks(baseUrl, loadingLabel, totalLabel){\n var pathTxtOrigin = $('#pathTxtOrigin').val();\n var pathTxtDestination = $('#pathTxtDestination').val();\n var parameters = \"&pathTxtOrigin=\" + pathTxtOrigin + \"&pathTxtDestination=\" + pathTxtDestination;\n var actionUrl = getReportActionUrl(baseUrl, 23, parameters);\n\n // the loading message\n ajaxindicatorstart(loadingLabel);\n\n $.getJSON( actionUrl, function( data ) {\n var table = initDataTableWithoutAjax('displayLinksTable', 4 , true);\n\n // clear all content from table\n table.clear().draw();\n\n // adding new content to table\n $.each(data.data, function( index, val ) {\n table.row.add( [\n checkUndefined(val[0]),\n checkUndefined(val[1]),\n checkUndefined(val[2]),\n checkUndefined(val[3]),\n checkUndefined(val[4])\n ] ).draw();\n });\n\n // Update footer\n $(table.column(0).footer()).html(totalLabel);\n $(table.column(1).footer()).html(checkUndefined(data.recordsTotal));\n });\n\n ajaxindicatorstop();\n}", "function appendPageLinks(list) {\n \n const listLength = list.length;\n\n const numOfPages = Math.ceil(listLength / contactsPerPage);\n\n const divPagination = document.createElement('div');\n divPagination.className = \"pagination\";\n\n const ulPagination = document.createElement('ul');\n\n divPagination.appendChild(ulPagination);\n const mainpageDiv = document.querySelector('.page');\n mainpageDiv.appendChild(divPagination); \n\n for (let i = 0; i < numOfPages; i++) {\n if (i < numOfPages) {\n let li = document.createElement(\"li\");\n let a = document.createElement(\"a\");\n a.href = \"#\";\n a.textContent = i + 1;\n\n a.addEventListener('click', function(){\n showPage(list, i+1);\n }); \n\n li.appendChild(a);\n ulPagination.appendChild(li);\n } \n }\n}", "injectPaginationLink() {\n const $nextLink = $('.pagination-item--next .pagination-link', this.$reviewsContent);\n const $prevLink = $('.pagination-item--previous .pagination-link', this.$reviewsContent);\n\n if ($nextLink.length) {\n $nextLink.attr('href', `${$nextLink.attr('href')} #product-reviews`);\n }\n\n if ($prevLink.length) {\n $prevLink.attr('href', `${$prevLink.attr('href')} #product-reviews`);\n }\n }", "function setPagination() {\n //recreated paging list\n $(\"div#current-data #pagination ul li\").detach();\n $(\"div#current-data #pagination ul\").append(\n \"<li id='firstPage' title='First'><a href='#' aria-label='First'><span aria-hidden='true'>&laquo;</span></a></li>\"+\n \"<li id='prevPage' title='Previous'><a href='#' aria-label='Previous'><span aria-hidden='true'>&lt;</span></a></li>\"\n );\n var startPageNo = Math.floor(currPageNo/pagePerLoad) * pagePerLoad + (currPageNo%pagePerLoad === 0 ? 0 : 1); //start page no of serial page on page selected\n var endPageNo = maxPage < (startPageNo + pagePerLoad) ? maxPage : (startPageNo + pagePerLoad -1); //end page no of serial page on page selected\n for(var idx = startPageNo; idx <= endPageNo; idx++) {\n $(\"div#current-data #pagination ul\").append(\n \"<li id='page\"+idx+\"'\"+(idx === currPageNo ? \" class='active' \" : \"\")+\"><a href='#'>\"+idx+\"</a></li>\"\n );\n }\n $(\"div#current-data #pagination ul\").append(\n \"<li id='nextPage' title='Next'><a href='#' aria-label='Next'><span aria-hidden='true'>&gt;</span></a></li>\"+\n \"<li id='lastPage' title='Last'><a href='#' aria-label='Last'><span aria-hidden='true'>&raquo;</span></a></li>\"\n );\n }", "function getData(){\n $.ajax({\n type: \"GET\",\n url: URL_SERVER + \"/userlinks\",\n success: function (msg) {\n links = msg.urlList;\n for(var i = 0; i < links.length; i ++){\n appendRow(links[i]);\n console.log(links[i].uri);\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n window.location.replace(URL_SERVER + \"/index.html\")\n }\n });\n}", "function loadList(data, start, limit) {\n var dataArray = [];\n if((start+limit) > data.length){\n limit = data.length - start; // Safety for the forloop to allow pages be in random sizes\n }\n for(var i = start; i < start+limit; i++) {\n var object = data[i];\n if(openContainerId == object.id) {\n active = 'class=\"active\"';\n } else {\n active = '';\n }\n var newElement = \"<tr \"+active+\"><td>\"+object.id+\"</td><td>\"+object.albumId+\"</td><td>\"+object.title+\"</td></tr>\";\n dataArray += newElement;\n }\n dataTable.html(dataArray);\n dataTable.prepend($('<tr/>') +'<th><a href=\"#\" id=\"id\">ID</a></th><th><a href=\"#\" id=\"albumId\">Album ID</a></th><th><a href=\"#\" id=\"title\">Title</a></th>');\n}", "function appendPageLinks(list) {\n // Remove old pagination if present, create paginstion DOM containters, loop over number of pages, create links, add active inital active class, addEvent listener with pageLinkAction helper function\n removeElement('.pagination');\n const page_div = createElement(\"DIV\", {class: 'pagination'}, main_container);\n const ul = createElement('UL', {}, page_div);\n for (let i = 1, j = Math.ceil(list.length / per_page); i <= j; i++) {\n const li = createElement('LI', {}, ul);\n const a = createElement('A', {href: '#'}, li);\n a.innerHTML = i;\n pageLinkAction(a, list, i);\n }\n document.querySelector('.pagination a').classList.add('active');\n}", "function appendPageLinks(list) {\n // find number of pages based on length of list\n const pages = Math.ceil(list.length / itemsPerPage);\n const paginationLinks = document.querySelector('div.pagination');\n // if pagination links are already created, remove them from the page\n if (paginationLinks !== null) {\n paginationLinks.parentNode.removeChild(paginationLinks)\n }\n //create document elements for links\n const div = document.createElement('div');\n div.className = 'pagination';\n const ul = document.createElement('ul');\n //create li and anchor elements for each page #\n for (i = 1; i < (pages + 1); i++) {\n let li = document.createElement('li');\n let a = document.createElement('a');\n a.href = '#';\n a.textContent = i;\n if (i === 1) a.className = 'active';\n //add event listener to pagination links and set clicked link to \"active\"\n a.addEventListener('click', (e) => {\n let active = document.querySelector('a.active');\n active.className = '';\n e.target.className = 'active';\n //call showPage function to display students from page clicked upon\n showPage(list, e.target.firstChild.textContent);\n });\n li.appendChild(a);\n ul.appendChild(li);\n }\n\n //append list to div and div to higher order div\n div.appendChild(ul);\n const pageDiv = document.querySelector('.page');\n pageDiv.appendChild(div);\n}", "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 loadpage(){\n //show the active page\n let active_page = \".pagination-participants li:nth-child(\" + (current_page+1) + \")\";\n $('.pagination-participants').find('.active').removeClass('active');\n $(active_page).addClass('active');\n\n //disable previous button when page number is 1\n if(current_page === 1){\n $('.prev').addClass('disabled');\n }\n\n //disable next button\n if(current_page === numPages()){\n $('.next').addClass('disabled');\n }\n\n $.each(participants, function(i, participant) {\n if (\n /^ *$/.test(participant.imageurl) ||\n participant.imageurl == \"\"\n ) {\n //regex to check empty string or spaces\n\n participant.imageurl =\n \"https://image.flaticon.com/icons/svg/1141/1141771.svg\";\n //Icon made by Freepik from www.flaticon.com *credits*\n } else {\n var url = participant.imageurl;\n //console.log(url);\n\n try {\n var http = new XMLHttpRequest();\n http.open(\"HEAD\", url, false);\n http.send();\n\n if (http.status == 404) {\n participant.imageurl =\n \"https://image.flaticon.com/icons/svg/1141/1141771.svg\";\n }\n } catch (err) {}\n }\n\n // check if social media links available otherwise disable them\n\n if (\n /^ *$/.test(participant.facebook) ||\n participant.facebook == \"\"\n ) {\n //regex to check empty string or spaces\n participant.facebook = \"javascript:void(0);\";\n\n } else {\n var url = participant.facebook;\n\n try {\n var http = new XMLHttpRequest();\n http.open(\"HEAD\", url, false);\n http.send();\n\n if (http.status == 404) {\n participant.facebook = \"javascript:void(0);\";\n }\n } catch (err) {}\n }\n\n if (\n /^ *$/.test(participant.github) ||\n participant.github == \"\"\n ) {\n //regex to check empty string or spaces\n participant.github = \"javascript:void(0);\";\n\n } else {\n var url = participant.github;\n\n try {\n var http = new XMLHttpRequest();\n http.open(\"HEAD\", url, false);\n http.send();\n\n if (http.status == 404) {\n participant.github = \"javascript:void(0);\";\n }\n } catch (err) {}\n }\n\n if (\n /^ *$/.test(participant.twitter) ||\n participant.twitter == \"\"\n ) {\n //regex to check empty string or spaces\n participant.twitter = \"javascript:void(0);\";\n\n } else {\n var url = participant.twitter;\n\n try {\n var http = new XMLHttpRequest();\n http.open(\"HEAD\", url, false);\n http.send();\n\n if (http.status == 404) {\n participant.twitter = \"javascript:void(0);\";\n }\n } catch (err) {}\n }\n var participantabout=participant.about;\n if(participantabout===\"\")\n participantabout=\"Talk is cheap. Show me the code\";\n var participantDiv =\n \"<div class='col-lg-2 col-md-4 col-sm-6 text-center mb-4'>\" +\n \"<div class='card participant-card' style='width: 18rem;'>\" +\n \"<div class = 'side'>\" +\n \"<img class='participant-img img-fluid card-img-top' src=\" +\n participant.imageurl +\n \" alt=''>\" +\n \"<div class='card-body project-card-body'>\" +\n \"<h4 class='card-title card-name'>\" +\n participant.name +\n \"</h4>\" +\n \"<p class='card-text card-college'>\" +\n participant.college +\n \"</p>\" +\n \"</div>\"+\n \"</div>\" +\n \"<div class='side back'>\" +\n \"<p class='card-about'>\" +\n participantabout +\n \"</p>\" +\n \"<div class='social-media-links'>\" +\n \"<a href=\" +\n participant.facebook +\n \"><i class='fab fa-facebook-f'></i></a>\" +\n \"<a href=\" +\n participant.github +\n \"><i class='fab fa-github'></i></a>\" +\n \"<a href=\" +\n participant.twitter +\n \"><i class='fab fa-twitter'></i></a>\" +\n \"<a href=\" +\n participant.website+\n \"><i class='fas fa-user'></i></a>\" +\n \"</div>\" +\n \"</div>\";\n\n $(\"#participants\").append(participantDiv);\n });\n }", "function initPagination() {\n _initSearchablePagination(\n $list,\n $('#search_form'),\n $('#pagination'), \n {\n url: '/appraisal_companies/_manager_list',\n afterLoad: function (content) {\n $list.html(content);\n initDelete();\n }\n }\n );\n }", "function getHomeSearchlogs(page) {\n\n var goto = page ;\n var pagesize = 10; \n waitFunc('enable');\n $.ajax({\n type: 'post',\n url: aurl+ 'logs/homesearch/',\n data: { goto: goto, pagesize:pagesize },\n success: function(data) {\n waitFunc('');\n if (data == 'error') {\n alertFunc('danger', 'Something went wrong, please try again')\n } else {\n //$('.HomeSearchLogs').html(data);\n data = $.parseJSON(data);\n\n var html = \"\";\n $.each(data, function (index, item) \n {\n client_name = item.city ;\n client_profession = item.zip ;\n client_phone = (item.vocation=='null'? 'Not Specified' : item.vocation) ;\n client_entrydate = item.created_at ;\n\n \n html += \"<tr id='$rand-$id'>\" +\n \"<td>\" + client_name + \"</td>\" +\n \"<td>\" + client_profession + \"</td>\" +\n \"<td>\" + client_phone + \"</td>\" +\n \"<td>\" + client_entrydate + \"</td>\" +\n \"</tr> \" ;\n });\n \n var pages = 10; \n var prev = goto == 1 ? 1 : parseInt(goto ) -1;\n var next = goto == pages ? pages : parseInt(goto ) + 1; \n html += \"<tr><td colspan='8'><ul class='pagination homesearchlog'><li><a data-func='prev' data-pg='\" + prev + \"'>«</a></li>\";\n for( i=1; i <= pages; i++)\n {\n active = i == parseInt(goto ) ? 'active' : '';\n html += \"<li class='\" + active + \"'><a data-pg='\" + i + \"'>\" + i + \"</a></li>\";\n }\n \n html += \"<li><a data-func='next' data-pg='\" + next + \"'>»</a></li></ul></td></tr>\";\n\n $('.HomeSearchLogs').html(html); \n }\n },\n error: function() {\n waitFunc('');\n alertFunc('info', 'Something went wrong, please try again')\n }\n });\n}", "function atualizarPaginacao(){\n\n page = page ? parseInt(page) : 1;\n\n var totalPaginas = Math.ceil(total_banco / config.limit);\n\n if( totalPaginas > 1 ){\n\n var paginacao = '<div class=\"text-center\"><ul class=\"pagination\">';\n\n paginacao += '<li><a href=\"'+remoteUrl+'page=1&limit='+config.limit+'\">&laquo;</a></li>';\n\n paginacao += '<li><a href=\"'+remoteUrl+'page='+(page > 2 ? page - 1 : 1)+'&limit='+config.limit+'\">&lt;</a></li>';\n\n for (var i = 1; i <= totalPaginas; i++) {\n paginacao += '<li class=\"'+ (i == page ? 'active' : '') + '\"><a href=\"'+remoteUrl+'page='+i+'&limit='+config.limit+'\">'+i+' <span class=\"sr-only\">(current)</span></a></li>';\n };\n\n paginacao += '<li><a href=\"'+remoteUrl+'page='+ ((page < totalPaginas) ? (page+1) : page) +'&limit='+config.limit+'\">&gt;</a></li>';\n\n paginacao += '<li><a href=\"'+remoteUrl+'page='+ totalPaginas +'&limit='+config.limit+'\">&raquo;</a></li>';\n\n paginacao += '</ul></div>';\n\n footer( $(paginacao ) );\n\n } else {\n\n footer( '' );\n\n }\n\n var posicaoPrimeiroItem = total_banco > 0 ? (page * config.limit) + 1 - config.limit : 0;\n\n var posicaoSegundoItem = (posicaoPrimeiroItem + config.limit - 1) > total_banco ? total_banco : posicaoPrimeiroItem + config.limit -1;\n\n var totalresumeHTML = $(document.createElement('div')).addClass('text-center').html(\"Mostrando do \" + posicaoPrimeiroItem + \"&ordm até o \" + posicaoSegundoItem + \"&ordm de \" + total_banco + \" registro(s) encontrado(s).\");\n\n var captionContent = $(document.createElement('small')).addClass('text-info').append( totalresumeHTML );\n\n self.caption( captionContent );\n\n }", "function getSearchlogs(page) \n{ \n \n var goto = page;\n var pagesize = 10; \n waitFunc('enable');\n $.ajax({\n type: 'post',\n url: aurl+ 'logs/vocationsearch/',\n data: { goto: goto, pagesize:pagesize },\n success: function(data) {\n waitFunc('');\n if (data.error == 1 ) {\n alertFunc('danger', 'Something went wrong, please try again')\n }\n else \n {\n data = $.parseJSON(data);\n html = \"\";\n \n $.each(data.result, function (index, item) \n {\n \n html += \"<tr id='row\" + index + \"'>\" + \n \"<td>\" + item.username + \"</td>\" +\n \"<td>\" + item.vocation + \"</td>\" +\n \"<td>\" + item.location + \"</td>\" +\n \"<td>\" + item.created_at + \"</td>\" + \n \"</tr>\"; \n });\n \n var pages = data.pages; \n var prev = goto == 1 ? 1 : parseInt(goto) -1;\n var next = goto == pages ? pages : parseInt(goto) + 1; \n html += \"<tr><td colspan='8'><ul class='pagination pageslog'><li><a data-func='prev' data-pg='\" + prev + \"'>«</a></li>\";\n for( i=1; i <= pages; i++)\n {\n active = i == goto ? 'active' : '';\n html += \"<li class='\" + active + \"'><a data-pg='\" + i + \"'>\" + i + \"</a></li>\";\n }\n \n html += \"<li><a data-func='next' data-pg='\" + next + \"'>»</a></li></ul></td></tr>\";\n \n $('.SearcLogs').html(html);\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n },\n error: function() {\n waitFunc('');\n alertFunc('info', 'Something went wrong, please try again')\n }\n });\n}", "function AppendPageLinks(list) {\n let pagesNeeded = Math.ceil(list.length / maxEntriesPerPage);\n let paginationLinks = document.createElement(\"ul\");\n // Check for an existing div with \"pagination\" class ...\n let oldPaginationDiv = document.querySelector(\"div.pagination\");\n // ... If such a div exists, remove it\n if (oldPaginationDiv != null) {\n pageDiv.removeChild(oldPaginationDiv);\n }\n\n let paginationDiv = document.createElement(\"div\");\n paginationDiv.className = \"pagination\";\n paginationDiv.appendChild(paginationLinks);\n pageDiv.appendChild(paginationDiv);\n\n for (let i = 1; i <= pagesNeeded; i++) {\n paginationLinks.appendChild(CreatePageLinks(list, i));\n }\n}", "function createLink(params) {\n\n // Case 1: build new links only\n // check if this link exists in the db\n $.ajax({\n url: requrl + 'exist/' + params.from + '/' + params.to,\n type: 'get',\n // contentType: 'application/json',\n dataType: 'json',\n // async: false,\n cache: false,\n timeout: 5000,\n success: function (data) {\n // var data = $.parseJSON(data);\n if (data.count == 0) {\n $.ajax({\n data: params,\n url: requrl + 'create',\n type: 'post',\n dataType: 'json',\n cache: false,\n success: function (data) {\n console.log(data.msg + ' ' + params.from + ' --> ' + params.to);\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log('error ' + textStatus + \" \" + errorThrown);\n }\n });\n } else {\n supportLink(params);\n // forgetLink(params);\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log('error ' + textStatus + \" \" + errorThrown);\n }\n });\n}", "createLinks() \r\n\t{\r\n\t\tlet ul = document.createElement('ul');\r\n\t\t\r\n\t\tthis.pages = this.createPageLinks();\r\n\t\tthis.previous = this.createPreviousButton();\r\n\t\tthis.next = this.createNextButton();\r\n\r\n\t\tul.className = 'pagination';\r\n\t\tul.appendChild(this.previous);\r\n\r\n\t\tthis.pages.forEach(function(page) {\r\n\t\t\tul.appendChild(page);\r\n\t\t});\r\n\r\n\t\tul.appendChild(this.next);\r\n\r\n\t\treturn ul;\r\n\t}", "function rss_paginate_load_html(selected_rss_link, pagenum, current_feed_html) {\n $.ajax({\n url: g_settings.base_url + 'social/create/get_rss_feed',\n type: 'POST',\n data: 'link=' + selected_rss_link + '&pagenum=' + pagenum,\n success: function (html) {\n if (html.length > 1) {\n $loading.replaceWith(html);\n } else {\n $loading.replaceWith(current_feed_html);\n }\n $container.find('input').iCheck({\n checkboxClass: 'icheckbox_minimal-grey',\n radioClass: 'iradio_minimal-grey',\n increaseArea: '20%' // optional\n });\n }\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 getData() {\n if (xhr) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n console.log(xhr.responseText);\n // return;\n var data = JSON.parse(xhr.responseText);\n if (data.status == 1)\n switch (data.action) {\n case \"get_banner\":\n data.links.forEach(element => set_link(element));\n break;\n }\n }\n }\n }", "function createEditPagination(numberData, origen) {\n var paginador = $(\"#listPag\" + origen);\n // paginador.attr(\"sourcePage\", origen);\n paginador.attr(\"totaReg\", numberData);\n paginador.html(\"\");\n items = numberData;\n totalPages = Math.ceil(items / rowsByPage);\n\n $('<li><a href=\"#\" class=\"first_link' + origen + '\">&#9664;</a></li>').appendTo(paginador);\n $('<li><a href=\"#\" class=\"prev_link' + origen + '\">&laquo;</a></li>').appendTo(paginador);\n\n for (var b = 0; totalPages > b;)\n $('<li><a href=\"#\" class=\"page_link' + origen + '\">' + (b + 1) + \"</a></li>\").appendTo(paginador), b++;\n\n numbersByPage > 1 && ($(\".page_link\" + origen).hide(), $(\".page_link\" + origen).slice(0, numbersByPage).show());\n\n $('<li><a href=\"#\" class=\"next_link' + origen + '\">&raquo;</a></li>').appendTo(paginador);\n $('<li><a href=\"#\" class=\"last_link' + origen + '\">&#9654;</a></li>').appendTo(paginador);\n\n 0 === pagina && (paginador.find(\".page_link\" + origen + \":first\").addClass(\"active\"),\n paginador.find(\".page_link\" + origen + \":first\").parents(\"li\").addClass(\"active\"));\n\n paginador.find(\".prev_link\" + origen).hide(), paginador.find(\"li .page_link\" + origen).click(function () {\n var a = $(this).html().valueOf() - 1;\n return loadPaginationEdit(a, paginador, origen), !1;\n }), paginador.find(\"li .first_link\" + origen).click(function () {\n var a = 0;\n return loadPaginationEdit(a, paginador, origen), !1;\n }), paginador.find(\"li .prev_link\" + origen).click(function () {\n var a = parseInt(paginador.data(\"pag\")) - 1;\n return loadPaginationEdit(a, paginador, origen), !1;\n }), paginador.find(\"li .next_link\" + origen).click(function () {\n if (paginador.data(\"pag\") === undefined) {\n a = 1;\n } else {\n a = parseInt(paginador.data(\"pag\")) + 1;\n }\n return loadPaginationEdit(a, paginador, origen), !1;\n }), paginador.find(\"li .last_link\" + origen).click(function () {\n items = paginador.attr(\"totaReg\");\n totalPages = Math.ceil(items / rowsByPage);\n var a = totalPages - 1;\n return loadPaginationEdit(a, paginador, origen), !1;\n });\n}", "function appendPageLinks (list){\n\n const ul = document.createElement('ul');\n const div = document.createElement('div');\n div.className = 'pagination';\n const pageDiv = document.querySelector('div.page');\n pageDiv.appendChild(div);\n div.appendChild(ul);\n \n const NumberOfButtons = Math.ceil(list.length /10); \n \n for (let i =0 ; i<NumberOfButtons ; i++){\n \n \n const button = document.createElement('a')\n button.textContent = i+1;\n button.setAttribute(\"href\",\"#\");\n const li = document.createElement('li');\n li.appendChild(button);\n ul.appendChild(li);\n \n };\n\n const pagination = document.querySelector('div.pagination');\n pagination.addEventListener('click',(e)=>{\n\n if(e.target.tagName == 'A'){\n\n const pageNumber = e.target.textContent;\n showPage(list , pageNumber);\n };\n\n }); \n}", "function insertContent(res) {\n $(options.pagerNav).removeClass('ac-in-progress');\n toogleLoader();\n status.page++;\n setUrl($(options.link, res));\n\n var nextContent = $(options.content, res);\n if (nextContent.length) {\n var tags = $(options.appendTo, res).closest('.ac-pager-ajax').find('.tag-sortings a');\n if (tags.length) {\n\n var filter = $(options.appendTo).closest('.ac-pager-ajax').find('.tag-sortings li'),\n tagsArr = extractCurrentTags($('a', filter)),\n prepend = filter.last();\n\n $.each(tags, function(){\n if ($.inArray($(this).attr('data-filter') + \"\", tagsArr) ==-1) {\n $(this).insertBefore(prepend).wrap('<li />');\n }\n });\n }\n nextContent.hide().appendTo(options.appendTo);\n Drupal.attachBehaviors(nextContent);\n Drupal.attachBehaviors($(nextContent).closest('.ac-portfolio').find('.filter'));\n var container = $(nextContent).closest('.p-items');\n if (container.is('.ac-appearance-multigrid')){\n imagesLoaded(nextContent, function() {\n $(nextContent).fadeIn();\n var elH = parseInt(container.attr(\"data-gplus_height\")) ? parseInt(container.attr(\"data-gplus_height\")) : 350;\n //$(nextContent).css('height', elH);\n container.collage();\n });\n }else if (jQuery().isotope) {\n imagesLoaded(nextContent, function() {\n $(nextContent).fadeIn();\n $(nextContent).closest('.ac-appearance-masonry').isotope('appended', $(nextContent));\n $(nextContent).find('.ac-fluid-video').fitVids();\n $(nextContent).closest('.ac-appearance-masonry').isotope('reLayout');\n });\n };\n\n status.content = nextContent.filter(':last');\n }\n\n // No more data\n if (!status.nextUrl && options.pager) {\n $(options.pagerNav).text(Drupal.t(options.doneText));\n }\n\n status.active = false;\n }", "function requestLinks(result){\n if (result.indexOf(\"nicht eindeutig\")>-1){ //Eingabe nicht eindeutig\n console.log(\"ERROR - NICHT EINDEUTIG\\n\"); //Handle Error \n return;\n }\n if (result === null || result ===\"\"){\n console.log(\"ERROR - SOMETHING WENT WRONG\\n\"); //Handle Error \n return;\n }\n var parser=new DOMParser();\n var html = parser.parseFromString(result,\"text/html\");\n\n for (var n=0; n<6; n++){ //clear localStorage routes\n localStorage.removeItem(\"route\"+n);\n }\n\n for (var i=0; i<amountRoutes;i++){// Links in der Routen aus Tabelle lesen (die ersten i) \n console.log(\"\\n\"+ html.getElementsByClassName('timelink').item(i).firstChild.href + \"\\n\\n\");//Log Link URL\n doCORSRequestData({ //Requests für Links\n method: 'GET',\n url: html.getElementsByClassName('timelink').item(i).firstChild.href,\n data: null\n });\n\n };\n \n}", "function ajaxLinks(){\n $('.ajaxForm').submitWithAjax();\n $('a.get').getWithAjax();\n $('a.post').postWithAjax();\n $('a.put').putWithAjax();\n $('a.delete').deleteWithAjax();\n}", "function create_pagination_for(publication_list, show_per_page){\n\n // clear old pagination\n for (let i = pagination.children.length - 2; i > 1; i--){\n pagination.children[i].remove();\n }\n\n // create new pagination\n var num_publications = publication_list.length;\n\n for (let i = 2; i < (num_publications / show_per_page) + 1; i++){\n var a = document.createElement('a');\n a.appendChild(document.createTextNode(i));\n a.href = \"#publications\";\n pagination.insertBefore(a, pagination.children[i]);\n }\n\n // register onclick events\n pagination.children[0].onclick = function(){\n prev_page(publication_list, show_per_page);\n };\n for (let i = 1; i < pagination.children.length - 1; i++){\n pagination.children[i].onclick = function(){\n //console.log('page', i);\n show_page_of(publication_list, i, show_per_page);\n };\n }\n pagination.children[pagination.children.length - 1].onclick = function(){\n next_page (publication_list, show_per_page, pagination.children.length - 2);\n };\n}", "function appendPageLinks(studentsList){\n //find the div element with id page\n\n //let existingPaginationDIV=document.querySelector('.pagination');\n //if(existingPaginationDIV !== null){\n //existingPaginationDIV.parentNode.removeChild(document.querySelector('.pagination'));\n removeDOMNodeByClass('.pagination');\n // }\n const pageDIV = document.querySelector('.page');\n\n let paginationDIV = document.createElement('div');\n paginationDIV.className='pagination';\n\n let linksUL = document.createElement('ul');\n\n const pages = Math.ceil(studentsList.length/studentsPerPage);\n\n console.log(\"I will create \"+pages+\" pages\");\n\n for(let i=1;i<=pages;i++){\n\n const liElement = document.createElement('li');\n \n const linkElement = createLinkElement(i);\n linkElement.addEventListener('click', (e) =>{\n\n const page =e.target.textContent;\n console.log(\"Page to submit \"+page);\n\n removeActiveClassFromLinks();\n\n let clickedLink = e.target;\n clickedLink.className='active';\n\n showPage(studentsList,page);\n });\n\n liElement.appendChild(linkElement);\n linksUL.appendChild(liElement);\n }\n\n paginationDIV.appendChild(linksUL);\n pageDIV.appendChild(paginationDIV);\n\n}", "async function pageLinks(pag) {\n var z = await pag.links();\n return z;\n}", "function getRels(header){\n var relsArr = {};\n var temp = header.split(', ');\n var regex = /page=([0-9]+)/\n var linkRegex = /\\<([\\S]+)\\>/\n relsArr['nextLink'] = linkRegex.exec(temp[0].split('; ')[0])[1];\n relsArr['last'] = temp[1].split('; ')[0];\n relsArr['total'] = parseInt(regex.exec(temp[1].split('; ')[0])[1]);\n var foundLast = temp[1].split('; ')[1].indexOf(\"prev\");\n if(foundLast == -1){\n relsArr['isLast'] = false\n }\n else{\n relsArr['isLast'] = true\n }\n return relsArr;\n}", "function createPaginationLinks( paginationUL, listSize, pageSize ) {\n let newPageCount = Math.ceil( listSize / pageSize );\n let links = paginationUL.children\n\n function createLI( pageNum ) {\n let newLI = document.createElement('li');\n let newLink = document.createElement('a');\n newLink.href = '#';\n newLink.textContent = pageNum.toString();\n newLink.style.marginRight = '4px';\n newLI.appendChild(newLink);\n return newLI;\n }\n\n // append needed buttons\n if ( links.length < newPageCount ) {\n for ( let idx = links.length; idx < newPageCount; idx++ ) {\n paginationUL.appendChild(createLI(idx + 1));\n }\n }\n // remove unneeded button starting from the last\n else if ( newPageCount < links.length ) {\n for ( let idx = (links.length - 1); idx >= newPageCount; idx-- ) {\n paginationUL.removeChild(links[idx]);\n }\n }\n}", "function create_pagination_bar(number_posts)\n{\n let html_string = '';\n\n html_string = '<li class=\"pagination-previous\" id=\"pagination_previous\"><a href=\"#\" class=\"disabled\" aria-label=\"Previous page\">Previous</a></li>';\n html_string += '<li class=\"current\"><span class=\"show-for-sr\">You\\'re on page</span> <span id=\"current_page_number\">1</span></li>';\n html_string += '<li class=\"pagination-next\" id=\"pagination_next\"><a href=\"#\" aria-label=\"Next page\">Next</a></li>';\n\n $('#page_pagination').html(html_string);\n\n if (number_posts > 5)\n {\n $('#pagination_next a').click(function () {\n next_page();\n });\n }else{\n $('#pagination_next a').addClass('disabled').off(\"click\");\n }\n}", "function initPagination() {\n\t/*$(\"#who_quienes_somos\").trigger('click');\n\t$(\"#mostRecent\").trigger('click');*/\n\t\n\ttransitionContent($(\"#who_quienes_somos\"),$(\"#who_quienes_somos\").attr(\"data-content\"),$(\"#who_quienes_somos\").attr(\"data-bg\"));\n\ttransitionContent($(\"#mostRecent\"),$(\"#mostRecent\").attr(\"data-content\"),$(\"#mostRecent\").attr(\"data-bg\"));\n}", "_applyPagination() {\n let page = Math.ceil(this.page / this.maxSize) - 1;\n let start = page * this.maxSize;\n let end = start + this.maxSize;\n return [start, end];\n }", "function createlinks() {\n $('#links').html('');\n $.each($imgpath, function ($precounter) {\n $('<img />').attr('src', $imgpath[$precounter]);\n $('#links').append('<a class=\"navbtn\" id=\"' + $precounter + '\">' + ($precounter + 1) + '</a>');\n $('.status').append('<img class=\"preload\" id=\"' + $precounter + '\" src=\"' + $galleryajax.thumbarray[$precounter] + '\" >');\n $('#arraysize').html($arraysize + ' Total images <br>');\n });\n }", "function LoadPage(startPageNum, totalPagesNum, visiblePagesNum, listCount ,lst) {\n // Jquery Pagination - TWBS\n $('#pagination').twbsPagination({\n startPage: startPageNum, // Start Page\n totalPages: totalPagesNum, // Total Pages\n visiblePages: visiblePagesNum, // Visible Pages\n first: '<span class=\"glyphicon glyphicon-backward\" aria-hidden=\"true\"></span>', \n prev: '<span class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span>',\n next: '<span class=\"glyphicon glyphicon-chevron-right\" aria-hidden=\"true\"></span>',\n last: '<span class=\"glyphicon glyphicon-forward\" aria-hidden=\"true\"></span>',\n // Set Event - Click For Each Page\n onPageClick: function (event, page) {\n // Get Length To Loop \n var length = (listCount > (page * visiblePagesNum)) ? (page * visiblePagesNum) : listCount;\n // Clear Table \n $(\"#tableContent\").empty();\n // For Loop To Load Row In Table\n for (var i = (page - 1) * visiblePagesNum; i < length; i++) {\n $(\"#tableContent\").append(\"<tr><td>\"+ lst[i].id +\"</td><td hidden>\" + lst[i].ID + \"</td>\" +\n \"<td>\" + lst[i].Name + \"</td>\" +\n \"<td>\" + lst[i].Description + \"</td>\" +\n \"<td>\" + stringAction + \"</td></tr>\"\n );\n }\n // Load Action For Row\n LoadEvent();\n }\n });\n}", "function getRollcallsPage()\n\t{\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"/api/searchAssemble\",\n\t\t\tdata: $('#faceted-search-form').serialize() + '&sort=' + $(\"#sorting-select\").val() + '&nextId=' + nextId + \"&jsapi=1\",\n\t\t\tbeforeSend:function(){\n\t\t\t\t$('#next-page').html('Loading...').attr('disabled', 'disabled');\n\t\t\t},\n\t\t\tsuccess: function(res, status, xhr) {\n\t\t\t\tmetaPageloaded += 1;\n\t\t\t\t$(\"#results-list\").append(res);\n\t\t\t\tselectIncludedVotes();\n\t\t\t\tnextId = xhr.getResponseHeader(\"Nextid\");\n\t\t\t\tconsole.log('New next id: '+nextId);\n\t\t\t\tif(nextId==0)\n\t\t\t\t{\n\t\t\t\t\t$(\"#next-page\").html(\"End of Results\").attr(\"disabled\",\"disabled\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(\"#next-page\").html(\"Next page\").removeAttr(\"disabled\");\n\t\t\t\t\tblockAutoscroll = 0; // Request resolved.\n\t\t\t\t}\n\t\t\t\t$('[data-toggle=\"tooltip\"]').tooltip(); \n\t\t\t}\n\t\t});\n\t}", "function ajax_call(end_url){\n $.ajax({\n url: end_url,\n success: function(data){\n // Looping through our results, creating a table row element and with some member info, then appending it\n // to the table\n data.results.forEach(function(e){\n var ele = $('<tr></tr>');\n ele.append(\n \"<td><a href='/member/\" + e.id + \"'>\" + e.firstName + \" \" + e.lastName + \"</a></td>\"\n );\n ele.append(\n $(\"<td></td>\").text(e.gender)\n );\n ele.append(\n $(\"<td></td>\").text(e.memberID)\n );\n ele.append(\n $(\"<td></td>\").text(e.city)\n );\n ele.append(\n $(\"<td></td>\").text(e.pCode)\n );\n ele.append(\n $(\"<td></td>\").text(e.bDay)\n );\n ele.append(\n $(\"<td></td>\").text(e.campus)\n );\n\n // Appending the element to the table\n $('#list_member').append(ele);\n });\n\n // If this is the all the data we're getting, we hide our show more button from the user.\n if( data.next == null)\n {\n $(\"#show_more\").hide();\n }\n // Clearing out any duplicate results in the table. Duplicates can happen in the OR cases.\n removeDuplicateRows($('#list_member'));\n }\n });\n }", "function appendPageLinks(list) {\r\n //If there is pagination button, remove it\r\n if(document.querySelector('.pagination')){\r\n document.querySelector('.pagination').remove();\r\n }\r\n //Find total page number using studentPerPage\r\n const totalPageNum = parseInt(list.length/studentPerPage)+1;\r\n //Create Container(pagination)& ul Element\r\n const container = document.createElement('div');\r\n container.className='pagination';\r\n const ul = document.createElement('ul');\r\n //Create page button using totalPageNum variable\r\n for(let i = 1 ; i<= totalPageNum ; i++) {\r\n const li = document.createElement('li');\r\n const a = document.createElement('a');\r\n a.textContent = i;\r\n //Give funcitionality on page buttons\r\n a.addEventListener('click', ()=>{\r\n pageNumber = a.textContent;\r\n container.querySelector('.active').className = 'none';\r\n a.className = 'active'\r\n showPage(list, pageNumber);\r\n });\r\n if(i===1){\r\n a.className = 'active';\r\n }\r\n li.appendChild(a);\r\n ul.appendChild(li);\r\n }\r\n container.appendChild(ul);\r\n page.appendChild(container);\r\n}", "function profileLinks(uid){\n\t\n\t$('#links-profie').hide();\n\tvar iddd = addLoadingImage( $(\"#links-pro\"), \"before\", \"loading_large_purple.gif\", 575, 40);\n\tjQuery.ajax({\n url: \"/\" + PROJECT_NAME + \"profile/links-profile-listing\",\n type: \"POST\",\n dataType: \"json\",\n data : \"uid=\"+uid,\n success: function(jsonData) {\n \tvar html=\"\";\n \thtml+='<div id=\"userLinks\" style=\"font-weight: bold; width: 100%; float: right ! important; text-align:right;\">';\n \tif( jsonData.links != '' )\n \t{\t\n \t\thtml+='<a href=\"javascript:;\" class=\"showLinks\" style=\"text-decoration:none;font-weight:bold;font-family:arial;\">All Links</a>';\n \t}\t\n \tif(jsonData.mutual_status==1)\n \t{\n \t\thtml+=' | <a href=\"javascript:;\" class=\"showMutualLinks inactiveLink\" style=\"text-decoration:none;font-weight:bold;font-family:arial;\">Mutual Links</a>';\t\t\n \t} \t\n \thtml+='</div>';\n \t\n \t$(\"span#\"+iddd).remove();\n \thtml+='<div style=\"width: 100%; float: left;\" class=\"links-listing\">';\n \tif( jsonData.links != '' )\n \t{\n \t\thtml+=jsonData.links;\n \t \thtml+='</div>';\n \thtml+='<div style=\"width: 100%; float: left; display:none;\" class=\"mutual-links-listing\">';\n \thtml+='</div>';\n \t$('#links-profie').html(html);\n \t$('#links-profie').show();\n \tfireLinksEvents();\n \t}\n \telse if ( jsonData.links == '')\n \t{\n \t\t$(\"div#links-profie\").show();\n \t\t$(\"div#no_links_div\").show();\n \t}\n\t\t},\n error: function(xhr, ajaxOptions, thrownError) \n {\n \t\n\t\t}\n });\n}", "createPageLinks() \r\n\t{\r\n\t\tvar pages = [];\r\n\r\n\t\tfor(var i = 1; i <= this.totalPages; i++) {\r\n\t\t\tvar pageItem = document.createElement('li');\r\n\t\t\tvar link = document.createElement('a');\r\n\t\t\tpageItem.className = (this.current == i) ? 'page-item active' : 'page-item';\r\n\t\t\tlink.className = 'page-link';\r\n\t\t\tlink.setAttribute('href', '?page='+ i);\r\n\t\t\tlink.setAttribute('data-page-nr', i);\r\n\t\t\tlink.innerHTML = i;\r\n\t\t\tpageItem.appendChild(link);\r\n\t\t\tpages.push(pageItem);\r\n\t\t}\r\n\r\n\t\treturn pages;\r\n\t}", "function pageLink(button) {\n\tlet dataPage \t\t\t\t= $(button).data(\"page\");\n\tlet pageListChildrenLength \t= $(\"#page-list\").children().length;\n\t$.ajax({\n\t\turl \t\t: \"files_backend_ajax/backend_barang_keluar.php\",\n\t\ttype \t\t: \"POST\",\n\t\tdata \t\t: { pageListTabelBarangKeluar : dataPage, pageListChildrenLength : pageListChildrenLength },\n\t\tsuccess\t: function(responseText) {\n\t\t\t$(\"#tabelBarangKeluar\").html(responseText);\n\t\t}\n\t});\n\tfor (let i = 1; i <= pageListChildrenLength; i++) {\n\t\tif (dataPage == i) {\n\t\t\t$(\".page-circle\").removeClass(\"page-actived\");\t\n\t\t\t$(button).addClass(\"page-actived\");\n\t\t}\n\t}\n}", "function news_paginations(news,page)\n{\n\n var html = '<div class=\"row\"><div class=\"twelve columns\"><ul class=\"pagination\">',\n count = 1 ;\n \n for(i=0; i < (news.length % news_per_pages) +1; i++){\n // If is current page...\n if(page != count){\n html = html + '<li>';\n }else{ \n html = html + '<li class=\"current\">';\n }\n \n html = html + '<a href=\"#\" onclick=\"javascript:load_news('+count+');\">'+count+'</a></li>';\n count++;\n }\n\n //html = html + \"<li class='arrow'><a href=\"\" onclick='javascript:load_new(xml_news,-2);'>&raquo;</a></li>\";\n\n html = html + \"</ul></div></div>\";\n\n return html;\n \n}", "function unpaginate(response) {\n if (!gitHubApiUtils.isGitHubApiUrl(response.config.url)) {\n return response;\n }\n\n\n var nextUrl = gitHubApiUtils.parseLinkHeader(response.headers('link'))['next'];\n if (!nextUrl) {\n return response;\n }\n var $http = $injector.get('$http');\n return $http({\n url: nextUrl,\n method: 'GET',\n transformResponse: $http.defaults.transformResponse.concat([function (data) {\n return response.data.concat(data);\n }])\n });\n }", "function appendPageLinks(list) {\n\tnumOfLinks = Math.ceil(list.length / itemsPerPage);\n\n\tlet li = document.createElement(\"li\");\n\tlet newDiv = document.createElement(\"div\");\n\t\n\tnewDiv.className = \"pagination\";\n\tdocument.querySelector(\".page\").appendChild(newDiv);\n\tlet newUl = document.createElement(\"ul\");\n\tdocument.querySelector(\".pagination\").appendChild(newUl);\n\tfor (let i = 1; i <= numOfLinks; i += 1) {\n\t\tnewUl.appendChild(li);\n\t\tlet a = document.createElement(\"a\");\n\t\tli.appendChild(a);\n\t\ta.href = \"#\";\n\t\ta.innerHTML = i;\n\t\ta.addEventListener('click', (e) => {\n\t\t\tshowPage(list, e.target.textContent);\n\t\t\tlet links = document.querySelectorAll(\"a\");\n\t\t\tfor (let i = 0; i < links.length; i += 1) {\n\t\t\t\tlinks[i].className = \"\";\n\t\t\t}\n\t\t\te.target.className = \"active\";\n\t\t});\n\t}\n}", "async function ReturnAllRemaining(linkHeader, accesskey, callType) {\n var linkParser = ParseLinkHead(linkHeader);\n var remainingPages;\n\n //while there is no last page or the current page does not equal the last page\n while (\n linkParser.rels.last === undefined ||\n linkParser.rels.current.href != linkParser.rels.last.href\n ) {\n await $.ajax({\n url: corsAnywhere + linkParser.rels.next.href,\n datatype: \"jsonp\",\n headers: {\n Authorization: \"Bearer \" + accesskey,\n \"x-requested-with\": \"xhr\",\n },\n success: async function(res, status, xhr) {\n await sleep(50);\n remainingPages = xhr.getResponseHeader(\"link\");\n\n //make sure that there was a link header in the last call\n if (remainingPages != null && remainingPages != undefined) {\n if (callType == \"Students\") {\n //courseStudentData = courseStudentData.concat(res);\n } else if (callType == \"Grades\") {\n courseGradeData = courseGradeData.concat(res);\n } else if (callType == \"Assignments\") {\n courseAssignmentData = courseAssignmentData.concat(res);\n }\n\n //set the current linkparser to the new link header\n linkParser = ParseLinkHead(remainingPages);\n }\n },\n error: function(xhr) {\n console.log(xhr.responseText);\n },\n });\n\n await sleep(100);\n }\n}", "function getNavLinks(req, res) {\n\n\tlet filterVisible = (req.query.visible && req.query.visible.toLowerCase() === 'true');\n\n\tdb.getNavLinks()\n\t.then( sections => {\n\t\tsections = pageHelper.populatePageUrls(sections);\n\n\t\tif(filterVisible) sections = pageHelper.filterVisible(sections);\n\n\t\tres.json(sections);\n\t})\n\t.catch( err => {\n console.log(err);\n\t\tres.status(500).json({message: \"Problem getting navigation links\", error: err});\t//response report error\tT#D\n\t});\n\n}", "function GetListItems(){\n $.ajax({\n url: url, \n method: \"GET\", \n headers: { \n \"Accept\": \"application/json; odata=verbose\" \n },\n success: function(data){\n\n\n response = response.concat(data.d.results);\n\n console.log(data)\n\n \n if (data.d.__next) {\n url = data.d.__next;\n\n\n GetListItems();\n }\n \n\n\n },\n error: function(e){\n // error handler code goes here\n console.log(e);\n }\n });\n }", "function sms_createPageNav() {\r\n var page_number = \"\";\r\n var aContent = 0;\r\n //to begin or end href\r\n var pageBeginHref = \"\",\r\n pageLastHref = \"\";\r\n pageBeginHref = (g_sms_pageIndex==1)?\"javascript:void(0);\" : \"javascript:sms_pageNav('first')\";\r\n pageLastHref = (g_sms_pageIndex == g_sms_totalSmsPage)?\"javascript:void(0);\" : \"javascript:sms_pageNav('last')\";\r\n if('ar_sa' == LANGUAGE_DATA.current_language ||'he_il' == LANGUAGE_DATA.current_language) {\r\n $('#pageBegin_chat').attr('href', pageLastHref);\r\n $('#pageLast_chat').attr('href', pageBeginHref);\r\n } else {\r\n $('#pageBegin_chat').attr('href', pageBeginHref);\r\n $('#pageLast_chat').attr('href', pageLastHref);\r\n }\r\n //to previous or next page\r\n var prePageHref = \"\",\r\n nextPageHref = \"\";\r\n prePageHref = (g_sms_pageIndex==1)? \"javascript:void(0);\" : \"javascript:sms_pageNav('prePage')\";\r\n nextPageHref = (g_sms_pageIndex == g_sms_totalSmsPage)? \"javascript:void(0);\" : \"javascript:sms_pageNav('nextPage')\";\r\n if('ar_sa' == LANGUAGE_DATA.current_language ||'he_il' == LANGUAGE_DATA.current_language) {\r\n $('#prePage_chat').attr('href', nextPageHref);\r\n $('#nextPage_chat').attr('href', prePageHref);\r\n } else {\r\n $('#prePage_chat').attr('href', prePageHref);\r\n $('#nextPage_chat').attr('href', nextPageHref);\r\n }\r\n //\r\n var beginPage , endPage ,pageSize = 8;\r\n g_sms_pageIndex = parseInt(g_sms_pageIndex,10);\r\n if(g_sms_totalSmsPage > pageSize) {\r\n if(g_sms_pageIndex +pageSize/2 >=g_sms_totalSmsPage) {\r\n endPage = g_sms_totalSmsPage;\r\n beginPage = endPage - pageSize;\r\n } else if(g_sms_pageIndex <=pageSize/2) {\r\n beginPage = 1;\r\n endPage = beginPage +pageSize;\r\n } else {\r\n beginPage = g_sms_pageIndex>4?g_sms_pageIndex-4:1;\r\n endPage = g_sms_pageIndex +4> g_sms_totalSmsPage? g_sms_totalSmsPage:g_sms_pageIndex +4;\r\n }\r\n } else {\r\n beginPage = 1;\r\n endPage = g_sms_totalSmsPage;\r\n }\r\n if('ar_sa' == LANGUAGE_DATA.current_language ||'he_il' == LANGUAGE_DATA.current_language) {\r\n for(i=endPage;i>=beginPage;i--) {\r\n aHref = i==g_sms_pageIndex? \" href=\\\"javascript:void(0);\\\"\" : \" href=\\\"javascript:sms_pageNav('\"+i+\"')\\\" style=\\\"text-decoration:underline\\\"\";\r\n page_number += \"<a \"+aHref+\">\"+i+\"</a>\";\r\n }\r\n } else {\r\n for(i=beginPage;i<=endPage;i++) {\r\n aHref = i==g_sms_pageIndex? \" href=\\\"javascript:void(0);\\\"\" : \" href=\\\"javascript:sms_pageNav('\"+i+\"')\\\" style=\\\"text-decoration:underline\\\"\";\r\n page_number += \"<a \"+aHref+\">\"+i+\"</a>\";\r\n }\r\n }\r\n $(\"#page_num_chat\").html(page_number);\r\n}", "function paginationLinks() {\n\tdocument.addEventListener(\"click\", (e) => {\n\t\tif (e.target.parentNode.parentNode.className === 'pagination') {\n\t\t\tcurrentPage = e.target.textContent;\n\t\t\tdisplayStudents(perPage, currentPage);\n\t\t}\n\t});\n}", "function IndexInit(LangResources) {\n\n\n\n function EnableDateFilterRequests() {\n if ($('.check-range-date').is(':checked')) {\n $('#checkdate').val('true');\n $('#txt_RequestStartDate').prop(\"disabled\", false);\n $('#txt_RequestEndDate').prop(\"disabled\", false);\n } else {\n $('#checkdate').val('false');\n $('#txt_RequestStartDate').prop(\"disabled\", true);\n $('#txt_RequestEndDate').prop(\"disabled\", true);\n }\n }\n\n var StatusToSelect = $(\"#SelectedDefaultStatus\").val().split(\",\");\n\n $('#txt_RequestNumber').maxlength();\n $('#txt_Responsible').maxlength();\n function ShowHidePagesRequests(activepage, PublicPrivateSeparator) {\n $('.custompager_' + PublicPrivateSeparator).hide();\n var PageCount = $('#PageCount_' + PublicPrivateSeparator).val();\n\n $('#custom_page_' + PublicPrivateSeparator + '_1').show();\n var rango_ini = activepage - 5;\n for (var i = activepage; i > rango_ini; i--) {\n $('#custom_page_' + PublicPrivateSeparator + '_' + i).show();\n }\n if (rango_ini > 1) {\n $('<li class=\"temp_li\"><a >...</a></li>').insertAfter('#custom_page_' + PublicPrivateSeparator + '_1');\n }\n\n var rango_fin = activepage + 5;\n for (var i = activepage; i < rango_fin; i++) {\n $('#custom_page_' + PublicPrivateSeparator + '_' + i).show();\n }\n if (rango_fin < PageCount) {\n $('<li class=\"temp_li\"><a >...</a></li>').insertBefore('#custom_page_' + PublicPrivateSeparator + '_' + PageCount);\n }\n $('#custom_page_' + PublicPrivateSeparator + '_' + PageCount).show();\n\n $('.custompager_' + PublicPrivateSeparator).removeClass(\"active\");\n $('#custom_page_' + PublicPrivateSeparator + '_' + activepage).addClass(\"active\");\n }\n function ChangeStatus(NewStatus, RequestResponsibleID) {\n var RequestIDs = [];\n var SingleRequestID = $(\"#Mo_AssRes_RequestID\").val();\n if (SingleRequestID != null && SingleRequestID != \"\" && SingleRequestID != \"0\") {\n RequestIDs.push($(\"#Mo_AssRes_RequestID\").val());\n } else {\n $(\".chk_all_request:checked\").each(function () {\n RequestIDs.push($(this).data(\"requestid\"));\n });\n }\n\n ShowProgressBar();\n $.post(\"/KioskRequestAdministrator/ChangeStatusRequest\", {\n RequestIDs: RequestIDs.join(),\n NewStatus: NewStatus,\n RequestResponsibleID: RequestResponsibleID,\n Comments: $('#txta_Comment').val()\n }).done(function (data) {\n notification(\"\", data.ErrorMessage, data.notifyType);\n\n if (data.ErrorCode == 0) {\n if (NewStatus == \"Assigned\") {\n $(\"#mo_AssignRequest\").modal(\"toggle\");\n } else {\n $(\"#mo_RequestStatusChange\").modal(\"toggle\");\n }\n\n SearchRequestData();\n }\n\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n\n }\n function ValidateSelectedRequisitions() {\n var RequestIDs = [];\n var ReturnValue = true;\n\n $(\".chk_all_request:checked\").each(function () {\n RequestIDs.push($(this).data(\"requestid\"));\n });\n if (RequestIDs.length == 0) {\n ReturnValue = false;\n }\n\n return ReturnValue;\n }\n function SearchRequestData() {\n //variables\n var RequestTypeIDs = $(\"#ddl_RequestTypes\").val();\n var RequestStatusIDs = $(\"#ddl_RequestStatus\").val();\n var DepartmentIDs = $(\"#ddl_RequestDepartment\").val();\n var StartDate = $(\"#txt_RequestStartDate\").val();\n var EndDate = $(\"#txt_RequestEndDate\").val();\n var RequestResponsible = $(\"#txt_Responsible\").val();\n var FacilityIDs = $(\"#ddl_UserFacilities\").val();\n var ShiftIDs = $(\"#ddl_ShiftsList\").val();\n\n //validaciones\n if (!($(\"#checkbox-filter-date\").is(\":checked\"))) {\n StartDate = null;\n EndDate = null;\n }\n if (RequestTypeIDs != null) {\n RequestTypeIDs = $(\"#ddl_RequestTypes\").val().join();\n }\n if (RequestStatusIDs != null) {\n RequestStatusIDs = $(\"#ddl_RequestStatus\").val().join();\n }\n\n if (DepartmentIDs != null) {\n DepartmentIDs = $(\"#ddl_RequestDepartment\").val();\n }\n\n if (FacilityIDs != null) {\n FacilityIDs = $(\"#ddl_UserFacilities\").val().join(',');\n }\n\n if (FacilityIDs == null) {\n FacilityIDs = \"\";\n }\n\n if (ShiftIDs != null) {\n ShiftIDs = $(\"#ddl_ShiftsList\").val().join(',');\n }\n\n if (ShiftIDs == null) {\n ShiftIDs = \"\";\n }\n\n ShowProgressBar();\n $.get(\"/KioskRequestAdministrator/SearchRequestData\", {\n RequestNumber: $(\"#txt_RequestNumber\").val(),\n RequestTypeIDs: RequestTypeIDs,\n RequestStatusIDs: RequestStatusIDs,\n StartDate: StartDate,\n EndDate: EndDate,\n DepartmentIDs: DepartmentIDs,\n EmployeeInfo: $(\"#txt_RequestEmployee\").val(),\n RequestDescription: $(\"#txt_RequestDescription\").val(),\n RequestResponsible: RequestResponsible,\n FacilityIDs: FacilityIDs,\n ShiftIDs: ShiftIDs\n }).done(function (data) {\n $('#div_RequestList').html(data);\n RegisterPluginDataTable(100);\n\n $(\".request_row\").each(function () {\n if ($(this).data(\"requestnumber\") == $(\"#txt_RequestNumber\").val()) {\n $(this).find(\".details-control\").click();\n }\n });\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n }\n\n function PrepareMultipleList(selector, SpecialOptionsToSelect) {\n var PrepareMultipleSelected = \"\";\n if (SpecialOptionsToSelect == \"All\") {\n $(selector + \" option\").each(function (k, v) {\n $(this).attr(\"selected\", true);\n $(this).addClass(\"selected\");\n $(this).selectpicker(\"refresh\");\n PrepareMultipleSelected += \", \" + $(this).text();\n });\n } else {\n //Para que esta parte funcione, se uso una lista normal para usar el ValueID de los catalogos\n $(selector + \" option\").each(function (k, v) {\n if (SpecialOptionsToSelect.includes($(this).data(\"valueid\"))) {\n $(this).attr(\"selected\", true);\n $(this).addClass(\"selected\");\n $(this).selectpicker(\"refresh\");\n PrepareMultipleSelected += \", \" + $(this).text();\n }\n });\n }\n PrepareMultipleSelected = PrepareMultipleSelected.substr(2, PrepareMultipleSelected.length);\n $(selector).attr(\"title\", PrepareMultipleSelected);\n $(selector).selectpicker(\"refresh\");\n }\n function RequestStatusChange(StatusName, RequestNumber, AlertText, StatusTypeChange, RequestID) {\n var IsValid = false;\n if (RequestNumber != null) {\n IsValid = true\n } else {\n IsValid = ValidateSelectedRequisitions();\n }\n\n if (IsValid) {\n var RequestNumbers = \"\";\n if (RequestNumber == null) {\n $(\".chk_all_request:checked\").each(function () {\n RequestNumbers += \", \" + $(this).closest(\"tr\").data(\"requestnumber\");\n });\n RequestNumbers = RequestNumbers.substring(2, RequestNumbers.length);\n } else {\n RequestNumbers = RequestNumber\n }\n\n ShowProgressBar();\n $.get(\"/KioskRequestAdministrator/GetRequestStatusChangeModal\", {\n StatusTypeChange: StatusTypeChange,\n RequestID: RequestID\n }).done(function (data) {\n $(\"#root_modal\").html(data);\n $(\"#mo_RequestStatusChange\").modal(\"show\");\n\n $(\"#ttl_StatusChangeTitle\").text(StatusName);\n $(\"#span_RequestNumbers\").text(RequestNumbers);\n\n $(\"#span_AlertText\").text(AlertText);\n\n HideProgressBar();\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n } else {\n notification(\"\", LangResources.msg_RequisitionMandatory, \"_ntf\");\n }\n }\n\n //Date Picker\n $('.datepicker-demo').datepicker({\n autoclose: true,\n format: 'yyyy-mm-dd',\n language: LangResources.culture\n });\n //Initialize\n $(\"select\").selectpicker();\n $(\"#ddl_UserFacilities\").selectpicker('selectAll');\n $(\"#ddl_ShiftsList\").selectpicker('selectAll');\n //ShowHidePagesRequests(1, \"public\");\n $(\"#tab_PublicRequestsList\").addClass(\"active\");\n $(\".customdatepicker\").datepicker({ format: 'yyyy-mm-dd' });\n $(\"#checkbox-filter-date\").iCheck();\n PrepareMultipleList(\"#ddl_RequestTypes\", \"All\");\n PrepareMultipleList(\"#ddl_RequestStatus\", StatusToSelect);\n EnableDateFilterRequests();\n $(\"#request_count\").text($(\".notification_count\").length);\n\n if ($(\"#PostedRequestNumber\").val() != null) {\n $(\"#txt_RequestNumber\").val($(\"#PostedRequestNumber\").val());\n $(\"#pnlRequestFilters\").css(\"display\", \"none\");\n }\n SearchRequestData();\n\n //Events\n $(document).on(\"ifChanged\", \".check-range-date\", function (e) {\n e.stopImmediatePropagation();\n EnableDateFilterRequests();\n });\n\n $(document).on(\"click\", \"#btn_RequestSearch\", function (e) {\n e.stopImmediatePropagation();\n SearchRequestData();\n });\n\n $(document).on(\"click\", \".view-request\", function (e) {\n e.stopImmediatePropagation();\n ShowProgressBar();\n $.get(\"/KioskRequestAdministrator/GetViewRequestModal\", {\n RequestID: $(this).data(\"requestid\")\n }).done(function (data) {\n $(\"#root_modal\").html(data);\n $(\"#mo_RequestView\").modal(\"show\");\n HideProgressBar();\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n });\n\n $(document).on(\"change\", \".RequestFilters\", function (e) {\n e.stopImmediatePropagation();\n $(\"#div_RequestList\").html(\"\");\n });\n\n $(document).on(\"keydown\", \".RequestFilters\", function (e) {\n e.stopImmediatePropagation();\n $(\"#div_RequestList\").html(\"\");\n });\n\n $(document).on(\"change\", \".chk_all_requests\", function (e) {\n e.stopImmediatePropagation();\n if ($(this).is(\":checked\")) {\n $(\".chk_all_request\").prop('checked', true);\n } else {\n $(\".chk_all_request\").prop('checked', false);\n }\n });\n\n\n //Begin: Eventos para cambios de status por lotes\n\n $(document).on(\"click\", \"#btn_AssignRequest\", function (e) {\n e.stopImmediatePropagation();\n\n if (ValidateSelectedRequisitions()) {\n var RequestIDs = \"\"\n $(\".chk_all_request:checked\").each(function () {\n RequestIDs += \", \" + $(this).data(\"requestnumber\");\n });\n RequestIDs = RequestIDs.substr(2, RequestIDs.length);\n\n ShowProgressBar();\n $.get(\"/KioskRequestAdministrator/GetAssignResponsibleModal\", {\n\n }).done(function (data) {\n $(\"#root_modal\").html(data);\n $(\"#ddl_ResponsiblesList\").selectpicker();\n $(\"#mo_AssignRequest\").modal(\"show\");\n //$(\"#txt_AssignResponsible\").focus();\n $(\"#span_RequestNumbers\").text(RequestIDs);\n //AutoCompleteDrop();\n HideProgressBar();\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n } else {\n notification(\"\", LangResources.msg_RequisitionMandatory, \"_ntf\");\n }\n\n });\n\n $(document).on(\"click\", \"#btn_MarkDoneRequest\", function (e) {\n e.stopImmediatePropagation();\n RequestStatusChange(LangResources.lbl_MarkDone, null, null, \"MarkDone\");\n });\n\n $(document).on(\"click\", \"#btn_CancelRequest\", function (e) {\n e.stopImmediatePropagation();\n RequestStatusChange(LangResources.lbl_CancelRequest, null, LangResources.lbl_CancelRequestAlertText, \"Cancel\");\n });\n\n $(document).on(\"click\", \"#btn_CloseRequest\", function (e) {\n e.stopImmediatePropagation();\n RequestStatusChange(LangResources.btn_CloseRequest, null, null, \"Close\");\n });\n\n $(document).on(\"click\", \"#btn_RejectRequest\", function (e) {\n e.stopImmediatePropagation();\n RequestStatusChange(LangResources.lbl_RejectRequest, null, LangResources.lbl_RejectRequestAlertText, \"Reject\");\n });\n\n $(document).on(\"click\", \"#btn_ReopenRequest\", function (e) {\n e.stopImmediatePropagation();\n RequestStatusChange(LangResources.lbl_ReOpenRequest, null, LangResources.lbl_ReOpenRequestAlertText, \"ReOpen\");\n });\n\n $(document).on(\"click\", \"#btn_SaveAssignResponsible\", function (e) {\n e.stopImmediatePropagation();\n SetConfirmBoxAction(function () {\n var idAsigned = $(\"#txt_AssignResponsible option:selected\").val();\n ChangeStatus(\"Assigned\", idAsigned);\n }, LangResources.msg_ConfirmMarkRequestAssign);\n });\n\n //End: Eventos para cambios de status por lotes\n\n\n\n\n //Guardar cambios de estado en requisiciones\n $(document).on(\"click\", \"#btn_SaveRequisitionNewStatus\", function (e) {\n e.stopImmediatePropagation();\n var WarningMessage = $(this).data(\"warningmessage\");\n var StatusType = $(this).data(\"statustype\");\n\n SetConfirmBoxAction(function () {\n ChangeStatus(StatusType, \"\");\n }, WarningMessage);\n });\n\n //Paginado\n $(document).on(\"click\", \".custompager\", function (e) {\n e.stopImmediatePropagation();\n SearchRequestData();\n });\n\n\n\n //Begin: Eventos para cambios de status individuales\n\n $(document).on(\"click\", \"#btn_CloseSinglePublicRequestView\", function (e) {\n e.stopImmediatePropagation();\n $(\"#mo_RequestView\").modal(\"toggle\");\n });\n\n $(document).on(\"click\", \".btn_TblAssignResponsible\", function (e) {\n e.stopImmediatePropagation();\n var RequestID = $(this).data(\"requestid\");\n var RequestNumber = $(this).closest(\"tr\").data(\"requestnumber\");\n\n ShowProgressBar();\n $.get(\"/KioskRequestAdministrator/GetAssignResponsibleModal\", {\n RequestID: RequestID\n }).done(function (data) {\n\n $(\"#root_modal\").html(data);\n $(\"#ddl_ResponsiblesList\").selectpicker();\n $(\"#mo_AssignRequest\").modal(\"show\");\n\n //$(\"#txt_AssignResponsible\").focus();\n $(\"#Mo_AssRes_RequestID\").val(RequestID);\n $(\"#span_RequestNumbers\").text(RequestNumber);\n //AutoCompleteDrop();\n //document.getElementsByName(\"Mo_AssRes_RequestID\")[0].value = RequestID\n\n HideProgressBar();\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n });\n\n $(document).on(\"click\", \".btn_TblCancelRequest\", function (e) {\n e.stopImmediatePropagation();\n var RequestNumber = $(this).closest(\"tr\").data(\"requestnumber\");\n var RequestID = $(this).closest(\"tr\").data(\"requestid\");\n RequestStatusChange(LangResources.lbl_CancelRequest, RequestNumber, LangResources.lbl_CancelRequestAlertText, \"Cancel\", RequestID);\n });\n\n $(document).on(\"click\", \".btn_TblRejectRequest\", function (e) {\n e.stopImmediatePropagation();\n var RequestNumber = $(this).closest(\"tr\").data(\"requestnumber\");\n var RequestID = $(this).closest(\"tr\").data(\"requestid\");\n RequestStatusChange(LangResources.lbl_RejectRequest, RequestNumber, LangResources.lbl_RejectRequestAlertText, \"Reject\", RequestID);\n });\n\n $(document).on(\"click\", \".btn_TblMarkDoneRequest\", function (e) {\n e.stopImmediatePropagation();\n var RequestNumber = $(this).closest(\"tr\").data(\"requestnumber\");\n var RequestID = $(this).closest(\"tr\").data(\"requestid\");\n RequestStatusChange(LangResources.lbl_MarkDone, RequestNumber, null, \"MarkDone\", RequestID);\n\n });\n\n $(document).on(\"click\", \".btn_TblReOpen\", function (e) {\n e.stopImmediatePropagation();\n var RequestNumber = $(this).closest(\"tr\").data(\"requestnumber\");\n var RequestID = $(this).closest(\"tr\").data(\"requestid\");\n RequestStatusChange(LangResources.lbl_ReOpenRequest, RequestNumber, LangResources.lbl_ReOpenRequestAlertText, \"ReOpen\", RequestID);\n\n });\n\n $(document).on(\"click\", \".btn_TblClose\", function (e) {\n e.stopImmediatePropagation();\n var RequestNumber = $(this).closest(\"tr\").data(\"requestnumber\");\n var RequestID = $(this).closest(\"tr\").data(\"requestid\");\n RequestStatusChange(LangResources.lbl_CloseRequest, RequestNumber, LangResources.lbl_RejectRequestAlertText, \"Close\", RequestID);\n\n });\n //End: Eventos para cambios de status individuales\n\n\n\n $(\"#ddl_RequestStatus\").change(function () {\n if ($(\"#ddl_RequestStatus option:selected\").length == 0) {\n $(\"#ddl_RequestStatus\").attr(\"title\", \"\");\n $(\"#ddl_RequestStatus\").selectpicker(\"refresh\");\n }\n });\n\n $(\"#ddl_RequestTypes\").change(function () {\n if ($(\"#ddl_RequestTypes option:selected\").length == 0) {\n $(\"#ddl_RequestTypes\").attr(\"title\", \"\");\n $(\"#ddl_RequestTypes\").selectpicker(\"refresh\");\n }\n });\n\n\n\n //expandir detalles con plugin DataTable\n $(document).on('click', 'td.details-control', function (e) {\n e.stopImmediatePropagation();\n\n var tr = $(this).closest('tr');\n\n if (tr.hasClass(\"shown\")) {\n $('div.slider', tr.next()).slideUp(function () {\n tr.next().remove();\n tr.removeClass('shown');\n });\n } else {\n\n var RequestID = tr.data(\"requestid\");\n\n ShowProgressBar();\n // abrir detalles y devolver detalles de una llamada ajax\n $.get(\"/HR/KioskRequestAdministrator/GetRequestLog\", {\n RequestID\n }).done(function (data) {\n tr.after('');\n tr.after('<tr><td colspan=\"13\" class=\"padding-0\">' + data + '</td></tr>');\n tr.addClass('shown');\n $('div.slider', tr.next()).slideDown();\n HideProgressBar();\n });\n }\n });\n\n $(document).on('click', \".btn-read-notify\", function (e) {\n e.stopImmediatePropagation();\n var button = $(this);\n var RequestNotificationIDs = \"\";\n $(\".notification_count\").each(function () {\n RequestNotificationIDs += \", \" + $(this).data(\"requestnotificationid\");\n });\n\n RequestNotificationIDs = RequestNotificationIDs.substr(2, RequestNotificationIDs.length);\n $.post(\"/KioskRequestAdministrator/SetUserNotificationsReaded\", {\n RequestNotificationIDs: RequestNotificationIDs\n }).done(function (data) {\n $(\"#request_count\").text(\"0\");\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n //HideProgressBar();\n });\n });\n\n $(document).on(\"click\", \"#btnSearchUser\", function (e) {\n e.stopImmediatePropagation();\n ShowProgressBar();\n $.get('/HR/KioskRequestAdministrator/SearchADUsers', {\n UserText: $('#txtSearchUser').val()\n }).done(function (data) {\n $(\"#div_ResponsiblesResultTable\").html(data.View);\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n });\n\n $(document).on('click', '.addUserAccount', function (e) {\n e.stopImmediatePropagation();\n var info = $(this);\n var User = {\n UserAccountID: info.data(\"useraccountid\"),\n FirstName: info.data(\"firstname\"),\n eMail: info.data(\"email\")\n }\n\n ShowProgressBar();\n $.post('/HR/KioskRequestAdministrator/AddResponsibleAccount', {\n User: User\n }).done(function (data) {\n notification(\"\", data.ErrorMessage, data.notifyType);\n\n if (data.ErrorCode == 0) {\n LoadResponsibles(data.ID);\n }\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n });\n\n\n function AutoCompleteDrop() {\n ShowProgressBar();\n\n $.get(\"/KioskRequestAdministrator/FilterResponsible\", {\n SearchUserInfo: $(\"#txt_AssignResponsible\").val()\n }).done(function (data) {\n console.log(data);\n $(\"#txt_AssignResponsible\").empty();\n $.each(data.ResponsiblesList, function (k, v) {\n $(\"#txt_AssignResponsible\").append(\n \"<option id=\" + v.ID + \" value=\" + v.ID + \" data-name=\" + v.FullName + \" data-empnumber=\" + v.EmployeeNumber + \" data-department=\" + v.DepartmentName + \">\" + v.FullName + \"</option>\"\n );\n idSelectedAsign = v.ID;\n //$(\"#datalist-responsibles\").append($(\"<option>\").attr('value', v.FullName).attr(\"data-id\", v.UserID));\n\n });\n $(\"#txt_AssignResponsible\").selectpicker();\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n\n }\n\n function LoadResponsibles(IDToSelect) {\n $.get(\"/KioskRequestAdministrator/GetRequestResponsibles\", {\n UserText: null\n }).done(function (data) {\n $(\"#txt_AssignResponsible\").empty();\n $.each(data.RequestResponsiblesList, function (k, v) {\n $(\"#txt_AssignResponsible\").append('<option value=\"' + v.ID + '\">' + v.FullName + '</option>')\n });\n\n if (IDToSelect != null) {\n $(\"#txt_AssignResponsible\").val(IDToSelect);\n $(\"#txt_AssignResponsible\").selectpicker(\"refresh\");\n }\n LoadUserInfo();\n $(\"#mo_AddNewUser\").modal(\"toggle\");\n });\n }\n\n function LoadUserInfo() {\n var option = $(\"#txt_AssignResponsible option:selected\");\n var Department = option.data(\"department\");\n var EmpNumber = option.data(\"employeenumber\");\n\n $(\"#Mo_ResponsibleName\").text(option.text());\n if (Department != null && Department != \"\") {\n $(\"#Mo_ResponsibleDepartment\").text(Department);\n }\n if (EmpNumber != null && EmpNumber != \"\") {\n $(\"#Mo_ResponsibleNum\").text(EmpNumber);\n }\n }\n\n $(document).on(\"keyup\", \"#txt_Responsible\", function (e) {\n e.stopImmediatePropagation();\n var long = $(\"#txt_Responsible\").val().length;\n if (long > 1) {\n $.get(\"/KioskRequestAdministrator/GetRequestResponsibles\", {\n UserText: $(\"#txt_Responsible\").val()\n }).done(function (data) {\n $(\"#dtl_RequestResponsibles\").empty();\n $.each(data.RequestResponsiblesList, function (k, v) {\n $(\"#dtl_RequestResponsibles\").append('<option>' + v.FullName + '</option>')\n });\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n });\n }\n });\n\n $(document).on(\"keydown\", \"#txt_RequestNumber,#txt_Responsible\", function (e) {\n e.stopImmediatePropagation();\n if (e.keyCode == 13) {\n return false;\n }\n })\n\n $(document).on(\"keyup\", \"#txt_RequestNumber\", function (e) {\n e.stopImmediatePropagation();\n var long = $(\"#txt_RequestNumber\").val().length;\n if (long > 1) {\n $.get(\"/KioskRequestAdministrator/GetRequestNumbers\", {\n RequestNumber: $(\"#txt_RequestNumber\").val()\n }).done(function (data) {\n $(\"#dtl_RequestNumbers\").empty();\n $.each(data.RequestNumbersList, function (k, v) {\n $(\"#dtl_RequestNumbers\").append('<option>' + v.RequestNumber + '</option>')\n });\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n });\n }\n });\n\n $(document).on(\"shown.bs.modal\", \"#mo_AssignRequest\", function (e) {\n $(\"#txta_Comment\").focus();\n $(\"#txta_Comment\").maxlength();\n $(\"#txt_AssignResponsible\").selectpicker();\n });\n\n //Add a New User\n $(document).on('change', '#txt_AssignResponsible', function (e) {\n e.stopImmediatePropagation();\n var option = $('#txt_AssignResponsible option:selected').val();\n if (option == \"new\") {\n ShowProgressBar();\n $.get(\"/KioskRequestAdministrator/GetAddUserModal\").done(function (data) {\n $(\"#div_add_new_user\").html(data);\n $(\".select\").selectpicker();\n $(\"#mo_AddNewUser\").modal(\"show\");\n $('#txt_AssignResponsible').val(0);\n $('#txt_AssignResponsible').selectpicker(\"refresh\");\n\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n } else {\n LoadUserInfo();\n }\n });\n\n $(document).on(\"click\", \"#btn_CloseAddUserModal\", function (e) {\n $(\"#mo_AddNewUser\").modal(\"toggle\");\n });\n\n $(document).on(\"click\", \"#btn_AddUser\", function (e) {\n var ProfileField = $('#ProfileID').val();\n var ProfileArrayID = \"\";\n\n if (ProfileField != null) {\n for (var i = 0; i < ProfileField.length; i++) {\n ProfileArrayID = ProfileField[i] + \",\" + ProfileArrayID;\n }\n }\n\n ShowProgressBar();\n $.post(\"/Users/Create\", {\n UserAccountID: $(\"#UserAccountID\").val(),\n eMail: $(\"#eMail\").val(),\n EmployeeNumber: $(\"#EmployeeNumber\").val(),\n FirstName: $(\"#FirstName\").val(),\n LastName: $(\"#LastName\").val(),\n ProfileID: $(\"#ProfileID\").val(),\n DepartmentID: $(\"#DepartmentID\").val(),\n ShiftID: $(\"#ShiftID\").val(),\n DefaultCultureID: $(\"#DefaultCultureID\").val(),\n ProfileArrayID: ProfileArrayID\n }).done(function (data) {\n if (data.ErrorCode == 0) {\n LoadResponsibles(data.ID);\n }\n }).fail(function (xhr, textStatus, error) {\n notification(\"\", error.message, \"error\");\n }).always(function () {\n HideProgressBar();\n });\n });\n\n}", "function categoriesPopulator(data) {\n $('.category-pagination').remove();\n\n for (var i = 0; i < data.data.length; i++) {$('#category-pagination-div').append('<a class=\"btn dark btn-outline btn-lg category-pagination\" style = \"font-size:1.25rem;\" data-id=\"'+data.data[i].id+'\"> '+data.data[i].name+' </a>');}\n if(data.prev_page == 0){$('#prev-category').prop('disabled', true)}else{$('#prev-category').prop('disabled', false).attr('data-id',data.prev_page)}\n if(data.next_page == 0){$('#next-category').prop('disabled', true)}else{$('#next-category').prop('disabled', false).attr('data-id',data.next_page)}\n}", "function nextResultSet()\n{\n //console.log('I am in nextResultSet'+startIndex) ;\n const settings =\n {\n url: 'https://developers.zomato.com/api/v2.1/search',\n /*url: 'https://developers.zomato.com/api/v2.1/collections',*/\n headers:\n {\n \"user-key\":'cba9c1eb99c74720b299dc97c499bacd'\n },\n data:\n {\n entity_id: `${cityId}`,\n entity_type:`${entity}`,\n count: 6,\n start:startIndex\n },\n dataType: 'json',\n type: 'GET',\n success: displayData\n }\n $.ajax(settings);\n }", "function makePaginate() {\n let node = fetchNode('ul');\n node.insertAdjacentHTML('afterend', '<ul class=\"pagination\"></ul>');\n node = fetchNode('.pagination');\n for(let i = studentGroups.length; i > 0; i--){\n node.insertAdjacentHTML('afterbegin', `<li><a href=\"#\">${i}</a></li>`);\n }\n fetchNode('ul a').classList.add('active');\n}", "function generatePagination(data, totalResults, numResultsToShow) {\n\n $('#custom-pagination').twbsPagination('destroy');\n\n var numPages = totalResults / numResultsToShow;\n if (numPages < 1) {\n numPages = 1;\n }\n\n $('#custom-pagination').twbsPagination({\n totalPages: numPages,\n visiblePages: 5,\n onPageClick: function (event, page) {\n var fromResult = Number(page-1) + \"0\";\n var toResult = page + \"0\";\n generateTable(data, fromResult, toResult);\n }\n });\n\n}" ]
[ "0.7330411", "0.6607836", "0.6513387", "0.5811541", "0.5557061", "0.5507803", "0.54909295", "0.5446983", "0.543234", "0.542587", "0.5387725", "0.5383911", "0.5379717", "0.53756595", "0.53669965", "0.53365123", "0.5314789", "0.5299204", "0.52892596", "0.52864665", "0.5286134", "0.5285736", "0.5282692", "0.52759165", "0.5272617", "0.52692753", "0.524778", "0.5244964", "0.52439064", "0.52284", "0.52259517", "0.5223681", "0.52204263", "0.5218187", "0.52141106", "0.52085435", "0.5203026", "0.51907635", "0.5189676", "0.51881313", "0.5184397", "0.5184228", "0.5183348", "0.5178859", "0.51774263", "0.516871", "0.5162671", "0.5148401", "0.514432", "0.5136474", "0.5135854", "0.51321685", "0.5132105", "0.5125827", "0.5124933", "0.5120961", "0.5119301", "0.5118534", "0.51066005", "0.5105205", "0.5101282", "0.50986165", "0.5091802", "0.5074131", "0.50677717", "0.50567317", "0.505455", "0.5051182", "0.50447303", "0.50408655", "0.5039241", "0.50360763", "0.5035775", "0.5021114", "0.5020305", "0.5012757", "0.5006238", "0.5005759", "0.5005608", "0.49997628", "0.4985445", "0.4984997", "0.4979707", "0.49745873", "0.49697742", "0.49651468", "0.49602568", "0.49553868", "0.49522352", "0.49489322", "0.49361226", "0.49347344", "0.49206522", "0.49185824", "0.49146637", "0.48991498", "0.48849353", "0.48774603", "0.48716927", "0.4870597" ]
0.73538446
0
Initialize the configuration list data table.
function initDataTable(){ $('table#configurations').DataTable({ paging: false, info: false, filter: false, searching: false, ordering: true, rowId: 'uid', "order": [[ 2, "desc" ]], columns: [ {data: 'name'}, {data: 'config_type'}, { data: 'created', render: function(data, type, row){ return moment(data).format('YYYY-MM-DD'); } }, {data: 'owner'}, {data: 'filename'}, { data: 'uid', render: function(data, type, row){ var html = '<div class="checkbox">' + '<label>' + '<input id="' + row.uid + '" type="checkbox" ' + 'data-type="' + row.config_type + '" ' + 'data-filename="' + row.filename + '" ' + 'data-published="' + row.published + '" ' + 'name="config"/>' + '</label>' + '</div>'; return html } } ] }); // clear the empty results message on initial draw.. $('td.dataTables_empty').html(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initTable() {\n // set up the table column names we want to use in the table\n var columns = $.map(CONFIG.attributes, function(value){ return value; });\n \n // set up formatted column names for the table\n var names = Object.keys(CONFIG.attributes);\n // don't include column for url; we're going to format this as a link together with the unit name\n var index = $.inArray('url',names);\n columns.splice(index, 1);\n names.splice(index, 1);\n CONFIG.table_names = names;\n\n // put table column names into format we need for DataTables\n var colnames = [];\n $.each(columns, function(k, value) {\n // set up an empty object and push a sTitle keys to it for each column title\n var obj = {};\n obj['title'] = value.name;\n colnames.push(obj);\n });\n\n // initialize and keep a reference to the DataTable\n CONFIG.table = $('#table-content table').DataTable({\n data : [],\n // include the id in the data, but not searchable, nor displayed\n columnDefs : [{targets:[0], visible: false, searchable: false}],\n columns : colnames,\n autoWidth : true,\n scrollY : \"1px\", // initial value only, will be resized by calling resize();\n scrollX : true,\n lengthMenu : [50, 100, 500],\n iDisplayLength : 100, // 100 has a noticable lag to it when displaying and filtering; 10 is fastest\n dom : 'litp',\n deferRender : true, // default is false\n });\n} // init table", "function init_config_form(){\n load_config();\n build_table();\n render_plugin_data();\n }", "function build_table(){\n S.table = new Tabulator(\"#config-table\", {\n data: S.config.json.table || [],\n columns: C.column.map(function(e){\n e.downloadTitle = e.field;\n return e;\n }),\n //fit columns to width of table\n layout: \"fitColumns\",\n //hide columns that dont fit on the table\n responsiveLayout: \"hide\",\n //show tool tips on cells\n tooltips: true,\n //when adding a new row, add it to the top of the table\n addRowPos: \"top\",\n //allow undo and redo actions on the table\n history: true,\n //paginate the data\n pagination: \"local\",\n //allow 7 rows per page of data\n paginationSize: 10,\n //allow column order to be changed\n movableColumns: true,\n //allow row order to be changed\n resizableRows: true,\n /* set height of table (in CSS or here),\n * this enables the Virtual DOM and\n * improves render speed dramatically (can be any valid css height value)\n */\n height: 360\n });\n }", "function initList(){\r\n\tif(dataTableIsLoaded()){\r\n\t\tdestoryDataTable();\r\n\t}\r\n\tvar html = new EJS({url: 'javascripts/templates/list_view.ejs'}).render(internship_data);\r\n\t$(\"#list_view_body\").html(html);\r\n\tinitDataTable();\r\n}", "_initializeTable(){\n\t\tvar element = this.element,\n\t\toptions = this.options;\n\t\t\n\t\tthis.interactionMonitor.initialize();\n\t\t\n\t\tthis.columnManager.initialize();\n\t\tthis.rowManager.initialize();\n\t\t\n\t\tthis._detectBrowser();\n\t\t\n\t\t//initialize core modules\n\t\tthis.modulesCore.forEach((mod) => {\n\t\t\tmod.initialize();\n\t\t});\n\t\t\n\t\t//build table elements\n\t\telement.appendChild(this.columnManager.getElement());\n\t\telement.appendChild(this.rowManager.getElement());\n\t\t\n\t\tif(options.footerElement){\n\t\t\tthis.footerManager.activate();\n\t\t}\n\t\t\n\t\tif(options.autoColumns && options.data){\n\t\t\t\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\n\t\t}\n\t\t\n\t\t//initialize regular modules\n\t\tthis.modulesRegular.forEach((mod) => {\n\t\t\tmod.initialize();\n\t\t});\n\t\t\n\t\tthis.columnManager.setColumns(options.columns);\n\t\t\n\t\tthis.eventBus.dispatch(\"table-built\");\n\t}", "function initialize() {\n var db = getDatabase();\n db.transaction(\n function(tx) {\n // Create the settings table if it doesn't already exist\n // If the table exists, this is skipped\n tx.executeSql('CREATE TABLE IF NOT EXISTS units(name TEXT UNIQUE, quantity TEXT, value FLOAT)');\n });\n}", "function _getTableConfig(){\n return {\n 'columnNames': dataColumns,\n 'columnKeys': dataFields\n }\n }", "function WOQLTableConfig(){\n\tthis.rules = [];\n\tthis.type = \"table\";\n}", "initialise() {\n cLogger('Initialising data state');\n // listen for socket events\n socketManager.setListener(this);\n // load the users\n this.getAllUsers();\n // load the entries\n this.getAllEntries();\n }", "function init() {\n var userList = getStorage();\n var empList = userList;\n insertRow(empList);\n}", "function viewConfiguration() {\n // public API\n this.configName = ''; // @public readonly\n this.where = ''; // @public readonly contains the SQL where-clause (if any)\n this.orderBy = ''; // @public readonly contains the SQL order by-clause (if any)\n this.createFullDOM = false; // @public\n this.skipSortArrows = false; // @public\n this.useOuterScroll = false; // @public @todo - possibly implement this\n\n // internal API (used internally and by interface files)\n this.initializing = true; // @public\n this.showTotals = false; // @internal\n this.cssFiles = []; // @internal\n this.dataStores = []; // @internal\n this.restrictToCategory = null; // @internal empty strings are a valid value, so null is used for default\n this.baseColumnConfigs = []; // @internal\n this.columnConfigs = []; // @internal\n this.filterHierarchy = []; // @internal\n\n // private\n this.lookupBaseColumns = []; // for performance. send itemName, get title\n this.dbPath = ''; // base path of the main datastore. used when excel-printing\n\n // shell functions that can be overridden\n this.convertDisplayValue = function () { }\n this.convertFilterOptionText = function () { }\n this.handleFilterOptions = function () { }\n this.overrideActiveFilterValue = function () { }\n this.refreshSummary = function () { }\n this.refreshBackgroundRows = function () { }\n this.refreshProgress = function () { }\n // misc callbacks\n this.preprocessData = null;\n this.translateWord = null;\n\n /* @public api */\n this.addColumns = function (columns) {\n var isArray = (Object.prototype.toString.call(columns) === '[object Array]');\n if (isArray) {\n for (var i = 0, l = columns.length; i < l; i++) {\n this.addColumnConfig(new columnConfig(columns[i]));\n }\n }\n else {\n this.addColumnConfig(new columnConfig(columns));\n }\n }\n /* @internal api */\n this.addBaseColumnConfig = function (cfg) { \n this.baseColumnConfigs.push(cfg);\n this.lookupBaseColumns[cfg.itemName] = cfg.title;\n }\n /* @private */\n this.addColumnConfig = function (cfg) {\n this.columnConfigs.push(cfg);\n //console.log(\"added a cfg. current qty: \" + this.columnConfigs.length);\n }\n /* @internal api */\n this.getColumnConfig = function (title) {\n title = title.toLowerCase();\n for (var i = 0, l = this.columnConfigs.length; i < l; i++) {\n if (this.columnConfigs[i].title.toLowerCase() === title)\n return this.columnConfigs[i];\n }\n return null;\n }\n /* @internal api */\n this.getBaseColumnTitleFromItemName = function (itemName) { \n return this.lookupBaseColumns[itemName];\n }\n\n /* @public api */\n this.addFilter = function (fieldName, filterValue) {\t\t// filterValue can be a value or an array of values\n if (fieldName === '') {\n console.log('<warning>filter must have a valid id. skipping');\n return;\n }\n var hierarchyIndex = 0;\n var filterObject = [{ FieldName: fieldName, FieldValue: filterValue }];\n hierarchyIndex++;\n alasql('SELECT * INTO filters FROM ?', [filterObject]);\n\n var index = this.filterHierarchy.indexOf(fieldName);\n if (index === -1) { // browser support for indexOf is limited; it is not supported in Internet Explorer 7 and 8.\n this.filterHierarchy.push(fieldName);\n }\n else {\n // fieldName already exists in the hierarchy list. do nothing\n }\n //printFilters();\n }\n\n /* @internal api */\n this.replaceFilter = function (fieldName, filterValue) {\t\t// filterValue can be a value or an array of values\n if (fieldName === '') {\n console.log('<warning>filter must have a valid name. skipping');\n return;\n }\n // do not call removeFilter() since that will remove from the filterHierarchy and it will be added last instead of keeping its current position\n var sql = 'DELETE FROM filters WHERE FieldName = \"' + fieldName + '\"';\n alasql(sql);\n this.addFilter(fieldName, filterValue);\n\n // replace can be called without addFilter first being replaced, so add it if missing\n var index = this.filterHierarchy.indexOf(fieldName);\n if (index === -1) {\n this.filterHierarchy.push(fieldName);\n }\n }\n\n /* @internal api */\n this.removeFilter = function (fieldName) {\n var sql = 'DELETE FROM filters WHERE FieldName = \"' + fieldName + '\"';\n alasql(sql);\n var index = this.filterHierarchy.indexOf(fieldName);\n if (index > -1) { // browser support for indexOf is limited; it is not supported in Internet Explorer 7 and 8.\n this.filterHierarchy.splice(index, 1); // removes it from the actual array\n }\n }\n /* @internal api */\n this.clearFilters = function () {\n var sql = 'DELETE FROM filters';\n alasql(sql);\n this.filterHierarchy.length = 0;\n }\n\n // returns an array with separate values (no arrays in the array)\n /* @internal api */\n this.getActiveFilterArray = function (fieldName) {\n var sql = 'SELECT FROM filters WHERE FieldName = \"' + fieldName + '\"';\n // get active filters. note that there can be more than one active filter for a field (if addFilter() has been called more than once)\n var arrFilterValues = alasql(sql);\n var resultsArray = [];\n for (var i = 0, l = arrFilterValues.length; i < l; i++) {\n var fieldValue = arrFilterValues[i].FieldValue; // can be either a string or an array\n var isArray = (Object.prototype.toString.call(fieldValue) === '[object Array]');\n if (isArray) {\n for (var j = 0, m = fieldValue.length; j < m; j++) {\n resultsArray.push(fieldValue[j]);\n }\n }\n else {\n resultsArray.push(fieldValue);\n }\n }\n return resultsArray;\n }\n\n // if alias is used but not category, category must be set to null\n /* @public api */\n this.addDataStore = function (url, category, alias) { // category and alias are optional\n alias = $.trim(alias);\n if (alias === '')\n alias = TABLE_DEFAULT; // set default table name when none is provided\n\n if (typeof category !== 'undefined' && category !== null) {\n this.dataStores.push({ url: url, alias: alias, category: category });\n }\n else {\n this.dataStores.push({ url: url, alias: alias });\n }\n }\n\n /* @public api */\n // used when adding raw data instead of providing a datasource\n this.addData = function (data, alias) {\n alias = $.trim(alias);\n if (alias === '')\n alias = TABLE_DEFAULT; // set default table name when none is provided\n\n this.dataStores.push({ data: data, alias: alias });\n }\n\n /* @public api */\n this.addCss = function (css) {\n this.cssFiles.push(css);\n }\n /* @internal api */\n this.getSourceDbUrl = function (storeIndex) {\n var view = viewConfig.dataStores[storeIndex].url.split(',')[0];\n return view.substring(0, view.lastIndexOf('/'));\n }\n /* @internal api */\n this.getSourceView = function (storeIndex) {\n var view = viewConfig.dataStores[storeIndex].url.split(',')[0];\n return view.substring(view.lastIndexOf('/') + 1);\n }\n\n /* @public api */\n this.setDbPath = function (dbPath) {\n this.dbPath = dbPath;\n }\n /* @public api */\n this.getDbPath = function () {\n return this.dbPath;\n }\n}", "function init() {\n\t\t\tconsole.log(\"init()\");\n\t\t\tresetData();\n\t\t\trefreshTotalCount();\n\t\t\taddAdbRow();\n\t\t\tconsole.log(\"done init()\");\n\t\t}", "function TablesInit() {\n initTable($tableEmp, tableGuideHeader);\n $tableEmp.bootstrapTable('load', eFullList);\n $(\"#emp_count\").text(eFullList.length);\n\n initTable($tableProduct, tableProductHeader);\n}", "construct(config) {\n const me = this;\n super.construct(config);\n me.initHeader();\n me.rowManager.on('addrows', me.onAddRow, me);\n }", "function initializeData(listName) {\n\t\t//use a list with default values\n\t\tshoppingLists = myList;\n\t\tsessionList = shoppingLists[listName];\n\t\t//create the initial list collection in local storage\n\t\tlocalStorage.setItem(\"shoppingLists\", JSON.stringify(shoppingLists));\n\t\t//call the function to display the list on screen, but set save to false since local storage is up to date\n\t\tsessionList.forEach(function(item) {\n\t\t\taddItem(item, false);\n\t\t});\n}", "function init () {\n data.forEach((tableData) => {\n let row = tbody.append(\"tr\");\n Object.values(tableData).forEach(value => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "construct(config) {\n const me = this;\n\n super.construct(config);\n\n me.initHeader();\n\n me.rowManager.on('addrows', me.onAddRow, me);\n }", "function init()\n{\n\tvalid.add(\n\t[\n\t\t{ id:'z3950Config.name', type:'length', minSize :1, maxSize :200 },\n\t\t{ id:'z3950Config.host', type:'length', minSize :1, maxSize :200 },\n\t\t{ id:'z3950Config.host', type:'hostname' },\n\t\t{ id:'z3950Config.port', type:'integer', minValue :80, maxValue :65535, empty:true },\n\n\t\t{ id:'z3950Config.username', type:'length', minSize :0, maxSize :200 },\n\t\t{ id:'z3950Config.password', type:'length', minSize :0, maxSize :200 }\n\t]);\n\n\tgui.setupTooltips(loader.getNode('tips'));\n}", "function initialize() {\n\t\tconfig = Object.assign({}, config, $scope.config);\n\t}", "constructor(config = null) {\n this._items = [];\n if (config != null)\n this.configure(config);\n }", "constructor() {\n\n this.table = {};\n\n this.tableSize = 0;\n }", "static task_list_columnConfig() {\n return [\n {\n label: 'Task Num',\n fieldName: 'Task_Num',\n type: 'text'\n },\n {\n label: 'Task Description',\n fieldName: 'Task_Desc',\n type: 'text'\n },\n {\n label: 'Task Status',\n fieldName: 'Task_Status',\n type: 'text'\n },\n {\n label: 'Task Resolver',\n fieldName: 'Task_Resolver',\n type: 'text'\n },\n {\n label: 'Target Date',\n fieldName: 'Target_Date',\n type: 'text'\n },\n {\n label: 'SLA Time',\n fieldName: 'SLA_Time',\n type: 'text'\n },\n {\n label: 'SLA Remain Time',\n fieldName: 'SLA_Remain_Time',\n type: 'text'\n },\n {\n label: 'Reason',\n fieldName: 'Reason',\n type: 'text'\n }\n ]\n }", "function init() {\n updateBatchList();\n}", "function createConfigList() {\n var hostUrl = decodeURIComponent(getQueryStringParameter(\"SPHostUrl\"));\n var currentcontext = new SP.ClientContext.get_current();\n var hostcontext = new SP.AppContextSite(currentcontext, hostUrl);\n var hostweb = hostcontext.get_web();\n\n //Set ListCreationInfomation()\n var listCreationInfo = new SP.ListCreationInformation();\n listCreationInfo.set_title('spConfig');\n listCreationInfo.set_templateType(SP.ListTemplateType.genericList);\n var newList = hostweb.get_lists().add(listCreationInfo);\n newList.set_hidden(true);\n newList.set_onQuickLaunch(false);\n newList.update();\n\n //Set column data\n var newListWithColumns = newList.get_fields().addFieldAsXml(\"<Field Type='Note' DisplayName='Value' Required='FALSE' EnforceUniqueValues='FALSE' NumLines='6' RichText='TRUE' RichTextMode='FullHtml' StaticName='Value' Name='Value'/>\", true, SP.AddFieldOptions.defaultValue);\n\n //final load/execute\n context.load(newListWithColumns);\n context.executeQueryAsync(function () {\n console.log('spConfig list created successfully!');\n },\n function (sender, args) {\n console.error(sender);\n console.error(args);\n alert('Failed to create the spConfig list. ' + args.get_message());\n });\n }", "initialize(options) {\n this._integrationIDs = options.integrationIDs;\n this._integrationsMap = options.integrationsMap;\n\n this.list = new Djblets.Config.List(\n {},\n {\n collection: new this.listItemsCollectionType(\n options.configs,\n {\n csrfToken: options.csrfToken,\n integrationsMap: options.integrationsMap,\n model: this.listItemType,\n parse: true,\n }\n ),\n });\n\n this._popup = null;\n }", "function _fnInitalise ( )\n\t\t{\n\t\t\t/* Ensure that the table data is fully initialised */\n\t\t\tif ( _bInitialised == false )\n\t\t\t{\n\t\t\t\tsetTimeout( function(){ _fnInitalise() }, 2000 );\n\t\t\t}\n\t\t\t\n\t\t\t/* Show the display HTML options */\n\t\t\t_fnAddOptionsHtml( _nTable );\n\t\t\t\n\t\t\t/* Draw the headers for the table */\n\t\t\t_fnDrawHead( _nTable, _iDefaultSortIndex );\n\t\t\t\n\t\t\t/* If there is default sorting required - let's do it. The sort function\n\t\t\t * will do the drawing for us. Otherwise we draw the table\n\t\t\t */\n\t\t\tif ( _oFeatures.bSort )\n\t\t\t{\n\t\t\t\t_fnSort( _nTable, _iDefaultSortIndex );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t_fnDraw( _nTable );\n\t\t\t}\n\t\t}", "function initializeDb() {\n console.log(\"useDB: Initializing database.\");\n createUserListTable();\n refreshUserList();\n }", "function init() {\n tableData.forEach((sightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function extensionTableInit() {\n const res = Object.create(null);\n for (const [_key, value] of Object.entries(exports.extensionTableInput)) {\n const key = _key;\n if (res[key]) {\n continue;\n }\n extensionTableBuilderInitKey(key, value, res);\n }\n exports.superTypeDictTable = res;\n}", "function populateTableListLayout(listOutput) {\n\tif (listOutput == null) {\n\t\treturn;\n\t}\n\t\n\tvar columnsMetadata = getListColumnsMetadata();\n\tif (columnsMetadata == null) {\n\t\treturn;\n\t}\n\t\n\tclearAllTableListLayoutRows();\n\t\n\tvar lastIndex = getHighestIndex(columnsMetadata[0].id);\n\tfor (var i = 0; i <= lastIndex; i++) {\n\t\tpopulateTableListLayoutRow(listOutput, columnsMetadata, i);\n\t}\n}", "function initTableData() {\n //get all data to local variable\n getData();\n\n if (!localDb.length) return;\n\n const fragment = document.createDocumentFragment();\n\n localDb.forEach((item) => {\n const row = createTableRow(item);\n fragment.appendChild(row);\n });\n\n tBody.appendChild(fragment);\n }", "static case_list_columnConfig() {\n return [\n {\n label: 'Case Num',\n fieldName: 'Case_Num',\n type: 'text'\n },\n {\n label: 'Case Type',\n fieldName: 'Case_Type',\n type: 'text'\n },\n {\n label: 'Case Sub Type',\n fieldName: 'Case_Sub_Type',\n type: 'text'\n },\n {\n label: 'Nature',\n fieldName: 'Nature',\n type: 'text'\n },\n {\n label: 'Sub Nature',\n fieldName: 'Sub_Nature',\n type: 'text'\n },\n {\n label: 'Mobile Num',\n fieldName: 'Mobile_Num',\n type: 'text'\n },\n {\n label: 'Account Num',\n fieldName: 'Account_Num',\n type: 'text'\n },\n {\n label: 'Channel',\n fieldName: 'Channel',\n type: 'text'\n },\n {\n label: 'Network',\n fieldName: 'Network',\n type: 'text'\n },\n {\n label: 'Status',\n fieldName: 'Status',\n type: 'text'\n },\n {\n label: 'Create Date',\n fieldName: 'Create_Date',\n type: 'text'\n },\n {\n label: 'Brand',\n fieldName: 'Brand',\n type: 'text'\n }\n /* {\n label: 'Out Target Indicator',\n fieldName: 'Out_Target_Indicator',\n type: 'text'\n },\n {\n label: 'Target Date',\n fieldName: 'Target_Date',\n type: 'text'\n },\n {\n label: 'Remain Time',\n fieldName: 'Remain_Time',\n type: 'text'\n },\n {\n label: 'Close Date',\n fieldName: 'Close_Date',\n type: 'text'\n },\n {\n label: 'Bill Adjustment Status',\n fieldName: 'Bill_Adjustment_Status',\n type: 'text'\n },\n {\n label: 'Bill Adjustment Amount',\n fieldName: 'Bill_Adjustment_Amount',\n type: 'text'\n },\n {\n label: 'Bill Adjustment Reason',\n fieldName: 'Bill_Adjustment_Reason',\n type: 'text'\n },\n {\n label: 'Delete Indicate',\n fieldName: 'Delete_Indicate',\n type: 'text'\n }\n */\n ]\n }", "function initialize() {\n\n var ref = new Firebase(\"https://glaring-heat-8025.firebaseio.com/config\");\n var sync = $firebase(ref);\n var syncObject = sync.$asObject();\n syncObject.$bindTo($scope, \"config\");\n syncObject.$loaded(function(data) {\n if ('$value' in data && data.$value == null) {\n sync.$set({ \n main: 'ready?',\n status: 'get started',\n customMain: '',\n customStatus: 'shake it up',\n devices: [],\n on: false\n });\n } else {\n $scope.config.on = ($scope.config.main == 'on');\n }\n readyPusher();\n });\n\n $scope.Config = {\n me: null,\n selectedDevice: null,\n sketches: [],\n selectedSketch: null\n };\n $scope.Processing = false;\n Model.index('api/sketches').success(function(data) {\n $scope.Config.sketches = data;\n });\n }", "initialize() {\n for (const ds of this.dataSources) {\n ds.visit((node) => node.initialize());\n }\n }", "function init(){\n db = bernApp.Database.open();\n return _createTables();\n }", "function init() {\n let tBody = d3.select(\"#tableBody\");\n let allData = tdata.filter(x => x.datetime);\n buildTable(allData);\n\n createMenu(availableDate(), 'selectDate');\n createMenu(availableCities(), 'selectCity');\n createMenu(availableState(), 'selectState');\n createMenu(availableCountry(), 'selectCountry');\n createMenu(availableShape(), 'selectShape');\n}", "constructor(configTable, locationTable) {\n this.PredefinedLocation = locationTable; // MySQL location Table\n this.ConfigTable = configTable; // MySQL config Table\n this.DateBase = require('../libs/database.js'); // used for DB\n this.axios = require('axios');\n }", "constructor(config){ \r\n\t\tsuper(config)\r\n\t\tvar x = this\r\n\t\tKonekti.raw('body', this.id+'List', '', {'tag':'datalist'})\r\n\t\tx.vc().onchange = function(){\r\n\t\t\tvar value = x.vc().value\r\n\t\t\tvar i=0\r\n\t\t\twhile(i<x.options.length && x.options[i].caption!=value) i++\r\n\t\t\tif(i<x.options.length) eval(Konekti.dom.onclick(x.options[i].id,x.onselect))\r\n\t\t\telse eval(Konekti.dom.onclick(value,x.onenter))\r\n\t\t\t//x.vc().value = ''\r\n\t\t}\r\n\r\n\t\tthis.set(this.options)\r\n\t}", "function init() {\n reloadFilter(appData);\n reloadDataTable(appData);\n // fillCountryDropDown(countries)\n}", "init() {\n for (const itemKey in this._config) {\n // confirm itemKey isn't from prototype\n if (this._config.hasOwnProperty(itemKey)) {\n const itemValue = localStorage.getItem(itemKey);\n if (itemValue !== null) {\n this._config[itemKey] = itemValue;\n }\n }\n }\n }", "function tableInit() {\n let body = document.body;\n let table = document.createElement('table');\n table.id = 'BookList';\n body.appendChild(table);\n\n let tbody = document.createElement('tbody');\n tbody.id = 'TableBody';\n table.appendChild(tbody);\n\n let caption = document.createElement('caption');\n caption.appendChild(document.createTextNode('My Book List'));\n table.appendChild(caption);\n\n let thead = document.createElement('thead');\n table.appendChild(thead);\n\n let tr = document.createElement('tr');\n thead.appendChild(tr);\n\n let thArray = ['No.', 'Title', 'Author', 'Page Count', 'Read On'];\n thArray.forEach((text) => {\n let th = document.createElement('th');\n th.appendChild(document.createTextNode(text));\n tr.appendChild(th);\n });\n\n createTable();\n}", "function aq_sortable_list_init() {\n\t\t$('.aq-sortable-list').sortable({\n\t\t\tcontainment: \"parent\",\n\t\t\tplaceholder: \"ui-state-highlight\"\n\t\t});\n\t}", "function InitStatusData() {\n //Defaults\n }", "function init() {\n\n /* Get the labels necessary for the list not to be only numbers */\n $scope.staticLabelListResource = modelStaticLabelsFactory.get({model:'employee'}, function(data){\n $scope.employeeStaticLabels = data.labels;\n });\n\n /* Get the labels necessary for the list of countries not to be only codes */\n $scope.countryListResource = modelIsoLabelsFactory.get({model:'country'}, function(data){\n $scope.countries = data.labels.country;\n });\n\n $scope.currencyListResource = modelIsoLabelsFactory.get({model:'currency'}, function(data){\n $scope.currencies = data.labels.currency;\n });\n\n $scope.showNewEmployeeForm = false;\n $scope.defaultEmployee = {\n 'title_id':1,\n 'sex_id':1,\n 'country_code':'SGP',\n 'date_of_birth':'1980-01-01',\n 'race_id':1,\n 'status_id':1,\n 'work_pass_type_id':1,\n 'employee_identity_doc':[],\n 'employee_doc':[]\n };\n\n }", "loadData(state, lists) {\n state.lists = lists;\n }", "static async initializeAll() {\n let ruleList;\n\n try {\n ruleList = await this.getStorageData();\n } catch (error) {\n return console.warn(error);\n }\n\n ruleList.forEach(this.initializeRule);\n }", "function initializeConfig() {\n _config = {\n appConfig: APP_CONFIG_DATA,\n routes: [],\n currentRoute: {\n route: '/',\n data: undefined\n }\n };\n }", "function init(){ \n data.forEach((rowData) => {\n var row = tbody.append(\"tr\");\n Object.entries(rowData).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "construct(config) {\n /**\n * A counter which is incremented whenever the Collection is mutated in a meaningful way.\n *\n * If a {@link #function-splice} call results in no net replacement, removal or addition,\n * then the `generation` will not be incremented.\n * @property {Number}\n * @readonly\n */\n this.generation = 0;\n this._values = [];\n super.construct(config);\n }", "static get defaultConfig() {\n return {\n /**\n * Row height in pixels. When set to null, an empty row will be measured and its height will be used as\n * default row height, enabling it to be controlled using CSS\n * @config {Number}\n * @default null\n * @category Common\n */\n rowHeight: null,\n\n // used if no rowHeight specified and none found in CSS. not public since our themes have row height\n // specified and this is more of an internal failsafe\n defaultRowHeight: 45,\n\n /**\n * Text to display when there is no data to display in the grid\n * @config {String}\n * @default\n * @category Common\n */\n emptyText: this.L('noRows'),\n\n /**\n * Refresh entire row when a cells value changes (true) or only the cell (false).\n * @config {Boolean}\n * @default\n * @category Misc\n */\n fullRowRefresh: true,\n\n /**\n * Read only or not\n * @config {Boolean}\n * @default false\n * @category Common\n */\n readOnly: null,\n\n /**\n * True to not create any grid column headers\n * @config {Boolean}\n * @default false\n * @category Misc\n */\n hideHeaders: null,\n\n /**\n * Show \"Remove row\" item in context menu (if enabled and grid not read only)\n * @config {Boolean}\n * @default\n * @category Misc\n */\n showRemoveRowInContextMenu: true,\n\n /**\n * Automatically set grids height to fit all rows (no scrolling in the grid). In general you should avoid\n * using `autoHeight: true`, since it will bypass Grids virtual rendering and render all rows at once, which\n * in a larger grid is really bad for performance.\n * @config {Boolean}\n * @default false\n * @category Layout\n */\n autoHeight: null,\n\n /**\n * Store that holds records to display in the grid, or a store config object.\n * A store will be created if none is specified\n * @config {Common.data.Store/Object}\n * @category Common\n */\n store: {},\n\n /**\n * Data to set in grids store (a Store will be created if none is specified)\n * @config {Object[]}\n * @category Common\n */\n data: null,\n\n /**\n * Column definitions for the grid, will be used to create Column instances that are added to a ColumnStore:\n *\n * ```\n * new Grid({\n * columns : [\n * { text : 'Alias', field : 'alias' },\n * { text : 'Superpower', field : 'power' }\n * ]\n * });\n * ```\n *\n * Also accepts a store config object:\n *\n * ```\n * new Grid({\n * columns : {\n * data : [\n * { text : 'Alias', field : 'alias' },\n * { text : 'Superpower', field : 'power' }\n * ],\n * listeners : {\n * update() {\n * // Some update happened\n * }\n * }\n * }\n * });\n * ```\n *\n * This store can be accessed using {@link #property-columns}:\n *\n * ```\n * grid.columns.add({ field : 'column', text : 'New column' });\n * ```\n * @config {Object[]|Object}\n * @category Common\n */\n columns: [],\n\n /**\n * Region to which columns are added when they have none specified\n * @config {String}\n * @default\n * @category Misc\n */\n defaultRegion: 'normal',\n\n /**\n * true to destroy the store when the grid is destroyed\n * @config {Boolean}\n * @default false\n * @category Misc\n */\n destroyStore: null,\n\n /**\n * Default selection settings\n * @config {Object}\n * @default\n * @category Selection\n */\n selectionMode: {\n row: true,\n cell: true,\n multiSelect: true,\n checkbox: false\n },\n\n /**\n * Set to true to allow text selection in the grid cells\n * @config {Boolean}\n * @default false\n * @category Selection\n */\n enableTextSelection: null,\n\n /**\n * A message to be shown when a store is performing a remote operation.\n * @config {String}\n * @default \"Loading...\"\n * @category Misc\n */\n loadMask: this.L('loadMask'),\n\n /**\n * Set to `false` to inhibit column lines\n * @config {Boolean}\n * @default\n * @category Misc\n */\n columnLines: true,\n\n /**\n * Set to `true` to stretch the last column in a grid with all fixed width columns\n * to fill extra available space if the grid's width is wider than the sum of all\n * configured column widths.\n * @config {Boolean}\n * @default\n * @category Layout\n */\n fillLastColumn: true,\n\n /**\n * Set to `false` to only measure cell contents when double clicking the edge between column headers.\n * @config {Boolean}\n * @default\n * @category Layout\n */\n resizeToFitIncludesHeader: true,\n\n /**\n * Set to `false` to prevent remove row animation and remove the delay related to that.\n * @config {Boolean}\n * @default\n * @category Misc\n */\n animateRemovingRows: !BrowserHelper.isIE11, // IE11 doesn't have reliable firing of transitionend\n\n /**\n * Set to `true` to not get a warning when using another base class than GridRowModel for your grid data. If\n * you do, and would like to use the full feature set of the grid then include the fields from GridRowModel\n * in your model definition.\n * @config {Boolean}\n * @default false\n * @category Misc\n */\n disableGridRowModelWarning: null,\n\n loadMaskErrorIcon: 'b-icon b-icon-warning',\n\n headerClass: Header,\n\n testPerformance: false,\n // TODO: break out as strategies\n positionMode: 'translate', // translate, translate3d, position\n rowScrollMode: 'move', // move, dom, all\n\n /**\n * Grid monitors window resize by default.\n * @config {Boolean}\n * @default true\n * @category Misc\n */\n monitorResize: true,\n\n /**\n * An object containing Feature configuration objects (or `true` if no configuration is required)\n * keyed by the Feature class name in all lowercase.\n * @config {Object}\n * @category Common\n * @typings any\n */\n features: true,\n\n /**\n * An object containing sub grid configuration objects keyed by a `region` property.\n * By default, grid has a 'locked' region (if configured with locked columns) and a 'normal' region.\n * The 'normal' region defaults to use `flex: 1`.\n *\n * This config can be used to reconfigure the \"built in\" sub grids or to define your own.\n * ```\n * // Redefining the \"built in\" regions\n * new Grid({\n * subGridConfigs : {\n * locked : { flex : 1 },\n * normal : { width : 100 }\n * }\n * });\n *\n * // Defining your own multi region sub grids\n * new Grid({\n * subGridConfigs : {\n * left : { width : 100 },\n * middle : { flex : 1 },\n * right : { width : 100 }\n * },\n *\n * columns : {\n * { field : 'manufacturer', text: 'Manufacturer', region : 'left' },\n * { field : 'model', text: 'Model', region : 'middle' },\n * { field : 'year', text: 'Year', region : 'middle' },\n * { field : 'sales', text: 'Sales', region : 'right' }\n * }\n * });\n * ```\n * @config {Object}\n * @category Misc\n */\n subGridConfigs: {\n normal: { flex: 1 }\n },\n\n /**\n * Configures whether the grid is scrollable in the `Y` axis. This is used to configure a {@link Grid.util.GridScroller}.\n * See the {@link #config-scrollerClass} config option.\n * @config {Object}\n * @category Scrolling\n */\n scrollable: {\n // Just Y for now until we implement a special grid.view.Scroller subclass\n // Which handles the X scrolling of subgrids.\n overflowY: true\n },\n\n /**\n * The class to instantiate to use as the {@link #config-scrollable}. Defaults to {@link Grid.util.GridScroller}.\n * @config {Common.helper.util.Scroller}\n * @internal\n * @category Scrolling\n */\n scrollerClass: GridScroller,\n\n /**\n * Configure as `true` to have the grid show a red \"changed\" tag in cells who's\n * field value has changed and not yet been committed.\n * @config {Boolean}\n * @default false\n * @category Misc\n */\n showDirty: null,\n\n loadMaskHideTimeout: 3000,\n\n refreshSuspended: 0\n\n // Grid requires a size to be considered visible\n //requireSize : true\n };\n }", "function init() {\n\t\t\tresetData();\n\t\t\trefreshTotalCount();\n\t\t\tloadVocabs();\n\t\t}", "function setupDataTables() {\n $('table').DataTable({ \n iDisplayLength: 5,\n aLengthMenu: [5, 10, 25, 50, 100], \n });\n }", "function init(options) {\n return initTable();\n }", "get_config_data() {\n return {}\n }", "function initData(){\n if (_users){\n return;\n }\n _users = [];\n _users['user1'] = {\n username: 'user1',\n password: 'password', \n };\n _users['user2'] = {\n username: 'user2',\n password: 'password',\n };\n}", "function initTable() {\n $table.bootstrapTable('destroy').bootstrapTable({\n height: 550,\n pagination: true,\n showPaginationSwitch: false,\n search: true,\n ajax: ajaxRequest,\n pageSize: 10,\n pageList: [10, 25, 50, 100],\n responseHandler: responseHandler,\n detailFormatter: detailFormatter,\n columns: [\n [{\n field: 'state',\n checkbox: true,\n align: 'center',\n valign: 'middle'\n }, {\n title: 'ID',\n field: 'id',\n align: 'center',\n valign: 'middle',\n sortable: false,\n }, {\n field: 'url',\n title: $rootScope.t('Preview'),\n sortable: false,\n align: 'center',\n formatter: previewFormatter\n },{\n field: 'isimage',\n title: $rootScope.t('Image'),\n sortable: true,\n align: 'center',\n }, {\n field: 'iscover',\n title: $rootScope.t('Cover'),\n sortable: true,\n align: 'center',\n }, {\n field: 'title',\n title: $rootScope.t('Title'),\n sortable: true,\n align: 'center',\n }, {\n field: 'module_name',\n title: $rootScope.t('Module'),\n sortable: true,\n align: 'center',\n }, {\n field: 'module_obj_id',\n title: $rootScope.t('Module') + 'ID',\n sortable: true,\n align: 'center',\n }, {\n field: 'weight',\n title: $rootScope.t('Weight'),\n sortable: true,\n align: 'center',\n }, {\n field: 'url',\n title: 'URL',\n sortable: false,\n align: 'left',\n formatter: urlFormatter\n },{\n field: 'imagetype',\n title: $rootScope.t('File Type'),\n sortable: false,\n align: 'center',\n },{\n field: 'filesize',\n title: $rootScope.t('Size'),\n sortable: false,\n align: 'center',\n },{\n field: 'mimetype',\n title: 'MIMETYPE',\n sortable: false,\n align: 'center',\n }, {\n field: 'operate',\n title: $rootScope.t('Operate'),\n align: 'center',\n events: window.operateEvents,\n formatter: operateFormatter\n }]\n ]\n })\n \n $table.on('check.bs.table uncheck.bs.table ' +\n 'check-all.bs.table uncheck-all.bs.table',\n function () {\n $remove.prop('disabled', !$table.bootstrapTable('getSelections').length)\n $attachments.prop('disabled', !$table.bootstrapTable('getSelections').length)\n // save your data, here just save the current page\n selections = getIdSelections()\n // push or splice the selections if you want to save all data selections\n })\n \n $table.on('expand-row.bs.table', function (e, index, row, $detail) {\n })\n \n $table.on('all.bs.table', function (e, name, args) {\n //console.log(name, args)\n }) \n }", "function initdb(config) {\n var db = new sqlite3.Database(config.db);\n var check;\n\n db.serialize(function () {\n db.run(\"CREATE TABLE if not exists items (id INTEGER PRIMARY KEY AUTOINCREMENT, item VARCHAR(50), qty NUMERIC, type INTEGER, done INTEGER DEFAULT 0, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)\");\n db.run(\"CREATE TABLE if not exists types (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50))\");\n\n var types = [];\n types.push({'name': 'Qty'});\n types.push({'name': 'Kg'});\n\n var stmt = db.prepare(\"INSERT INTO types (id, name) VALUES (null, ?)\");\n\n for (var i = 0; i < types.length; i++) {\n stmt.run(types[i].name);\n }\n\n stmt.finalize();\n });\n\n db.close();\n}", "initSettings() {\n this.ignoredColumnById('rowStatus');\n this.setInlineActionableMode();\n this.sortColumn = { sortField: null, sortAsc: true };\n this.gridCount = $('.datagrid').length + 1;\n this.lastSelectedRow = 0; // Remember index to use shift key\n\n this.contextualToolbar = this.element.prev('.contextual-toolbar');\n this.contextualToolbar.addClass('datagrid-contextual-toolbar');\n }", "static ad_list_columnConfig() {\n return [\n {\n label: 'Admin Code',\n fieldName: 'Admin_Code',\n type: 'text'\n },\n {\n label: 'Description(English)',\n fieldName: 'Description_En',\n type: 'text'\n },\n {\n label: 'Description(Traditional Chinese)',\n fieldName: 'Description_Tc',\n type: 'text'\n },\n {\n label: 'Description(Simplified Chinese)',\n fieldName: 'Description_Sc',\n type: 'text'\n },\n {\n label: 'Admin Code Filtering',\n fieldName: 'Admin_Code_Filtering',\n type: 'text'\n },\n {\n label: 'Admin Code Mapping',\n fieldName: 'Admin_Code_Mapping',\n type: 'text'\n },\n {\n label: 'Delete Indicate',\n fieldName: 'Delete_Indicate',\n type: 'text'\n },\n {\n type: 'action',\n typeAttributes: {\n rowActions: [{ label: 'Delete', name: 'delete' }]\n }\n }\n ]\n }", "function _fnInitalise(oSettings) {\n\t\t\tvar i, iLen;\n\n\t\t\t/* Ensure that the table data is fully initialised */\n\t\t\tif (oSettings.bInitialised === false) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t_fnInitalise(oSettings);\n\t\t\t\t}, 200);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/* Show the display HTML options */\n\t\t\t_fnAddOptionsHtml(oSettings);\n\n\t\t\t/* Draw the headers for the table */\n\t\t\t_fnDrawHead(oSettings);\n\n\t\t\t/* Okay to show that something is going on now */\n\t\t\t_fnProcessingDisplay(oSettings, true);\n\n\t\t\t/* Calculate sizes for columns */\n\t\t\tif (oSettings.oFeatures.bAutoWidth) {\n\t\t\t\t_fnCalculateColumnWidths(oSettings);\n\t\t\t}\n\n\t\t\tfor (i = 0, iLen = oSettings.aoColumns.length; i < iLen; i++) {\n\t\t\t\tif (oSettings.aoColumns[i].sWidth !== null) {\n\t\t\t\t\toSettings.aoColumns[i].nTh.style.width = _fnStringToCss(oSettings.aoColumns[i].sWidth);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * If there is default sorting required - let's do it. The sort\n\t\t\t * function will do the drawing for us. Otherwise we draw the table\n\t\t\t * regardless of the Ajax source - this allows the table to look\n\t\t\t * initialised for Ajax sourcing data (show 'loading' message\n\t\t\t * possibly)\n\t\t\t */\n\t\t\tif (oSettings.oFeatures.bSort) {\n\t\t\t\t_fnSort(oSettings);\n\t\t\t} else {\n\t\t\t\toSettings.aiDisplay = oSettings.aiDisplayMaster.slice();\n\t\t\t\t_fnCalculateEnd(oSettings);\n\t\t\t\t_fnDraw(oSettings);\n\t\t\t}\n\n\t\t\t/* if there is an ajax source load the data */\n\t\t\tif (oSettings.sAjaxSource !== null\n\t\t\t\t\t&& !oSettings.oFeatures.bServerSide) {\n\t\t\t\toSettings.fnServerData\n\t\t\t\t\t\t.call(\n\t\t\t\t\t\t\t\toSettings.oInstance,\n\t\t\t\t\t\t\t\toSettings.sAjaxSource,\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\tfunction(json) {\n\t\t\t\t\t\t\t\t\t/* Got the data - add it to the table */\n\t\t\t\t\t\t\t\t\tfor (i = 0; i < json.aaData.length; i++) {\n\t\t\t\t\t\t\t\t\t\t_fnAddData(oSettings, json.aaData[i]);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t * Reset the init display for cookie saving.\n\t\t\t\t\t\t\t\t\t * We've already done a filter, and\n\t\t\t\t\t\t\t\t\t * therefore cleared it before. So we need\n\t\t\t\t\t\t\t\t\t * to make it appear 'fresh'\n\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\toSettings.iInitDisplayStart = oSettings._iDisplayStart;\n\n\t\t\t\t\t\t\t\t\tif (oSettings.oFeatures.bSort) {\n\t\t\t\t\t\t\t\t\t\t_fnSort(oSettings);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\toSettings.aiDisplay = oSettings.aiDisplayMaster\n\t\t\t\t\t\t\t\t\t\t\t\t.slice();\n\t\t\t\t\t\t\t\t\t\t_fnCalculateEnd(oSettings);\n\t\t\t\t\t\t\t\t\t\t_fnDraw(oSettings);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t_fnProcessingDisplay(oSettings, false);\n\t\t\t\t\t\t\t\t\t_fnInitComplete(oSettings, json);\n\t\t\t\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Server-side processing initialisation complete is done at the end\n\t\t\t * of _fnDraw\n\t\t\t */\n\t\t\tif (!oSettings.oFeatures.bServerSide) {\n\t\t\t\t_fnProcessingDisplay(oSettings, false);\n\t\t\t\t_fnInitComplete(oSettings);\n\t\t\t}\n\t\t}", "function initTableFromAry(){\n\t//setPaginationActiveClass(1);\n\t//var num_pages = rebuildTableFromAry();\n\t//rebuildPagination(num_pages);\n}", "initialize(config) {}", "function initTable() {\n var table = document.getElementById('my_table');\n utils.removeAllChildren(table); // in case one of the catalogs got updated\n\n //table.appendChild( initColGroup());\n table.appendChild( initTHead());\n table.appendChild( initTBody());\n}", "function init_listjs() {\n // Setup - add a text input to each footer cell\n $('#pricing_products_table tfoot th').each( function () {\n var title = $('#pricing_products_table thead th').eq( $(this).index() ).text();\n $(this).html( '<input size=10 type=\"text\" placeholder=\"Search '+title+'\" />' );\n } );\n\n var table = $('#pricing_products_table').DataTable({\n \"paging\":false,\n \"info\":false,\n \"order\": [[ 0, \"desc\" ]]\n });\n\n //Add the bootstrap classes to the search thingy\n $('div.dataTables_filter input').addClass('form-control search search-query');\n $('#pricing_products_table_filter').addClass('form-inline pull-right');\n $(\"#pricing_products_table_filter\").appendTo(\"h1\");\n $('#pricing_products_table_filter label input').appendTo($('#pricing_products_table_filter'));\n $('#pricing_products_table_filter label').remove();\n $(\"#pricing_products_table_filter input\").attr(\"placeholder\", \"Search table...\");\n // Apply the search\n table.columns().every( function () {\n var that = this;\n $( 'input', this.footer() ).on( 'keyup change', function () {\n that\n .search( this.value )\n .draw();\n } );\n } );\n}", "function init_log_table(){\n\t\t\n\t\tvar columns = [\n\t\t\t\t\t\t{ \"title\": \"FECHA\", \"data\": \"date\", \"class\": \"center\", \"width\": \"15%\" },\n\t\t\t\t\t\t{ \"title\": \"HORA\", \"data\": \"date\", \"class\": \"center\", \"width\": \"15%\" },\n\t\t\t\t\t\t{ \"title\": \"USUARIO\", \"data\": \"user\", \"class\": \"center\", \"width\": \"20%\" },\n\t\t\t\t\t\t{ \"title\": \"ACCIÓN\", \"data\": \"action\", \"class\": \"left\", \"width\": \"25%\" },\n\t\t\t\t\t\t{ \"title\": \"DETALLE\", \"data\": \"details\", \"class\": \"left\", \"width\": \"25%\" }\n\t\t\t\t\t ];\n\t\tvar columnDefs = [{\t\t\"targets\": 0,\n\t\t\t\t\t\t\t\t\"render\": function( data, type, row ){\n\t\t\t\t\t\t\t\t\treturn data.substr(0,10);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t },\n\t\t\t\t\t\t {\t\t\"targets\": 1,\n\t\t\t\t\t\t\t \t\"render\": function( data, type, row){\n\t\t\t\t\t\t\t \t\treturn data.substr(11,12);\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t }];\n\n\t\tdt = $('table#log-data').dataTable({\n\t\t\t\t\n\t\t\t\"data\": [],\n\t\t\t\"lengthMenu\": [ 5, 10, 20, 30 ],\n\t\t\t\"pageLength\": 10,\n\t\t\t\"pagingType\": \"full_numbers\",\n\t\t\t\"order\": [[ 0, \"desc\" ],[ 1, \"desc\"]],\n\t\t\t\"dom\": '<\"l-cant\">lrtTip',\n\t\t\t\"tableTools\": {\n\t\t\t\t\"aButtons\": [],\n\t\t\t\tfnRowSelected: function(){},\n\t\t\t\tfnRowDeselected: function(){}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t},\n\t\t\t\"columns\": columns,\n\t\t\t\"columnDefs\": columnDefs,\n\t\t\t\"language\": {\n\t \"lengthMenu\": \"Mostrar _MENU_ datos por página\",\n\t \"zeroRecords\": \"Sin datos para mostrar\",\n\t \"info\": \"Mostrando página _PAGE_ de _PAGES_\",\n\t \"infoEmpty\": \"Sin datos para mostrar\",\n\t \"infoFiltered\": \"(filtrados de un total de _MAX_ datos)\",\n\t\t\t \"emptyTable\": \"Sin datos para mostrar\",\n\t\t\t \"infoPostFix\": \"\",\n\t\t\t \"thousands\": \".\",\n\t\t\t \"loadingRecords\": \"Cargando...\",\n\t\t\t \"processing\": \"Procesando...\",\n\t\t\t \"search\": \"Buscar:\",\n\t\t\t \"paginate\": {\n\t\t\t \"first\": \"Primera\",\n\t\t\t \"last\": \"Última\",\n\t\t\t \"next\": \"Siguiente\",\n\t\t\t \"previous\": \"Anterior\"\n\t\t\t },\n\t\t\t \"aria\": {\n\t\t\t \"sortAscending\": \": Click para ordenar ascendentemente\",\n\t\t\t \"sortDescending\": \": Click para ordenar descendentemente\"\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\t$('div.l-cant').html('Resultado: <b>0</b> datos');\n\t}", "function init() {\n \n \n mostrarForm(false);\n listar();\n }", "function initializeRows() {\n blogContainer.empty();\n var productsToAdd = [];\n for (var i = 0; i < products.length; i++) {\n productsToAdd.push(createNewRow(products[i]));\n }\n blogContainer.append(productsToAdd);\n }", "function aq_sortable_list_init() {\n\t\t$('.aq-sortable-list').sortable({\n\t\t\tcontainment: \"parent\",\n\t\t\tplaceholder: \"ui-state-highlight\",\n\t\t\topacity: 0.6,\n\t\t\tcursor: 'move',\n\t\t\trevert: true\n\t\t});\n\t}", "function initData(callback) {\n initLanguage(); // set the system language if not set\n DB.loadAll(function() {\n if(getUsers() === null){\n setUsers(DB.users);\n console.log('storing users in localStorage');\n }\n if(getBeverages() === null){\n setBeverages(DB.beverages);\n console.log('Storing beverages in localstorage');\n }\n if(getOrders() === null){\n setOrders([]);\n }\n if(callback) callback();\n });\n}", "function initData() {\n initLtr_factor();\n initBosunit();\n initHero();\n initSelect25();\n initMS();\n}", "function clearData () {\n getSetUpList().forEach(function (entry) {\n if (entry.list) {\n entry.factory.initList(entry.id);\n } else {\n entry.factory.initObj(entry.id);\n }\n });\n }", "function initDataTable(){\n $('table#configurations').DataTable({\n paging: false,\n info: false,\n filter: false,\n searching: false,\n ordering: true,\n rowId: 'uid',\n \"order\": [[ 2, \"desc\" ]],\n columns: [\n {data: 'name'},\n {data: 'config_type'},\n {\n data: 'created',\n render: function(data, type, row){\n return moment(data).format('YYYY-MM-DD');\n }\n },\n {\n data: 'filename',\n render: function(data, type, row){\n return '<a href=\"' + row.upload + '\" target=\"_blank\">' + data + '</a>';\n }\n },\n { data: 'owner'},\n {\n data: 'published',\n orderable:false,\n render: function(data, type, row){\n var published = row.published;\n var owner = $('span#user').text();\n var $div = $('<div>');\n var $pubSpan = $('<span class=\"glyphicon\"></span>');\n $div.append($pubSpan);\n if (owner === row.owner) {\n var $userSpan = $('<span class=\"glyphicon glyphicon-user\"></span>');\n $div.append($userSpan);\n }\n else {\n var $userSpan = $('<span class=\"fa fa-users\"></span>');\n $div.append($userSpan);\n }\n if (published) {\n $pubSpan.addClass('glyphicon-globe');\n }\n else {\n $pubSpan.addClass('glyphicon-minus-sign');\n }\n // return the html\n return $div[0].outerHTML;\n }\n },\n {\n data: 'uid',\n orderable:false,\n render: function(data, type, row){\n var user = $('span#user').text();\n if (row.owner === user) {\n return '<button title=\"Delete this configuration file\" id=\"' + data + '\" type=\"button\" class=\"delete-file btn btn-danger btn-sm pull-right\">' +\n 'Delete</button>';\n }\n else {\n return '';\n }\n }\n }\n ],\n rowCallback: function(row, data, index){\n var user = $('span#user').text();\n var owner = user === data.owner ? 'me' : data.owner;\n var $pubSpan = $(row).find('.glyphicon-globe');\n var $unpubSpan = $(row).find('.glyphicon-minus-sign');\n var $users = $(row).find('.fa-users');\n var $user = $(row).find('.glyphicon-user');\n if (data.published) {\n $pubSpan.tooltip({\n 'html': true,\n 'title': gettext('Published preset')\n });\n }\n else {\n $unpubSpan.tooltip({\n 'html': true,\n 'title': gettext('Private preset')\n });\n }\n $users.tooltip({\n 'html': true,\n 'title': gettext('Created by ') + owner\n });\n $user.tooltip({\n 'html': true,\n 'title': gettext('Created by ') + owner\n });\n }\n });\n // clear the empty results message on initial draw..\n $('td.dataTables_empty').html('');\n }", "function init_checkin_habits_data_table(table) {\n\ttable.addColumn(\"string\", \"Day\");\n\n\t// Add hour columns\n\t$.each([\"12 am\", \"2\", \"4\", \"6\", \"8\", \"10 am\", \"12 pm\", \"2\", \"4\", \"6\", \"8\", \"10 pm\"], function (idx, value) {\n\t\ttable.addColumn(\"number\", value);\n\t});\n\n\t// Add days.\n\t$.each([\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], function (idx, value) {\n\t\ttable.addRow([value, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n\t});\n}", "function init() {\n if (window._env === 'development') console.debug('INIT');\n initFilters();\n initCountrySearch();\n initTableHeader();\n initTableDownload();\n }", "function initialize(wf_list_id) {\n // Load all the workflows from the database\n // workflows = db.get_workflows();\n // console.log('Workflows');\n // console.log(workflows);\n // // Setup workflow list and populate it with stuff from database\n workflow_list = new WorkflowList(wf_list_id);\n // for (workflow in workflows) {\n // workflow_list.add(workflow);\n // }\n}", "constructor(init) {\n init = init || {};\n this.content = {\n date: init.date || new Date().toISOString(),\n version: require('../package.json').version,\n tables: init.tables || [],\n columns: {},\n rows: {},\n data: init.data || {},\n };\n }", "constructor(list, data) {\n this._list = list;\n this._data = data;\n }", "function _fnInitalise ( oSettings )\n\t\t{\n\t\t\tvar i, iLen;\n\t\t\t\n\t\t\t/* Ensure that the table data is fully initialised */\n\t\t\tif ( oSettings.bInitialised === false )\n\t\t\t{\n\t\t\t\tsetTimeout( function(){ _fnInitalise( oSettings ); }, 200 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t/* Show the display HTML options */\n\t\t\t_fnAddOptionsHtml( oSettings );\n\t\t\t\n\t\t\t/* Draw the headers for the table */\n\t\t\t_fnDrawHead( oSettings );\n\t\t\t\n\t\t\t/* Okay to show that something is going on now */\n\t\t\t_fnProcessingDisplay( oSettings, true );\n\t\t\t\n\t\t\t/* Calculate sizes for columns */\n\t\t\tif ( oSettings.oFeatures.bAutoWidth )\n\t\t\t{\n\t\t\t\t_fnCalculateColumnWidths( oSettings );\n\t\t\t}\n\t\t\t\n\t\t\tfor ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t{\n\t\t\t\tif ( oSettings.aoColumns[i].sWidth !== null )\n\t\t\t\t{\n\t\t\t\t\toSettings.aoColumns[i].nTh.style.width = _fnStringToCss( oSettings.aoColumns[i].sWidth );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* If there is default sorting required - let's do it. The sort function will do the\n\t\t\t * drawing for us. Otherwise we draw the table regardless of the Ajax source - this allows\n\t\t\t * the table to look initialised for Ajax sourcing data (show 'loading' message possibly)\n\t\t\t */\n\t\t\tif ( oSettings.oFeatures.bSort )\n\t\t\t{\n\t\t\t\t_fnSort( oSettings );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\toSettings.aiDisplay = oSettings.aiDisplayMaster.slice();\n\t\t\t\t_fnCalculateEnd( oSettings );\n\t\t\t\t_fnDraw( oSettings );\n\t\t\t}\n\t\t\t\n\t\t\t/* if there is an ajax source load the data */\n\t\t\tif ( oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )\n\t\t\t{\n\t\t\t\toSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, [], function(json) {\n\t\t\t\t\t/* Got the data - add it to the table */\n\t\t\t\t\tfor ( i=0 ; i<json.aaData.length ; i++ )\n\t\t\t\t\t{\n\t\t\t\t\t\t_fnAddData( oSettings, json.aaData[i] );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* Reset the init display for cookie saving. We've already done a filter, and\n\t\t\t\t\t * therefore cleared it before. So we need to make it appear 'fresh'\n\t\t\t\t\t */\n\t\t\t\t\toSettings.iInitDisplayStart = oSettings._iDisplayStart;\n\t\t\t\t\t\n\t\t\t\t\tif ( oSettings.oFeatures.bSort )\n\t\t\t\t\t{\n\t\t\t\t\t\t_fnSort( oSettings );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\toSettings.aiDisplay = oSettings.aiDisplayMaster.slice();\n\t\t\t\t\t\t_fnCalculateEnd( oSettings );\n\t\t\t\t\t\t_fnDraw( oSettings );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t_fnProcessingDisplay( oSettings, false );\n\t\t\t\t\t_fnInitComplete( oSettings, json );\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t/* Server-side processing initialisation complete is done at the end of _fnDraw */\n\t\t\tif ( !oSettings.oFeatures.bServerSide )\n\t\t\t{\n\t\t\t\t_fnProcessingDisplay( oSettings, false );\n\t\t\t\t_fnInitComplete( oSettings );\n\t\t\t}\n\t\t}", "function initData () {\n\t\t\tdefaultSlickCallbacks = {\n\t\t\t\tonInit: function(slick) {\n\t\t\t\t\t//slick.$slides.each(function (i, el) {\n\t\t\t\t\t//});\n\n\t\t\t\t\tslick.$slider.addClass(\"ibm-carousel\");\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Merge configs then dupe for camelcase settings since data-attr can't do camelcase.\n\t\t\tconfig = $.extend({}, defaults, defaultSlickCallbacks, $container.data() || {}, settings);\n\t\t\tconfig.adaptiveHeight = config.adaptiveheight;\n\t\t\tconfig.autoplaySpeed = config.autoplayspeed;\n\t\t\tconfig.variableWidth = config.variablewidth;\n\t\t}", "function initNgTableStructure() {\n vm.tableParams = new ngTableParams({\n page: 1, // show first page\n count: 10, // count per page\n sorting: {\n name: 'asc' // initial sorting\n }\n }, {\n total: 0, // length of data\n getData: function ($defer, params) {\n var orderedData = params.sorting() ? $filter('orderBy')(vm.testCases, params.orderBy()) : vm.testCases;\n\n var orderedDataNew = [];\n angular.forEach(orderedData, function (testCase) {\n for (var i = 0; i < vm.testNamesToRun.length; i++) {\n if (testCase.testName === vm.testNamesToRun[i]){\n orderedDataNew.push(testCase);\n }\n }\n testCase.expanded = false;\n if (angular.isDefined(testCase.actual)) {//init view properties, which are not going to go to DS\n testCase.expectedText = JSON.stringify(testsuiteService.arrayPropertiesToStrings(testCase.expected), null, PRETTY_PRINT_INDENT);\n testCase.actualText = JSON.stringify(testsuiteService.arrayPropertiesToStrings(testCase.actual), null, PRETTY_PRINT_INDENT);\n }\n });\n\n if (vm.testNamesToRun.length !=0) {\n orderedData = orderedDataNew;\n }\n // use built-in angular filter\n orderedData = params.filter() ? $filter('filter')(orderedData, params.filter()) : orderedData;\n\n params.total(orderedData.length); // set total for recalc pagination\n var totalPages = Math.max(1, Math.ceil(params.total() / params.count()));\n if (params.page() > totalPages) {\n params.page(totalPages);\n }\n orderedData = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count());\n $defer.resolve(orderedData);\n }\n });\n //workaround for https://github.com/esvit/ng-table/issues/297\n vm.tableParams.settings().$scope = $scope;\n }", "function init() {\n // Get all entries\n LEDGER.GETALL().then(function successCallback(res) {\n $scope.entries = res.data;\n if (res.data.length > 0) {\n $scope.entriesExist = true;\n } else {\n $scope.entriesExist = false;\n }\n }, function errorCallback(res) {\n console.log(res.data.status);\n });\n\n // Get all categories\n CATEGORY.GETALL().then(function successCallback(res) {\n // Category options\n $scope.categoryOptions = [];\n res.data.forEach(function(element) {\n $scope.categoryOptions.push(element.name);\n }, this);\n $scope.categoryOptions.push('category');\n $scope.categoryOptions.push('transfer to savings');\n $scope.categoryOptions.push('transfer to checking');\n // Sort category options\n $scope.categoryOptions = $scope.categoryOptions.sort();\n }, function errorCallback(res) {\n console.log(res.data.status);\n });\n\n // Initialize new entry fields\n $scope.newEntry = {\n category: 'category',\n type: 'type'\n };\n\n \n }", "function _getParamConfig(data, param) {\n var tempdata = data;\n data = data == null || !data.length ? [] : data;\n var rowCount = 0;\n\n if (!isEmpty(param)) {\n // ristrict user from creating new row for data entry;\n $scope.IsNewRowAllowed = false;\n for (var current in tempdata)\n param[current] = tempdata[current];\n }\n else {\n //console.log($scope.IsNewRowAllowed + \"----\")\n $scope.IsNewRowAllowed = true;\n //console.log($scope.IsNewRowAllowed + \"----\")\n }\n // get row count for preconfigured questions\n for (var i in param) {\n var rows = param[i];\n for (var row in rows) {\n rowCount++\n }\n //check it for only first element in param and break, assuming that every element will have same count, it not then\n //admin has done something wrong.\n break;\n }\n //console.log($scope.DataColumns);\n // push new rows in Scope.Data till its lenght is equals to rowcount\n if (data.length <= 0) {\n for (var i = 0; i < rowCount; i++)\n data.push(_createBlankRow($scope.DataColumns));\n }\n //console.log(_data);\n // populate questions\n\n for (var i in param) {\n rowCount = 0;\n var rows = param[i];\n for (var row in rows) {\n data[rowCount++][i] = rows[row];\n }\n }\n //date Hack, its is a hack as I don't have a concrete solutions\n for (var i in $scope.DataColumns) {\n if ($scope.DataColumns[i].template == \"date\" && $scope.DataColumns[i].dataType == \"date\") {\n for (var j in data) {\n data[j][$scope.DataColumns[i].key] = new Date(data[j][$scope.DataColumns[i].key]);\n }\n }\n else if ($scope.DataColumns[i].template == \"label\" && $scope.DataColumns[i].dataType == \"date\") {\n for (var j in data) {\n var dt = new Date(data[j][$scope.DataColumns[i].key]);\n if (dt.getFullYear() > 2013)\n data[j][$scope.DataColumns[i].key] = (dt.getMonth() + 1) + \"/\" + dt.getDate() + \"/\" + dt.getFullYear();\n else\n data[j][$scope.DataColumns[i].key] = \"\";\n }\n }\n }\n return data;\n }", "init (config, dbConfig) {\n if (config && config.filepath && config.filepath !== this.filepath) {\n\n // first save existing content to new dir before changing\n if (!_.isEmpty(this.store.object[this.name]) && !fs.existsSync(config.filepath)) {\n this.store.saveSync(config.filepath);\n }\n\n this.filepath = config.filepath;\n this.store = low(this.filepath, dbConfig);\n }\n\n let rows = this.rows,\n __model = rows.length && rows[0].__model;\n\n if (__model) {\n this.store.object[this.name] = _.map(rows, (record) => {\n return model(record);\n });\n }\n }", "function init(){\n getReportData();\n }", "function InitDataConfigIntegrationFields() {\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields = {};\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.AddNewField = AddNewField;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.OnOpenJsonModal = OnOpenJsonModal;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.Close = CloseDataExtIntegrationFields;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.OnDataExtIntegrationFieldsClick = OnDataExtIntegrationFieldsClick;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.Save = IntegrationConfigFieldsSave;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.Delete = DeleteConfirmation;\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.EditDataConfigField = EditDataConfigField;\n \n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.SaveBtnText = \"OK\";\n DataExtIntegrationCtrl.ePage.Masters.DataExtIntegration.DataExtIntegrationFields.IsDisableSaveBtn = false;\n\n InitExpression();\n InitRelatedInput();\n }", "function configure() {\n\t\t\tbindEvents();\n\t\t\tinitForm();\n\t\t\taddDomEvents();\n\t\t\tconsole.log('csv module initialized!');\n\n\t\t}", "function init() {\n var mainPath = \"serviceVisitsData.php?table=\";\n outputFilterCard(mainPath);\n setupFilters(mainPath);\n\n}", "function initDataTable()\n{\n RMPApplication.debug(\"begin initDataTable\");\n \n var datatable_language = col_lang_opt.code_datatable;\n var datatable_lang_option = {};\n for (i=0; i<datatable_lang.length; i++) {\n if (datatable_lang[i].language == datatable_language) {\n datatable_lang_option = datatable_lang[i].options;\n break;\n }\n }\n \n var ticket_nb_col = ${P_quoted(i18n(\"ticket_nb_col\", \"N° Ticket\"))};\n var ticket_site_col = ${P_quoted(i18n(\"ticket_site_col\", \"Site\"))};\n var ticket_desc_abr_col = ${P_quoted(i18n(\"task_desc_abr_col\", \"Description (abrégée)\"))};\n var status_col = ${P_quoted(i18n(\"status_col\", \"Statut\"))};\n var ticket_opened_col = ${P_quoted(i18n(\"ticket_opened_col\", \"Date Ouverture\"))};\n var ticket_closed_col = ${P_quoted(i18n(\"ticket_closed_col\", \"Date Fermeture\"))};\n var ticket_eval_col = ${P_quoted(i18n(\"ticket_eval_col\", \"Evaluation\"))};\n var task_nb_col = ${P_quoted(i18n(\"task_nb_col\", \"N° Tâche\"))};\n var task_desc_col = ${P_quoted(i18n(\"task_desc_col\", \"Description\"))};\n var task_affected_col = ${P_quoted(i18n(\"task_affected_col\", \"Affectée à\"))};\n\n // datatable visibility change according screen context\n var contexte = id_context.getValue(); \n switch (contexte) {\n case \"web\" :\n var responsive_options = true;\n var tab_wm_order_col = [\n { title : \"\", visible : false },\n { title : ticket_nb_col },\n { title : ticket_desc_abr_col },\n { title : status_col }, \n { title : ticket_eval_col, orderable: false },\n { title : ticket_site_col },\n { title : ticket_opened_col },\n { title : ticket_closed_col }\n ];\n var tab_wm_task_col = [\n { title : \"\", visible : false },\n { title : task_nb_col },\n { title : task_desc_col },\n { title : status_col },\n { title : task_affected_col }\n ];\n break;\n\n case \"tablet\" :\n var responsive_options = {\n details: { type: 'column' }\n };\n var columDefs_options = [\n {\n className: 'control',\n orderable: false,\n targets: 0\n },\n ];\n var tab_wm_order_col = [\n { title : \"\", visible: false },\n { title : ticket_nb_col },\n { title : ticket_desc_abr_col },\n { title : status_col }, \n { title : ticket_eval_col, orderable: false },\n { title : ticket_site_col },\n { title : ticket_opened_col },\n { title : ticket_closed_col }\n ];\n var tab_wm_task_col = [\n { title : \"\", visible : false },\n { title : task_nb_col },\n { title : task_desc_col },\n { title : status_col },\n { title : task_affected_col }\n ];\n break;\n\n case \"mobile\" :\n var responsive_options = {\n details: { type: 'column' }\n };\n var columDefs_options = [\n {\n className: 'control',\n orderable: false,\n targets: 0\n },\n ];\n var tab_wm_order_col = [\n { title : \"\" },\n { title : ticket_nb_col },\n { title : ticket_desc_abr_col, className: \"not-mobile\" },\n { title : status_col, className: \"not-mobile\" }, \n { title : ticket_eval_col, orderable: false, className: \"not-mobile\" },\n { title : ticket_site_col },\n { title : ticket_opened_col },\n { title : ticket_closed_col, className: \"not-mobile\" }\n ];\n var tab_wm_task_col = [\n { title : \"\", \"orderable\": false },\n { title : task_nb_col },\n { title : task_desc_col, className: \"not-mobile\" },\n { title : status_col },\n { title : task_affected_col, className: \"not-mobile\" }\n ];\n break;\n };\n // order by opened date\n var order_wm_options = [6, 'desc'];\n\n // what date format to apply\n var dateFormatLang = col_lang_opt.date_full;\n var momentFormatLang = col_lang_opt.code_moment;\n\n // #id_tab_wm_order table options\n if ( $.fn.dataTable.isDataTable('#id_tab_wm_order') == false ) {\n $.fn.dataTable.moment(dateFormatLang, momentFormatLang);\n $('#id_tab_wm_order').DataTable({\n responsive: responsive_options,\n columns: tab_wm_order_col,\n columnDefs: columDefs_options,\n order: order_wm_options,\n ordering: true,\n searching: false, // Disable searching abilities in DataTables\n lengthChange: false, // Disable user ability to change number of records per page\n \"pagingType\": \"full_numbers\",\n \"language\": datatable_lang_option\n });\n }\n // #id_tab_wm_task table options\n if ( $.fn.dataTable.isDataTable('#id_tab_wm_task') == false ) {\n $.fn.dataTable.moment(dateFormatLang, momentFormatLang);\n $('#id_tab_wm_task').DataTable({\n responsive: responsive_options,\n columns: tab_wm_task_col,\n columnDefs: columDefs_options,\n ordering: false,\n searching: false, // Disable searching abilities in DataTables\n lengthChange: false, // Disable user ability to change number of records per page\n \"pagingType\": \"full_numbers\",\n \"language\": datatable_lang_option\n });\n }\n RMPApplication.debug(\"end initDataTable\");\n}", "function _init() {\r\n\r\n //Set name on scope\r\n $sc['_name'] = CONTROLLER_NAME;\r\n\r\n //Set title and navigation\r\n $hs['$scope'].setTitle(serverData['serverName'] + ' -> ' + serverData['date']);\r\n $hs['$scope'].setNav('ranking.list');\r\n\r\n $sc['data'] = _data;\r\n\r\n //Initialize serverData\r\n _initialize_versusData();\r\n _initialize_serverData();\r\n _initialize_navigation();\r\n _initialize_chartData();\r\n\r\n _initialize_pagination();\r\n\r\n _data['filter']['all_classess'] = storedDataService['characterClassIds'].where(function(itm){ return itm.id; });\r\n _data['filter']['all_ranks'] = storedDataService['characterClassIds']\r\n .where(function(itm){ return itm.id >= 10; })\r\n .sort(function(a, b){ return b.id - a.id; });\r\n }", "function initializeRows() {\n pillboxContainer.empty();\n var schedulesToAdd = [];\n for (var i = 0; i < schedules.length; i++) {\n schedulesToAdd.push(createNewRow(schedules[i]));\n }\n pillboxContainer.append(schedulesToAdd);\n medConflict(medlist);\n }", "function init() {\n fetchInstructors();\n setEvents();\n }", "function init() {\n\t\tBB.TableModule.initTableVars();\n\t\t_addBalls();\n\t\t_renderBalls();\n\t\t_startGameLoop();\n\t}", "function initializeRows() {\n eventFeed.empty();\n const eventsToAdd = [];\n for (let i = 0; i < events.length; i++) {\n eventsToAdd.push(createNewRow(events[i]));\n }\n eventFeed.append(eventsToAdd);\n }", "function initData(){\n dynarexDataIsland.init();\n loadFunctionTimes();\n setEventListener();\n}", "function init() {\n $('#data-table').DataTable({\n responsive: true\n });\n\n $('.date-picker').datepicker({\n\t\tdateFormat: \"yy-mm-dd\",\n\t\tmaxDate: new Date()\n });\n\n validateForms();\n}", "prepLoadList (list, callback) {\n\n // store here for when loadList gets called.\n this._list = list;\n\n // only want a single instance of this function.\n this._bulkLoadCompleteFn = callback;\n }", "function init() {\n\n\t\t\t// Shim for forEach for IE/Edge\n\t\t\tif (typeof NodeList.prototype.forEach !== 'function') {\n\t\t\t\t\t\tNodeList.prototype.forEach = Array.prototype.forEach;\n\t\t\t}\n\t\t\t_config2.default.browserUtils = new _BrowserUtils2.default();\n\t\t\t_config2.default.launchScreen = new _LaunchScreen2.default();\n\n\t\t\t_config2.default.learningSection = new _LearningSection2.default(document.querySelector('#learning-section'));\n\t\t\t_config2.default.inputSection = new _InputSection2.default(document.querySelector('#input-section'));\n\t\t\t_config2.default.outputSection = new _OutputSection2.default(document.querySelector('#output-section'));\n\t\t\t_config2.default.recordOpener = new _RecordOpener2.default(document.querySelector('#record-open-section'));\n\n\t\t\t_config2.default.inputSection.ready();\n\t\t\t_config2.default.learningSection.ready();\n\t\t\t_config2.default.wizard = new _Wizard2.default();\n\t\t\t_config2.default.recordSection = new _Recording2.default(document.querySelector('#recording'));\n\t\t\tif (localStorage.getItem('isBackFacingCam') && localStorage.getItem('isBackFacingCam') === 'true') {\n\t\t\t\t\t\t_config2.default.isBackFacingCam = true;\n\t\t\t}\n}", "constructor() {\n this.list = {};\n }", "function initSelectionLists() {\n vm.selectionLists.defendantRole = [\n { label: \"Primary Defendant\", value: \"prime\" },\n { label: \"Secondary Defendant\", value: \"secondary\" },\n { label: \"3rd Party Defendant \", value: \"tertiary\" },\n { label: \"Discontinued Defendant\", value: \"quaternary\" }\n ];\n\n vm.selectionLists.gender = [\n { label: \"Male\", value: \"male\" },\n { label: \"Female\", value: \"female\" },\n { label: \"Other\", value: \"other\" },\n { label: \"Not Specified\", value: \"Not Specified\" }\n ];\n\n }", "function initDataTable(){\r\n\t// DATATABLES =============================================================\r\n\t// DataTables Config (more info can be found at http://www.datatables.net/)\r\n\toTable = $('.datatable').dataTable({\r\n\t\t\"bJQueryUI\": true,\r\n\t\t\"sScrollX\": \"\",\r\n\t\t\"bSortClasses\": false,\r\n\t\t\"aaSorting\": [[0,'asc']],\r\n\t\t\"bAutoWidth\": true,\r\n\t\t\"bInfo\": true,\r\n\t\t\"sScrollY\": \"100%\",\t\r\n\t\t\"sScrollX\": \"100%\",\r\n\t\t\"bScrollCollapse\": true,\r\n\t\t\"sPaginationType\": \"full_numbers\",\r\n\t\t\"bRetrieve\": true\r\n\t});\r\n\r\n\t$(window).bind('resize', function(){\r\n\t\toTable.fnAdjustColumnSizing();\r\n\t});\r\n}" ]
[ "0.6537567", "0.61117136", "0.5949384", "0.58970004", "0.5894257", "0.5888427", "0.58621114", "0.5851771", "0.58117783", "0.5781461", "0.5777629", "0.571766", "0.570573", "0.5599325", "0.55989295", "0.5560771", "0.55461824", "0.5532833", "0.5528997", "0.55246097", "0.55206215", "0.55202115", "0.5487386", "0.54804796", "0.5442116", "0.5438322", "0.54164654", "0.5400972", "0.54003364", "0.5389324", "0.5343689", "0.5340089", "0.5333034", "0.5330719", "0.53065497", "0.52988315", "0.52949816", "0.5292505", "0.5288141", "0.52788955", "0.52517414", "0.5248318", "0.5246662", "0.52431655", "0.5242551", "0.5240078", "0.5229091", "0.52262014", "0.5215933", "0.52151823", "0.5209247", "0.5207518", "0.5205639", "0.5195161", "0.51848775", "0.51833236", "0.5182999", "0.5180376", "0.51760894", "0.5174959", "0.5168759", "0.5157362", "0.51551974", "0.5155045", "0.5145876", "0.5142949", "0.5139107", "0.51351345", "0.51323", "0.5127603", "0.51170725", "0.5114253", "0.5113852", "0.51096505", "0.51034987", "0.50994265", "0.5089792", "0.5079035", "0.50686806", "0.5068497", "0.5065137", "0.5060844", "0.5057655", "0.50543815", "0.50521326", "0.5049901", "0.5047056", "0.50443953", "0.504321", "0.50370103", "0.50350344", "0.50303274", "0.5030236", "0.50160736", "0.5014987", "0.50099456", "0.500828", "0.50080514", "0.5002387", "0.5001712" ]
0.6306317
1
Initialize the start / end date pickers.
function initDatePickers(){ $('#start-date').datetimepicker({ showTodayButton: true, // show one month of configurations by default defaultDate: moment().subtract(1, 'month').startOf('d'), format: 'YYYY-MM-DD HH:mm' }); $('#end-date').datetimepicker({ showTodayButton: true, // default end-date to now. defaultDate: moment().endOf('d'), format: 'YYYY-MM-DD HH:mm' }); $("#start-date").on("dp.change", function(e){ runSearch(); }); $("#end-date").on("dp.change", function(e){ runSearch(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initInputs() {\n setDateInput(\"startDate\", { dateFormat: \"yy-mm-dd\" });\n setDateInput(\"endDate\", { dateFormat: \"yy-mm-dd\" });\n}", "function setUpDatepickerStartAndEndDateValidation() {\n\n jq(\".startDateEndDate\").each(function (j, domEl) {\n\n const startDatepicker = jq(jq(this).find('.startDate'));\n const endDatepicker = jq(jq(this).find('.endDate'));\n\n if (startDatepicker) {\n startDatepicker.change(function () {\n let startDate = startDatepicker.find('input[type=text]').datepicker('getDate');\n if (startDate) {\n endDatepicker.find('input[type=text]').datepicker('option', 'minDate', startDate);\n }\n });\n }\n\n if (endDatepicker) {\n endDatepicker.change(function () {\n let endDate = endDatepicker.find('input[type=text]').datepicker('getDate');\n if (endDate) {\n startDatepicker.find('input[type=text]').datepicker('option', 'maxDate', endDate);\n }\n });\n }\n });\n}", "function initDatePickers(){\n $('.datepickerhotelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n $('.datepickerhotelOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+1)), to: (hotel.maxNights - 1) }\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n\n // DATE PICKER FOR HOSTEL\n $('.datepickerhostelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n $('.datepickerhostelOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+1)), to: (hostel.maxNights - 1) }\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n\n // DATE PICKER FOR MOTEL\n $('.datepickermotelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n\n $('.datepickermotelOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+3)), to: (motel.maxNights - 3) }\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n\n // DATE PICKER FOR HOUSE\n $('.datepickerhouseIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n $('.datepickerhouseOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+2)), to: (house.maxNights - 2)}\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n } // Invoked at line 186", "function setupDateRanges() {\n // Configure initial states of date ranges\n var endYearGrouped = $(\"#end-year-grouped\")\n var endYear = $(\"#end-year\")\n var pageLoadEndYearGroupedValue = endYearGrouped.val()\n var pageLoadEndYearValue = endYear.val()\n updateEndYearRange();\n updateEndYearGroupedRange();\n $(\"#end-year-grouped\").val(pageLoadEndYearGroupedValue)\n $(\"#end-year\").val(pageLoadEndYearValue)\n\n // Setup event listeners for change of state on date ranges\n $(\"#start-year\").change(updateEndYearRange)\n $(\"#start-year-grouped\").change(updateEndYearGroupedRange)\n }", "function initDatePicker()\n\t{\n\t\tif($('.datepicker').length)\n\t\t{\n\t\t\tvar datePickers = $('.datepicker');\n\t\t\tdatePickers.each(function()\n\t\t\t{\n\t\t\t\tvar dp = $(this);\n\t\t\t\t// Uncomment to use date as a placeholder\n\t\t\t\t// var date = new Date();\n\t\t\t\t// var dateM = date.getMonth() + 1;\n\t\t\t\t// var dateD = date.getDate();\n\t\t\t\t// var dateY = date.getFullYear();\n\t\t\t\t// var dateFinal = dateM + '/' + dateD + '/' + dateY;\n\t\t\t\tvar placeholder = dp.data('placeholder');\n\t\t\t\tdp.val(placeholder);\n\t\t\t\tdp.datepicker();\n\t\t\t});\n\t\t}\t\n\t}", "function initializeOptions()\n{\n\tvar minDate = data.getValue(0, 0);\n\tvar maxDate = data.getValue(data.getNumberOfRows() - 1, 0);\n\n\tvar minDateMonth;\n\tvar maxDateMonth;\n\tvar minDateDay;\n\tvar maxDateDay;\n\n\tvar minDateISO;\n\tvar maxDateISO;\n\n\t// Store the month and day values of the min and max dates\n\tminDateMonth = minDate.getMonth() + 1;\n\tmaxDateMonth = maxDate.getMonth() + 1;\n\tminDateDay = minDate.getDate();\n\tmaxDateDay = maxDate.getDate();\n\n\t// Ensure the month and day values are 2 digits.\n\tif (minDateMonth < 10)\n\t\tminDateMonth = \"0\" + minDateMonth;\n\tif (maxDateMonth < 10)\n\t\tmaxDateMonth = \"0\" + maxDateMonth;\n\tif (minDateDay < 10)\n\t\tminDateDay = \"0\" + minDateDay;\n\tif (maxDateDay < 10)\n\t\tmaxDateDay = \"0\" + maxDateDay;\n\n\t// Generate the ISO strings (YYYY-MM-DD) for the min and max dates\n\tminDateISO = minDate.getFullYear() + \"-\" + minDateMonth + \"-\" + minDateDay;\n\tmaxDateISO = maxDate.getFullYear() + \"-\" + maxDateMonth + \"-\" + maxDateDay;\n\n\t// Set the proper attributes for the input fields\n\tdocument.getElementById(\"startDate\").min = minDateISO;\n\tdocument.getElementById(\"startDate\").max = maxDateISO;\n\tdocument.getElementById(\"startDate\").value = minDateISO;\n\tdocument.getElementById(\"endDate\").min = minDateISO;\n\tdocument.getElementById(\"endDate\").max = maxDateISO;\n\tdocument.getElementById(\"endDate\").value = maxDateISO;\n}", "function init() {\n initVariable();\n initDatePicker();\n }", "function initDateRange() {\n\tvar elements = $('[data-date-range-set]');\n\t\n\t// defining constants\n\tvar con = {'CURRENT_WEEK': 0,\n\t\t\t'CURRENT_MONTH' : 1,\n\t\t\t'DAYS_30': 2,\n\t\t\t'LAST_MONTH': 3\n\t\t};\n\t\n\tif (elements.length === 0) {\n\t\treturn;\n\t}\n\telements.click(function(e) {\n\t\tconf = $(this).attr('data-date-range-set');\n\t\tvar from = new Date();\n\t\tvar to = new Date();\n\t\tswitch(con[conf]) {\n\t\t\tcase con.CURRENT_WEEK:\n\t\t\t\tfrom.setDate(from.getDate() - from.getDay() + 1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.CURRENT_MONTH:\n\t\t\t\tfrom.setDate(1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.DAYS_30:\n\t\t\t\tfrom.setDate(from.getDate() - 30);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.LAST_MONTH:\n\t\t\t\tfrom.setMonth(from.getMonth() - 1);\n\t\t\t\tfrom.setDate(1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t\n\t\t\t\tto.setDate(0);\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString(to));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t});\n}", "function initPicker() {\n\t$('.datepicker-input').datetimepicker({\n\t\ttimepicker: false,\n\t\tformat:'d.m.Y',\n\t\ttodayButton: false,\n\t\tminDate: 0,\n\t\tdayOfWeekStart: 1\n\t});\n\n\t$('.timepicker-input').datetimepicker({\n\t\tdatepicker:false,\n\t\tformat:'H:i',\n\t\tminTime:'9:00',\n\t\tmaxTime:'22:00',\n\t\tstep: 30\n\t});\n}", "function initializeDatepickers(){\n window.ST.set_datepicker_language(gon);\n\n // Get booked dates for\n // Set the first listing as checked and initialize datepicker with the booked dates of this listing\n var booked_dates = [];\n $('input:radio[name=listing_id]:first').prop('checked',true);\n var listing_id = parseInt($('input[name=listing_id]:checked', '#poolTool_form').val());\n for(var y=0; y<gon.source.length; y++){\n if(gon.source[y].listing_id === listing_id){\n if (gon.source[y].already_booked_dates){\n booked_dates = gon.source[y].already_booked_dates;\n }\n break;\n }\n }\n\n // If modifying the past is not allowed, then ensure this in the datepicker\n var start_date;\n if (!gon.pool_tool_preferences.pool_tool_modify_past){\n start_date = new Date(new Date().setHours(0,0,0,0));\n }\n\n window.ST.initializeDatePickerWithBookings('#datepicker', booked_dates, '#start-on', '#end-on', \"#booking-start-output\", \"#booking-end-output\", start_date);\n window.ST.initializeDatePickerWithBookings('#datepicker2', booked_dates, '#start-on2', '#end-on2', \"#booking-start-output2\", \"#booking-end-output2\"); // don't use start today, because the datepicker will remove the old dates\n\n\n // EVENT LISTENER: If the user changes the listing selected listing in the\n // \"add new booking\" form, then also update the booked dates in the datepicker\n $(\"input[name=listing_id]:radio\").change(function (ev) {\n var booked_dates = [];\n var listing_id = parseInt($('input[name=listing_id]:checked', '#poolTool_form').val());\n\n for(var y=0; y<gon.source.length; y++){\n if(gon.source[y].listing_id === listing_id){\n if (gon.source[y].already_booked_dates){\n booked_dates = gon.source[y].already_booked_dates;\n }\n break;\n }\n }\n\n // Re-initialize Datepickers\n $('#start-on').val('');\n $('#end-on').val('');\n $('#datepicker').datepicker('remove');\n\n // Slightly delay execution of Datepicker update, so that DOM is\n // immediately updated and UI with radio button change isn't stuck\n setTimeout(updateDatepicker(booked_dates), 1);\n });\n }", "function initDatepicker () {\n\t\t$('#datepicker').datepicker({\n\t\t\tbeforeShowDay: $.datepicker.noWeekends,\n\t\t\tinline: true,\n\t showOtherMonths: true,\n\t dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\t\t\tdateFormat: \"yy-m-d\",\n\t\t\tminDate: 0,\n\t\t\tonSelect: function (date) {\n\t\t\t\t$('#input-date').val(date);\n\t\t\t\tgetMonthOfApptTypes();\n\t\t\t},\n\t\t\tonChangeMonthYear: function (year, month) {\n\t\t\t\t//update global variable 'dpMonthDate' to match datepicker state\n\t\t\t\tdpMonthDate= year+'-'+month+'-1';\n\n\t\t\t\t//call UI update function with updated date\n\t\t\t\tgetMonthOfApptTypes(dpMonthDate);\n\t\t\t}\n\t\t});\n\n\t\t//update calendar ui (dots) each time apptType selection changes\n\t\t$('input[name=\"apptTypeID[]\"]').change(function () {\n\t\t\tgetMonthOfApptTypes( true );\n\t\t});\n\t}", "_init() {\n this._setRanges(this.selected);\n this._todayDate = this._getCellCompareValue(this._dateAdapter.today());\n this._monthLabel = this._dateFormats.display.monthLabel\n ? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel)\n : this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]\n .toLocaleUpperCase();\n let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);\n this._firstWeekOffset =\n (DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) -\n this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;\n this._initWeekdays();\n this._createWeekCells();\n this._changeDetectorRef.markForCheck();\n }", "initPickersCalendar(){\n var options = {\n // closeText: 'Fermer',\n // prevText: '&#x3c;Préc',\n // nextText: 'Suiv&#x3e;',\n currentText: 'Aujourd\\'hui',\n monthNames: ['Janvier','Fevrier','Mars','Avril','Mai','Juin',\n 'Juillet','Aout','Septembre','Octobre','Novembre','Decembre'],\n monthNamesShort: ['Jan','Fev','Mar','Avr','Mai','Jun',\n 'Jul','Aou','Sep','Oct','Nov','Dec'],\n dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],\n dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],\n dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],\n weekHeader: 'Sm',\n dateFormat: 'dd/mm/yy',\n firstDay: 1,\n // isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: '',\n // minDate: 0,\n maxDate: '+12M +0D',\n minDate: new Date (2017, 8, 1), \n beforeShowDay: $.proxy(this.CalendarEventDay, this), // pour ne pas perdre le this en tant que mon app\n numberOfMonths: 1,\n showButtonPanel: true\n \n };\n \n this.$datepicker.datepicker(options);\n // this.$datepicker.datepicker( \"options\", \"beforeShowDay\", true);\n\n }", "function initDatepicker() {\n var today = new Date();\n\n jQuery.datepicker.setDefaults($.datepicker.regional[$(\"html\").attr(\"lang\")]);//abe++\n\n jQuery('.datepicker-holder').each(function () {\n var holder = jQuery(this);\n var inputs = holder.find('input:text, input:hidden');\n var from = inputs.filter('input.from');\n var to = inputs.filter('input.to');\n var nbDays = holder.parent().find('#date_range_nb_days');\n\n inputs.each(function () {\n var input = jQuery(this);\n\n input.closest('.col').find('.add-on').on('click', function (e) {\n e.preventDefault();\n input.focus();\n });\n });\n\n inputs.datepicker({\n //dateFormat: \"dd / mm / y\",\n dateFormat: \"dd/mm/yy\",//abe++\n minDate: today,\n onSelect: function (selectedDate) {\n var input = jQuery(this);\n var option = input.is(from) ? 'minDate' : 'maxDate';\n var instance = input.data('datepicker');\n var date = jQuery.datepicker.parseDate(instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat, selectedDate, instance.settings);\n\n inputs.not(input).filter('input:text').datepicker('option', option, date);\n\n if (input.is(from)) {\n //abe++\n if (to.attr('type') == 'text') {//Days are displayed range mode (cocorico.days_display_mode: range)\n setTimeout(function () {\n to.focus();\n }, 100);\n } else if (to.attr('type') == 'hidden') {//Day are displayed in duration mode\n setEndDay(input, to, nbDays);\n }\n }\n }\n });\n\n //abe++\n nbDays.on('change', function () {\n setEndDay(from, to, $(this));\n });\n });\n\n initTimePicker('.timepicker-holder');\n}", "function onInit() {\n\n // Initialize left part ( from - to year and get this months day )\n if (self.startOn < self.endOn) {\n getYearRange();\n }\n else toastr.error(infoErrorObj.startEndError)\n\n }", "function date_time_picker_init(){\n}", "function init_dates(){\n domo.get('/data/v1/dataset?fields=date&groupby=date&orderby=date descending&limit=8').then(function(data){\n start_date = data[data.length-1].date;\n end_date = data[0].date;\n\n $(function() {\n $(\"#datepicker\").daterangepicker({\n datepickerOptions : {\n numberOfMonths : 2\n }\n });\n });\n $(\"#datepicker\").daterangepicker({\n initialText : moment(start_date, \"YYYY-MM-DD\").format(\"MMM DD, YYYY\") + \" - \" + moment(end_date, \"YYYY-MM-DD\").format(\"MMM DD, YYYY\")\n });\n\n // show filters\n $(\".filterpanel\").show();\n\n // Init main routine\n // update_data();\n\n });\n}", "_init() {\n this._setRanges(this.selected);\n this._todayDate = this._getCellCompareValue(this._dateAdapter.today());\n this._monthLabel =\n this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]\n .toLocaleUpperCase();\n let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);\n this._firstWeekOffset =\n (DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) -\n this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;\n this._initWeekdays();\n this._createWeekCells();\n this._changeDetectorRef.markForCheck();\n }", "function init() {\n initDate();\n }", "function initialiseDatePicker() {\n\n //get the last date for which the user has an album\n if(album_dates.ld !=\"\") {\n\n var lastAlbumDate = new Date(album_dates.ld.split(\"/\")[2], album_dates.ld.split(\"/\")[1]-1, album_dates.ld.split(\"/\")[0]);\n\n //set the current album to the album for lastAlbumDate\n for (var i=0;i<albums.length;i++) {\n\n str1 = JSON.stringify(albums[i].date)\n str2 = JSON.stringify(album_dates.ld);\n\n if (str1 == str2) {\n currentAlbum = albums[i];\n break;\n }\n }\n\n //sets the calender to the last date that the user has images for\n datePicker.datepicker('update', lastAlbumDate);\n\n //make the single image controls visible\n imageButtons.removeClass(\"hidden\");\n imageButtons.addClass(\"visible\");\n slide = $('#slider-image').slider({value:0, min: 0, max: 0, step: 1});\n currentImgTime = currentAlbum.images[0].time;\n\n //show the first image in the current album\n currentImgNum=0;\n $(\"#singleImg\").attr(\"src\", currentAlbum.images[0].src);\n $(\"#selectedAlbum\").html(album_dates.ld);\n $(\"#numImages\").html(currentAlbum.images.length);\n $(\"#selectedAlbumStatus\").html(currentAlbum.submitted);\n $(\"#wearTimeEst\").html(currentAlbum.wearTime[0].hours + \" hrs \" + currentAlbum.wearTime[0].minutes + \" mins\");\n $(\"#imgTime\").html(currentImgTime);\n\n //set the slider values for the selected Album\n setSliderValues (slide, currentAlbum.images.length-1, 0, currentAlbum.images[currentImgNum].time);\n\n }\n\n //set up the shortcut keys for the image viewer\n setUpShortcutKeys();\n\n }", "init() {\n // Store a reference to the date picker instance against the input\n this._dom.input._mhDatePicker = this\n\n // Create the date picker element\n this._dom.picker = $.create(\n 'div',\n {'class': this.constructor.css['picker']}\n )\n document.body.appendChild(this._dom.picker)\n\n // Set up calendar\n this._calendar = new Calendar(\n this.picker,\n (date) => {\n const {maxDate} = this._options\n const {minDate} = this._options\n\n // Check date is within any min/max range\n if (minDate && date.getTime() < minDate.getTime()) {\n return false\n }\n\n if (maxDate && date.getTime() > maxDate.getTime()) {\n return false\n }\n\n // Apply `dateTest` behaviour\n const dateTest = this.constructor\n .behaviours\n .dateTest[this._behaviours.dateTest]\n\n return dateTest(this, date)\n },\n this._options.firstWeekday,\n this._options.monthNames,\n this._options.weekdayNames\n )\n this.calendar.init()\n\n // Attempt to get the the date from initial field value\n const date = this.dateParser.parse(\n this._options.parsers,\n this.input.value\n )\n if (date !== null) {\n this.calendar.date = date\n }\n\n // Set up event listeners\n $.listen(\n window,\n {\n 'fullscreenchange': this._handlers.close,\n 'orientationchange': this._handlers.close,\n 'resize': this._handlers.close\n }\n )\n\n $.listen(\n this.input,\n {\n 'blur': this._handlers.close,\n 'change': this._handlers.input,\n 'click': this._handlers.open,\n 'focus': this._handlers.open\n }\n )\n\n $.listen(this.calendar.calendar, {'picked': this._handlers.picked})\n }", "function setDatePickers(filter_id, datePickers) {\n\n\tif (!datePickers) {\n\t\treturn false;\n\t}\n\n\t// Loop all datepickers\n\t[].concat(_toConsumableArray(datePickers)).forEach(function (datePicker, e) {\n\t\tvar mode = datePicker.dataset.displayMode ? datePicker.dataset.displayMode : 'single';\n\t\tvar display_format = datePicker.dataset.displayFormat ? datePicker.dataset.displayFormat : 'Y-m-d';\n\t\tvar locale = datePicker.dataset.dateLocale ? datePicker.dataset.dateLocale : 'en';\n\n\t\tvar options = {\n\t\t\tdateFormat: display_format,\n\t\t\tmode: mode,\n\t\t\tlocale: _l10n2.default[locale]\n\n\t\t\t// Get custom config options\n\n\t\t};var opt_var = filter_id !== '' ? 'alm_flatpickr_opts_' + filter_id : 'alm_flatpickr_opts'; // Dynamic Variable Name\t\t\n\t\tvar alm_flatpickr_opts = window[opt_var]; // Get window variable\n\n\t\tif (alm_flatpickr_opts) {\n\t\t\tObject.keys(alm_flatpickr_opts).forEach(function (key) {\n\t\t\t\t// Loop object\tto create key:prop\t\t\t\n\t\t\t\toptions[key] = alm_flatpickr_opts[key];\n\t\t\t});\n\t\t}\n\n\t\t// Normalize rangeSeparator for `Range` mode \n\t\toptions.locale.rangeSeparator = ' | ';\n\n\t\t// Init Flatpickr\n\t\tvar fp = (0, _flatpickr2.default)(datePicker, options);\n\t});\n}", "function initiateDatePickers(){\n $( function() {\n $('#datepicker1').datepicker({ dateFormat: 'yy-mm-dd' ,\n minDate: 0,\n onSelect: function(date){\n\n var selectedDate = new Date(date);\n var msecsInADay = 86400000;\n var endDate = new Date(selectedDate.getTime() + msecsInADay);\n\n //Set Minimum Date of EndDatePicker After Selected Date of StartDatePicker\n $(\"#datepicker2\").datepicker( \"option\", \"minDate\", endDate );\n \n }\n\n }).val();\n } );\n\n $( function() {\n \n $('#datepicker2').datepicker({ dateFormat: 'yy-mm-dd' ,\n \n onSelect: function(date){\n var from = $('#datepicker1').val();\n var to = $('#datepicker2').val();\n\n // end - start returns difference in milliseconds \n var diff = new Date(Date.parse(to) - Date.parse(from))\n console.log(diff);\n // get days\n var days = diff/1000/60/60/24;\n $('#days').val(days);\n var pricePerDay = $(\"#price\").val();\n var qty = $(\"#qty\").val();\n $(\"#tot\").val(days*pricePerDay*qty);\n }\n } );\n });\n}", "function initEventDatePicker() {\r\n LocalizeDatePicker();\r\n var dates = $(\"#event-startdate, #event-enddate\").datepicker({\r\n numberOfMonths: 2,\r\n minDate: -365,\r\n beforeShow: function (input, inst) { $(this).siblings('label:first').hide(); },\r\n onSelect: function (selectedDate) {\r\n $(this).siblings('label:first').hide();\r\n var option = this.id == \"event-startdate\" ? \"minDate\" : \"maxDate\", instance = $(this).data('datepicker');\r\n date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);\r\n dates.not(this).datepicker('option', option, date);\r\n },\r\n onClose: function (dateText, inst) { if ($(this).val() == \"\") { $(this).siblings('label:first').show(); } }\r\n });\r\n}", "setRange(min, max) {\n self.datePicker.min = new Date(min);\n self.datePicker.max = new Date(max);\n }", "function init_daterangepicker() {\n\n\t\t\tif( typeof ($.fn.daterangepicker) === 'undefined'){ return; }\n\t\t\tconsole.log('init_daterangepicker');\n\n\t\t\tvar cb = function(start, end, label) {\n\t\t\t console.log(start.toISOString(), end.toISOString(), label);\n\t\t\t $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));\n\t\t\t};\n\n\t\t\tvar optionSet1 = {\n\t\t\t startDate: moment().subtract(29, 'days'),\n\t\t\t endDate: moment(),\n\t\t\t minDate: '01/01/2012',\n\t\t\t maxDate: '12/31/2015',\n\t\t\t dateLimit: {\n\t\t\t\tdays: 60\n\t\t\t },\n\t\t\t showDropdowns: true,\n\t\t\t showWeekNumbers: true,\n\t\t\t timePicker: false,\n\t\t\t timePickerIncrement: 1,\n\t\t\t timePicker12Hour: true,\n\t\t\t ranges: {\n\t\t\t\t'Today': [moment(), moment()],\n\t\t\t\t'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n\t\t\t\t'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n\t\t\t\t'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n\t\t\t\t'This Month': [moment().startOf('month'), moment().endOf('month')],\n\t\t\t\t'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n\t\t\t },\n\t\t\t opens: 'left',\n\t\t\t buttonClasses: ['btn btn-default'],\n\t\t\t applyClass: 'btn-small btn-primary',\n\t\t\t cancelClass: 'btn-small',\n\t\t\t format: 'MM/DD/YYYY',\n\t\t\t separator: ' to ',\n\t\t\t locale: {\n\t\t\t\tapplyLabel: 'Submit',\n\t\t\t\tcancelLabel: 'Clear',\n\t\t\t\tfromLabel: 'From',\n\t\t\t\ttoLabel: 'To',\n\t\t\t\tcustomRangeLabel: 'Custom',\n\t\t\t\tdaysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\t\t\tmonthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\t\t\t\tfirstDay: 1\n\t\t\t }\n\t\t\t};\n\n\t\t\t$('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));\n\t\t\t$('#reportrange').daterangepicker(optionSet1, cb);\n\t\t\t$('#reportrange').on('show.daterangepicker', function() {\n\t\t\t console.log(\"show event fired\");\n\t\t\t});\n\t\t\t$('#reportrange').on('hide.daterangepicker', function() {\n\t\t\t console.log(\"hide event fired\");\n\t\t\t});\n\t\t\t$('#reportrange').on('apply.daterangepicker', function(ev, picker) {\n\t\t\t console.log(\"apply event fired, start/end dates are \" + picker.startDate.format('MMMM D, YYYY') + \" to \" + picker.endDate.format('MMMM D, YYYY'));\n\t\t\t});\n\t\t\t$('#reportrange').on('cancel.daterangepicker', function(ev, picker) {\n\t\t\t console.log(\"cancel event fired\");\n\t\t\t});\n\t\t\t$('#options1').click(function() {\n\t\t\t $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);\n\t\t\t});\n\t\t\t$('#options2').click(function() {\n\t\t\t $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);\n\t\t\t});\n\t\t\t$('#destroy').click(function() {\n\t\t\t $('#reportrange').data('daterangepicker').remove();\n\t\t\t});\n\n\t\t}", "function setDefaultDates() {\n /**\n * Return the day of the month of the provided date as a two-digit number\n * Example:\n * First day of month = \"01\"\n */\n function getTwoDigitDay(date) {\n return date.getDate().toString().padStart(2, \"0\");\n }\n\n /**\n * Return the month of the provided date as a two-digit number\n * Example:\n * January = \"01\"\n */\n function getTwoDigitMonth(date) {\n return (date.getMonth() + 1).toString().padStart(2, \"0\");\n }\n\n /**\n * Set the start date default to one year ago\n */\n function setStartDate() {\n const lastYearDate = new Date();\n const lastYear = lastYearDate.getFullYear() - 1;\n lastYearDate.setFullYear(lastYear);\n const month = getTwoDigitMonth(lastYearDate);\n const day = getTwoDigitDay(lastYearDate);\n\n $(\"#search-start\").val(`${lastYear}-${month}-${day}`);\n }\n\n /**\n * Set the end date default to the current date\n */\n function setEndDate() {\n const today = new Date();\n const year = today.getFullYear();\n const month = getTwoDigitMonth(today);\n const day = getTwoDigitDay(today);\n\n // YYYY-MM-DD\n $(\"#search-end\").val(`${year}-${month}-${day}`);\n }\n\n setStartDate();\n setEndDate();\n}", "function Datepick() {\n this._uuid = new Date().getTime(); // Unique identifier seed\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[''] = { // Default regional settings\n clearText: 'Clear', // Display text for clear link\n clearStatus: 'Erase the current date', // Status text for clear link\n closeText: 'Close', // Display text for close link\n closeStatus: 'Close without change', // Status text for close link\n prevText: '&laquo;Prev', // Display text for previous month link\n prevStatus: 'Show the previous month', // Status text for previous month link\n prevBigText: '&#x3c;&#x3c;', // Display text for previous year link\n prevBigStatus: 'Show the previous year', // Status text for previous year link\n nextText: 'Next&raquo;', // Display text for next month link\n nextStatus: 'Show the next month', // Status text for next month link\n nextBigText: '&#x3e;&#x3e;', // Display text for next year link\n nextBigStatus: 'Show the next year', // Status text for next year link\n currentText: 'Today', // Display text for current month link\n currentStatus: 'Show the current month', // Status text for current month link\n monthNames: ['January','February','March','April','May','June',\n 'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n monthStatus: 'Show a different month', // Status text for selecting a month\n yearStatus: 'Show a different year', // Status text for selecting a year\n weekHeader: 'Wk', // Header for the week of the year column\n weekStatus: 'Week of the year', // Status text for the week of the year column\n dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n dayStatus: 'Set DD as first week day', // Status text for the day of the week selection\n dateStatus: 'Select DD, M d', // Status text for the date selection\n dateFormat: 'mm/dd/yy', // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n initStatus: 'Select a date', // Initial Status text on opening\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: '' // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: 'focus', // 'focus' for popup on focus,\n // 'button' for trigger button, or 'both' for either\n showAnim: 'show', // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n duration: 'normal', // Duration of display/closure\n buttonText: '...', // Text for trigger button\n buttonImage: '', // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n showDefault: false, // True to populate field with the default date\n appendText: '', // Display text following the input box, e.g. showing the format\n closeAtTop: true, // True to have the clear/close at the top,\n // false to have them at the bottom\n mandatory: false, // True to hide the Clear link, false to include it\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n showBigPrevNext: false, // True to show big prev/next links\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: true, // True if month can be selected directly, false if only prev/next\n changeYear: true, // True if year can be selected directly, false if only prev/next\n yearRange: '-10:+10', // Range of years to display in drop-down,\n // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)\n changeFirstDay: false, // True to click on day name to change, false to remain as set\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n highlightWeek: false, // True to highlight the selected week\n showWeeks: false, // True to show week of the year, false to omit\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: '+10', // Short year values < this are in the current century,\n // > this are in the previous century, string value starting with '+'\n // for current year + value, -1 for no change\n showStatus: false, // True to show status bar at bottom, false to not show it\n statusForDate: this.dateStatus, // Function to provide status text for a date -\n // takes date and instance as parameters, returns display text\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multiple months at which to show the current month (starting at 0)\n rangeSelect: false, // Allows for selecting a date range on one date picker\n rangeSeparator: ' - ', // Text between two dates in a range\n multiSelect: 0, // Maximum number of selectable dates\n multiSeparator: ',', // Text between multiple dates\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n // [2] = cell title (optional), e.g. $.datepick.noWeekends\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onHover: null, // Define a callback function when hovering over a day\n onSelect: null, // Define a callback function when a date is selected\n onClose: null, // Define a callback function when the datepicker is closed\n altField: '', // Selector for an alternate field to store selected dates into\n altFormat: '', // The date format to use for the alternate field\n constrainInput: true // The input is constrained by the current date format\n };\n $.extend(this._defaults, this.regional['']);\n this.dpDiv = $('<div id=\"' + this._mainDivId + '\" style=\"display: none;\"></div>');\n}", "function initDatePicker()\r\n\t{\r\n\t\tvar dp = $('#datepicker');\r\n\t\tdp.datepicker();\r\n\t}", "function InitIL() {\n UPInit(); /* From userpreferences.js */\n \n // Datepickers: set language and starting dates.\n $('#dpfrom').datepicker($.datepicker.regional[user_lang]);\n $('#dpfrom').datepicker(\"option\", \"dateFormat\", \"yy-mm-dd\");\n $('#dpfrom').datepicker('setDate', period_start);\n\n $('#dpto').datepicker($.datepicker.regional[user_lang]);\n $('#dpto').datepicker(\"option\", \"dateFormat\", \"yy-mm-dd\");\n $('#dpto').datepicker('setDate', period_end);\n \n // Handlers on the input fields for the datepickers, when the dates \n // change we can catch it.\n $('#dpfrom').bind('change', DateChangedStart);\n $('#dpto').bind('change', DateChangedEnd);\n}", "function defineStartAndEndDate(list) {\n var minDate;\n var maxDate;\n\n $.each(list, function(key, value) {\n if (moment(value[4], 'MM-DD-YY', true).isValid()) {\n if (!minDate && !maxDate) {\n minDate = value[4];\n maxDate = value[4];\n }\n if (moment(value[4]).isBefore(minDate)) {\n // if(value[4] < minDate) {\n minDate = value[4];\n }\n if (moment(value[4]).isAfter(maxDate)) {\n // if(value[4] > maxDate) {\n maxDate = value[4];\n }\n }\n });\n\n minDate = moment(minDate,'MM-DD-YY').format('YYYY-MM-DD');\n maxDate = moment(maxDate,'MM-DD-YY').format('YYYY-MM-DD');\n\n $('.input-daterange').attr('data-start-date',minDate);\n $('#startdate').val(minDate);\n $('.input-daterange').attr('data-end-date',maxDate);\n $('#enddate').val(maxDate);\n }", "function setVariables(){\n\tdateFrom = $('#dateFrom');\n\tdateTo = $('#dateTo');\n\taddress = $('#address');\n\t\n\tdateFrom.datepicker();\n\tdateTo.datepicker();\n}", "function OnDisplayDateStartChanged(/*DependencyObject*/ d, /*DependencyPropertyChangedEventArgs*/ e) \r\n {\r\n\t\tvar dp = d instanceof DatePicker ? d : null;\r\n// Debug.Assert(dp != null);\r\n\r\n dp.CoerceValue(DatePicker.DisplayDateEndProperty);\r\n dp.CoerceValue(DatePicker.DisplayDateProperty); \r\n }", "function init() {\n $(\"#startDate\").jqxDateTimeInput({ width: '270px', height: '25px' });\n $(\"#endDate\").jqxDateTimeInput({ width: '270px', height: '25px' });\n isInitialized=true\n \n}", "setDropDownDates(first, last) {\n const addDateToSelector = (date, selector, isSelected, isEnabled) => {\n const option = document.createElement(\"option\");\n const dateString = Form.getDropDownDate(date);\n option.text = dateString;\n option.value = dateString;\n option.selected = isSelected;\n option.disabled = !isEnabled;\n selector.add(option);\n };\n Utilities.emptyElement(this.dateFromElement);\n Utilities.emptyElement(this.dateToElement);\n this.data.rankings.forEach((ranking) => {\n addDateToSelector(ranking.date, this.dateFromElement, ranking === first, ranking.date < last.date);\n addDateToSelector(ranking.date, this.dateToElement, ranking === last, ranking.date > first.date);\n });\n }", "function init(){\n // get settings\n getSettings(function(datetimepickerOptions, appSettings){\n if(appSettings.enabled){\n createDatePicker(appSettings);\n jQ('#' + formInputTarget).datetimepicker(datetimepickerOptions);\n }\n\n })\n }", "function initTimepicker(){\r\n // custom Hour Wheel with 100h\r\n var hourWheel = {};\r\n for (var i=0;i<=100;i++) {\r\n hourWheel[\"\"+i] = i;\r\n }\r\n // custom minutes Wheel with 59m\r\n var minutesWheel = {};\r\n for (var i=0;i<60;i++) {\r\n minutesWheel[\"\"+i] = i;\r\n }\r\n \r\n $('.date-picker-et').scroller({\r\n theme: 'default',\r\n display: 'modal',\r\n mode: 'mixed',\r\n width: 100,\r\n wheels: [{ 'Hours': hourWheel, 'Minutes': { '0': 0, '15': 15 , '30' : 30, '45' : 45 }}],\r\n headerText: false,\r\n rows: 5,\r\n onSelect: onScrollerSelect\r\n });\r\n \r\n $('.date-picker-wt').scroller({\r\n theme: 'default',\r\n display: 'modal',\r\n mode: 'mixed',\r\n width: 100,\r\n wheels: [{ 'Hours': hourWheel, 'Minutes': minutesWheel }],\r\n headerText: false,\r\n rows: 5,\r\n onSelect: onScrollerSelect\r\n });\r\n }", "function customRange(dates) {\n var difff = diffDays(vacationEnd, vacationStart);\n duration = difff;\n\n vacationStart.calendarsPicker('option', 'minDate', 1 || null);\n\n if ($(this).hasClass(\"vacationStart\")) {\n vacationEnd.datepick('enable');\n var startDate = vacationStart.datepick('getDate')[0];\n\n console.log($.datepick.formatDate($.datepick.determineDate(startDate.value)));\n startDate = startDate.value;\n\n console.log(Date.parse(startDate));\n\n vacationEnd.calendarsPicker('option', 'minDate', startDate);\n vacationEnd.val('');\n vacationDuration.val('');\n\n } else {\n //vacationStart.calendarsPicker('option', 'maxDate', dates[0] || null);\n vacationDuration.val(difff);\n\n verifyDuration(vacationDuration);\n }\n\n }", "setDates(){\n\t\tthis.dates=[];\n\t\tlet min=new Date(this.min);\n\t\twhile(min<=this.max){\n\t\t\tthis.dates.push(new Date(min));\n\t\t\tmin.setDate(min.getDate()+1);\n\t\t}\n\t\tthis.dates.push(new Date(min));\n\t}", "function datePickerInit() {\n var cb = function(start, end, label) {\n console.log(start.toISOString(), end.toISOString(), label);\n $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));\n //alert(\"Callback has fired: [\" + start.format('MMMM D, YYYY') + \" to \" + end.format('MMMM D, YYYY') + \", label = \" + label + \"]\");\n };\n\n var optionSet1 = {\n startDate: moment().subtract(29, 'days'),\n endDate: moment(),\n minDate: '01/01/2012',\n maxDate: '12/31/2015',\n dateLimit: {\n days: 60\n },\n showDropdowns: true,\n showWeekNumbers: true,\n timePicker: false,\n timePickerIncrement: 1,\n timePicker12Hour: true,\n ranges: {\n 'Today': [moment(), moment()],\n 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n 'This Month': [moment().startOf('month'), moment().endOf('month')],\n 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n },\n opens: 'left',\n buttonClasses: ['btn btn-default'],\n applyClass: 'btn-small btn-primary',\n cancelClass: 'btn-small',\n format: 'MM/DD/YYYY',\n separator: ' to ',\n locale: {\n applyLabel: 'Submit',\n cancelLabel: 'Clear',\n fromLabel: 'From',\n toLabel: 'To',\n customRangeLabel: 'Custom',\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n firstDay: 1\n }\n };\n $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));\n $('#reportrange').daterangepicker(optionSet1, cb);\n $('#reportrange').on('show.daterangepicker', function() {\n console.log(\"show event fired\");\n });\n $('#reportrange').on('hide.daterangepicker', function() {\n console.log(\"hide event fired\");\n });\n $('#reportrange').on('apply.daterangepicker', function(ev, picker) {\n console.log(\"apply event fired, start/end dates are \" + picker.startDate.format('MMMM D, YYYY') + \" to \" + picker.endDate.format('MMMM D, YYYY'));\n });\n $('#reportrange').on('cancel.daterangepicker', function(ev, picker) {\n console.log(\"cancel event fired\");\n });\n $('#options1').click(function() {\n $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);\n });\n $('#options2').click(function() {\n $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);\n });\n $('#destroy').click(function() {\n $('#reportrange').data('daterangepicker').remove();\n });\n}", "function bindInitializeDatePickerOnDateInput() {\n //txtLeaseExpiryDate, txtLeaseStartDate\n var leaseStartDate = $('#txtLeaseStartDate');\n var leaseExpiryDate = $('#txtLeaseExpiryDate');\n var leasingStatus = $('#txtLeaseMandatory');\n\n if(leasingStatus.val() === '1') {\n // lease start date section\n leaseStartDate.datepicker({\n dateFormat: \"dd/mm/yy\",\n onClose: function() {\n var startDateArray = $(this).val().split('/');\n var day = parseInt(startDateArray[0]);\n var month = parseInt(startDateArray[1]);\n var year = parseInt(startDateArray[2]);\n leaseExpiryDate.datepicker(\"change\", {\n minDate: new Date(year, month-1, day) \n });\n }\n }).on('change', function(e) {\n bindShowContractLeasePeriodMonths();\n });\n \n // lease expiry date section\n leaseExpiryDate.datepicker({\n dateFormat: \"dd/mm/yy\",\n onClose: function() {\n var expiryDateArray = $(this).val().split('/');\n var day = parseInt(expiryDateArray[0]);\n var month = parseInt(expiryDateArray[1]);\n var year = parseInt(expiryDateArray[2]);\n leaseStartDate.datepicker(\"change\", {\n maxDate: new Date(year, month-1, day) \n });\n }\n \n }).on('change', function(e) {\n bindShowContractLeasePeriodMonths();\n });\n } else {\n // for destroy date picker\n// leaseStartDate.removeClass('calendarclass');\n leaseStartDate.removeClass('hasDatepicker');\n leaseStartDate.unbind();\n \n leaseExpiryDate.removeClass('hasDatepicker');\n leaseExpiryDate.unbind();\n }\n}", "function initDatePicker() {\n\t\tif($('#booking1-dt').length != 1) {\n\t\t\t$timeout(localmethods.initDatePicker, 50);\n\t\t\t//console.log(\"inside datepicker\");\n\t\t\treturn;\n\t\t}\n\t\t$('#booking1-dt').datetimepicker({\n\t\t\tdefaultDate: localVariables.bookNowobj.date,\n\t\t\tformat: 'DD-MM-YYYY'\n\t\t});\n\n\t\t/*set array of enabled dates*/\n\t\t//vm.model.fromMonthDate = moment(new Date()).format(\"YYYYMM\");\n\t\tvm.model.fromMonthDate = localVariables.bookNowobj.date.format('YYYYMM');\n\t\t$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates(localVariables.bookNowobj.datesEnabled);\n\n\t\t/* Event called when month is changed */\n $(\"#booking1-dt\").on(\"dp.update\", function (e) {\n \tvm.model.selectedDate = e.date;\n \tvm.model.fromMonthDate = e.viewDate.format(\"YYYYMM\");\n \tif(vm.model.selectedLocation != 'Choose Location') {\n \t\tcustApi.checkAvailableDatesInMonth(3, vm.model.fromMonthDate, vm.model.selectedLocation.pincodeid, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId).\n\t\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\t\tconsole.log(\"Available dates retrieved successfully\");\n\t\t\t\t\t\n\t\t\t\t\t/* Enabling available dates */\n\t\t\t\t\tvar i=0;\n\t\t\t\t\tvar enableDatesArray = [];\n\t\t\t\t\tvar yr='';\n\t\t\t\t\tvar month='';\n\t\t\t\t\tvar day='';\n\t\t\t\t\tvar date='';\n\t\t\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\t\t\tyr = p.substring(0,4);\n\t\t\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\t\t\tday = p.substring(6,8);\n\t\t\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\t\t\tenableDatesArray.push(new Date(date));\n\t\t\t\t\t});\t\t\t\t\n\t\t\t\t\t/*$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates(enableDatesArray);*/\n\t\t\t\t\tif(enableDatesArray.length != 0) {\n\t\t\t\t\t\t$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates(enableDatesArray);\n\t\t\t\t\t\tvm.flags.datesNotAvailable = false;\n\t\t\t\t\t\tvm.flags.bookingErrorContainer = vm.flags.datesNotAvailable;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvm.flags.datesNotAvailable = true;\n\t\t\t\t\t\tvm.flags.bookingErrorContainer = vm.flags.datesNotAvailable;\n\t\t\t\t\t\tvm.model.bookingErrorMessageContainer = 'Dates not Available for currently selected Location';\n\t\t\t\t\t\t$timeout(function () { vm.flags.bookingErrorContainer = false; vm.flags.datesNotAvailable = false}, 5000);\n\t\t\t\t\t\t$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t\t\t}\n\t\t\t\t}).\n\t\t\t\terror(function (data, status, header, config) {\n\t\t\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t\t\t});\n \t}\n \tvm.promoobj.promocode='';\n\t\t\tvm.promoobj.promocodeid='';\n\t\t\tvm.promoobj.finalcost='';\n\t\t\tvm.promoobj.discount='';\n\t\t\tvm.model.apptCost = localVariables.bookNowobj.apptCost;\n\t\t\tvm.custInfoFormFields.promocode='';\n });\n\n /*\n * Event called when date is changed \n */\n $(\"#booking1-dt\").on(\"dp.change\", function (e) {\n \tvm.model.fromDate = e.date.format(\"YYYYMMDD\");\n \tvm.model.selectedDate = e.date;\n \t/* For available date retrieve 'available time' slots */\n \tif(vm.model.selectedLocation != 'Choose Location') {\n \t\tcustApi.fetchAvailableSlotsForDay(vm.model.fromDate, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId, vm.model.selectedLocation.pincodeid).\n \tsuccess(function (data, status, header, config) {\n \t\tconsole.log(\"Available slots retrieved successfully\");\n \t\tconsole.log(\"Slots:\");\n \t\tconsole.log(data);\n \t\tvm.model.timeslotArray = [];\n \t\t/* format time slot into hr:min am/pm */\n \t\tdata.payload.appointmentslots.forEach(function(item) {\n \t\t\tvar hours = item.st.substring(0,2);\n \t\t\tvar mins = item.st.substring(2,4);\n \t\t\tvar period = \"\";\n\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t}\n \t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n \t\t\tvm.model.timeslotArray.push({starttime: timeformat});\n \t\t});\n \t}).\n \terror(function (data, status, header, config) {\n \t\tconsole.log(\"Error in retrieving available slots\");\n \t});\n \t}\n \tvm.promoobj.promocode='';\n\t\t\tvm.promoobj.promocodeid='';\n\t\t\tvm.promoobj.finalcost='';\n\t\t\tvm.promoobj.discount='';\n\t\t\tvm.model.apptCost = localVariables.bookNowobj.apptCost; \n\t\t\tvm.custInfoFormFields.promocode='';\n });\n\t}", "function rangeDateBootstrapDatePicker(idStartDate,idEndDate,optionStartDate='',optionEndDate='')\n{\n let options = {\n language: 'es',\n autoclose:true,\n };\n\n if(optionStartDate !== ''){\n options.startDate = optionStartDate;\n }\n\n if(optionEndDate !== ''){\n options.endDate = optionEndDate;\n }\n\n $(`#${idStartDate}`).datepicker(options).on('changeDate', function() {\n $(`#${idEndDate}`).datepicker('setStartDate',this.value);\n });\n\n $(`#${idEndDate}`).datepicker(options).on('changeDate', function() {\n $(`#${idStartDate}`).datepicker('setEndDate',this.value);\n });\n}", "function datePick() {\r\n $('.date-pick').daterangepicker({\r\n singleDatePicker: true,\r\n showDropdowns: true,\r\n opens: 'right',\r\n drops: 'up',\r\n })\r\n }", "function init(){\n\t\t//para la fecha del calendario\n\t\t$(\".datepicker\").datepicker({ \n\t\t\tformat: \"yyyy-mm-dd\",\n\t autoclose: true\n\t\t}).datepicker(\"setDate\",\"today\");\n\t}", "function initDatePickr(element) {\n element.flatpickr({\n altInput: true,\n altFormat: \"F j, Y\",\n dateFormat: \"Z\",\n minDate: tomorr\n });\n}", "_init() {\n this._todayYear = this._dateAdapter.getYear(this._dateAdapter.today());\n // We want a range years such that we maximize the number of\n // enabled dates visible at once. This prevents issues where the minimum year\n // is the last item of a page OR the maximum year is the first item of a page.\n // The offset from the active year to the \"slot\" for the starting year is the\n // *actual* first rendered year in the multi-year view.\n const activeYear = this._dateAdapter.getYear(this._activeDate);\n const minYearOfPage = activeYear - getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);\n this._years = [];\n for (let i = 0, row = []; i < yearsPerPage; i++) {\n row.push(minYearOfPage + i);\n if (row.length == yearsPerRow) {\n this._years.push(row.map(year => this._createCellForYear(year)));\n row = [];\n }\n }\n this._changeDetectorRef.markForCheck();\n }", "_init() {\n this._todayYear = this._dateAdapter.getYear(this._dateAdapter.today());\n // We want a range years such that we maximize the number of\n // enabled dates visible at once. This prevents issues where the minimum year\n // is the last item of a page OR the maximum year is the first item of a page.\n // The offset from the active year to the \"slot\" for the starting year is the\n // *actual* first rendered year in the multi-year view.\n const activeYear = this._dateAdapter.getYear(this._activeDate);\n const minYearOfPage = activeYear - getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);\n this._years = [];\n for (let i = 0, row = []; i < yearsPerPage; i++) {\n row.push(minYearOfPage + i);\n if (row.length == yearsPerRow) {\n this._years.push(row.map(year => this._createCellForYear(year)));\n row = [];\n }\n }\n this._changeDetectorRef.markForCheck();\n }", "function init(e) {\n var input = this;\n if (input.element.bulmaCalendar) return;\n\n var yearly = input.attr('yearly');\n var format = yearly ? 'DD-MM' : 'DD-MM-YYYY';\n\n bulmaCalendar.attach(input.element, {\n type: 'date',\n lang: locale,\n dateFormat: format\n });\n\n input.element.bulmaCalendar.on('select', function(e) {\n input.trigger('dp.change');\n });\n }", "function initDatepicker() {\n\t\t\tif($('#dt1').length != 1) {\n\t\t\t\t$timeout(initDatepicker, 50);\n\t\t\t\t//console.log(\"inside datepicker\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$('#dt1').datetimepicker({\n\t\t\t\t/*defaultDate: new Date(),*/\n\t\t\t\tformat: 'DD-MM-YYYY'\n\t\t\t});\n\t\t\tvm.fromMonthDate = moment(new Date()).format(\"YYYYMM\");\n\t\t\t$(\"#dt1\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\n\t\t\t/* Event called when month is changed */\n\t\t\t$(\"#dt1\").on(\"dp.update\", function (e) {\n\t\t\t\tvm.fromMonthDate = e.viewDate.format(\"YYYYMM\");\n\t\t\t\t/*var getdate = $('.dt1').val();\n\t\t\t\t$('.dt1').data('DateTimePicker').date(moment(getdate, 'DD-MM-YYYY'));*/\n\t\t\t\t/* If location not Pune then check 'available dates' for the month */\n\t\t\t\tif(vm.selectedLocation != 'Choose Location') {\n\t\t\t\t\tcustApi.checkAvailableDatesInMonth(3, vm.fromMonthDate, vm.selectedLocation.pincodeid, vm.selectedLocation.zoneid, vm.physiotherapyId).\n\t\t\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\t\t\tconsole.log(\"Available dates retrieved successfully\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Enabling available dates */\n\t\t\t\t\t\tvar i=0;\n\t\t\t\t\t\tenableDatesArray = [];\n\t\t\t\t\t\tvar yr='';\n\t\t\t\t\t\tvar month='';\n\t\t\t\t\t\tvar day='';\n\t\t\t\t\t\tvar date='';\n\t\t\t\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\t\t\t\tyr = p.substring(0,4);\n\t\t\t\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\t\t\t\tday = p.substring(6,8);\n\t\t\t\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\t\t\t\tenableDatesArray.push(new Date(date));\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif(enableDatesArray.length != 0) {\n\t\t\t\t\t\t\tvm.flags.datesNotAvailable = false;\n\t\t\t\t\t\t\t$(\"#dt1\").data(\"DateTimePicker\").enabledDates(enableDatesArray);\n\t\t\t\t\t\t\t$(\"#dt2\").data(\"DateTimePicker\").enabledDates(enableDatesArray);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvm.flags.datesNotAvailable = true;\n\t\t\t\t\t\t\t$timeout(function () { vm.flags.datesNotAvailable = false; }, 5000);\n\t\t\t\t\t\t\t$(\"#dt1\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t\t\t\t\t$(\"#dt2\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}).\n\t\t\t\t\terror(function (data, status, header, config) {\n\t\t\t\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t/*\n\t\t\t* Event called when date is changed \n\t\t\t*/\n\t\t\t$(\"#dt1\").on(\"dp.change\", function (e) {\n\t\t\t\tvm.fromDate = e.date.format(\"YYYYMMDD\");\n\t\t\t\t$(\"#dt2\").data(\"DateTimePicker\").date(e.date);\n\t\t\t\tvm.selectedDate = e.date;\n\t\t\t\t/* For available date retrieve 'available time' slots */\n\t\t\t\tif(vm.selectedLocation != 'Choose Location') {\n\t\t\t\t\tcustApi.fetchAvailableSlotsForDay(vm.fromDate, vm.selectedLocation.zoneid, vm.physiotherapyId, vm.selectedLocation.pincodeid).\n\t\t\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\t\t\tconsole.log(\"Available slots retrieved successfully\");\n\t\t\t\t\t\tconsole.log(\"Slots:\");\n\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t\tvm.timeslotArray = [];\n\t\t\t\t\t\t/* format time slot into hr:min am/pm */\n\t\t\t\t\t\tdata.payload.appointmentslots.forEach(function(item) {\n\t\t\t\t\t\t\tvar hours = item.st.substring(0,2);\n\t\t\t\t\t\t\tvar mins = item.st.substring(2,4);\n\t\t\t\t\t\t\tvar period = \"\";\n\t\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n\t\t\t\t\t\t\tvm.timeslotArray.push({starttime: timeformat});\n\t\t\t\t\t\t});\n\t\t\t\t\t}).\n\t\t\t\t\terror(function (data, status, header, config) {\n\t\t\t\t\t\tconsole.log(\"Error in retrieving available slots\");\n\t\t\t\t\t});\n\t\t\t\t} \t\n\t\t\t});\n\t\t}", "function Datepicker() {\r\n\tthis.debug = false; // Change this to true to start debugging\r\n\tthis._nextId = 0; // Next ID for a date picker instance\r\n\tthis._inst = []; // List of instances indexed by ID\r\n\tthis._curInst = null; // The current instance in use\r\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\r\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\r\n\tthis.regional = []; // Available regional settings, indexed by language code\r\n\tthis.regional[''] = { // Default regional settings\r\n\t\tclearText: 'Clear', // Display text for clear link\r\n\t\tclearStatus: 'Erase the current date', // Status text for clear link\r\n\t\tcloseText: 'Close', // Display text for close link\r\n\t\tcloseStatus: 'Close without change', // Status text for close link\r\n\t\tprevText: '&#x3c;Prev', // Display text for previous month link\r\n\t\tprevStatus: 'Show the previous month', // Status text for previous month link\r\n\t\tnextText: 'Next&#x3e;', // Display text for next month link\r\n\t\tnextStatus: 'Show the next month', // Status text for next month link\r\n\t\tcurrentText: 'Today', // Display text for current month link\r\n\t\tcurrentStatus: 'Show the current month', // Status text for current month link\r\n\t\tmonthNames: ['January','February','March','April','May','June',\r\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\r\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\r\n\t\tmonthStatus: 'Show a different month', // Status text for selecting a month\r\n\t\tyearStatus: 'Show a different year', // Status text for selecting a year\r\n\t\tweekHeader: 'Wk', // Header for the week of the year column\r\n\t\tweekStatus: 'Week of the year', // Status text for the week of the year column\r\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\r\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\r\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\r\n\t\tdayStatus: 'Set DD as first week day', // Status text for the day of the week selection\r\n\t\tdateStatus: 'Select DD, M d', // Status text for the date selection\r\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\r\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n\t\tinitStatus: 'Select a date', // Initial Status text on opening\r\n\t\tisRTL: false // True if right-to-left language, false if left-to-right\r\n\t};\r\n\tthis._defaults = { // Global defaults for all the date picker instances\r\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\r\n\t\t\t// 'button' for trigger button, or 'both' for either\r\n\t\tshowAnim: 'show', // Name of jQuery animation for popup\r\n\t\tdefaultDate: null, // Used when field is blank: actual date,\r\n\t\t\t// +/-number for offset from today, null for today\r\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\r\n\t\tbuttonText: '...', // Text for trigger button\r\n\t\tbuttonImage: '', // URL for trigger button image\r\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n\t\tcloseAtTop: true, // True to have the clear/close at the top,\r\n\t\t\t// false to have them at the bottom\r\n\t\tmandatory: false, // True to hide the Clear link, false to include it\r\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\r\n\t\t\t// if not applicable, false to just disable them\r\n\t\tchangeMonth: true, // True if month can be selected directly, false if only prev/next\r\n\t\tchangeYear: true, // True if year can be selected directly, false if only prev/next\r\n\t\tyearRange: '-10:+10', // Range of years to display in drop-down,\r\n\t\t\t// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)\r\n\t\tchangeFirstDay: true, // True to click on day name to change, false to remain as set\r\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\r\n\t\tshowWeeks: false, // True to show week of the year, false to omit\r\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n\t\t\t// takes a Date and returns the number of the week for it\r\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\r\n\t\t\t// > this are in the previous century, \r\n\t\t\t// string value starting with '+' for current year + value\r\n\t\tshowStatus: false, // True to show status bar at bottom, false to not show it\r\n\t\tstatusForDate: this.dateStatus, // Function to provide status text for a date -\r\n\t\t\t// takes date and instance as parameters, returns display text\r\n\t\tminDate: null, // The earliest selectable date, or null for no limit\r\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\r\n\t\tspeed: 'normal', // Speed of display/closure\r\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\r\n\t\t\t// [0] = true if selectable, false if not,\r\n\t\t\t// [1] = custom CSS class name(s) or '', e.g. $.datepicker.noWeekends\r\n\t\tbeforeShow: null, // Function that takes an input field and\r\n\t\t\t// returns a set of custom settings for the date picker\r\n\t\tonSelect: null, // Define a callback function when a date is selected\r\n\t\tonClose: null, // Define a callback function when the datepicker is closed\r\n\t\tnumberOfMonths: 1, // Number of months to show at a time\r\n\t\tstepMonths: 1, // Number of months to step back/forward\r\n\t\trangeSelect: false, // Allows for selecting a date range on one date picker\r\n\t\trangeSeparator: ' - ' // Text between two dates in a range\r\n\t};\r\n\t$.extend(this._defaults, this.regional['']);\r\n\tthis._datepickerDiv = $('<div id=\"datepicker_div\">');\r\n}", "function init() {\n setMortalitySlider()\n setIncidentsSlider()\n setDeathPercentageSlider()\n setYearSlider()\n}", "function Datepicker() {}", "function Datepicker() {}", "function setDates() {\n var endDate, dat_endDate;\n if ((document.forms[0].startDate) && (document.forms[0].endDate)) {\n startDate=document.forms[0].startDate.value;\n endDate=document.forms[0].endDate.value;\n if (startDate != '') {\n if (startDate > endDate) {\n document.forms[0].endDate_dummy.value=document.forms[0].startDate_dummy.value;\n document.forms[0].endDate.value=document.forms[0].startDate.value;\n }\n\t }\n }\n}", "function select_dates() {\n var dateFormat = 'dd/mm/yy';\n\n var from = $('#from')\n .datepicker({\n defaultDate: '-4d',\n changeMonth: true,\n numberOfMonths: 1\n })\n .on('change', function(){\n to.datepicker('option', 'minDate', getDateDatePicker( this, 0, 'to'));\n to.datepicker('option', 'maxDate', getDateDatePicker( this, 4, 'to'));\n $(this).datepicker('option', 'minDate', null);\n $(this).datepicker('option', 'maxDate', 0);\n date.from = new Date(this.value);\n date.to = setDateDatePicker($('#to').datepicker('getDate'));\n get_data();\n });\n\n $('#from').datepicker('setDate', new Date());\n\n var to = $('#to').datepicker({\n defaultDate: '0d',\n changeMonth: true,\n numberOfMonths: 1,\n maxDate: 0\n })\n .on('change', function(){\n from.datepicker('option', 'maxDate', getDateDatePicker( this, 0, 'from'));\n from.datepicker('option', 'minDate', getDateDatePicker( this, -4, 'from'));\n $(this).datepicker('option', 'minDate', null);\n $(this).datepicker('option', 'maxDate', 0);\n date.from = setDateDatePicker($('#from').datepicker('getDate'))\n date.to = new Date(this.value)\n get_data();\n });\n\n $('#to').datepicker('setDate', new Date());\n \n function getDateDatePicker(element, diff, opt){\n var date_out;\n var date_tmp;\n var date_tmp_aux;\n var date_tmp_out;\n try{\n date_tmp_aux = new Date();\n date_tmp = new Date(element.value);\n date_tmp.setDate(date_tmp.getDate() + parseInt(diff));\n if(opt == 'to'){\n if(date_tmp > date_tmp_aux){\n date_tmp_out = new Date(date_tmp_aux);\n }\n else{\n date_tmp_out = new Date(date_tmp);\n }\n }\n else{\n date_tmp_out = date_tmp;\n }\n date_out = $.datepicker.parseDate( dateFormat, date_tmp_out.getDate() + '/' + (date_tmp_out.getMonth()+1) + '/' + date_tmp_out.getFullYear());\n } catch( error ) {\n date_out = null;\n }\n return date_out;\n }\n\n function setDateDatePicker(datetime){\n date_out = $.datepicker.parseDate( dateFormat, datetime.getDate() + '/' + (datetime.getMonth()+1) + '/' + datetime.getFullYear());\n return date_out;\n }\n }", "function Datepicker() {\r\n this._curInst = null; // The current instance in use\r\n this._keyEvent = false; // If the last event was a key event\r\n this._disabledInputs = []; // List of date picker inputs that have been disabled\r\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n this._inDialog = false; // True if showing within a \"dialog\", false if not\r\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\r\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\r\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\r\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\r\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\r\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\r\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\r\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\r\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\r\n this.regional = []; // Available regional settings, indexed by language code\r\n this.regional[\"\"] = { // Default regional settings\r\n closeText: \"Done\", // Display text for close link\r\n prevText: \"Prev\", // Display text for previous month link\r\n nextText: \"Next\", // Display text for next month link\r\n currentText: \"Today\", // Display text for current month link\r\n monthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\r\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\r\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\r\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\r\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\r\n dayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\r\n weekHeader: \"Wk\", // Column header for week of the year\r\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\r\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n isRTL: false, // True if right-to-left language, false if left-to-right\r\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n yearSuffix: \"\" // Additional text to append to the year in the month headers\r\n };\r\n this._defaults = { // Global defaults for all the date picker instances\r\n showOn: \"focus\", // \"focus\" for popup on focus,\r\n // \"button\" for trigger button, or \"both\" for either\r\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\r\n showOptions: {}, // Options for enhanced animations\r\n defaultDate: null, // Used when field is blank: actual date,\r\n // +/-number for offset from today, null for today\r\n appendText: \"\", // Display text following the input box, e.g. showing the format\r\n buttonText: \"...\", // Text for trigger button\r\n buttonImage: \"\", // URL for trigger button image\r\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n hideIfNoPrevNext: false, // True to hide next/previous month links\r\n // if not applicable, false to just disable them\r\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n gotoCurrent: false, // True if today link goes back to current selection instead\r\n changeMonth: false, // True if month can be selected directly, false if only prev/next\r\n changeYear: false, // True if year can be selected directly, false if only prev/next\r\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\r\n // either relative to today's year (-nn:+nn), relative to currently displayed year\r\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n showOtherMonths: false, // True to show dates in other months, false to leave blank\r\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n showWeek: false, // True to show week of the year, false to not show it\r\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n // takes a Date and returns the number of the week for it\r\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\r\n // > this are in the previous century,\r\n // string value starting with \"+\" for current year + value\r\n minDate: null, // The earliest selectable date, or null for no limit\r\n maxDate: null, // The latest selectable date, or null for no limit\r\n duration: \"fast\", // Duration of display/closure\r\n beforeShowDay: null, // Function that takes a date and returns an array with\r\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\r\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n beforeShow: null, // Function that takes an input field and\r\n // returns a set of custom settings for the date picker\r\n onSelect: null, // Define a callback function when a date is selected\r\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n onClose: null, // Define a callback function when the datepicker is closed\r\n numberOfMonths: 1, // Number of months to show at a time\r\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n stepMonths: 1, // Number of months to step back/forward\r\n stepBigMonths: 12, // Number of months to step back/forward for the big links\r\n altField: \"\", // Selector for an alternate field to store selected dates into\r\n altFormat: \"\", // The date format to use for the alternate field\r\n constrainInput: true, // The input is constrained by the current date format\r\n showButtonPanel: false, // True to show button panel, false to not show it\r\n autoSize: false, // True to size the input for the date format, false to leave as is\r\n disabled: false // The initial disabled state\r\n };\r\n $.extend(this._defaults, this.regional[\"\"]);\r\n this.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\r\n }", "function init() {\r\n\t// Apply date picker.\r\n\tflatpickr( document.querySelector( \"#sFromDate\"), flatpickrDefault(\"sFromDate\", -30) );\r\n\tflatpickr( document.querySelector( \"#sToDate\") , flatpickrDefault(\"sToDate\" ) );\t\r\n\t\r\n\t// display store information\r\n\tdocument.querySelector( \"#idAccumCustomerCnt\" \t).value = accumCustomerCnt \t+ \" \" + mLang.get(\"peopleqty\");\r\n\tdocument.querySelector( \"#idAccumSavAmt\" \t\t).value = accumSavAmt\t\t+ \" \" + ( savTp == \"C\" ? mLang.get(\"numberqty\"):mLang.get(\"point\") );\r\n\tdocument.querySelector( \"#idAccumUseAmt\" \t\t).value\t= accumUseAmt\t\t+ \" \" + ( savTp == \"C\" ? mLang.get(\"numberqty\"):mLang.get(\"point\") );\r\n}", "function initDatePicker(elems) {\n var instances = M.Datepicker.init(elems, {\n autoClose: true,\n showMonthAfterYear: true,\n format: 'yyyy/mm/dd',\n defaultDate: new Date('2017/02/23'),\n minDate: new Date('2017/02/23'),\n maxDate: new Date('2017/04/26'),\n setDefaultDate: true,\n container: '#dialog-container',\n // Localization\n i18n: {\n cancel: '取消',\n clear: '清除',\n done: '确认',\n months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n monthsShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],\n weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],\n weekdaysShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],\n weekdaysAbbrev: ['日', '一', '二', '三', '四', '五', '六'],\n },\n onSelect: onDateSelection,\n\n });\n return instances;\n}", "function OnStartDateChanged(sender, eventArgs) {\n ClearTimeIfNoDate(startDatePickerId, startTimePickerId);\n FireDateRangeValidator();\n }", "function initDate() {\n $(\".date\").flatpickr({\n // enableTime: true,\n // dateFormat: \"Y-m-d H:i\"\n });\n }", "function setupCal() {\n var date1, newDate;\n $(\"#checkin\").datepicker({\n inline: true,\n firstDay: 0,\n showOtherMonths: true,\n dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n dateFormat: 'dd-m-yy',\n minDate: 0,\n onSelect: function (date) {\n date1 = $(\"#checkin\").datepicker('getDate');\n date = new Date(Date.parse(date1));\n date.setDate(date.getDate() + 1);\n newDate = date.toDateString();\n newDate = new Date(Date.parse(newDate));\n $(\"#checkout\").datepicker(\"option\", \"minDate\", newDate);\n }\n });\n\n $(\"#checkout\").datepicker({\n inline: true,\n firstDay: 0,\n showOtherMonths: true,\n dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n dateFormat: 'dd-m-yy',\n minDate: 1\n });\n }", "function changeDate(){\n\n\t\t$(\"#d1\").datepicker({\n\t\t format: 'yyyy-mm-dd',\n\t\t todayHighlight: true,\n\t\t autoclose: true,\n\t\t}).on('changeDate', function (selected) {\n\t\t $('#d2').datepicker({\n\t\t format: 'yyyy-mm-dd',\n\t\t autoclose: true,\n\t\t todayHighlight: true\n\t\t });\n\t\t var minDate = new Date(selected.date.valueOf());\n\t\t $('#d2').datepicker(\"update\", minDate);\n\t\t $('#d2').datepicker('setStartDate', minDate);\n\t\t});\n\t\t//for end date\n\t\t$(\"#d2\").datepicker({\n\t\t format: 'yyyy-mm-dd',\n\t\t autoclose: true\n\t\t}).on('changeDate', function (selected) {\n\t\t var maxDate = new Date(selected.date.valueOf());\n\t\t $('#d1').datepicker('setEndDate', maxDate);\n\t\t});\n\t}", "function populateInitialValues(){\r\n\t\t\tvar existingDate = mainEvt.target.value;\r\n\t\t\texistingDate = existingDate.split(\".\");\r\n\t\t\tif(existingDate.length > 1){\r\n\t\t\t\tvar date = existingDate[2] + \"-\" + addLeadingZero(existingDate[1]) + \"-01\";\r\n\t\t\t\t// Update display date\r\n\t\t\t\tjcalendar_y_m.children[0].textContent = JC_Months[existingDate[1] - 1];\r\n\t\t\t\tjcalendar_y_m.children[1].textContent = existingDate[2];\r\n\t\t\t\t// Update select boxes\r\n\t\t\t\tjcalendar_year.value = existingDate[2];\r\n\t\t\t\tjcalendar_month.value = (+existingDate[1]);\r\n\t\t\t\tpopulateData(get1stDayOfMonth(date), getTotalDays(existingDate[2], existingDate[1]));\r\n\t\t\t}else{\r\n\t\t\t\tvar date = JC_cur_year + \"-\" + JC_cur_month + \"-01\";\r\n\t\t\t\t// Update display date\r\n\t\t\t\tjcalendar_y_m.children[0].textContent = JC_Months[JC_cur_month - 1];\r\n\t\t\t\tjcalendar_y_m.children[1].textContent = JC_cur_year;\r\n\t\t\t\t// Update select boxes\r\n\t\t\t\tjcalendar_year.value = JC_cur_year;\r\n\t\t\t\tjcalendar_month.value = (+JC_cur_month);\r\n\t\t\t\tpopulateData(get1stDayOfMonth(date), getTotalDays(JC_cur_year, JC_cur_month));\r\n\t\t\t}\r\n\t\t}", "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t}", "function initialize() {\n $(\"#dtFechaIni\").datepicker('setDate', new Date());\n $(\"#dtFechaFin\").datepicker('setDate', new Date());\n $(\"#divRightMenu\").hide();\n EscondeObjetosAlIniciar();\n CargaMetodos();\n setTimer();\n refresh();\n}", "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n\t\t\t\t\"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\tdayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t}", "function datePickerConfig(element){\r\n var defaultMinDateValue = element.defaultMinDateValue;\r\n var defaultMaxDateValue = element.defaultMaxDateValue;\r\n var minDateValue = defaultMinDateValue;\r\n var maxDateValue = defaultMaxDateValue;\r\n \r\n // Start date calendar\r\n maxDateValue = $(element.endDate).val();\r\n \r\n // Add readonly attribute to prevent inappropriate user input\r\n // $(element.startDate).attr('readonly', true);\r\n var finalMaxDate = (maxDateValue != 0) ? maxDateValue : defaultMaxDateValue;\r\n $(element.startDate).datepicker({\r\n dateFormat : \"yy-mm-dd\",\r\n minDate : defaultMinDateValue,\r\n maxDate : finalMaxDate,\r\n changeMonth : true,\r\n changeYear : true,\r\n defaultDate : null,\r\n onClose : function(selectedDate){\r\n if (selectedDate != \"\") {\r\n $(element.endDate).datepicker(\"option\", \"minDate\", selectedDate);\r\n }\r\n }\r\n });\r\n \r\n // End date calendar\r\n minDateValue = $(element.startDate).val();\r\n \r\n // Add readonly attribute to prevent inappropriate user input\r\n // $(element.endDate).attr('readonly', true);\r\n var finalMinDate = (minDateValue != 0) ? minDateValue : defaultMinDateValue;\r\n $(element.endDate).datepicker({\r\n dateFormat : \"yy-mm-dd\",\r\n minDate : finalMinDate,\r\n maxDate : defaultMaxDateValue,\r\n changeMonth : true,\r\n changeYear : true,\r\n defaultDate : null,\r\n onClose : function(selectedDate){\r\n if (selectedDate != \"\") {\r\n $(element.startDate).datepicker(\"option\", \"maxDate\", selectedDate);\r\n }\r\n }\r\n });\r\n }", "function addDatepicker(){\n\t$('#startdateinput').datepicker({\n\t\tinline: true,\n\t\tshowOtherMonths: true,\n\t\tdayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\t});\n\t$('#endateinput').datepicker({\n\t\tinline: true,\n\t\tshowOtherMonths: true,\n\t\tdayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\t});\n}", "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[ \"\" ] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n monthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n dayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n dayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n dayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend( this._defaults, this.regional[ \"\" ] );\n this.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n this.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n this.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n}", "function Datepicker() {\r\n\tthis._curInst = null; // The current instance in use\r\n\tthis._keyEvent = false; // If the last event was a key event\r\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\r\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\r\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\r\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\r\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\r\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\r\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\r\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\r\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\r\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\r\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\r\n\tthis.regional = []; // Available regional settings, indexed by language code\r\n\tthis.regional[\"\"] = { // Default regional settings\r\n\t\tcloseText: \"Done\", // Display text for close link\r\n\t\tprevText: \"Prev\", // Display text for previous month link\r\n\t\tnextText: \"Next\", // Display text for next month link\r\n\t\tcurrentText: \"Today\", // Display text for current month link\r\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\r\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\r\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\r\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\r\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\r\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\r\n\t\tweekHeader: \"Wk\", // Column header for week of the year\r\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\r\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\r\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\r\n\t};\r\n\tthis._defaults = { // Global defaults for all the date picker instances\r\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\r\n\t\t\t// \"button\" for trigger button, or \"both\" for either\r\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\r\n\t\tshowOptions: {}, // Options for enhanced animations\r\n\t\tdefaultDate: null, // Used when field is blank: actual date,\r\n\t\t\t// +/-number for offset from today, null for today\r\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\r\n\t\tbuttonText: \"...\", // Text for trigger button\r\n\t\tbuttonImage: \"\", // URL for trigger button image\r\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\r\n\t\t\t// if not applicable, false to just disable them\r\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\r\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\r\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\r\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\r\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\r\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\r\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n\t\tshowWeek: false, // True to show week of the year, false to not show it\r\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n\t\t\t// takes a Date and returns the number of the week for it\r\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\r\n\t\t\t// > this are in the previous century,\r\n\t\t\t// string value starting with \"+\" for current year + value\r\n\t\tminDate: null, // The earliest selectable date, or null for no limit\r\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\r\n\t\tduration: \"fast\", // Duration of display/closure\r\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\r\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\r\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n\t\tbeforeShow: null, // Function that takes an input field and\r\n\t\t\t// returns a set of custom settings for the date picker\r\n\t\tonSelect: null, // Define a callback function when a date is selected\r\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n\t\tonClose: null, // Define a callback function when the datepicker is closed\r\n\t\tnumberOfMonths: 1, // Number of months to show at a time\r\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n\t\tstepMonths: 1, // Number of months to step back/forward\r\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\r\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\r\n\t\taltFormat: \"\", // The date format to use for the alternate field\r\n\t\tconstrainInput: true, // The input is constrained by the current date format\r\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\r\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\r\n\t\tdisabled: false // The initial disabled state\r\n\t};\r\n\t$.extend(this._defaults, this.regional[\"\"]);\r\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\r\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\r\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\r\n}", "function Datepicker() {\r\n\tthis._curInst = null; // The current instance in use\r\n\tthis._keyEvent = false; // If the last event was a key event\r\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\r\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\r\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\r\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\r\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\r\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\r\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\r\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\r\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\r\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\r\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\r\n\tthis.regional = []; // Available regional settings, indexed by language code\r\n\tthis.regional[\"\"] = { // Default regional settings\r\n\t\tcloseText: \"Done\", // Display text for close link\r\n\t\tprevText: \"Prev\", // Display text for previous month link\r\n\t\tnextText: \"Next\", // Display text for next month link\r\n\t\tcurrentText: \"Today\", // Display text for current month link\r\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\r\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\r\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\r\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\r\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\r\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\r\n\t\tweekHeader: \"Wk\", // Column header for week of the year\r\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\r\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\r\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\r\n\t};\r\n\tthis._defaults = { // Global defaults for all the date picker instances\r\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\r\n\t\t\t// \"button\" for trigger button, or \"both\" for either\r\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\r\n\t\tshowOptions: {}, // Options for enhanced animations\r\n\t\tdefaultDate: null, // Used when field is blank: actual date,\r\n\t\t\t// +/-number for offset from today, null for today\r\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\r\n\t\tbuttonText: \"...\", // Text for trigger button\r\n\t\tbuttonImage: \"\", // URL for trigger button image\r\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\r\n\t\t\t// if not applicable, false to just disable them\r\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\r\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\r\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\r\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\r\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\r\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\r\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n\t\tshowWeek: false, // True to show week of the year, false to not show it\r\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n\t\t\t// takes a Date and returns the number of the week for it\r\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\r\n\t\t\t// > this are in the previous century,\r\n\t\t\t// string value starting with \"+\" for current year + value\r\n\t\tminDate: null, // The earliest selectable date, or null for no limit\r\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\r\n\t\tduration: \"fast\", // Duration of display/closure\r\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\r\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\r\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n\t\tbeforeShow: null, // Function that takes an input field and\r\n\t\t\t// returns a set of custom settings for the date picker\r\n\t\tonSelect: null, // Define a callback function when a date is selected\r\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n\t\tonClose: null, // Define a callback function when the datepicker is closed\r\n\t\tnumberOfMonths: 1, // Number of months to show at a time\r\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n\t\tstepMonths: 1, // Number of months to step back/forward\r\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\r\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\r\n\t\taltFormat: \"\", // The date format to use for the alternate field\r\n\t\tconstrainInput: true, // The input is constrained by the current date format\r\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\r\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\r\n\t\tdisabled: false // The initial disabled state\r\n\t};\r\n\t$.extend(this._defaults, this.regional[\"\"]);\r\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\r\n}", "function initDatePicker() {\n\t\tif($('#dt3').length != 1) {\n\t\t\t$timeout(localmethods.initDatePicker, 50);\n\t\t\t//console.log(\"inside datepicker\");\n\t\t\treturn;\n\t\t}\n\t\t$('#dt3').datetimepicker({\n\t\t\t/*defaultDate: localVariables.bookNowobj.date,*/\n\t\t\tformat: 'DD-MM-YYYY'\n\t\t});\n\n\t\t/*set array of enabled dates*/\n\t\tvm.model.fromMonthDate = moment(new Date()).format(\"YYYYMM\");\n\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\n\t\t/* Event called when month is changed */\n $(\"#dt3\").on(\"dp.update\", function (e) {\n \tvm.model.fromMonthDate = e.viewDate.format(\"YYYYMM\");\n \tif(vm.model.selectedLocation != 'Choose Location') {\n \t\tcustApi.checkAvailableDatesInMonth(3, vm.model.fromMonthDate, vm.model.selectedLocation.pincodeid, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId).\n\t\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\t\tconsole.log(\"Available dates retrieved successfully\");\n\t\t\t\t\t\n\t\t\t\t\t/* Enabling available dates */\n\t\t\t\t\tvar i=0;\n\t\t\t\t\tlocalVariables.enableDatesArray = [];\n\t\t\t\t\tvar yr='';\n\t\t\t\t\tvar month='';\n\t\t\t\t\tvar day='';\n\t\t\t\t\tvar date='';\n\t\t\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\t\t\tyr = p.substring(0,4);\n\t\t\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\t\t\tday = p.substring(6,8);\n\t\t\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\t\t\tlocalVariables.enableDatesArray.push(new Date(date));\n \n\t\t\t\t\t});\t\t\t\t\n \n\t\t\t\t\tif(localVariables.enableDatesArray.length != 0) {\n console.log(\"setting date not available flag to false\");\n \t$scope.$parent.cpc.flags.datesNotAvailable = false;\n\t\t\t\t\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates(localVariables.enableDatesArray);\n\t\t\t\t\t} else {\n console.log(\"setting date not available flag to true\");\n $scope.$parent.cpc.flags.datesNotAvailable = true;\n \n $timeout(function () { \t$scope.$parent.cpc.flags.datesNotAvailable = false; }, 5000);\n\t\t\t\t\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t\t\t}\n\t\t\t\t}).\n\t\t\t\terror(function (data, status, header, config) {\n\t\t\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t\t\t});\n \t}\n });\n\n /* *Event called when date is changed* */\n $(\"#dt3\").on(\"dp.change\", function (e) {\n \tvm.model.fromDate = e.date.format(\"YYYYMMDD\");\n \tvm.model.selectedDate = e.date;\n \t/* For available date retrieve 'available time' slots */\n \tif(vm.model.selectedLocation != 'Choose Location') {\n \t\tcustApi.fetchAvailableSlotsForDay(vm.model.fromDate, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId, vm.model.selectedLocation.pincodeid).\n \tsuccess(function (data, status, header, config) {\n \t\tconsole.log(\"Available slots retrieved successfully\");\n \t\tconsole.log(\"Slots:\");\n \t\tconsole.log(data);\n \t\tvm.model.timeslotArray = [];\n \t\t/* format time slot into hr:min am/pm */\n \t\tdata.payload.appointmentslots.forEach(function(item) {\n \t\t\tvar hours = item.st.substring(0,2);\n \t\t\tvar mins = item.st.substring(2,4);\n \t\t\tvar period = \"\";\n\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t}\n \t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n \t\t\tvm.model.timeslotArray.push({starttime: timeformat});\n \t\t});\n \t}).\n \terror(function (data, status, header, config) {\n \t\tconsole.log(\"Error in retrieving available slots\");\n \t});\n \t} \t\n });\n\t}", "function Datepicker() {\n this._curInst = null;\n // The current instance in use\n this._keyEvent = false;\n // If the last event was a key event\n this._disabledInputs = [];\n // List of date picker inputs that have been disabled\n this._datepickerShowing = false;\n // True if the popup picker is showing , false if not\n this._inDialog = false;\n // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\";\n // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\";\n // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\";\n // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\";\n // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\";\n // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\";\n // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\";\n // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\";\n // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\";\n // The name of the day hover marker class\n this.regional = [];\n // Available regional settings, indexed by language code\n this.regional[\"\"] = {\n // Default regional settings\n closeText: \"Done\",\n // Display text for close link\n prevText: \"Prev\",\n // Display text for previous month link\n nextText: \"Next\",\n // Display text for next month link\n currentText: \"Today\",\n // Display text for current month link\n monthNames: [ \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n // Names of months for drop-down and formatting\n monthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ],\n // For formatting\n dayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ],\n // For formatting\n dayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ],\n // For formatting\n dayNamesMin: [ \"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\" ],\n // Column headings for days starting at Sunday\n weekHeader: \"Wk\",\n // Column header for week of the year\n dateFormat: \"mm/dd/yy\",\n // See format options on parseDate\n firstDay: 0,\n // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false,\n // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false,\n // True if the year select precedes month, false for month then year\n yearSuffix: \"\"\n };\n this._defaults = {\n // Global defaults for all the date picker instances\n showOn: \"focus\",\n // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\",\n // Name of jQuery animation for popup\n showOptions: {},\n // Options for enhanced animations\n defaultDate: null,\n // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\",\n // Display text following the input box, e.g. showing the format\n buttonText: \"...\",\n // Text for trigger button\n buttonImage: \"\",\n // URL for trigger button image\n buttonImageOnly: false,\n // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false,\n // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false,\n // True if date formatting applied to prev/today/next links\n gotoCurrent: false,\n // True if today link goes back to current selection instead\n changeMonth: false,\n // True if month can be selected directly, false if only prev/next\n changeYear: false,\n // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\",\n // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false,\n // True to show dates in other months, false to leave blank\n selectOtherMonths: false,\n // True to allow selection of dates in other months, false for unselectable\n showWeek: false,\n // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week,\n // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\",\n // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null,\n // The earliest selectable date, or null for no limit\n maxDate: null,\n // The latest selectable date, or null for no limit\n duration: \"fast\",\n // Duration of display/closure\n beforeShowDay: null,\n // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null,\n // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null,\n // Define a callback function when a date is selected\n onChangeMonthYear: null,\n // Define a callback function when the month or year is changed\n onClose: null,\n // Define a callback function when the datepicker is closed\n numberOfMonths: 1,\n // Number of months to show at a time\n showCurrentAtPos: 0,\n // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1,\n // Number of months to step back/forward\n stepBigMonths: 12,\n // Number of months to step back/forward for the big links\n altField: \"\",\n // Selector for an alternate field to store selected dates into\n altFormat: \"\",\n // The date format to use for the alternate field\n constrainInput: true,\n // The input is constrained by the current date format\n showButtonPanel: false,\n // True to show button panel, false to not show it\n autoSize: false,\n // True to size the input for the date format, false to leave as is\n disabled: false\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "function Datepicker(){this._curInst = null; // The current instance in use\nthis._keyEvent = false; // If the last event was a key event\nthis._disabledInputs = []; // List of date picker inputs that have been disabled\nthis._datepickerShowing = false; // True if the popup picker is showing , false if not\nthis._inDialog = false; // True if showing within a \"dialog\", false if not\nthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\nthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\nthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\nthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\nthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\nthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\nthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\nthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\nthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\nthis.regional = []; // Available regional settings, indexed by language code\nthis.regional[\"\"] = { // Default regional settings\ncloseText:\"Done\", // Display text for close link\nprevText:\"Prev\", // Display text for previous month link\nnextText:\"Next\", // Display text for next month link\ncurrentText:\"Today\", // Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"], // For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"], // For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"], // For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\nweekHeader:\"Wk\", // Column header for week of the year\ndateFormat:\"mm/dd/yy\", // See format options on parseDate\nfirstDay:0, // The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:false, // True if right-to-left language, false if left-to-right\nshowMonthAfterYear:false, // True if the year select precedes month, false for month then year\nyearSuffix:\"\" // Additional text to append to the year in the month headers\n};this._defaults = { // Global defaults for all the date picker instances\nshowOn:\"focus\", // \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\", // Name of jQuery animation for popup\nshowOptions:{}, // Options for enhanced animations\ndefaultDate:null, // Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\", // Display text following the input box, e.g. showing the format\nbuttonText:\"...\", // Text for trigger button\nbuttonImage:\"\", // URL for trigger button image\nbuttonImageOnly:false, // True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:false, // True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:false, // True if date formatting applied to prev/today/next links\ngotoCurrent:false, // True if today link goes back to current selection instead\nchangeMonth:false, // True if month can be selected directly, false if only prev/next\nchangeYear:false, // True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\", // Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:false, // True to show dates in other months, false to leave blank\nselectOtherMonths:false, // True to allow selection of dates in other months, false for unselectable\nshowWeek:false, // True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week, // How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\", // Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null, // The earliest selectable date, or null for no limit\nmaxDate:null, // The latest selectable date, or null for no limit\nduration:\"fast\", // Duration of display/closure\nbeforeShowDay:null, // Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null, // Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null, // Define a callback function when a date is selected\nonChangeMonthYear:null, // Define a callback function when the month or year is changed\nonClose:null, // Define a callback function when the datepicker is closed\nnumberOfMonths:1, // Number of months to show at a time\nshowCurrentAtPos:0, // The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1, // Number of months to step back/forward\nstepBigMonths:12, // Number of months to step back/forward for the big links\naltField:\"\", // Selector for an alternate field to store selected dates into\naltFormat:\"\", // The date format to use for the alternate field\nconstrainInput:true, // The input is constrained by the current date format\nshowButtonPanel:false, // True to show button panel, false to not show it\nautoSize:false, // True to size the input for the date format, false to leave as is\ndisabled:false // The initial disabled state\n};$.extend(this._defaults,this.regional[\"\"]);this.regional.en = $.extend(true,{},this.regional[\"\"]);this.regional[\"en-US\"] = $.extend(true,{},this.regional.en);this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));}", "function Datepicker(){this._curInst = null; // The current instance in use\nthis._keyEvent = false; // If the last event was a key event\nthis._disabledInputs = []; // List of date picker inputs that have been disabled\nthis._datepickerShowing = false; // True if the popup picker is showing , false if not\nthis._inDialog = false; // True if showing within a \"dialog\", false if not\nthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\nthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\nthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\nthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\nthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\nthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\nthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\nthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\nthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\nthis.regional = []; // Available regional settings, indexed by language code\nthis.regional[\"\"] = { // Default regional settings\ncloseText:\"Done\", // Display text for close link\nprevText:\"Prev\", // Display text for previous month link\nnextText:\"Next\", // Display text for next month link\ncurrentText:\"Today\", // Display text for current month link\nmonthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\nmonthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"], // For formatting\ndayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"], // For formatting\ndayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"], // For formatting\ndayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\nweekHeader:\"Wk\", // Column header for week of the year\ndateFormat:\"mm/dd/yy\", // See format options on parseDate\nfirstDay:0, // The first day of the week, Sun = 0, Mon = 1, ...\nisRTL:false, // True if right-to-left language, false if left-to-right\nshowMonthAfterYear:false, // True if the year select precedes month, false for month then year\nyearSuffix:\"\" // Additional text to append to the year in the month headers\n};this._defaults = { // Global defaults for all the date picker instances\nshowOn:\"focus\", // \"focus\" for popup on focus,\n// \"button\" for trigger button, or \"both\" for either\nshowAnim:\"fadeIn\", // Name of jQuery animation for popup\nshowOptions:{}, // Options for enhanced animations\ndefaultDate:null, // Used when field is blank: actual date,\n// +/-number for offset from today, null for today\nappendText:\"\", // Display text following the input box, e.g. showing the format\nbuttonText:\"...\", // Text for trigger button\nbuttonImage:\"\", // URL for trigger button image\nbuttonImageOnly:false, // True if the image appears alone, false if it appears on a button\nhideIfNoPrevNext:false, // True to hide next/previous month links\n// if not applicable, false to just disable them\nnavigationAsDateFormat:false, // True if date formatting applied to prev/today/next links\ngotoCurrent:false, // True if today link goes back to current selection instead\nchangeMonth:false, // True if month can be selected directly, false if only prev/next\nchangeYear:false, // True if year can be selected directly, false if only prev/next\nyearRange:\"c-10:c+10\", // Range of years to display in drop-down,\n// either relative to today's year (-nn:+nn), relative to currently displayed year\n// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\nshowOtherMonths:false, // True to show dates in other months, false to leave blank\nselectOtherMonths:false, // True to allow selection of dates in other months, false for unselectable\nshowWeek:false, // True to show week of the year, false to not show it\ncalculateWeek:this.iso8601Week, // How to calculate the week of the year,\n// takes a Date and returns the number of the week for it\nshortYearCutoff:\"+10\", // Short year values < this are in the current century,\n// > this are in the previous century,\n// string value starting with \"+\" for current year + value\nminDate:null, // The earliest selectable date, or null for no limit\nmaxDate:null, // The latest selectable date, or null for no limit\nduration:\"fast\", // Duration of display/closure\nbeforeShowDay:null, // Function that takes a date and returns an array with\n// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n// [2] = cell title (optional), e.g. $.datepicker.noWeekends\nbeforeShow:null, // Function that takes an input field and\n// returns a set of custom settings for the date picker\nonSelect:null, // Define a callback function when a date is selected\nonChangeMonthYear:null, // Define a callback function when the month or year is changed\nonClose:null, // Define a callback function when the datepicker is closed\nnumberOfMonths:1, // Number of months to show at a time\nshowCurrentAtPos:0, // The position in multipe months at which to show the current month (starting at 0)\nstepMonths:1, // Number of months to step back/forward\nstepBigMonths:12, // Number of months to step back/forward for the big links\naltField:\"\", // Selector for an alternate field to store selected dates into\naltFormat:\"\", // The date format to use for the alternate field\nconstrainInput:true, // The input is constrained by the current date format\nshowButtonPanel:false, // True to show button panel, false to not show it\nautoSize:false, // True to size the input for the date format, false to leave as is\ndisabled:false // The initial disabled state\n};$.extend(this._defaults,this.regional[\"\"]);this.regional.en = $.extend(true,{},this.regional[\"\"]);this.regional[\"en-US\"] = $.extend(true,{},this.regional.en);this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));}", "function datePickerLoadBefore() {\n const DateToday = new Date();\n $('.datePickerBefore').datepicker({\n orientation: \"auto\",\n todayBtn: \"linked\",\n keyboardNavigation: true,\n forceParse: false,\n calendarWeeks: true,\n autoClose: true,\n endDate: DateToday,\n format: \"yyyy-mm-dd\"\n });\n}", "function DatePicker( picker, settings ) {\n\t\n\t var calendar = this,\n\t element = picker.$node[ 0 ],\n\t elementValue = element.value,\n\t elementDataValue = picker.$node.data( 'value' ),\n\t valueString = elementDataValue || elementValue,\n\t formatString = elementDataValue ? settings.formatSubmit : settings.format,\n\t isRTL = function() {\n\t\n\t return element.currentStyle ?\n\t\n\t // For IE.\n\t element.currentStyle.direction == 'rtl' :\n\t\n\t // For normal browsers.\n\t getComputedStyle( picker.$root[0] ).direction == 'rtl'\n\t }\n\t\n\t calendar.settings = settings\n\t calendar.$node = picker.$node\n\t\n\t // The queue of methods that will be used to build item objects.\n\t calendar.queue = {\n\t min: 'measure create',\n\t max: 'measure create',\n\t now: 'now create',\n\t select: 'parse create validate',\n\t highlight: 'parse navigate create validate',\n\t view: 'parse create validate viewset',\n\t disable: 'deactivate',\n\t enable: 'activate'\n\t }\n\t\n\t // The component's item object.\n\t calendar.item = {}\n\t\n\t calendar.item.clear = null\n\t calendar.item.disable = ( settings.disable || [] ).slice( 0 )\n\t calendar.item.enable = -(function( collectionDisabled ) {\n\t return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1\n\t })( calendar.item.disable )\n\t\n\t calendar.\n\t set( 'min', settings.min ).\n\t set( 'max', settings.max ).\n\t set( 'now' )\n\t\n\t // When there’s a value, set the `select`, which in turn\n\t // also sets the `highlight` and `view`.\n\t if ( valueString ) {\n\t calendar.set( 'select', valueString, { format: formatString })\n\t }\n\t\n\t // If there’s no value, default to highlighting “today”.\n\t else {\n\t calendar.\n\t set( 'select', null ).\n\t set( 'highlight', calendar.item.now )\n\t }\n\t\n\t\n\t // The keycode to movement mapping.\n\t calendar.key = {\n\t 40: 7, // Down\n\t 38: -7, // Up\n\t 39: function() { return isRTL() ? -1 : 1 }, // Right\n\t 37: function() { return isRTL() ? 1 : -1 }, // Left\n\t go: function( timeChange ) {\n\t var highlightedObject = calendar.item.highlight,\n\t targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )\n\t calendar.set(\n\t 'highlight',\n\t targetDate,\n\t { interval: timeChange }\n\t )\n\t this.render()\n\t }\n\t }\n\t\n\t\n\t // Bind some picker events.\n\t picker.\n\t on( 'render', function() {\n\t picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {\n\t var value = this.value\n\t if ( value ) {\n\t picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )\n\t picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )\n\t }\n\t })\n\t picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {\n\t var value = this.value\n\t if ( value ) {\n\t picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )\n\t picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )\n\t }\n\t })\n\t }, 1 ).\n\t on( 'open', function() {\n\t var includeToday = ''\n\t if ( calendar.disabled( calendar.get('now') ) ) {\n\t includeToday = ':not(.' + settings.klass.buttonToday + ')'\n\t }\n\t picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )\n\t }, 1 ).\n\t on( 'close', function() {\n\t picker.$root.find( 'button, select' ).attr( 'disabled', true )\n\t }, 1 )\n\t\n\t}", "function setDateRange(){\n\t\tviewGridFactory.getDateRange().success(function(data){\n\t\t\t$scope.datemin = data.min;\n\t\t\t$scope.datemax = data.max;\n\t\t});\n\t}", "_init() {\n this._setSelectedMonth(this.selected);\n this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());\n this._yearLabel = this._dateAdapter.getYearName(this.activeDate);\n let monthNames = this._dateAdapter.getMonthNames('short');\n // First row of months only contains 5 elements so we can fit the year label on the same row.\n this._months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));\n this._changeDetectorRef.markForCheck();\n }", "_init() {\n this._setSelectedMonth(this.selected);\n this._todayMonth = this._getMonthInCurrentYear(this._dateAdapter.today());\n this._yearLabel = this._dateAdapter.getYearName(this.activeDate);\n let monthNames = this._dateAdapter.getMonthNames('short');\n // First row of months only contains 5 elements so we can fit the year label on the same row.\n this._months = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));\n this._changeDetectorRef.markForCheck();\n }", "function initialDatesSet() {\n date1 = moment().startOf(\"day\");\n date2 = moment(date1).add(2, \"day\");\n difference = date2.diff(date1, \"days\");\n }", "function startChange(that) {\n var start = $(\"#\" + that.sender.options.startControlId).data(\"kendoDatePicker\");\n var end = $(\"#\" + that.sender.options.endControlId).data(\"kendoDatePicker\");\n var startDate = start.value();\n\n if (startDate) {\n startDate = new Date(startDate);\n startDate.setDate(startDate.getDate());\n end.min(startDate);\n }\n}", "function updateDatepicker2(booked_dates, start_date){\n window.ST.initializeDatePickerWithBookings('#datepicker2', booked_dates, '#start-on2', '#end-on2', \"#booking-start-output2\", \"#booking-end-output2\", start_date);\n $('#datepicker2').datepicker('update');\n }", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false // True if right-to-left language, false if left-to-right\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'show', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearRange: '-10:+10', // Range of years to display in drop-down,\n\t\t\t// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'normal', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false // True to show button panel, false to not show it\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible\"></div>');\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false // True to size the input for the date format, false to leave as is\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>');\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false // True to size the input for the date format, false to leave as is\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>');\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false // True if right-to-left language, false if left-to-right\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'show', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearRange: '-10:+10', // Range of years to display in drop-down,\n\t\t\t// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'normal', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false // True to show button panel, false to not show it\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible\"></div>');\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "function Datepicker() {\n\tthis.debug = false; // Change this to true to start debugging\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[''] = { // Default regional settings\n\t\tcloseText: 'Done', // Display text for close link\n\t\tprevText: 'Prev', // Display text for previous month link\n\t\tnextText: 'Next', // Display text for next month link\n\t\tcurrentText: 'Today', // Display text for current month link\n\t\tmonthNames: ['January','February','March','April','May','June',\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\n\t\tweekHeader: 'Wk', // Column header for week of the year\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\n\t\t\t// 'button' for trigger button, or 'both' for either\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\n\t\tbuttonText: '...', // Text for trigger button\n\t\tbuttonImage: '', // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with '+' for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: 'fast', // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: '', // Selector for an alternate field to store selected dates into\n\t\taltFormat: '', // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n}", "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}" ]
[ "0.7645802", "0.69845736", "0.68799394", "0.68079084", "0.6767333", "0.67236614", "0.6666404", "0.6634765", "0.6596021", "0.6558281", "0.6553629", "0.6466366", "0.64634514", "0.64395493", "0.6434868", "0.6410827", "0.640996", "0.63991565", "0.6381354", "0.6376126", "0.6367025", "0.6347279", "0.6337591", "0.6323048", "0.6317519", "0.63068867", "0.6294819", "0.6225372", "0.6179812", "0.6154534", "0.61445194", "0.6143213", "0.6127043", "0.6121449", "0.6111965", "0.61006474", "0.60806465", "0.60783124", "0.60671055", "0.6057156", "0.60447174", "0.6042819", "0.60334057", "0.6033166", "0.60246336", "0.60235053", "0.5970425", "0.5970425", "0.59654313", "0.595495", "0.594568", "0.59326226", "0.59010017", "0.59010017", "0.5893162", "0.5878511", "0.58691007", "0.58684915", "0.5861491", "0.585615", "0.5832909", "0.5828067", "0.58175075", "0.58157223", "0.5802763", "0.57938254", "0.5792952", "0.57925165", "0.57894015", "0.57886034", "0.5787825", "0.5787825", "0.5786324", "0.57821167", "0.5779408", "0.5779408", "0.57788515", "0.5775", "0.57499903", "0.57432777", "0.57432777", "0.573973", "0.57318866", "0.5729019", "0.57241064", "0.57241064", "0.57241064", "0.57241064", "0.57241064", "0.57241064", "0.57241064", "0.57241064", "0.57241064", "0.5723409", "0.5723409", "0.5723409", "0.5723409", "0.5723409", "0.5723409" ]
0.79984665
1
Runs a search. Takes query params from serialized form inputs.
function runSearch(){ var url = Config.CONFIGURATION_URL + '?'; url += searchForm.serialize(); listConfigurations(url); // update results table }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function executeSearch(){\n\t/*Save the form data to a JSON file, so that it can be autopopulated the next time the form page is opened.*/\n\tsaveJsonToBrowserStorage(convertCriteriaToJSON());\n\t/*Redirect to the search page*/\n\tcreateNewTabWithURL(generateSearchURL());\n\t/*Close the Current Tab, as it has no need to be open, and avoid Tab Spam.*/\n\tcloseCurrentTab();\n}", "function execute_query(data, params){\n //gets list of all searchable fields\n const keys = window.store.filter(a => a.searchable).map(a => a.value);\n //build full index\n const options = {\n keys: keys,\n threshold: window.threshold,\n useExtendedSearch: true,\n findAllMatches: true,\n }\n const fuse = new Fuse(data, options);\n //SEARCH 1: All fields search (q) + fuzzy text search (a)\n //adds q and a together and formats them in the way fuse.js expects them\n const a = params.a ? params.a : [];\n const q = params.q ? params.q : [];\n const or = q.length ? { $or: keys.map((k) => ({[k]:q.join(\" \")}))} : '';\n const search1 = typeof or === \"object\"? {$and: [...a, or ]} : {$and: [...a]};\n //search all fields and text fields\n //If there are search results, maps them to be in the same format as the original data\n //If there are no search params, return all data\n let searchRes = search1.$and.length ? fuse.search(search1).map(a => a.item) : data;\n const n = params.n ? params.n : [];\n if (n.length){\n //iterate through each item in the n field\n for (const param in n){\n //get type of param\n const field = Object.keys(n[param])[0];\n const type = get_field_by_value(\"type\", field);\n //deals with numbers\n if (type === \"num\"){\n //blank Set for storing unique results from among all num searches\n let newSearchResSet = new Set();\n //split number field into array on \",\" (trim whitespace)\n const nums = String(n[param][field]).split(\",\").map(a => a.replace(/\\s/g,''));\n for (const num in nums){\n if (nums[num].includes(\">\")){\n searchRes.filter(a => a[field] >= nums[num].replace(\">\",'')).forEach(a => newSearchResSet.add(a));\n } else if (nums[num].includes(\"<\")){\n searchRes.filter(a => a[field] <= nums[num].replace(\"<\",'')).forEach(a => newSearchResSet.add(a));\n } else {\n //note this works fine for numbers without a hyphen in them too, so there's no seperate case for that\n const numrange = nums[num].split(\"-\");\n searchRes.filter(a => (a[field] >= parseInt(numrange[0]) && (numrange[numrange.length -1].length ? a[field] <= parseInt(numrange[numrange.length - 1]) : true))).forEach(a => newSearchResSet.add(a));\n }\n }\n //passes new set of results back into searchRes variable.\n searchRes = [...newSearchResSet];\n //deals with symbols\n } else if (type === \"sym\"){\n //blank Set for storing unique results form among all sym searches\n let newSearchResSet = new Set();\n ///split symbol field into array on \"|\" (trim whitespace)\n const syms = String(n[param][field]).split(\"|\").map(a => a.replace(/\\s/g,''));\n for (const sym in syms){\n //if sym contains *, remove * and do a search for anything including the letters\n if (syms[sym].includes(\"*\")){\n //removes * from sym and converts it to an array of characters\n const wildsym = syms[sym].replace(\"*\",'').split('');\n //filters only search results that contain the array of charaters in wildsym\n searchRes.filter(a => wildsym.every(val => a[field].split('').includes(val))).forEach(a => newSearchResSet.add(a));\n } else { //if sym doesn't contain *, do a search for anything exactly matching the letters\n //note: sorts both strings to ensure that the order doesn't matter\n searchRes.filter(a => (a[field].split('').sort().join('') === syms[sym].split('').sort().join(''))).forEach(a => newSearchResSet.add(a));\n }\n }\n //passes new set of results back into searchRes variable.\n searchRes = [...newSearchResSet];\n }\n }\n }\n return searchRes;\n}", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "function 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 paramQuerySearch() {\n var params = getParam(\"paramQuery\");\n parameterSearch(params);\n}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function run_search(query) {\n var cache_key = query + computeURL();\n var cached_results = cache.get(cache_key);\n if(cached_results) {\n if ($.isFunction($(input).data(\"settings\").onCachedResult)) {\n cached_results = $(input).data(\"settings\").onCachedResult.call(hidden_input, cached_results);\n }\n populate_dropdown(query, cached_results);\n } else {\n // Are we doing an ajax search or local data search?\n if($(input).data(\"settings\").url) {\n var url = computeURL();\n // Extract exisiting get params\n var ajax_params = {};\n ajax_params.data = {};\n if(url.indexOf(\"?\") > -1) {\n var parts = url.split(\"?\");\n ajax_params.url = parts[0];\n\n var param_array = parts[1].split(\"&\");\n $.each(param_array, function (index, value) {\n var kv = value.split(\"=\");\n ajax_params.data[kv[0]] = kv[1];\n });\n } else {\n ajax_params.url = url;\n }\n\n // Prepare the request\n ajax_params.data[$(input).data(\"settings\").queryParam] = $(input).data(\"settings\").formatQueryParam(query, ajax_params);\n ajax_params.type = $(input).data(\"settings\").method;\n ajax_params.dataType = $(input).data(\"settings\").contentType;\n if($(input).data(\"settings\").crossDomain) {\n ajax_params.dataType = \"jsonp\";\n }\n\n // Attach the success callback\n ajax_params.success = function(results) {\n if ($(input).data(\"settings\").caching) {\n cache.add(cache_key, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n }\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hidden_input, results);\n }\n\n // only populate the dropdown if the results are associated with the active search query\n if(input_box.val() === query) {\n populate_dropdown(query, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n }\n };\n\n // Make the request\n $.ajax(ajax_params);\n } else if($(input).data(\"settings\").local_data) {\n // Do the search through local data\n var results = $.grep($(input).data(\"settings\").local_data, function (row) {\n return row[$(input).data(\"settings\").propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;\n });\n\n cache.add(cache_key, results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hidden_input, results);\n }\n populate_dropdown(query, results);\n }\n }\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 collectSearchQuery() {\n document.querySelector('#submitButton').addEventListener('click', function () {\n const searchJSON = { search: { subject: '', code: '', title: '', semester: '', weight: '', department: '' } }\n\n searchJSON.search.subject = document.getElementById('subject').value\n searchJSON.search.code = document.getElementById('code').value\n searchJSON.search.title = document.getElementById('title').value\n searchJSON.search.semester = document.getElementById('semester').value\n searchJSON.search.weight = document.getElementById('weight').value\n searchJSON.search.department = document.getElementById('department').value\n\n console.log('Search request: ' + JSON.stringify(searchJSON))\n\n window.api.send('toMain', searchJSON)\n\n window.api.receive('fromMain', (data) => {\n console.log(`Received ${data} from main process`)\n })\n\n window.location.replace('results.html')\n })\n}", "function run_search(query) {\n var cache_key = query + computeURL();\n var cached_results = cache.get(cache_key);\n if(cached_results) {\n if ($.isFunction($(input).data(\"settings\").onCachedResult)) {\n cached_results = $(input).data(\"settings\").onCachedResult.call(hidden_input, cached_results);\n }\n populate_dropdown(query, cached_results);\n } else {\n // Are we doing an ajax search or local data search?\n if($(input).data(\"settings\").url) {\n var url = computeURL();\n // Extract exisiting get params\n var ajax_params = {};\n ajax_params.data = {};\n if(url.indexOf(\"?\") > -1) {\n var parts = url.split(\"?\");\n ajax_params.url = parts[0];\n\n var param_array = parts[1].split(\"&\");\n $.each(param_array, function (index, value) {\n var kv = value.split(\"=\");\n ajax_params.data[kv[0]] = kv[1];\n });\n } else {\n ajax_params.url = url;\n }\n\n // Prepare the request\n ajax_params.data[$(input).data(\"settings\").queryParam] = query;\n ajax_params.type = $(input).data(\"settings\").method;\n ajax_params.dataType = $(input).data(\"settings\").contentType;\n if($(input).data(\"settings\").crossDomain) {\n ajax_params.dataType = \"jsonp\";\n }\n\n // Attach the success callback\n ajax_params.success = function(results) {\n cache.add(cache_key, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hidden_input, results);\n }\n\n // only populate the dropdown if the results are associated with the active search query\n if(input_box.val() === query) {\n populate_dropdown(query, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n }\n };\n\n // Make the request\n $.ajax(ajax_params);\n } else if($(input).data(\"settings\").local_data) {\n // Do the search through local data\n var results = $.grep($(input).data(\"settings\").local_data, function (row) {\n return row[$(input).data(\"settings\").propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;\n });\n\n cache.add(cache_key, results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hidden_input, results);\n }\n populate_dropdown(query, results);\n }\n }\n }", "function run_search(query) {\n var cache_key = query + computeURL();\n var cached_results = cache.get(cache_key);\n if(cached_results) {\n if ($.isFunction($(input).data(\"settings\").onCachedResult)) {\n cached_results = $(input).data(\"settings\").onCachedResult.call(hidden_input, cached_results);\n }\n populate_dropdown(query, cached_results);\n } else {\n // Are we doing an ajax search or local data search?\n if($(input).data(\"settings\").url) {\n var url = computeURL();\n // Extract exisiting get params\n var ajax_params = {};\n ajax_params.data = {};\n if(url.indexOf(\"?\") > -1) {\n var parts = url.split(\"?\");\n ajax_params.url = parts[0];\n\n var param_array = parts[1].split(\"&\");\n $.each(param_array, function (index, value) {\n var kv = value.split(\"=\");\n ajax_params.data[kv[0]] = kv[1];\n });\n } else {\n ajax_params.url = url;\n }\n\n // Prepare the request\n ajax_params.data[$(input).data(\"settings\").queryParam] = query;\n ajax_params.type = $(input).data(\"settings\").method;\n ajax_params.dataType = $(input).data(\"settings\").contentType;\n if($(input).data(\"settings\").crossDomain) {\n ajax_params.dataType = \"jsonp\";\n }\n\n // Attach the success callback\n ajax_params.success = function(results) {\n cache.add(cache_key, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hidden_input, results);\n }\n\n // only populate the dropdown if the results are associated with the active search query\n if(input_box.val() === query) {\n populate_dropdown(query, $(input).data(\"settings\").jsonContainer ? results[$(input).data(\"settings\").jsonContainer] : results);\n }\n };\n\n // Make the request\n $.ajax(ajax_params);\n } else if($(input).data(\"settings\").local_data) {\n // Do the search through local data\n var results = $.grep($(input).data(\"settings\").local_data, function (row) {\n return row[$(input).data(\"settings\").propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;\n });\n\n cache.add(cache_key, results);\n if($.isFunction($(input).data(\"settings\").onResult)) {\n results = $(input).data(\"settings\").onResult.call(hidden_input, results);\n }\n populate_dropdown(query, results);\n }\n }\n }", "function searchRequestSubmit () {\n var query = $('.query', self.$form).val();\n\n youtube.search(query, function (response) {\n self.results.load(query, response);\n });\n\n return false;\n }", "function ssearch_do_search() {\n\tvar search_string = d$(\"string_to_search\").value;\n\tif ( !search_string.length )\n\t\treturn;\n\twoas.do_search(search_string);\n}", "function runSearch() {\n ps.search()\n .then(function(rsp) {\n if(rsp.stat === \"fail\") {\n ps.showError(rsp);\n }\n else if (rsp.stat === \"ok\") {\n ps.paging = rsp.photos;\n ps.parseSearchResults();\n }\n });\n }", "searchWithParams(query) {\n if (Object.keys(query).length) {\n this.set('isSearching', true);\n this.get('store').query('patient-search', query).then(results => {\n this.setProperties({\n results: results.filterBy('isActive'),\n isSearching: false\n });\n this.sendAction('didSearch');\n\n if (this.get('displayResults')){\n this.set('showResults', true);\n this.set('showHints', false);\n }\n }).catch(error => {\n if (!this.get('isDestroyed')) {\n this.set('isSearching', false);\n this.sendAction('didSearch', error);\n }\n });\n }\n }", "function sendSearchQuery(){\n lastAction = \"search\";\n if(!stopped){\n data = {};\n data['instance'] = collection;\n data['string_query'] = 'true';\n data['vector_query'] = 'false';\n query = $(\"div.task\"+currentTask).find('input[name=\"query\"]').val();\n data['query'] = query;\n data['vector_query'] = JSON.stringify(getCurrentVectorQuery());\n $(\".relevance-feedback-search-results\").show();\n $(\".relevance-feedback-search-results\").html(\"Loading...\");\n $.post(\"src/php/similarsentences/similarsentences.php\",\n data,\n handleResults);\n } else {\n startTimedTask(currentTask);\n sendSearchQuery();\n }\n logActivity({\n instance:collection,\n participant: getParticipant(),\n task_number: currentTask,\n activity: \"search\",\n search_query: query,\n num_relevant : -1,\n num_irrelevant: -1,\n })\n}", "search(params) {\n let query = params;\n this.set('query', query);\n this.transitionToRoute('search', {queryParams: {q: query, p: this.page }});\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 postSearchFromInput(search) { // post request, search multiple movies titles.\n\n\t$('.spinner').show();\n\t\n\t$.post('search', {search: search}, function(data) {\n\t\t$('.spinner').hide();\n\t\t$('.search-li').remove();\n\n var movies = data;\n\n var counter = 0;\n movies.forEach(function() {\n handleMovie(movies, counter);\n counter += 1;\n }); // amount of search results\n\n\t});\n}", "function 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}", "function run_search(query) {\n var cache_key = query + computeURL();\n var cached_results = cache.get(cache_key);\n if(cached_results) {\n populate_dropdown(query, cached_results);\n } else {\n // Are we doing an ajax search or local data search?\n if(settings.url) {\n var url = computeURL();\n // Extract exisiting get params\n var ajax_params = {};\n ajax_params.data = {};\n if(url.indexOf(\"?\") > -1) {\n var parts = url.split(\"?\");\n ajax_params.url = parts[0];\n\n var param_array = parts[1].split(\"&\");\n $.each(param_array, function (index, value) {\n var kv = value.split(\"=\");\n ajax_params.data[kv[0]] = kv[1];\n });\n } else {\n ajax_params.url = url;\n }\n\n // Prepare the request\n ajax_params.data[settings.extraParam] = hidden_input.attr(settings.extraParam);\n ajax_params.data[settings.queryParam] = query;\n ajax_params.type = settings.method;\n ajax_params.dataType = settings.contentType;\n if(settings.crossDomain) {\n ajax_params.dataType = \"jsonp\";\n }\n\n // Attach the success callback\n ajax_params.success = function(results) {\n if($.isFunction(settings.onResult)) {\n results = settings.onResult.call(hidden_input, results);\n }\n cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results);\n\n // only populate the dropdown if the results are associated with the active search query\n if(input_box.val().toLowerCase() === query) {\n populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);\n }\n };\n\n // Make the request\n $.ajax(ajax_params);\n } else if(settings.local_data) {\n // Do the search through local data\n var results = $.grep(settings.local_data, function (row) {\n return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;\n });\n\n if($.isFunction(settings.onResult)) {\n results = settings.onResult.call(hidden_input, results);\n }\n cache.add(cache_key, results);\n populate_dropdown(query, results);\n }\n }\n }", "function doSearch() {\n var termsFacet = ejs.TermsFacet('types').field('type');\n var dataHistogramFacet = ejs.DateHistogramFacet('period').field('created').interval(interval);\n\n if (termsFacetFilter && rangeFacetFilter) {\n var andFacet = ejs.AndFilter([termsFacetFilter, rangeFacetFilter]);\n termsFacet.facetFilter(andFacet);\n dataHistogramFacet.facetFilter(andFacet);\n }\n else if (termsFacetFilter) {\n termsFacet.facetFilter(termsFacetFilter);\n dataHistogramFacet.facetFilter(termsFacetFilter);\n }\n else if (rangeFacetFilter) {\n termsFacet.facetFilter(rangeFacetFilter);\n dataHistogramFacet.facetFilter(rangeFacetFilter);\n }\n\n ejs.Request().indices(index).types(type)\n .facet(termsFacet)\n .facet(dataHistogramFacet).doSearch(function (results) {\n $scope.results = results;\n $log.log(results);\n });\n }", "function basicsearch() {\n searchString = document.basicForm.basicText.value;\n searchTerms = searchString.split(/\\s/);\n\n putHeader();\n\n findResults();\n putResults();\n\n putFooter();\n\n writeResultsPage();\n}", "search( query, field = null ) {\n\n // Save the call in memory.\n this.memory('search', Array.from(arguments));\n\n // Execute the request.\n return this.request('GET', 'search/' + (field ? `${field.split('.').join('/')}/${query}` : query));\n\n }", "function OnSubmit() {\n // An empty search value causes an on the api, so if the search is accidentally submitted when it's empty we can essentially just cancel the search, which stops the app from breaking\n if (!searchVal) return;\n setLoading(true);\n fetch('http://localhost:5000/nodes/search', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ query: searchVal }),\n })\n .then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error('something went wrong');\n }\n })\n .then((responseJson) => {\n setNodes(responseJson);\n setLoading(false);\n })\n .catch((error) => {\n console.log(error);\n });\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 performSearchFromHompage(){\n\tvar queryString = new Array();\n\t//Logic below credits go to aspdotnetcodebook-blogspot-com from StackOverflow\n\tif (queryString.length == 0) {\n if (window.location.search.split('?').length > 1) {\n var params = window.location.search.split('?')[1].split('&');\n for (var i = 0; i < params.length; i++) {\n var key = params[i].split('=')[0];\n var value = decodeURIComponent(params[i].split('=')[1]);\n queryString[key] = value;\n }\n }\n }\n if (queryString[\"datesearch\"] != null) {\n var data = \"\";\n data += queryString[\"datesearch\"];\n searchDatabase(data);\n displayActivitiesByName(data);\n }else if(queryString[\"selectedDateplan\"] != null){\n \tvar data = \"\";\n data += queryString[\"selectedDateplan\"];\n \tgetFullDatePlanByID(data);\n }\n else if(queryString[\"selectedActivity\"] != null){\n \tvar data = \"\";\n data += queryString[\"selectedActivity\"];\n \tgetActivityById(data);\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}", "function executeSearch() {\n\n\t$('#loading-gif').removeClass(\"hidden\"); // Show the loading icon\n\n\tvar query = $(\"#searchField\").val().toLowerCase().split(' ').join('-');\n\tconsole.log(query);\n\n\t// Save query in the URL for bookmarking purposes\n\tif (window.location.search != \"?q=\" + query) {\n\t\twindow.history.pushState({}, document.title, \"/index.html?q=\" + query);\n\t\tcurURL = window.location.href; // update with new URL\n\t}\n\n\t// Ajax request to get JSON response\n\t$.ajax({\n\t\turl: \"/search/\" + query,\n\t\ttype: \"GET\",\n\n\t\tsuccess: function(response) { // No server error\n\t\t\tconsole.log(response);\n\t\t\trenderResponse(response);\n\t\t\t// Scroll to year if hash is present\n\t\t\tif (curURL.slice(-5)[0] === '#') {\n\t\t\t\tscrollToYear(curURL.slice(-4));\n\t\t\t}\n\t\t\t// Else scroll to top\n\t\t\telse {\n\t\t\t\t$('#main').animate({ scrollTop: 0 }, 'fast');\n\t\t\t}\n\t\t\t$('#loading-gif').addClass(\"hidden\");\n\n\t\t},\n\n\t\terror: function(response) { // Server error, shouldn't happen\n\t\tconsole.log(response);\n\t\trenderResponse({success:false,'error':'unknown-error'});\n\t\t$('#loading-gif').addClass(\"hidden\");\n\t}\t\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 runSearch() {\n\tinquirer.prompt({\n\t\tname: \"action\",\n\t\ttype: \"list\",\n\t\tmessage: \"What would you like to do?\",\n\t\tchoices: [\n\t\t\"View Products For Sale\",\n\t\t\"View Low Inventory\",\n\t\t\"Add To Inventory\",\n\t\t\"Add New Product\",\n\t\t]\n\t})\n\t.then(function(answer){\n\t\tswitch(answer.action) {\n\t\t\tcase \"View Products For Sale\":\n\t\t\tproductsForSale();\n\t\t\tbreak;\n\n\t\t\tcase \"View Low Inventory\":\n\t\t\tlowInventory();\n\t\t\tbreak;\n\n\t\t\tcase \"Add To Inventory\":\n\t\t\taddToInventory();\n\t\t\tbreak;\n\n\t\t\tcase \"Add New Product\":\n\t\t\taddNewProduct();\n\t\t\tbreak;\n\t\t}\n\t});\n}", "function runSearch(search, term) {\n // By default, if no search type is provided, search for a movie\n if (!search) {\n search = \"movie-this\";\n }\n\n // this runs the omdb.js if user selects \"movie-this\"\n if (search === \"movie-this\") {\n // By default, if no search term is provided, search for \"Mr. Nobody\"\n if (!term) {\n term = \"Mr. Nobody\";\n };\n //uses constructor from omdb.js to call the findMovie function and pass through the user's term\n movie.findMovie(term);\n // this runs the bands.js if user selects \"concert-this\"\n } else if (search === \"concert-this\") {\n //uses constructor from bands.js to call the findShow function and pass through the user's term\n band.findShow(term);\n // this runs the spotify.js if user selects \"spotify-this-song\"\n } else if (search === \"spotify-this-song\") {\n //By default, if no search term is provided, search for \"The Sign\"\n if (!term) {\n term = \"The Sign\";\n };\n //uses constructor from spotify.js to call the findSong function and pass through the user's term\n spotify.findSong(term);\n // if user types in an unknown search command\n } else {\n console.log(\"I don't know that.\")\n }\n}", "function search() {\r\n\r\n\tif (player)\r\n\t\tplayer.stop();\r\n\t$(\"#output\").css(\"border\",\"auto solid #69605d\");\r\n\r\n\t//clear the previous search data\r\n\tdocument.getElementById(\"output\").innerHTML = \"\";\r\n\r\n\t//get the search query from the search box\r\n\tlet term = document.getElementById(\"query\").value;\r\n\tlet filter = document.getElementById(\"wav\").checked ? \"wav\" : null;\r\n\t//set auth to false because we defined auth = true to be the bearer auth token\r\n\tlet auth = false;\r\n\t//finally pass parameters to the create request function\r\n\tcreateRequest(auth,processSearch,undefined,term,filter);\r\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 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 search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function searchSpotify(){ \r\n console.log(\"got here 2\")\r\n var query = $search.val();\r\n console.log(\"got here 3 value of query = ...\")\r\n console.log(query);\r\n console.log(\"------\");\r\n \r\n// var searchType = $radioBtn.val();\r\n var searchType = $(\"input:radio[name=qryType]:checked\").val();\r\n var params = {q: query, type: searchType};\r\n \r\n $.get(searchURL, params).done(onDataReceive).fail(onError)\r\n \r\n }", "function performSearch() {\n // reset the scroll in case they scrolled down to read prior results\n window.scrollTo(0, 0)\n\n fetchSearch(\n // Ensures event properties include \"type\": \"gene\" in search logging.\n 'gene', {\n page: searchParams.page,\n genes: searchParams.genes,\n preset: searchParams.preset\n }).then(results => {\n setSearchState({\n params: searchParams,\n isError: false,\n isLoading: false,\n isLoaded: true,\n results,\n updateSearch\n })\n }).catch(error => {\n setSearchState({\n params: searchParams,\n isError: true,\n isLoading: false,\n isLoaded: true,\n results: error,\n updateSearch\n })\n })\n }", "function post_search(req, res) {\n console.log(req.body);\n Model3d.find_by_string(req.body.search_bar, function(err, docs) {\n if (err) {\n res.send(\"something went wrong\");\n }\n else {\n res.render('navigation/search', {models: docs, selected: \"Search Results\" });\n }\n });\n}", "function executeSearch(event) {\n event.preventDefault();\n\n // Get the user's input from the textbox.\n var searchTerms = document.getElementById(\"search-terms\").value;\n\n // Print out the user's search terms to the developer console.\n console.log(\"The user has submitted the following search terms: \" + searchTerms);\n\n // Make an asynchronous request to Spotify's library. We'll have to provide the\n // function that should be called once the results are received.\n var parameters = {\n\turl: 'https://api.spotify.com/v1/search',\n\tdata: {\n\t q: searchTerms,\n\t type: 'track'\n\t},\n\tsuccess: onSuccessfulSearch\n };\n \n $.ajax(parameters);\n \n \n}", "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 }", "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 Query(searchobj) {\n this.logger = Logger.get('search');\n this.matches_waiters = [];\n this.facets = [];\n this.searchobj = searchobj;\n}", "function search() {\n console.log(\"search \", search);\n const ingredientsList = ingredients.join(\",\");\n const url = `http://localhost:8888/api?i=${ingredientsList}&q=${inputValue}&p=1`;\n axios\n .get(url)\n .then((res) => {\n console.log(\"res \", res);\n setResults(res.data.results);\n })\n .catch((err) => {\n console.log(\"err \", err);\n });\n }", "function doSearch(formData)\n{\n\tif( formData != null)\n\t{\n\t\tconsole.log('get request from post array:');\n\t\tvar myForm = formData;\n\t\tvar mycontentType = 'multipart/form-data';\n\t}\n\telse\n\t{\n\t\tconsole.log('get request from form:');\n\t\tvar myForm = $(\"#caveSearchForm\");\n \n //convert datepickers date to unixTimestamp to search into db\n var datepickers = $(\".hasDatepicker\");\n //iterate through datpickers to convert data type\n datepickers.each(function (e){\n if ( $(this).val() != ''){\n unixTimestamp = Date.parse( $(this).val() ) /1000 ; //convert date in epoch in sec\n myForm.find('[name=\"' + $(this).attr('name') + '\"]').val(unixTimestamp); \n }\n });\n \n myForm = $(\"#caveSearchForm\").serialize();\n console.log(myForm);\n var mycontentType = 'application/x-www-form-urlencoded'\n\t}\n\t\n\t$.ajax(\n\t{\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: 'search.php',\n\t\t\t\tprocessData: false,\n\t\t\t\tcontentType: mycontentType,\n\t\t\t\tdata: myForm,\n\t\t\t\tdataType: \"json\",\n\t\t\t\tsuccess: searchSuccess,\n\t\t\t\terror: searchError,\n\t});\n\t\n\treturn true;\n\t\t\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 searchQuery(){\n var myData = $('#search_field').val()\n $.post( '/search', { \"myData\": myData, \"tickethub\": true } ).done(function(response) {\n $('#search_results-hub').html(response['text']);\n \n }).fail(function() {\n $('#search_entry').text('Error: Could not find search results!');\n });\n}", "function run_search(query) {\n var cached_results = cache.get(query);\n if(cached_results) {\n populate_dropdown(query, cached_results);\n } else {\n // Are we doing an ajax search or local data search?\n if(settings.url) {\n // Extract exisiting get params\n var ajax_params = {};\n ajax_params.data = {};\n if(settings.url.indexOf(\"?\") > -1) {\n var parts = settings.url.split(\"?\");\n ajax_params.url = parts[0];\n\n var param_array = parts[1].split(\"&\");\n $.each(param_array, function (index, value) {\n var kv = value.split(\"=\");\n ajax_params.data[kv[0]] = kv[1];\n });\n } else {\n ajax_params.url = settings.url;\n }\n\n // Prepare the request\n ajax_params.data[settings.queryParam] = query;\n ajax_params.type = settings.method;\n ajax_params.dataType = settings.contentType;\n if(settings.crossDomain) {\n ajax_params.dataType = \"jsonp\";\n }\n\n // Attach the success callback\n ajax_params.success = function(results) {\n if($.isFunction(settings.onResult)) {\n results = settings.onResult.call(hidden_input, results);\n }\n cache.add(query, settings.jsonContainer ? results[settings.jsonContainer] : results);\n\n // only populate the dropdown if the results are associated with the active search query\n if(input_box.val().toLowerCase() === query) {\n populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);\n }\n };\n\n // Make the request\n $.ajax(ajax_params);\n } else if(settings.local_data) {\n // Do the search through local data\n var results = $.grep(settings.local_data, function (row) {\n return row.name.toLowerCase().indexOf(query.toLowerCase()) > -1;\n });\n\n if($.isFunction(settings.onResult)) {\n results = settings.onResult.call(hidden_input, results);\n }\n cache.add(query, results);\n populate_dropdown(query, results);\n }\n }\n }", "function handleSearchSubmit(event) {\n event.preventDefault()\n setQuery(event.target.search.value)\n history.push('/search')\n }", "search(query) {\n if (query) {\n this._algoliaHelper.setQuery(query)\n }\n this._algoliaHelper.search()\n }", "searchWardrobe(query) {\n this.props.searchWardrobe(query.target.value);\n }", "function Search() {\n if ($('#doc-count').html() != \"\") {\n $('#loading-indicator').show();\n }\n else $('#progress-indicator').show();\n\n q = $(\"#q\").val();\n\n // Get center of map to use to score the search results\n $.get('/api/GetDocuments',\n {\n q: q != undefined ? q : \"*\",\n searchFacets: selectedFacets,\n currentPage: currentPage\n },\n function (data) {\n $('#loading-indicator').css(\"display\", \"none\");\n $('#progress-indicator').css(\"display\", \"none\");\n UpdateResults(data);\n });\n}", "search(queryStr) {\n\n this.queryStr = queryStr;\n this.saveQueryStr();\n let normalizedQueryStr = RefSearchQuery.normalizeQueryStr(queryStr);\n\n this.results.length = 0;\n // Always select the first result when the search query changes\n this.selectedResultIndex = 0;\n\n if (normalizedQueryStr === '') {\n this.isLoadingResults = false;\n this.onUpdateSearchStatus();\n return;\n }\n\n return this.searchByRef(normalizedQueryStr);\n\n }", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function searching(val) {\n\n\t// Create a request object pointed at the search route on the server\n\tconst req = new XMLHttpRequest();\n\treq.open('POST', '/search');\n\n\t// Handle data once it returns from the server\n\treq.onload = () => {\n\t\tconst data = JSON.parse(req.responseText);\n\t};\n\n\t// Package the search data that the user entered\n\tconst data = new FormData();\n\tdata.append('text', val);\n\t// Send the request\n\treq.send(data);\n}", "function doSearch(params, res, callback) {\n\n var filtered = JSON.parse(params[4]);\n var applyFilter = (filtered.fields.length > 0);\n\n var path = config.es.server + '/';\n path += params[0];\n path += (params[1] !== '') ? '/' + params[1] : '';\n path += '/_search';\n logger.debug(path, 'doSearch path');\n\n var q = {};\n switch (params[3]) {\n case '':\n if (applyFilter) {\n q = JSON.parse('{\\\"from\\\":0,\\\"size\\\":1000,\\\"query\\\":{\\\"filtered\\\":{\\\"query\\\":{\\\"match_all\\\":{}},\\\"filter\\\":{}}},\\\"sort\\\":{},\\\"aggs\\\":{}}');\n } else {\n q = JSON.parse('{\\\"from\\\":0,\\\"size\\\":1000,\\\"query\\\":{\\\"match_all\\\":{}},\\\"sort\\\":{},\\\"aggs\\\":{}}');\n }\n break;\n default:\n if (applyFilter) {\n q = JSON.parse('{\\\"from\\\":0,\\\"size\\\":1000,\\\"query\\\":{\\\"filtered\\\":{\\\"query\\\":{\\\"wildcard\\\":{\\\"' + params[2] + '\\\":\\\"*' + params[3].toLowerCase() + '*\\\"}},\\\"filter\\\":{}}},\\\"sort\\\":{},\\\"aggs\\\":{}}');\n } else {\n q = JSON.parse('{\\\"from\\\":0,\\\"size\\\":1000,\\\"query\\\":{\\\"wildcard\\\":{\\\"' + params[2] + '\\\":\\\"*' + params[3].toLowerCase() + '*\\\"}},\\\"sort\\\":{},\\\"aggs\\\":{}}');\n }\n }\n\n // load the facets\n var facets = [];\n _.find(global.ds.index, function (index) {\n if (index.name === params[0]) {\n for (var i=0; i < index.types.length; i++) {\n if (index.types[i].type === params[1]) {\n var fields = index.types[i].fields;\n for (var f=0; f < fields.length; f++) {\n if (fields[f].type !== 'nested') {\n if (fields[f].facet) {\n facets.push({\n id: fields[f].id,\n type: fields[f].type\n });\n }\n } else {\n var nestedFields = fields[f].fields;\n for (var n=0; n < nestedFields.length; n++) {\n if (nestedFields[n].facet) {\n facets.push({\n id: fields[f].id + '.' + nestedFields[n].id,\n type: nestedFields[n].type\n });\n }\n }\n }\n }\n }\n }\n }\n });\n\n // create the facet object\n var facetObject = {};\n for (var f=0; f<facets.length; f++) {\n switch (facets[f].type) {\n case 'string':\n facetObject[facets[f].id] = JSON.parse('{' + '\\\"terms\\\":{' + '\\\"field\\\":\\\"' + facets[f].id + '.raw\\\", \\\"size\\\": 0, \\\"order\\\":{\\\"_count\\\":\\\"desc\\\"}}}');\n break;\n case 'float':\n case 'integer':\n case 'long':\n case 'date':\n facetObject[facets[f].id] = JSON.parse('{' +\n '\\\"stats\\\": { ' +\n '\\\"field\\\":\\\"' + facets[f].id + '\\\"' +\n '}' +\n '}');\n break;\n }\n }\n\n // create the sort object\n if (params[5] && params[5].hasOwnProperty('field')) {\n var sort = [];\n var sortObject = {};\n sortObject[params[5].field] = {order: params[5].asc };\n sort.push(sortObject);\n q.sort = sort;\n }\n\n // assign the object to aggs\n if (applyFilter) {\n q.aggs = facetObject;\n\n // generate the filter format\n var filterObj = {\n \"bool\": {\n \"must\": []\n }\n };\n for (var fl=0; fl < filtered.fields.length; fl++) {\n var field = filtered.fields[fl];\n switch (field.type) {\n case 'text':\n if (field.values.length === 1) {\n filterObj.bool.must.push(\n JSON.parse('{\"term\":{\"' + field.field + '.raw\":\"' + field.values[0] + '\"}}')\n );\n } else {\n var valueList = '';\n for (var v = 0; v < field.values.length; v++) {\n valueList += '\\\"' + field.values[v] + '\\\"';\n if (v !== field.values.length - 1) {\n valueList += ',';\n }\n }\n filterObj.bool.must.push(\n JSON.parse('{\"terms\":{\"' + field.field + '.raw\":[' + valueList + ']}}')\n );\n }\n break;\n case 'number':\n case 'date':\n filterObj.bool.must.push(\n JSON.parse('{\"range\":{\"' + field.field + '\": { \"gte\":' + field.values[0] + ', \"lte\":' + field.values[1] + '}}}')\n );\n break;\n }\n }\n q.query.filtered.filter = filterObj;\n\n } else {\n q.aggs = facetObject;\n }\n\n logger.debug(q, 'doSearch query');\n\n request({\n method: 'POST',\n uri: path,\n gzip: true,\n json: true,\n body: q\n },\n function (err, res, body) {\n if (err) {\n logger.error(err, 'ERROR: doSearch');\n callback(err, {});\n } else {\n var searchResult = body;\n logger.info(searchResult, 'search results');\n getIndexMapping(params[0], params[1], function(err, result) {\n if (!err) {\n if (result.body.length > 2) {\n searchResult._meta = JSON.parse(result.body)[params[0]].mappings[params[1]]._meta;\n var results = formatSearchResultsForTable(searchResult, facets, params);\n callback(null, results);\n }\n }\n });\n\n }\n });\n }", "function searchHelper() {\r\n let searchValue = searchField.value;\r\n if (searchValue.length) search(searchValue);\r\n else getAll();\r\n }", "function search() {\n var input = document.getElementById('query');\n if (input.value) {\n filter = new RegExp(input.value, 'gi');\n } else {\n filter = null;\n }\n socket.json.send({'search': input.value});\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 }", "function Search(querystring, searchindex){\n this.querystring = querystring;\n this.searchindex = searchindex;\n}", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "function readSearchData() {\n var searchTerm = document.getElementById(\"keyword\").value;\n var state = document.getElementById(\"state\").value;\n var city = document.getElementById(\"city\").value;\n orgSearch(searchTerm, state, city);\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 }", "function setQuery() {\n getSearch(search.value);\n}", "function searchSubmit() {\n $('.js-search-form').click(e => {\n event.preventDefault();\n const searchTarget = $(event.currentTarget).find('.js-query');\n const query = searchTarget.val();\n getComicInfo(query,callBack)\n });\n}", "function search()\n{\n\tvar query = ($(\"#search\")[0]).value;\n\tcreateCookie('search', query, 1); /// Save the search query\n\tgoTo('index'); /// Go to index (search) page\n}", "function searchIt() {\r\n if (MovieListLoaded && SeriesListLoaded) {\r\n var searchFor = window.location.href.split('?q=');\r\n var searchQuery = searchFor[1];\r\n\r\n if (searchQuery !== null && searchFor.length > 1) {\r\n document.getElementById('searchText').value = decodeURI(\r\n searchQuery);\r\n getMovies(searchQuery);\r\n }\r\n }\r\n}", "doSearch() {\n console.log(\"do search event triggered, search \" + this.get('searchQuery'));\n this.transitionToRoute('search.do-search',\n {\n queryParams:\n {\n q: this.get('searchQuery'),\n y1: this.get('yearFrom'),\n y2: this.get('yearTo'),\n ratingFrom: this.get('imdbRatingFrom'),\n ratingTo: this.get('imdbRatingTo')\n }\n });\n }", "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n }", "runSearch() {\n this.books = this.service.getBooks(this.searchValue).subscribe(books => this.books = books);\n this.searchValue.setValue('');\n this.test = true;\n this.searched = true;\n }", "localSearch(queryId, searchInput, maxResults) {\n // This results dictionary will have domain object ID keys which\n // point to the value the domain object's score.\n let results;\n const input = searchInput.trim().toLowerCase();\n const message = {\n request: 'search',\n results: {},\n total: 0,\n queryId\n };\n\n results = Object.values(this.localIndexedItems).filter((indexedItem) => {\n return indexedItem.name.toLowerCase().includes(input);\n });\n\n message.total = results.length;\n message.results = results\n .slice(0, maxResults);\n const eventToReturn = {\n data: message\n };\n this.onWorkerMessage(eventToReturn);\n }", "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.classList.add('header-searchResults--show')\r\n\r\n let resultsHtml = '';\r\n if (results.length){\r\n \r\n resultsHtml = `Found ${results.length} post(s).`;\r\n for(let result of results){\r\n let doc = searchEngine.documentStore.getDoc(result.ref);\r\n resultsHtml += `\r\n <div class=\"header-searchResult\">\r\n <a href=\"${doc.id}\">${doc.title}</a>\r\n </div>`;\r\n\r\n }\r\n } else{\r\n resultsHtml = `<div class=\"header-searchResult\">\r\n No results found for ${searchField.value}\r\n </div>`;\r\n }\r\n\r\n searchResults.innerHTML = resultsHtml;\r\n}", "function clickSearchBox(object){\n let searchText = document.querySelector(\".form-inline input[type='text']\").value;\n document.location = page.RESULT + '?searchWords='+searchText.toLowerCase();\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 }", "search(query) {\r\n return this.create(Search).execute(query);\r\n }", "function handleSearch() {\n if (!searchAvailable) return;\n\n setSearchResults(null);\n setSearchPending(true);\n setSearchError(false);\n\n // Get the date in the proper format\n const date = moment(selectedDate).format('L');\n const hour = moment(selectedHour).format('HH:mm:ss');\n\n const body = {\n \"route_id\": selectedLine.route_id,\n \"direction_id\": selectedLine.direction_id,\n \"departure_stop_id\": origin.stop_id,\n \"arrival_stop_id\": destination.stop_id,\n \"datetime\": date + \", \" + hour\n };\n\n fetch(\"https://dublin-bus.net/predict/\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n })\n .then((res) => {\n if (!res.ok) {\n throw Error();\n }\n return res.json();\n })\n .then((json) => {\n setSearchPending(false);\n setSearchResults(json);\n })\n .catch((err) => {\n setSearchPending(false);\n setSearchError(true);\n });\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 searchWine(){\n setSearchFor();\n whatToSearch();\n watchSubmit();\n}", "function search() {\n let input = getSearchCastInput();\n filterCast(input);\n}", "static async search(query) {\n const res = await this.request(`search`, { query });\n return res;\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 makeSearchQuery() {\n var active_tab = $('.add_to_search-form .tab-buttons li.active a').attr('href');\n\n if (active_tab === '#simple-search') {\n var current_query = $.trim(searchQueryField.val())\n var new_part = getSimpleQuery()\n setSearchFieldValue(mergeQuery(current_query, new_part))\n cleanSimpleQueryForm()\n } else {\n addAdvancedQueryToSearch()\n $('.add_to_search-form .appender').trigger('click')\n }\n }", "function onExecuteSearch(searchInput, resultsContainer)\n{\n var query = searchInput.value;\n\n if(query)\n {\n getResults(query, function(results) {\n\n var resultsList = getResultsList(results);\n\n // Clear existing results container (if applicable)\n var currResultsList = document.getElementById('results');\n if(currResultsList)\n {\n resultsContainer.removeChild(currResultsList);\n }\n\n // Display current results\n resultsContainer.appendChild(resultsList);\n\n });\n }\n}", "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 searchIt (target) {\n let searchTerm = target.textContent;\n inputField.value = searchTerm;\n document.querySelector('#search-form').submit();\n}", "function search(el, direct) {\n var query;\n if (!direct) {\n el = $(el);\n query = el.parent().parent().children('input').val()\n }\n else\n query = direct;\n\n if (!query)\n return;\n\n window.location = '/list?query=' + query;\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}", "async search(query = '', filters = {}) {\n if (!this.availableFunctions.includes('search')) {\n throw new GuardianJSInvalidMethodException('search is an invalid method');\n }\n let filter = '';\n Object.entries(filters).forEach((entry) => {\n const key = entry[0].replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n filter = `${filter}&${key}=${entry[1]}`;\n });\n return this._request(`${this.base}/${this.endpoint}?api-key=${this.key}&q=${query}${filter}`);\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 }", "search(accessToken, query) {\r\n if (!accessToken) {\r\n throw (\"Invalid token.\");\r\n }\r\n if (!query) {\r\n throw (\"No person search query provided.\");\r\n }\r\n let url = this._config.search;\r\n let queryUrl = `${url}?searchQuery=${query}`;\r\n this._logger.info(`Dispatching a search to ${queryUrl}`);\r\n return this._httpRequester.get(queryUrl, { headers: { \"Authorization\": `Bearer ${accessToken}` } });\r\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 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 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 processallContentSearch(hiddenForm, queryForm)\n{\n\tvar formToSubmit = hiddenForm;\n\tvar formToProcess = queryForm;\n\t\n\t// Do some basic form validation\n\tif(formToProcess.terms.value != \"\")\n\t{\n\t\tformToSubmit.WISsearch1.value = formToProcess.terms.value;\n\t\tformToSubmit.submit();\t\t\n\t}\n\telse\n\t{\n\t\talert(\"You must enter a search term in the text box before you click go.\");\n\t}\n}", "function doFind() {\n //Set the search text to the value in the box\n if (this.id == 'search') {\n findParams.searchText = dom.byId(\"roadName\").value;\n whichSearch = \"grid\";\n } else if (this.id == 'search2') {\n findParams.searchText = dom.byId(\"parcelInfo\").value;\n whichSearch = \"grid1\";\n }\n findTask.execute(findParams, showResults);\n }", "function handleSearchFormSubmit(event) {\n event.preventDefault();\n // Get input field contents\n var searchValue = $('#search-input').val();\n // If input is empty, do nothing\n if (!searchValue) {\n return;\n }\n // Make API call\n searchApi(searchValue);\n searchVApi(\"coding\" + searchValue);\n}" ]
[ "0.74207944", "0.6716437", "0.66979533", "0.666286", "0.66055363", "0.65641415", "0.6559055", "0.64709526", "0.6429326", "0.6422621", "0.6418924", "0.6418924", "0.641053", "0.63864434", "0.6353802", "0.6337319", "0.63283527", "0.6325842", "0.62999326", "0.62981796", "0.62829", "0.6280196", "0.62777144", "0.6269948", "0.6265757", "0.62544876", "0.6251642", "0.6243539", "0.6242122", "0.6217939", "0.6209494", "0.6191577", "0.6186196", "0.6185377", "0.617525", "0.6164632", "0.61607355", "0.61578417", "0.6143319", "0.6133379", "0.61289304", "0.6127618", "0.61134404", "0.6109416", "0.6105085", "0.60983676", "0.60870993", "0.6083554", "0.6076498", "0.60733855", "0.60658026", "0.6064572", "0.605762", "0.60556805", "0.6050992", "0.60451746", "0.60258406", "0.6024057", "0.60223234", "0.6007507", "0.5994736", "0.59847254", "0.5980339", "0.59776354", "0.5967982", "0.5965122", "0.59571886", "0.5950541", "0.59489334", "0.59480065", "0.5946359", "0.5938816", "0.5936147", "0.5928213", "0.59258777", "0.59254205", "0.5922772", "0.5920834", "0.5914109", "0.5912142", "0.5911838", "0.5903021", "0.59013885", "0.58959407", "0.5894829", "0.58946437", "0.5890271", "0.58872527", "0.58849823", "0.5876525", "0.5874565", "0.5870563", "0.5869252", "0.58592975", "0.5841638", "0.5841638", "0.5834163", "0.583045", "0.5830123" ]
0.6352665
16
appends notes to json
function saveNote(note, noteArr){ // if the array is not empty push to the list then write if(noteArr){ noteArr.push(note); fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2)); return noteArr; } // else if empty, assign note as array then write noteArr = note; fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2)); return noteArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNote() {\n fs.writeFileSync(\"Develop/db/db.json\", JSON.stringify(notesData))\n}", "function newNotes() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes), err => {\n if (err) {\n return console.log(err);\n }\n });\n }", "function saveNotes(note) {\n // Set the note's id to the length of the array\n note.id = data.length;\n // push the note onto the current json array\n data.push(note);\n // write the updated array to the json file\n fs.writeFile(dbPath, JSON.stringify(data), error => {\n if(error){\n throw error;\n }\n });\n\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 updateJSON() {\n fs.writeFile('db/db.json', JSON.stringify(notes, '\\t'), err => {\n if (err) {\n return err;\n }\n return true;\n });\n }", "addNote(newNote) {\n const noteAdd = {\n title: newNote.title,\n text: newNote.text,\n id: uuidv1()\n }\n return this.getNotes()\n .then(notes => [...notes, noteAdd])\n .then(allNotes => {\n asyncWriteFile(\"db/db.json\", JSON.stringify(allNotes))\n \n }).then(() => noteAdd)\n }", "function createNewNote(body, notesArray){\n const note = body; \n notesArray.push(note);\n fs.writeFileSync (\n path.join(__dirname, '../db/db.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n return note; \n}", "function appendNotes(notes, append=true){\r\n $.each(notes, function(){\r\n var li = $(\"#note-item-templete\").clone().attr(\"id\",\"li-\"+this._id).show();\r\n append ? li.appendTo(\"#notelist\") : li.prependTo(\"#notelist\");\r\n var content = this.noteContent;\r\n if (this.growth){\r\n if (this.growth.height)\r\n content += \"</br>\" + \"Hight: \" + this.growth.height;\r\n if (this.growth.weight)\r\n content += \", \" + \"Weight: \" + this.growth.weight;\r\n if (this.growth.growthDate)\r\n content += \", \" + \"Date: \" + this.growth.growthDate;\r\n }\r\n li.find(\"p\").html(content);\r\n if(this.img){\r\n li.find(\".note-img\").attr(\"src\", \"/note/\"+this._id+\"/img\").attr(\"height\", \"300\").attr(\"width\",\"400\");\r\n }\r\n li.find(\".time span\").html(this.insertAt);\r\n li.find(\"a.js-action-del\").attr(\"rel\", this._id).attr(\"href\", \"#\");\r\n\r\n noteCount += 1;\r\n $(\"span#noteCount\").html(noteCount);\r\n });\r\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 }", "function createNewNote(body, notesArray) {\n console.log('body',body)\n //create id\n let newId = getId();\n if(!ids.assigned(newId)){\n createNewNote(body, notesArray)\n }else {\n body.id = newId\n }\n\n let note = body;\n notesArray.push(note);\n\n fs.writeFileSync(\n path.join(__dirname, '../data/notes.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n return note;\n}", "function updateNotesData(notes) {\n fs.writeFile('db/db.json', JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n })\n}", "addNote(note) {\n note.id = this.nextID();\n let noteData = this.jsonData();\n\n //note that I use unshift and not push. This is to show the latest not on top when rendering.\n noteData.unshift(note);\n this.storeData(noteData);\n return noteData;\n }", "function createNewNote (body, notesArray) {\n const note = body;\n notesArray.push(note);\n // Add new note to JSON file\n fs.writeFileSync(\n path.join(__dirname, './db/db.json'),\n JSON.stringify({notes: notesArray}, null, 2)\n );\n return note;\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 writeToJsonFile(notes) {\n let notesJSON = JSON.stringify(notes, null, 2);\n fs.writeFile(\"./db/notes.json\", notesJSON, function (err) {\n if (err) {\n throw err;\n }\n });\n}", "function addNote(newNote) {\n allNotes.push(newNote);\n updateNotes(allNotes);\n}", "function createNewNote(body, notesArray) {\n const note = body;\n console.log('notes array:' + notesArray.length);\n let noteId;\n if (!notesArray.length) {\n noteId = 1;\n }\n else {\n noteId = notesArray.length + 1;\n }\n\n console.log(noteId);\n note.id=noteId;\n notesArray.push(note)\n fs.writeFileSync(path.join(__dirname, '../db/db.json'),JSON.stringify(notesArray));\n return note;\n}", "function createNewNote(body, notesArray) {\n const note = body;\n notesArray.push(note);\n fs.writeFileSync(\n path.join(__dirname, '../db/db.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n return note;\n}", "addNotes(note) {\n // generate random id each time\n let ID = uuidv4();\n // pull data from new note\n const { title, text } = note;\n // new note object to store data from above & adds new ID number\n const newNote = { id: ID, title, text }\n return this.getNotes()\n .then(notes => [...notes, newNote])\n .then(updateNotes => this.write(updateNotes))\n .then(() => newNote)\n }", "addNote(note) {\n const newNote = {\n title: note.title,\n text: note.text,\n id: note.id,\n };\n return this.getNote()\n .then((notes) => {\n return [...notes, newNote];\n })\n .then((newNoteArr) => {\n this.write(newNoteArr);\n })\n .then(() => newNote);\n }", "function getNotes() {\n fs.readFile(\"db/db.json\", \"utf8\", function (err, data) {\n if (err) {\n return error(err)\n }else{ savedNotes.push(...JSON.parse(data));}\n });\n}", "function saveNotes(notesLs) {\n fs.writeFile('./public/notes.json', JSON.stringify(notesLs), function(err){\n if(err) { console.log(err) }\n });\n }", "push(note) {\n this._notes.push(note);\n }", "function retrieveNotesAndAppend() {\n\n\t\tsetTimeout(function() {\n\t\t\tvar thisId = $('div.item.fetched-article.active').attr('data-id');\n\n\t\t\t$.ajax({\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\turl: \"/articles/\" + thisId,\n\t\t\t\t})\n\t\t\t\t.done(function(data) {\n\n\t\t\t\t\t$('#saved-notes').empty();\n\n\t\t\t\t\t$.each(data.notes, function(index, value) {\n\t\t\t\t\t\tvar $noteTitle = $('<h4>').addClass('article-note-titles text-uppercase')\n\t\t\t\t\t\t\t\t\t\t\t\t .html('<strong>' + value.title + '</strong>');\n\n\t\t\t\t\t\tvar $noteBody = $('<p>').addClass('article-note-body')\n\t\t\t\t\t\t\t\t\t\t\t\t.text(value.body);\n\n\t\t\t\t\t\tvar $noteRemoveBtn = $('<a>').addClass('btn btn-xs btn-danger btn-block note-remove-btn')\n\t\t\t\t\t\t\t\t\t\t\t\t\t .html('DELETE');\n\n\t\t\t\t\t\tvar $noteDiv = $('<div>').addClass('article-note-div')\n \t\t\t\t\t\t\t\t\t\t\t\t .attr('data-note-id', value._id);\n\n\t\t\t\t\t\t$noteDiv.append('<hr>',\n\t\t\t\t\t\t\t\t\t\t$noteTitle,\n\t\t\t\t\t\t\t\t\t\t$noteBody,\n\t\t\t\t\t\t\t\t\t\t$noteRemoveBtn,\n\t\t\t\t\t\t\t\t\t\t'<hr>')\n\t\t\t\t\t\t\t\t.appendTo('#saved-notes');\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t}, 1000);\n\t}", "function updateNotes(notesArray) {\n notesArray = JSON.stringify(notesArray);\n fs.writeFileSync(\"./db/db.json\", notesArray);\n}", "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "function writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "function loadNotesFromJSON(data) {\n\t\ttuneJSON = data;\n\t\tloadCanvas();\n\t}", "function createNote(body, noteArray) {\n const note = body;\n noteArray.push(note);\n fs.writeFileSync(\n path.join(__dirname, \"../db/db.json\"),\n JSON.stringify({ notes: noteArray }, null, 2)\n );\n return note;\n}", "function addNotesToPage() {\n // for each data_point in this team's notes_data\n for (let data_point_index in notes_data[selected_team]) {\n // data_point is new notes to add\n let data_point = notes_data[selected_team][data_point_index];\n // adds a new line\n $(\"#notes-\" + selected_team + \"-\" + data_point[1]).prepend('<h4>Stand app:</h4>').append(\"<br><hr><h4>Notes app:</h4>\" + data_point[0]);\n }\n}", "function returnNotes(){\n let data = fs.readFileSync(\"./db/db.json\", \"utf8\");\n\n let notes = JSON.parse(data);\n\n for(let i = 0; i < notes.length; i++) {\n notes[i].id = 1 + i;\n }\n\n return notes;\n}", "addNote(note) {\n // note with the title and text\n const { title, text } = note;\n\n // title and text must have content to save\n if (!title || !text) {\n throw new Error(\"Note cannot be blank!\")\n };\n\n // new note object includes title, text, & id (using uuid version 4 that automatically generates unique ID)\n const newNote = { title, text, id: uuidv4() };\n\n // returning notesArr from getNotes() along with note we want to add\n return this.getNotes()\n // expanding notesArr and adding our new note to the end\n .then((notesArr) => [...notesArr, newNote])\n // creating a NEW ARRAY called \"updatedNotes\" with the new note included and writing said array\n .then((newNotesArr) => this.write(newNotesArr))\n // emptying newNote for the next time we need to add a note\n .then(() => newNote);\n }", "addNote () {\n const time = Date.now()\n // Default new note\n const note = {\n id: String(time),\n title: 'New note ' + (this.notes.length + 1),\n content: \"**Hi!** This notebook is using [markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) for formatting!\",\n created: time,\n favorite: false,\n }\n // Add to the list\n this.notes.push(note)\n }", "function addToNotesArr(val, dur, beats) {\n var tempObj = {\n tone: val.tone,\n start: val.duration.start,\n stop: val.duration.stop,\n dur: dur,\n beats: beats.beats,\n notation: beats.notation\n };\n notes.push(tempObj);\n }", "function addNoteToArray(textDetails,taskDate,taskHours){\n var obj = createObjectNote(textDetails,taskDate,taskHours);\n notesArray.push(obj);\n localStorage.setItem(\"note_local\", JSON.stringify(notesArray));\n}", "writefnc(notes) {\n return write('./Develop/db/db.json', JSON.stringify({ notes }, null, 2));\n }", "function addNotetoDB(note) {\n const requestOptions = {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n title: note.title,\n content: note.content,\n }),\n };\n\n fetch(\"/dataItems\", requestOptions)\n .then((res) => res.json())\n //using the JSON response we'll now add the note to the Array\n .then((newNote) => addNoteToArray(newNote));\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}", "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 }", "addNote(note) {\n const { title, text } = note;\n\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' must be completed\");\n\n }\n\n const newNote = { title, text, id: uuidv1() };\n\n return this.getNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.write(updatedNotes))\n .then(() => newNote);\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 addNote() {\n var form = document.getElementById(\"note-form\");\n var title = document.getElementById(\"title\").value;\n var content = document.getElementById(\"contentbody\").value;\n var pri = document.getElementById(\"priority\").value;\n if (title !== \"\" && content !== \"\") {\n notes.push({\n title: `${title}`,\n content: `${content}`,\n pri: pri,\n id: c,\n state: 1\n });\n sendmsg(\"Note Added\", \"success\");\n } else {\n sendmsg(\"Fill all Fields\", \"danger\");\n }\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"contentbody\").value = \"\";\n c++;\n saveNotes();\n postNotes();\n btn.innerHTML = \"Add\";\n}", "function appendNote(data) {\n // create a new card and add it to the container \n let head = `\n <div class=\"card bg-info\" id=\"note-${data.id}\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.title}</h5>\n </div>\n <ul class=\"list-group list-group-flush\">`;\n let foot = `\n </ul>\n <div class=\"card-footer text-right\">\n <button type=\"button\" class=\"btn btn-light\"><i class=\"fa fa-trash-o\" aria-hidden=\"true\"></i></button>\n </div>\n </div>`;\n let list = ``;\n\n if (data.todos !== null) {\n data.todos.forEach(todo => {\n list += `<li class=\"list-group-item\">${todo.body}</li>`\n });\n }\n $(\"#content\").append(head + list + foot);\n}", "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "function pushNote(thisNote) {\n //console.log('push has been called');\n myNotes.push(thisNote);\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('New Note Saved');\n confirmation.placeholder = 'New note saved';\n note.value = '';\n}", "function json2obj(notes_list, repeat_list, timeout_list){\n\t\tvar i = 1;\n\t\t// verifying wheter there is no duplicate\n\t\tif (i == repeat_list) {\n\t\t\t// appending into a new array\n\t\t\tnotes_parsed.push(notes_list)\n\t\t\tnotes_time.push(timeout_list)\n\t\t\t// generating the syntax string in order to converted into a json\n\t\t\tvar json1 = '{\"keys\": [\"';\n\t\t\tvar json2 = notes_list + '/4\"], \"duration\": \"q\"}';\n\t\t\tvar json3 = json1.concat(json2)\n\t\t\t// parse the json into a object\n\t\t\tconst obj = JSON.parse(json3);\n\t\t\t// create a note using Vexflow\n\t\t\tvar note = new VF.StaveNote(obj);\n\t\t\t// append the final result\n\t\t\tnotes.push(note);\n\t\t\treturn notes;\n\t\t} else {\n\t\t\t\t// generate the duplicate audio\n\t\t\t\twhile( i <= repeat_list)\n\t\t\t\t{\n\t\t\t\t// append the input into a new array\n\t\t\t\tnotes_parsed.push(notes_list)\n\t\t\t\tnotes_time.push(timeout_list)\n\t\t\t\t// generating the syntax string in oreder to converted into a json\n\t\t\t\tvar json1 = '{\"keys\": [\"';\n\t\t\t\tvar json2 = notes_list + '/4\"], \"duration\": \"q\"}';\n\t\t\t\tvar json3 = json1.concat(json2)\n\t\t\t\t// parse the json into a object\n\t\t\t\tconst obj = JSON.parse(json3);\n\t\t\t\t// create a note using Vexflow\n\t\t\t\tvar note = new VF.StaveNote(obj);\n\t\t\t\t\n\t\t\t\t// append the input\n\t\t\t\tnotes.push(note);\n\t\t\t\ti = i + 1;\n\t\t\t\t\n\t\t\t}\n\t\t\t// return the final result\n\t\t\treturn notes;\n\t\t}\n\t\t\n\t}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\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 saveNotes() {\n fs.writeFileSync(\"db/db.json\", JSON.stringify(db));\n}", "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "function addNotesToReporteeList(data){\n\tvar html = \"\";\n\tif(data.length === 0){\n\t\thtml = \"<h5 class='text-center'>No Notes.</h5>\";\n\t}else{\n\t\t$.each(data, function(key, val){\n\t\t\tvar timestamp = moment(val.timestamp).format('DD MMM YYYY HH:mm');\n\t\t\thtml = reporteeNotesListHTML(val.providerName, val.noteDescription, timestamp) + html;\n\t\t});\n\t}\n\t$(\"#reportee-notes-list\").html(html);\n}", "function addNote(newNote) {\n setNotes(prevNotes => {\n return [...prevNotes, newNote];\n });\n }", "function buildNotes(notes) {\n\n //Loop through the notes\n notes.forEach(function(note) {\n\n\n const noteCard = `<div id=\"${note._id}\" class=\"note alert alert-primary alert-dismissible\" role=\"alert\">\n <div class=\"note-body\">\n ${note.body}\n </div>\n <button type=\"button\" class=\"close edit-note\">\n <span><i class=\"fas fa-edit\"></i></span>\n </button>\n <button type=\"button\" class=\"close delete-note\">\n <span>&times;</span>\n </button>\n </div>`\n\n $(\".notes-modal\").find(\"#article-notes\").append(noteCard)\n\n\n });\n }", "function addNewNote(title , content) {\n setTodoList(prev => {\n var newItem = {\n title : title,\n content: content\n }\n return[...prev, newItem]\n })\n \n }", "function addNote(note) {\n setNotes((prevNotes) => {\n return [...prevNotes, note];\n });\n }", "function addNotesDatabase(notes, newNote) {\n\tnotes.push(newNote);\n}", "handler () {\n notes.addNote(title, body);\n }", "function AddNote(noteText_ = \"\") {\n if (noteText_ == null || noteText_ == \"\") {\n return;\n }\n\n var newNoteArray = [];\n if (stateVars.itemArray != null) {\n newNoteArray = stateVars.itemArray;\n }\n\n newNoteArray.push(noteText_);\n\n setStateVars((prevState) => {\n return ({\n ...prevState,\n noteArray: newNoteArray,\n promptNewNote: false,\n newNoteText: \"\",\n requireUpdate: true\n });\n });\n }", "function loadNotes() {\n if (localStorage.notes != undefined) {\n var contents = JSON.parse(localStorage.getItem(\"notes\"));\n\n for (var i = 0; i < contents.length; i ++) {\n addNote(contents[i]);\n }\n }\n}", "addNote(note) {\r\n return new Promise((resolve, reject) => {\r\n //for end code wrap in the listNotePromise ==> only if this works run this.\r\n //this.listNotePromise.then(() => {\r\n\r\n //this.notes.push(note);\r\n fs.writeFile(this.filename, JSON.stringify([note]), (err) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n resolve();\r\n });\r\n });\r\n\r\n\r\n\r\n //});\r\n /*\r\n This addNote is not the best due to fact we are just asking for a note every time you call, then we only write origional notes, we need to change the implementation so that we can save the previous notes\r\n \r\n we need to change add note and list note!\r\n \r\n change how we resolve in list note - \r\n this.note = JSON.parse(data);\r\n resolve(this.notes)\r\n \r\n in add note we add these lines\r\n this.notes.push(note);\r\n fs.writeFile(this.filename, JSON.stringify(this.notes), (err) => {\r\n .....\r\n })\r\n \r\n \r\n when we try to list the notes, we save the information in a cache an object that is hidden, then when we add the note we push the new note to the caches file, so that now we can list both notes\r\n might throw an error - we must list the notes first!\r\n add it to the constructor this.notes = [];\r\n \r\n now we can pass\r\n \r\n */\r\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 var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function addNoteTextStorage(event) {\n const node = event.target.parentNode.parentNode;\n const text = node.querySelector('.note__text').innerText;\n const date = node.querySelector('.date').innerText;\n\n const noteText = { text, date };\n\n notes.push(noteText);\n localStorage.setItem('notes', JSON.stringify(notes));\n\n populateNotes(notes, notesList);\n}", "function addANote(req, res) {\n console.log(\"im in addANote\");\n Articles.findByIdAndUpdate(req.params.id, {\n $addToSet: {\n notes: req.body.note\n }\n }, {\n new: true\n }).then(function (data) {\n console.log(data);\n const prevNotes = [];\n for (let i = 0; i < data.notes.length; i++) {\n console.log(data.notes[i]);\n prevNotes.push({\n \"noteId\": i,\n \"note\": data.notes[i]\n });\n }\n console.log(\"prevNotes:\");\n console.log(prevNotes);\n res.render(\"notes\", {\n prevNotes: prevNotes\n });\n }).catch(function (err) {\n console.log(\"There was a DB error - addANote\");\n console.log(err);\n res.status(500).send(\"A Server Error Occurred\");\n });\n}", "function updateNoteDb() {\n fs.writeFile(\"db/db.json\",JSON.stringify(notes,'\\t'),err => {\n if (err) throw err;\n return true;\n });\n}", "function addNote(note) {\n setNotesList(prevList => { return [...prevList, note] });\n }", "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "_pushJSONPre() {\n if (! this._pre) {\n this.push('{\"content\": \"');\n this._pre = true;\n }\n }", "saveNote(note) {\n let savedNote = {\n title: note.title,\n text: note.text,\n };\n\n return this.getNotes()\n .then((notes) => [...notes, savedNote])\n .then((newNote) => this.write(newNote))\n .then(() => savedNote);\n\n }", "setupNotesFromData() {\n if(this.locations) {\n if(typeof(this.locations) === \"string\") {\n this.locations = JSON.parse(this.locations);\n }\n for(let id in this.locations) {\n if(id === null || this.locations[id] === null) {\n continue;\n }\n this.currentMaxId = Math.max(parseInt(id),this.currentMaxId);\n this.dirtyNotesId.add(id);\n let fieldLabel = this.locations[id].fieldName;\n if(!(this.locations[id].fieldName && this.locations[id].fieldName !== '')) {\n fieldLabel = \"Note Label\";\n }\n this.notes.push({\n id: id,\n top: this.locations[id].top,\n left: this.locations[id].left,\n isDirty: true,\n fieldName: this.locations[id].fieldName,\n comment: this.locations[id].comment,\n isDragToggleEnabled :false,\n isDragEnabled : false,\n });\n }\n }\n this.refillNotes();\n }", "function notePush(i) {\n strings.push(fretNotes[i].string);\n frets.push(fretNotes[i].fret);\n midis.push(fretNotes[i].midi);\n ids.push(fretNotes[i].id);\n relations.push(fretNotes[i].relation);\n count++;\n index.push(i);\n }", "constructor() {\n\t\tthis.notes = [\n\t\t\t {\n\t\t\t \"title\":\"Test Title\",\n\t\t\t \"text\":\"Test text\",\n\t\t\t \"id\": 0\n\t\t\t }\n\t\t\t];\n\t}", "function addNote(req, res) {\n Recipe.findById(req.params.id, function (err, recipe) {\n Note.create({\n content: req.body.note,\n }, function (err, note) {\n recipe.notes.push(note._id)\n recipe.save(function (err) {\n res.redirect(`/recipes/${recipe._id}`)\n })\n })\n })\n}", "storeNotes () {\n State.store('notifications', this.notes.map(n => {\n return {\n subject: n.subject,\n details: n.details,\n severity: n.severity,\n stamp: n.stamp,\n id: n.id,\n acked: n.acked\n }\n }))\n }", "write(note) {\n return writeFileAsync(\"db/db.json\", JSON.stringify(note));\n }", "function addNote(note) {\r\n setListNote((prevNote) => {\r\n return [...prevNote, note];\r\n });\r\n }", "function addUserNote() {\n var result = notes.addNote()\n console.log(result)\n}", "function loadNotes() {\n noteId = 0;\n idx = 1;\n notes = [];\n document.getElementById('data').innerHTML = '';\n\n chrome.storage.sync.get('todos_notes', function(result) {\n notes = result.todos_notes;\n if (!notes) {\n notes = [''];\n }\n createNotes(notes, idx, 0);\n });\n }", "function note_add(_Poc,_text){\r\n\tNotecurrent_IdNUM++;\r\n\tvar newnote ={\r\n\t\tid:'note'+Notecurrent_IdNUM\r\n\t\t,x: _Poc.x\r\n\t\t,y: _Poc.y\r\n\t\t,text:_text\r\n\t\t,color:defaultCOLOR\r\n\t\t,fontsize:defaultFONTSIZE\r\n\t\t,selected:false\r\n\t};\r\n\tnotes.push(newnote);\r\n\tnumnote++;\r\n\treturn newnote;\r\n}", "writeFile(note) {\n return fileWrite('db/db.json', JSON.stringify(note));\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 newNote(gameState, text) {\n thisGameState.notes.push(text);\n socket.emit(\"save\", gameState);\n}", "write() {\r\n return new Promise((resolve, reject) => {\r\n fs.writeFile(this.file, JSON.stringify(this.notes), err => {\r\n if (err) {\r\n return reject(err);\r\n }\r\n resolve(this.notes); //with every step, we should be resolving it by showing the list of notes that we have created\r\n });\r\n });\r\n }", "function saveNoteDataToLocalStorage() {\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "static getNotes() {\n return fetch(`${baseURL}/notes`).then(resp => resp.json())\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}", "function addNotes(id, con){\n\tvar musicPosition = 0;\n\tvar storeNotes_arr = [];\n\t\n\tif(con){\n\t\tmusicPosition = id.position;\n\t\tstoreNotes_arr = id.notes;\n\t\tid = id.id;\n\t}\n\t\n\tvar notesHTML = '';\n\tvar noteID = 'note'+edtNotesCount;\n\tvar percent = 0;\n\tvar bgColour = '';\n\tvar editAdded = '';\n\t\n\tfor(n=0;n<notes_arr.length;n++){\n\t\tif(id == notes_arr[n].id){\n\t\t\tpercent = 100/(Number(notes_arr[n].amount)+1);\n\t\t\tbgColour = notes_arr[n].colour;\n\t\t\t\n\t\t\tvar totalNote = '';\n\t\t\tfor(p=0;p<notes_arr[n].amount;p++){\n\t\t\t\ttotalNote += '<div class=\"note\"></div>';\n\t\t\t}\n\t\t\t\n\t\t\tif(!con){\n\t\t\t\teditAdded = 'added';\n\t\t\t}\n\t\t\tnotesHTML = '<div id=\"'+noteID+'\" data-array='+id+' data-type='+id+' class=\"notesWrapper '+editAdded+'\">'+totalNote+'</div>';\n\t\t}\n\t}\n\t\n\t$('.playerNotes').append(notesHTML);\n\t$('#'+noteID+', #'+noteID+' .note').css('background', bgColour);\n\t$('#'+noteID+' .note').draggable({ containment: '#'+noteID, scroll: false, start:function(){ curNote=$(this).closest('div.notesWrapper').attr('data-array');highLightNote(false); }, drag:function(){updateNoteValue(false);}});\n\t$('#'+noteID).draggable({ containment:'.editPlayerWrapper', scroll:false, start:function(){ curNote=$(this).attr('data-array');highLightNote(false); }, drag:function(){updateNoteValue(false);}});\n\t\n\t$('#'+noteID).click(function(){\n\t\tcurNote=$(this).attr('data-array');highLightNote(false);\n\t});\n\t\n\t$('#'+noteID+' .note').click(function(){\n\t\tcurNote=$(this).closest('div.notesWrapper').attr('data-array');highLightNote(false);\n\t});\n\t\n\tif(con){\n\t\t$('#'+noteID).css('top', musicPosition * heightScale);\n\t}else{\n\t\t$('#'+noteID).css('top', curMusicPosition);\t\n\t}\n\t\n\tvar curLeft = percent;\n\t$('#'+noteID+' .note').each(function(index, element) {\n\t\tif(con){\n\t\t\t$(this).css('left',storeNotes_arr[index]);\n\t\t}else{\n\t\t\t$(this).css('left',curLeft+'%');\n\t\t\tcurLeft+=percent;\n\t\t}\n });\n\t\n\tedtNotesCount++;\n\tstopGame();\n}", "function saveNoteDataToLocalStorage() {\n\n noteObj = {\n userEndTime: userEndTime,\n noteText: noteText,\n Index: noteList.length\n }\n noteList.push(noteObj);\n localStorage.setItem(\"noteList\", JSON.stringify(noteList));\n}", "function findRelatedNotes(thisNote) {\n //console.log('findRelatedNotes has been called');\n if (myNotes.length > 0) {\n //console.log('case 1');\n var flag = false; //initialise flag / flag state reset\n // loop through exsisting notes. If note title exsists, then append note.\n for (var i = 0; i < myNotes.length; i++) {\n //console.log('loop started');\n if (myNotes[i].title == thisNote.title) {\n flag = true; //prevent note from being pushed as a new entry\n //console.log('found match');\n //console.log('appending to note');\n var currentNoteVal = myNotes[i].note;\n var newNoteVal = currentNoteVal + '<br/><br/>' + dateString + ' | ' + thisNote.note;\n //console.log(newNoteVal);\n myNotes[i].note = newNoteVal;\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('Saved');\n confirmation.placeholder = 'The note for this subject has been updated';\n note.value = '';\n }\n }\n if (flag === false) {\n pushNote(thisNote);\n }\n } else if (myNotes.length === 0) {\n //console.log('case 2');\n pushNote(thisNote);\n }\n}", "function attachNotes(){\n $('.location p').remove();\n var startKey = 'note_'+groupNumber+'_'+chosenNumber;\n db.allDocs({\n include_docs: true,\n attachements: true,\n startkey: startKey,\n endkey: startKey+'\\uffff'\n }).then(function(locationData){\n console.log(locationData);\n for(var i = 0; i < locationData.rows.length; i++){\n var location = locationData.rows[i].doc.location;\n var player = locationData.rows[i].doc.author;\n var content = locationData.rows[i].doc.content;\n var id = locationData.rows[i].doc._id;\n $('#note'+chosenNumber).append('<p id='+id+' class=\"notePlayer'+player+'\">'+content+'</p>');\n }\n attachAgus();\n\n });\n}", "function newNote() {\n var csrftoken = $.cookie('csrftoken'),\n folder_id = $('.folder-list>.active>a').attr(\"data-folderid\"),\n data = {\n title: \"Untitled note\",\n body: \"<br>\",\n folder_id: folder_id,\n csrfmiddlewaretoken: csrftoken\n };\n $.post(\"/notes/addnote/\", data, function (data) {\n $('#notelist').children().prepend(data).children().first().trigger('click');\n $('#title').empty();\n });\n }", "function saveNotesToLocalStorage() {\n let holdsLocalStorageNotes = [];\n allNotes.forEach((element) => {\n element.getNoteText();\n\n let temporaryVarForTextContent = \"\";\n if (element.getNoteText() != \"\") {\n temporaryVarForTextContent = element.getNoteText();\n }\n\n let liFromObjArray = element.getNoteLi();\n\n holdsLocalStorageNotes.push(\n element.noteType,\n element.titleOfNoteBook,\n element.date,\n temporaryVarForTextContent\n ); //fix here\n\n if (element.noteType == 2) {\n liFromObjArray.forEach((element) => {\n holdsLocalStorageNotes.push(element);\n });\n }\n\n holdsLocalStorageNotes.push(\"//\");\n });\n\n toString(holdsLocalStorageNotes);\n\n localStorage.setItem(\"notes\", holdsLocalStorageNotes);\n\n // maby add a call in remove notes to jsut to keep in current\n}", "function addNote(text) {\n var newNote = $(\"<div class = 'note'></div>\");\n var icons = $(\"<div class = 'icons'></div>\");\n\n var tag = $(\"<i class = 'fa fa-tag' aria-hidden = 'true'></i>\");\n var removeButton = $(\"<i class = 'fa fa-times' aria-hidden = 'true'></i>\");\n var textBox = $(\"<textarea></textarea>\");\n\n if (text != undefined) textBox.val(text);\n\n tag.click(changeColor);\n textBox.blur(saveNotes);\n removeButton.click(function() {\n newNote.remove();\n saveNotes();\n });\n\n icons.append(tag);\n icons.append(removeButton);\n\n newNote.append(icons);\n newNote.append(textBox);\n newNote.appendTo($(\"#sticky-notes\"));\n saveNotes();\n}", "async function saveNote(req) {\n try {\n let data = await fs.promises.readFile(\"./db/db.json\", \"utf8\");\n let dataJSON = JSON.parse(data);\n let currentData;\n if(req.body.id){\n console.log(\"We got an update, not a new Note!\")\n currentData = dataJSON.filter((data) => {\n return data.id != req.body.id\n })\n }else{\n currentData = dataJSON;\n req.body.id = Math.random();\n }\n let newNotes = [...currentData, req.body];\n await write(newNotes);\n return Promise.resolve(newNotes);\n } catch (err) {\n console.log(err);\n }\n}", "function listNotes(){\n var notes = getNotes();\n\n notes.forEach((note) => formatNote(note));\n}", "function postNote(event) {\n event.preventDefault();\n var note = {};\n\n $.each($('#todoForm').serializeArray(), function (i, field) {\n note[field.name] = field.value;\n });\n console.log(note);\n $.ajax({\n type: 'POST',\n url: '/notes',\n data: note,\n success: function (data) {\n getNotes();\n }\n });\n}", "function new_notes(){\r\n var lec = $('#Topic').val();\r\n var cor = $('#Course_Name').val();\r\n var des = $('#Description').val();\r\n\r\n var user = firebase.auth().currentUser;\r\n var name, email, photoUrl, uid;\r\n\r\n if (user != null) {\r\n // name = user.displayName;\r\n email = user.email;\r\n uid = user.uid; // The user's ID, unique to the Firebase project. Do NOT use\r\n // this value to authenticate with your backend server, if\r\n // you have one. Use User.getToken() instead.\r\n }\r\n\r\n var notesData = {\r\n Topic: lec,\r\n userid: uid,\r\n Description: des,\r\n Course_Name: cor\r\n };\r\n\r\n // Get a key for a new Post.\r\n var newNotesKey = firebase.database().ref().child('Notes').push().key;\r\n\r\n // Write the new post's data simultaneously in the posts list and the user's post list.\r\n var updates = {};\r\n updates['/Notes/' + newNotesKey] = notesData;\r\n // updates['/user-notes/' + uid + '/' + 'noteid'] = newNotesKey;\r\n\r\n firebase.database().ref().update(updates);\r\n}", "function render_notes(data)\n {\n var note_list = [];\n var note;\n if (!data.notes.length)\n {\n // no notes\n note = [\"<li class='list-group-item'>\", \"No notes for this headline yet.\", \"</li>\"].join(\"\");\n note_list.push(note);\n } else {\n // have notes\n for (var i = 0; i < data.notes.length; i++)\n {\n // create the HTML note object\n note = $(\n [\n \"<li class='list-group-item note'>\",\n data.notes[i].text,\n \"<button class='btn btn-danger note-delete'>x</button>\",\n \"</li>\"\n ].join(\"\")\n );\n // attach the note's id to the jQuery element, to be used to figure out which note to delete\n note.children(\"button\").data(\"_id\", data.notes[i]._id);\n note_list.push(note);\n }\n }\n $(\".note-container\").append(note_list);\n }", "function storeNote() {\n let title = document.getElementById(\"title\").value; //receives text from input field\n let note = document.getElementById(\"takeNote\").value; //recieves text from textarea\n note = note.replace(/\\n\\r/g, \"<br />\"); //replace \\n \\r with \"<br />\" as notices are stored as an string\n if ((title || note) == \"\") {\n //leave function if title or note are empty\n return;\n }\n\n titles.push(title); //store title in array titles\n notes.push(note); //store note in array notes\n setArray(\"titles\", titles); //store also under localStorage\n setArray(\"notes\", notes); //store also under localStorage\n\n document.getElementById(\"title\").value = \"\"; // delete input title\n document.getElementById(\"takeNote\").value = \"\"; // delete input notes\n\n showNotes(\"my-notes\", titles, notes); //shows update notes\n}", "function createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}" ]
[ "0.74540186", "0.7315348", "0.7185029", "0.7019678", "0.6928482", "0.68346703", "0.67743486", "0.676566", "0.67204356", "0.6720389", "0.6694183", "0.66903615", "0.66879076", "0.66209245", "0.6597926", "0.65664387", "0.65643656", "0.6558496", "0.65463877", "0.65138054", "0.64905185", "0.6484508", "0.6479003", "0.6478863", "0.64631724", "0.64285004", "0.64229846", "0.6413517", "0.6404295", "0.63835645", "0.6383495", "0.63672066", "0.636563", "0.63630545", "0.63162845", "0.63147086", "0.63075256", "0.62678915", "0.6253051", "0.62473977", "0.62238735", "0.6215897", "0.62131643", "0.621206", "0.62030315", "0.6201075", "0.6179745", "0.617428", "0.6149933", "0.6143871", "0.61307734", "0.61151665", "0.6101835", "0.6100627", "0.60988814", "0.60974824", "0.6080839", "0.6069581", "0.60662496", "0.60653", "0.6040341", "0.6029954", "0.6023266", "0.6021648", "0.6017566", "0.6011502", "0.600124", "0.599966", "0.59975797", "0.5965979", "0.595709", "0.5954044", "0.59499466", "0.5938444", "0.5918677", "0.59158677", "0.5909963", "0.5880904", "0.588074", "0.58799815", "0.58779776", "0.58725625", "0.58565086", "0.5851346", "0.58498615", "0.58421487", "0.5839079", "0.5838668", "0.58382535", "0.58270246", "0.58233964", "0.58206177", "0.5808082", "0.5800785", "0.57908577", "0.57890266", "0.5784827", "0.57758534", "0.5773614", "0.57728004" ]
0.6474921
24
deletes note by id from json
function deleteNoteById(id, noteArr){ let updatedNoteArr // if the arr is empty then return an empty arr if(noteArr.length == 0) updatedNoteArr = []; else{ // otherwise, return all elements that dont match that id from passed arr updatedNoteArr = noteArr.filter(note => id != note.id); // update id's post removal corresponding to the elements index updatedNoteArr.forEach((note, index) => { note.id = index; updatedNoteArr[index] = note; }); } // wite fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: updatedNoteArr}, null, 2)); return updatedNoteArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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(id) {\n // remove the note at index: id from the json array\n data.splice(id, 1);\n // Update the ids for every other note to match their updated position in the array\n for (let i = 0; i < data.length; i++) {\n data[i].id = i;\n }\n // Write the updated array to the json file\n fs.writeFile(dbPath, JSON.stringify(data), error => {\n if(error){\n throw error;\n }\n })\n}", "deleteNote(id) {\n if(this.locations.hasOwnProperty(id)) {\n delete this.locations[id];\n }\n this.dirtyNotesId.delete(id);\n\n for(let i in this.notes) {\n if(this.notes[i].id === id) {\n this.notes.splice(i,1)\n break;\n }\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 (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}", "function removeNote(id) {\n // find object (note) for which id equals the argument\n const noteIndex = notes.findIndex(function(note) {\n return note.id === id;\n });\n if (noteIndex > -1) {\n // delete that one object\n notes.splice(noteIndex, 1);\n }\n}", "removeNote(id) {\n // use get notes function to acess array of notes\n return this.getNotes()\n // filter through notes array to get all notes besides the one with the matching ID\n .then(notes => this.write(notes.filter(note => note.id != id)))\n }", "deleteNote(id) {\n // This uses the same kind of logic. It doesn't actually delete the note...\n return this.getNotes()\n // we find the note we want to delete by filtering throught notesArr by id \n .then(notesArr => notesArr.filter((note) => note.id !== id))\n // and create a NEW ARRAY with the new note inside\n .then(filteredNotesArr => this.write(filteredNotesArr))\n }", "function deleteById(id, notesArray) {\n const requiredIndex = notesArray.findIndex(el => {\n return el.id === String(id);\n });\n if (requiredIndex === -1){\n return false; \n };\n notesArray.splice(requiredIndex, 1);\n fs.writeFileSync(\n path.join(__dirname, '../db/db.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n ); \n return notesArray; \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 }", "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 deletenote(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/notes/\" + id\n })\n .done(function() {\n getnotes(noteCategorySelect.val());\n });\n }", "deleteNote(id) {\n// get the notes, filter and grab out the one in the id\nreturn this.getNotes()\n.then(notes => (notes.filter(note => note.id !== parseInt(id))))\n.then(newNoteSet => asyncWriteFile(\"db/db.json\", JSON.stringify(newNoteSet)))\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 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 deleteNoteFromDB(deletedNoteId) {\n const requestOptions = {\n method: \"DELETE\",\n };\n fetch(\"/dataItems/\" + deletedNoteId + \"/delete\", requestOptions)\n .then((res) => res.json())\n //using the JSON response we'll now delete the note from the Array\n .then((deletedNote) => {\n deleteNoteFromArray(deletedNote.noteId);\n });\n }", "removeNote(id) {\n return this.getNotes()\n .then((notes) => notes.filter((note) => note.id !== id))\n .then((filteredNotes) => this.write(filteredNotes));\n }", "function deleteNote(id) {\r\n console.log(\"deleted id: \" + id);\r\n\r\n setListNote((prevList) => {\r\n return prevList.filter((note, index) => {\r\n return index !== id;\r\n });\r\n });\r\n }", "function deleteNote(id) {\n setNotesList(prevList => {\n return (prevList.filter(\n (value, index) => index !== id))\n });\n }", "function deleteElementFromObject(id){\n \n for(let i=0;i<notes.length;i++){\n if(notes[i].id===id){\n notes.splice(i,1);\n }\n}\nconsole.log(notes);\n}", "function deleteNote(id) {\n setNotes((prevNotes) => {\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n }", "removeNote(id) {\n return this.getInfo()\n .then((info) => info.filter((info) => info.id !== id))\n .then((filteredInfo) => this.write(filteredInfo));\n }", "function deleteNote(id, notesArray) {\n let noteID = parseInt(id);\n for (let i = 0; i < notes.length; i++) {\n if (noteID === notes[i].id) {\n notes.splice(i,1);\n if (notes.length > 0) {\n notes[0].id = 0;\n for (let j = 1; j < notes.length; j++) {\n notes[j].id = notes[j-1].id + 1;\n } \n }\n fs.writeFileSync(\n path.join(__dirname, '../db/db.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n }\n }\n return notes;\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 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}", "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 deleteNote(noteEl) {\n fetch(url + '/' + `${noteEl.id} `, {\n method: 'DELETE'\n }).then(() => noteEl.parentElement.remove())\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 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 deleteById(id){\n var list = createJsonList()\n var index = 0;\n for(var i =0; i < list.length; i++){\n var cur = list[i];\n if(id == parseInt(cur.id)){\n index = i;\n break;\n }\n }\n list.splice(index,1);\n clearCanvas()\n jsonListToCanvas(list)\n}", "function delNote(d)\n{\n // get key as id, then remove that object from DB\n var keyToDel = d.id\n loc.child(keyToDel).remove()\n\n // delete from web page\n var rowToBeDel = d.parentNode.parentNode\n var ch0 = rowToBeDel.childNodes[0]\n var ch1 = rowToBeDel.childNodes[1]\n var ch2 = rowToBeDel.childNodes[2]\n rowToBeDel.removeChild(ch0)\n rowToBeDel.removeChild(ch1)\n rowToBeDel.removeChild(ch2)\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 }", "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 deleteNote(note) {\n setAllNotes(allNotes.filter(item => item !== note));\n const notesDataJson = JSON.stringify(allNotes);\n localStorage.setItem('notesData', notesDataJson);\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 }", "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 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}", "deleteNote(note) {\n this.notes = this.notes.filter(item => item !== note);\n }", "removeNote(noteId) {\n //localizando el hijo y buscarlo por el id\n this.db.child(noteId).remove();\n\n }", "deleteNote(knex, id) {\n /* return Promise.resolve({}) */\n return knex('noteful_notes')\n .where({ id })\n .delete()\n }", "function deleteJSON(id)\n{\n filesDB.transaction(function (tx) \n {\n tx.executeSql(\"DELETE FROM files where id = ?\", [id]);\n });\n \n}", "function deleteJSON(id)\n{\n filesDB.transaction(function (tx) \n {\n tx.executeSql(\"DELETE FROM files where id = ?\", [id]);\n });\n \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}", "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}", "async function deleteNoteById(id) {\n const result = await query(\"DELETE FROM notes WHERE id = $1 RETURNING id;\", [\n id,\n ]);\n return result.rows[0].id;\n}", "async delete(noteID) {\r\n let store = await this.notesAccessStore(\"readwrite\")\r\n return store.delete(Number(noteID))\r\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 deleteById(id) {\n return fs.readFile(dbPath, \"utf-8\").then((jsonData) => {\n const articles = JSON.parse(jsonData);\n\n const newArticles = articles.filter((article) => {\n return article.id !== id;\n });\n\n return fs.writeFile(dbPath, JSON.stringify(newArticles));\n });\n}", "function deletePost(id){\n fs.readFile('data/data.json', 'utf8', function (err, data) {\n \n if (err) {\n return console.log(err);\n }\n parsedData = JSON.parse(data);\n for (i = 0; i < parsedData.posts.length; i++){\n if (parsedData.posts[i].id == id){\n parsedData.posts.splice(parsedData.posts[i], 1);\n }\n }\n\n fs.writeFileSync('data/data.json', JSON.stringify(parsedData));\n //callback(parsedData.events)\n });\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 deleteToDo( id ) {\n\n return fetch( `${postToDoURL}` + '/' + `${id}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n }\n } ).then( response => response.json() );\n }", "function deleteNoteFromArray(deletedNoteId) {\n setNotes((prevValue) => {\n return prevValue.filter((x) => {\n return x.id !== deletedNoteId;\n });\n });\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 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 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}", "deleteNote(i) {\n const index = this.state.list.findIndex((p) => p.id === i.id);\n if (index !== -1) {\n this.state.list.splice(index, 1);\n this.props.removeItem(this.state.list);\n this.setState({ listString: JSON.stringify(this.state.list) })\n }\n }", "function deleteExercise(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/exercises/\" + id\n })\n .then(function () {\n $(`[data-exercise=${id}]`).remove();\n });\n }", "function 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 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 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 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}", "function todo_delete_id(db, id, res) {\n db.get(\"SELECT id, subject, content, priority FROM todo WHERE id = ?\", id, (err, row) => {\n if(err) throw err\n res.json({\n \"messages\": [{\n \"buttons\": [\n {\n \"postback\": \"yes\",\n \"text\": \"YES\"\n }, {\n \"postback\": \"no\",\n \"text\": \"NO\"\n }],\n \"imageUrl\": undefined,\n \"platform\": \"facebook\",\n \"subtitle\": row.subject,\n \"title\": \"Are you sure?\",\n \"type\": 1\n }]\n })\n })\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(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(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"NoteDeleted\", noteId);\n }\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 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){\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) {\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 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) {\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(\"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\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}", "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 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}", "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) {\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}", "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}", "deleteNote(id){\n // // creating a new var that holds current notes\n let newNoteArr = this.state.notes;\n // // mapping through array of all notes that's saved in our state, passing in the current note along with the index of that current note\n newNoteArr.map((note, index) => {\n // //at ever note (from the array in our state) we check to see if the id passed in matches the id of the note we're currently on\n\n if (id === note.id) {\n // // if it matches we're removing just one item from that array\n newNoteArr.splice(index,1);\n }\n });\n // // our array now has the same elements minus the one we just deleted\n // // update our state to show that new array which will trigger a re-render\n this.setState(\n {\n notes: newNoteArr\n }\n );\n }", "function unArchiveNote(id) {\n let data = {\n noteIdList: [id],\n isArchived: false\n\n }\n postService('post', '/notes/archiveNotes', data)\n .then((res) => {\n console.log(res)\n getArchnote();\n\n })\n .catch((err) => {\n console.log(err)\n })\n}", "function deleteAnime(id) {\n anime.animes = anime.animes.filter(el => { return id !== el.id })\n writeJson();\n}", "remove(id, params) {}", "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 }", "async function delNote (noteId) {\n await utils.asyncForEach(noteId, async function (id) {\n const socket = await utils.connect(id)\n socket.on('connect', async () => {\n socket.emit('delete')\n await delHistoryNote([id])\n })\n })\n\n personalCache = await utils.getPersonal()\n const hrefList = personalCache.map(e => e.href)\n var fail = []\n noteId.forEach(id => {\n if (hrefList.indexOf(id) !== -1) fail.push(id)\n })\n\n if (fail.length > 0) return delNote(fail)\n return []\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){\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) {\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 borrarNota(id) {\n var uri = __env.apiUrl + 'nota/borrar/' + id;\n return $http({\n url: uri,\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response;\n });\n }", "deleteItem(id) {\n\n if (confirm(\"Delete this entry forever?\")) {\n\n submitDataAsync({id: id}, \"/journal/delete\", false, (responseData) => {\n\n console.log(responseData);\n\n if (responseData.success === true) {\n this.setState(prevState => ({\n items: prevState.items.filter((item) => {\n return item._id.$oid !== id;\n })\n }));\n }\n\n });\n }\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 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 }", "deleteNote() {\n let noteToDelete = this.state.selectedNote;\n let existingNotes = [...this.state.notes];\n let updatedNotes = existingNotes.filter(note => {\n if (note._id !== noteToDelete._id) {\n return note;\n }\n });\n this.setState({\n notes: updatedNotes,\n selectedNote: { _id: null, text: \"\", dateUpdated: \"\" }\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 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) {\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 deleteNotification(id) { // id = notification id\n // jQuery AJAX call for JSON\n $.getJSON( '/notifications/deleteNotification/'+ id, function( ) {\n });\n}", "static deleteById(req, res) {\n\t\t//delete referensi di user dulu\n\t\tUser.findByIdAndUpdate(req.headers.userId, {\n\t\t\t$pull: { userTodos: { $in: ObjectId(req.params.todoId) } }\n\t\t})\n\t\t\t.exec()\n\t\t\t.then(deleteResponse => {\n\t\t\t\tres.json(deleteResponse);\n\t\t\t\t///return Todo.findByIdAndRemove(ObjectId(req.params.todoId));\n\t\t\t})\n\t\t\t.then(response => {\n\t\t\t\tres.status(200).json({\n\t\t\t\t\tmessage: \"Todo Deleted\"\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tres.status(400).json({\n\t\t\t\t\tmessage: err.message,\n\t\t\t\t\tdata: err\n\t\t\t\t});\n\t\t\t});\n\t}", "function deleteAnnotationById(id) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4 && xhr.status === 200) {\n console.log(xhr.responseText);\n }\n }\n xhr.open(\"DELETE\", \"https://youtube-annotate-backend.herokuapp.com/api/remove/\" + id, true);\n xhr.send(null);\n}" ]
[ "0.8388772", "0.77906513", "0.7785953", "0.76012933", "0.7568043", "0.75050163", "0.7481722", "0.74281424", "0.7400665", "0.73658234", "0.73554605", "0.73432297", "0.73396564", "0.7338531", "0.72993416", "0.72823566", "0.72796124", "0.7273544", "0.7252594", "0.7246397", "0.72082055", "0.7190422", "0.7174644", "0.7074226", "0.70654285", "0.7043105", "0.6899864", "0.6890311", "0.68857485", "0.6870719", "0.6817739", "0.6766299", "0.6751617", "0.67368436", "0.6734345", "0.6666526", "0.66468906", "0.66331476", "0.66317165", "0.66160893", "0.6611658", "0.6611658", "0.6602781", "0.6576515", "0.6567868", "0.6544374", "0.65270543", "0.6520076", "0.6512133", "0.65079206", "0.650306", "0.6500059", "0.6491071", "0.6488072", "0.6488072", "0.6487201", "0.64795077", "0.6475603", "0.6467122", "0.645105", "0.6446374", "0.64378256", "0.64341736", "0.6426096", "0.6413912", "0.64127475", "0.6407739", "0.64072144", "0.6406744", "0.6402064", "0.63966554", "0.63853395", "0.63827384", "0.63798165", "0.63735145", "0.63604516", "0.6355933", "0.6340752", "0.63405824", "0.6335286", "0.63279647", "0.6316266", "0.6311528", "0.6310898", "0.6298452", "0.62893224", "0.6287293", "0.62844145", "0.62808406", "0.62718874", "0.62677234", "0.62673044", "0.6252172", "0.62353855", "0.62326854", "0.6216397", "0.621371", "0.62120086", "0.62114644", "0.62113756" ]
0.7328403
14
Validate and log use in.
function onLogin(loginResponse){ // Send headers to your server and validate user by calling Digits’ API var oAuthHeaders = loginResponse.oauth_echo_headers; var verifyData = { authHeader: oAuthHeaders['X-Verify-Credentials-Authorization'], apiUrl: oAuthHeaders['X-Auth-Service-Provider'] }; console.log('logged in!'); console.log(verifyData); $('.digits-widget').hide(); alert('You are now logged in!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "validate() {}", "validate() { }", "function validation() {\r\n\t\t\r\n\t}", "validateAndSubmitForm() {\n if (!this.state.login.trim()) {\n this.setState({formError: this.props.translate('loginForm.pleaseEnterEmailOrPhoneNumber')});\n return;\n }\n\n this.setState({\n formError: null,\n });\n\n // Check if this login has an account associated with it or not\n fetchAccountDetails(this.state.login);\n }", "_validate() {\n\t}", "function validateIn() {\r\n\t// username\r\n\tif (username.value == \"\") {\r\n\t\talertUsername.textContent = \"Username is required.\";\r\n\t\tusername.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// check username length\r\n\tif (username.value.length < 6 || username.value.length > 18) {\r\n\t\talertUsername.textContent = \"Between 6 and 18 characters.\";\r\n\t\tusername.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// username must contain only\r\n\t\t// letters\r\n\t\t// numbers\r\n\t\t// no whitespaces\r\n\tif (!(/^(?:[a-zA-Z])[a-zA-Z0-9]+$/.test(username.value))) {\r\n\t\talertUsername.textContent = \"Begin with a letter, followed by numbers only. No whitespaces.\";\r\n\t\tusername.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// password\r\n\tif (password.value == \"\") {\r\n\t\talertPassword.textContent = \"Password is required.\";\r\n\t\tpassword.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// check length of password\r\n\tif (password.value.length < 8) {\r\n\t\talertPassword.textContent = \"8 or more characters.\";\r\n\t\tpassword.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// check if password contains\r\n\t\t// one lowercase\r\n\t\t// one uppercase\r\n\t\t// one number\r\n\t\t// one special character from !@#$%^&*\r\n\tif (!(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!_.@#\\$%\\^&\\*])/.test(password.value))) {\r\n\t\talertPassword.textContent = \"Must contain one lowercase, one uppercase, one number and one special character.\";\r\n\t\tpassword.focus();\r\n\t\treturn false;\r\n\t}\r\n}", "function logForm()\n{\n if(userEmail1.value == \"\"){\n userEmail1.style.borderColor = \"#dddddd\";\n userEmail1.focus();\n emailError.innerHTML = \"please enter your email\";\n return false;\n }\n\n if(userPass.value == \"\"){\n userPass.style.borderColor = \"#dddddd\";\n userPass.focus();\n userPassErr.innerHTML = \"please enter your password\";\n return false;\n }\n \n}", "static validate(user) {\n return true\n }", "onSubmit() {\n console.warn(\"onSubmit() should be implemented in subclasses\");\n // this.attemptLogin();\n }", "async function validloggued() {\n const user = await AsyncStorage.getItem(\"user\");\n if (user)\n dispatch({\n type: AUTH_LOGUIN,\n payload: user,\n });\n else\n dispatch({\n type: AUTH_LOGUOT,\n payload: null,\n });\n }", "function appValidation() {\n if ($(\"#registerForm\").length > 0)\n registerFormValid();\n if ($(\"#loginForm\").length > 0)\n loginFormValid();\n if ($(\"#checkForm\").length > 0)\n checkFormValid();\n if ($('#saleForm').length > 0)\n saleFormValid();\n }", "function valida_user( ) /* OK */\r\n\t{\r\n \r\n\t}", "validateCredentials() {\n Keyboard.dismiss();\n this.setState({ errors: \"\" });\n let valid = false;\n if (!(this.state.email.match(/^([\\w.%+-]+)@([\\w-]+\\.)+([\\w]{2,})$/i))) {\n this.refs.toast.show(\"Please enter a valid email\")\n }\n else if (this.state.password.length < 8) {\n this.refs.toast.show(\"Password should be at least of 8 characters\")\n } else {\n this.signinUser();\n }\n }", "validate() {\n\t\t// Validate blog url\n\t\tconst parts = url.parse(this.url);\n\t\tif (!(parts.protocol && parts.host)) {\n\t\t\treturn new Error('INVALID_URL');\n\t\t}\n\n\t\t// Validate email (super basic, dependency free)\n\t\tif (this.user === undefined ||\n\t\t\tthis.user === '' ||\n\t\t\tthis.user.indexOf('@') <= 0 ||\n\t\t\tthis.user.indexOf('.') <= 0) {\n\t\t\treturn new Error('INVALID_USER');\n\t\t}\n\n\t\t// Validate data that should exist\n\t\tconst tests = ['pass', 'client', 'secret'];\n\t\tlet err = false\n\n\t\ttests.forEach((test) => {\n\t\t\tif (this[test] === undefined || this[test] === '') {\n\t\t\t\terr = err || new Error(`INVALID_${test.toUpperCase()}`);\n\t\t\t}\n\t\t});\n\n\t\t// Validate token. Handled by class\n\t\treturn err || this.token.validate();\n\t}", "selfValidate(){\n\n }", "function init() {\n checkCredentials();\n}", "validate() {\n // Check required top level fields\n for (const requiredField of [\n 'description',\n 'organizationName',\n 'passTypeIdentifier',\n 'serialNumber',\n 'teamIdentifier',\n ])\n if (!(requiredField in this.fields))\n throw new ReferenceError(`${requiredField} is required in a Pass`);\n // authenticationToken && webServiceURL must be either both or none\n if ('webServiceURL' in this.fields) {\n if (typeof this.fields.authenticationToken !== 'string')\n throw new Error('While webServiceURL is present, authenticationToken also required!');\n if (this.fields.authenticationToken.length < 16)\n throw new ReferenceError('authenticationToken must be at least 16 characters long!');\n }\n else if ('authenticationToken' in this.fields)\n throw new TypeError('authenticationToken is presented in Pass data while webServiceURL is missing!');\n this.images.validate();\n }", "function ValidateLogIn(){\n let emailLogIn = document.getElementById('InputEmailLogIn');\n let passwordLogIn = document.getElementById('InputPasswordLogIn');\n emailLogIn.classList.remove('is-invalid');\n passwordLogIn.classList.remove('is-invalid');\n let errors = 0;\n let regexEmail = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\n // email validation\n if (emailLogIn.value == ''){\n emailLogIn.classList.add('is-invalid');\n document.getElementById('errorEmailLogIn').textContent = 'Email is required.';\n errors ++;\n }else if(regexEmail.test(emailLogIn.value) == false){\n emailLogIn.classList.add('is-invalid');\n document.getElementById('errorEmailLogIn').textContent = 'Email contains illegal characters.';\n errors ++;\n }\n\n // password validation\n if (passwordLogIn.value == ''){\n passwordLogIn.classList.add('is-invalid');\n document.getElementById('errorPasswordLogIn').textContent = 'Password is required.';\n errors ++;\n }else if(passwordLogIn.value.length < 6){\n passwordLogIn.classList.add('is-invalid');\n document.getElementById('errorPasswordLogIn').textContent = 'Password must be at least 6 characters long.';\n errors ++;\n }\n\n // errors result for final validation\n if(errors > 0){\n return false;\n }else{\n return true;\n }\n}", "function Validate(){}", "function Validate(){}", "function withLogging() {\n try {\n saveUserData(user);\n } catch (error) {\n logToSnapErrors(error);\n }\n}", "function check_and_report() {\n \n }", "function loginValidation(reqContents) {\n const returnErrs = {};\n let validFrom = true;\n let message = '';\n\n console.log('Validating login right now!');\n\n //Checks if the username field is valid.\n if (!reqContents || typeof reqContents.email !== 'string' ||\n reqContents.email.trim().length === 0) {\n validFrom = false;\n returnErrs.email = 'Please provide your email address.';\n }\n\n //Checks if the password field is valid.\n if (!reqContents || typeof reqContents.password !== 'string' ||\n reqContents.password.trim().length === 0) {\n validFrom = false;\n returnErrs.password = 'Please provide your password.';\n }\n\n //Returns message if there is any issue with the form.\n if (!validFrom) {\n message = 'Make sure both fields are completed.';\n }\n\n console.log('Done validating login');\n\n return {\n success: validFrom,\n message,\n returnErrs,\n };\n}", "function validateFormLog() {\n var email = document.getElementById(\"email-log\");\n var password = document.getElementById(\"password-log\");\n var form = document.getElementById(\"login\");\n\n if (email.value.replace(/\\s/g, \"\") == \"\" || password.value.replace(/\\s/g, \"\") == \"\") {\n $(\"#status\").html(\"<p>All fields are mendatory</p>\");\n $(\"#status\").css(\"color\", \"#ff0000\");\n }else{\n if (validEmail(email.value)) {\n if (validPassword(password.value)) {\n form.submit();\n }else{\n $(\"#status\").html(\"<p>Please enter a valid password</p>\");\n $(\"#status\").css(\"color\", \"#ff0000\");\n }\n }else{\n $(\"#status\").html(\"<p>Please enter a valid email</p>\");\n $(\"#status\").css(\"color\", \"#ff0000\");\n }\n }\n}", "preValidate() { }", "function validateUserRegistrationForm() {\n\tconsole.log(`# validating recipient registration...`);\n}", "function handle_enter() {\n switch (page) {\n case 'register':\n validate_register();\n break;\n case 'update_user':\n validate_update_user();\n break;\n case 'create_game':\n validate_game_data();\n break;\n case 'reconfig_game':\n validate_game_data();\n break;\n case 'game':\n validate_game();\n break;\n case 'game_search':\n validate_game_search();\n break;\n case 'add_remove_moderator':\n validate_add_remove_moderator();\n break;\n case 'user_help':\n validate_send_report();\n break;\n case 'blacklist_whitelist':\n validate_blacklist_whitelist();\n break;\n default:\n break;\n }\n}", "function checkValidity() {\n\n if(state.type === \"\"){\n return notification.warning({\n message: \"Please select a type\" ,\n });\n }else\n if(state.accountHolder === \"\"){\n return notification.warning({\n message: \"Please provide a Account holder\" ,\n });\n }else if(state.accountName === \"\"){\n return notification.warning({\n message: \"Please provide a Account Name\" ,\n });\n }else if(state.accountNumber === \"\"){\n return notification.warning({\n message: \"Please provide a Account Number\" ,\n });\n }else if(state.currency === \"\"){\n return notification.warning({\n message: \"Please provide a currency\" ,\n });\n }else if(state.domicileBranch === \"\"){\n return notification.warning({\n message: \"Please provide a Domicile Branch\" ,\n });\n }else if(state.institution === \"\"){\n return notification.warning({\n message: \"Please provide a insitiution\" ,\n });\n }else if(state.openingBalance === \"\"){\n return notification.warning({\n message: \"Please provide a opening balance\" ,\n });\n }else if(state.swiftCode === \"\"){\n return notification.warning({\n message: \"Please provide a swift code\" ,\n });\n }else if(state.transitNumber === \"\"){\n return notification.warning({\n message: \"Please provide a transit number\" ,\n });\n }\n else {\n // if form is valid then do something\n setDisabled(true)\n api\n .post(\"/account/create\", state)\n .then((res) => {\n console.log(res)\n notification.success({message : \"Account Added.\"})\n history.goBack();\n setDisabled(false)\n })\n .catch((err) => {\n console.log(err); \n setDisabled(false)\n notification.error({message : \"Failed to add account.\"})\n });\n }\n \n }", "function loginOnChange() {\n const pattern = \"^[a-zA-Z][a-zA-Z0-9-_\\\\.]{3,20}$\";\n validate(this, pattern);\n}", "function Validate() {}", "init() {\n this._checkOptions();\n this._sendErrors();\n }", "function validateLogin(e, f, names){\r\n\t//implementation of login validation goes in here should the need arise\r\n\treturn true;\r\n}", "function validate(inst, validation) {}", "function _validateData() {\n const { identifier, password, ip } = user;\n var success = false;\n var error_name, error_code;\n\n if (\n identifier.length < 6 ||\n identifier.length > 254 ||\n identifier === \"undefined\"\n ) {\n error_name = \"username or email\";\n error_code = \"0003\";\n } else if (\n password.length < 8 ||\n password.length > 254 ||\n password === \"undefined\"\n ) {\n error_name = \"password\";\n error_code = \"0004\";\n } else if (!ipValidator(ip) || ip === \"undefined\") {\n error_name = \"ip\";\n error_code = \"0004\";\n } else {\n success = true;\n }\n //respuesta 409 - error del cliente\n switch (success) {\n case false:\n res.cookie(\"refreshToken\", null, {\n maxAge: 0,\n });\n res.status(400).send({\n error_code: `ERROR_SIGN_IN_${error_code}`,\n message: `Invalid ${error_name}.`,\n success: false,\n });\n return false;\n default:\n return true;\n }\n }", "function validate (input) {\n \t//ver dps..\n \treturn true;\n }", "function checkLogData(name, password) {\r\n\tcount = 0;\r\n\tvar nameRegEx = /^[a-zA-Z][a-zA-Z0-9-_\\.]{2,20}$/;\r\n\tvar passRegEx = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\\s).*$/;\r\n\tif(!nameRegEx.test(name)){\r\n\t\tcheckNameMessage = \"invalid name\";\r\n\t\tcount++;\r\n\t}else{\r\n\t\tcheckNameMessage = empty;\r\n\t}\r\n\tif(!passRegEx.test(password)){\r\n\t\tcheckPassMessage = \"invalid password\";\r\n\t\tcount++;\r\n\t}else{\r\n\t\tcheckPassMessage = empty;\r\n\t}\r\n}", "submit() {\n const errors = this.validate();\n if (errors) {\n Store.changeProperty(\"login.errors\",errors);\n return;\n } else Store.changeProperties({\"login.errors\":{},\"activeScreen\":Screens.LOADING});\n const state = Store.getState().login;\n Backend.auth.login(state.name,state.password, (error) => {\n Backend.auth.checkLogin();\n if (error) Store.changeProperty(\"login.errors\", {\"general\":error});\n else Store.changeProperties({\"login.name\":\"\",\"login.password\":\"\",\"login.errors\":{}});\n })\n }", "function validLogin() \n{\n\tlet lUser = document.getElementById(\"logName\").value;\n\tlet lPass = document.getElementById(\"logPass\").value;\n\t///let d = document.getElementsByTagName(\"option\")[z].value;\n\tif ((lUser === '') || (lPass === '') || (actionValue === ''))\n\t{\n\t\talert(\"Sorry, enter all fields\");\n\t\tconsole.log(\"Please enter the required fields...!!!!!!\");\n\t\treturn false;\n\t} \n\telse\n\t\treturn true;\n}", "function runValidation() {\n nameVal();\n phoneVal();\n mailVal();\n}", "checkAuth() { }", "function validate(inst, validation) {\r\n if (inst.spiManager == \"User\") {\r\n if ((inst.spiHandle == \"NULL\") || (inst.spiHandle == \"\")) {\r\n let message = \"Must be the name of a global SPI Handle.\";\r\n logWarning(validation, inst, \"spiHandle\", message);\r\n }\r\n }\r\n else if (inst.spiHandle != \"\") {\r\n let message = \"Must be NULL when the NVS driver manages the SPI instance.\";\r\n logWarning(validation, inst, \"spiHandle\", message);\r\n }\r\n\r\n}", "save() {\n try{\n validateUserData()\n }catch(err) {\n \n }\n }", "function test_satellite_credential_validation_times_out_with_error_message() {}", "function clickLogin() {\r\n\tvar name = document.getElementById('login-log').value;\r\n\tvar password = document.getElementById('password-log').value;\r\n\tname = name.replace(/\\s/g, empty);\r\n\tpassword = password.replace(/\\s/g, empty);\r\n\t//validation of input data\r\n\tcheckLogData(name, password);\r\n\tif(count == 0){\r\n\t\tif(document.getElementById('login-log-error') != null){\r\n\t\t\tclearInput(logInput.id);\r\n\t\t}\r\n\t\tif(document.getElementById('password-log-error') != null){\r\n\t\t\tclearInput(passInput.id);\r\n\t\t}\r\n\t\t//sending data to the server and receiving a response\r\n\t\tgetUserFromDB(name, password);\r\n\t}else{\r\n\t\t/*\r\n\t\t * checking for errors and displaying an error message or \r\n\t\t * clearing the input form when data is entered correctly\r\n\t\t */\r\n\t\tif(checkNameMessage.length != 0 && document.getElementById('login-log-error') == null){\r\n\t\t\t//output a message about incorrect data entered\r\n\t\t\taddErrorMessage(logInput, checkNameMessage);\r\n\t\t\tcheckNameMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkNameMessage.length == 0 && document.getElementById('login-log-error') != null){\r\n\t\t\t\t//clearing the input form when incorrect data is entered\r\n\t\t\t\tclearInput(logInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(checkPassMessage.length != 0 && document.getElementById('password-log-error') == null){\r\n\t\t\taddErrorMessage(passInput, checkPassMessage);\r\n\t\t\tcheckPassMessage = empty;\r\n\t\t}else{\r\n\t\t\tif(checkPassMessage.length == 0 && document.getElementById('password-log-error') != null){\r\n\t\t\t\tclearInput(passInput.id);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "validateInit() {\n this.runValidation(true);\n }", "function formValidator(){\n \n // create object that will save user inputs (empty bucket)\n let feedback = {};\n // create array that will save error messages (empty bucket)\n let errors = [];\n \n // check if full name has a value\n if (fn.value !== \"\"){\n // if it does, save it\n feedback.fname = fn.value;\n } else {\n // if it does not, create the error message (and save it too)\n errors.push(\"<p>Please provide your full name</p>\");\n }\n \n // check if email has a value\n if (em.value !== \"\"){\n // if it does, save it\n feedback.email = em.value;\n } else {\n // if it does not, create the error message (and save it too)\n errors.push(\"<p>Please provide your email</p>\");\n }\n \n // check if message has a value\n // if it does, save it\n // if it does not, create the error message (and save it too)\n \n // create either feedback or display all errors\n \n if (errors.length ===0){\n console.log(feedback);\n }else{\n console.log(errors);\n }\n \n // close your event-handler\n }", "function validate() {\n\n\tvar reqBody = locals.body;\n\n\tif (!reqBody.email)\n\t\tthrow new Error('Email is required!');\n\n\tif(!GenHelper.isvalidEmail(reqBody.email))\n\t\tthrow new Error('Email required a valid format!');\n\n\tif (!reqBody.password)\n\t\tthrow new Error('Password is required!');\n}", "function checkInputs() {\r\n // get input VALUES\r\n\r\n const usernameValue = username.value.trim();\r\n const emailValue = email.value.trim();\r\n const passwordValue = password.value.trim();\r\n const passwordCheckValue = passwordCheck.value.trim();\r\n\r\n // USERNAME CHECK\r\n\r\n if (usernameValue === '' || usernameValue === null) {\r\n // add error class (analogous to ToDo project)\r\n\r\n setErrorFor(username, 'Username cannot be blank');\r\n } else {\r\n setSuccessFor(username)\r\n }\r\n\r\n // EMAIL CHECK\r\n\r\n if (emailValue === '') {\r\n // add error class (analogous to ToDo project)\r\n\r\n setErrorFor(email, 'E-mail cannot be blank');\r\n } else if (!emailIsValid(emailValue)) {\r\n setErrorFor(email, 'E-mail is not valid.');\r\n } else {\r\n setSuccessFor(email);\r\n }\r\n\r\n //PASSWORD CHECK\r\n\r\n if (passwordValue === '' || passwordValue === null) {\r\n // add error class (analogous to ToDo project)\r\n\r\n setErrorFor(password, 'Password cannot be blank');\r\n } else {\r\n setSuccessFor(password)\r\n }\r\n\r\n // PASSWORD CHECK CHECK\r\n\r\n if (passwordCheckValue === '' || passwordCheckValue === null) {\r\n // add error class (analogous to ToDo project)\r\n\r\n setErrorFor(passwordCheck, 'Password check cannot be blank');\r\n } else if (passwordCheckValue !== passwordValue) {\r\n setErrorFor(passwordCheck, 'Password check must equal password');\r\n setErrorFor(password, 'Password check must equal password');\r\n } else {\r\n setSuccessFor(passwordCheck);\r\n }\r\n}", "function validateCheck() {\n\n setActivityCardRules($scope.cardRules.value());\n setSpecialUsePackages($scope.specialPackages.value());\n generateCodeAuto();\n service.validate($scope.activity).success(function () {\n $scope.save();\n }).error(function (error) {\n console.log('error -> ', error);\n });\n }", "function GranularSanityChecks() {}", "function checkValues() {\n let student = $(\"#student\").val();\n let email = $(\"#email\").val();\n let password = $(\"#password\").val();\n let login = true;\n\n ////Validate last, first name\n //let validate = student.search(/[a-zA-Z]+(,)?\\s[a-zA-Z]/);\n //if (validate != 0) {\n // $(\"#student\").css(\"border\", \"1px #880000 solid\");\n // $(\"#studentText\").text(\"Invalid Name\");\n // $(\"#studentText\").css(\"color\", \"#880000\");\n\n // if (validate == \"Shmoe, Joe\" || validate == \"Shmoe Joe\"); {\n // login = false;\n // }\n //}\n //// Validate email\n //validate = email.search(/(.+)@(.+){2,}\\.(.+){2,}/);\n //if (validate != 0) {\n // $(\"#email\").css(\"border\", \"1px #880000 solid\");\n // $(\"#emailText\").text(\"Invalid Email\");\n // $(\"#emailText\").css(\"color\", \"#880000\");\n\n // if (validate == \"jshmoe@cedarville.edu\"); {\n // login = false;\n // }\n //}\n\n //// Validate password\n //validate = password.search(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*])(?=.{8,})/);\n //if (validate != 0) {\n // $(\"#password\").css(\"border\", \"1px #880000 solid\");\n // $(\"#passwordText\").text(\"Invalid Password\");\n // $(\"#passwordText\").css(\"color\", \"#880000\");\n\n // if(validate == \"Joe1sBest!\"); {\n // login = false;\n // }\n //}\n\n // Put things back to normal if no errors occured\n if (login) {\n $(\"#form\").css(\"transition-duration\", \".8s\");\n $(\"#form, .input, .input-text\").css(\"width\", \"0\");\n $(\"#form\").css(\"height\", \"0\");\n setTimeout(hideOthers, 300);\n setTimeout(hideForm, 800);\n }\n}", "function validate() {\r\n console.log(`Validate called`);\r\n var firstName = document.getElementById('fName').value.trim();\r\n var lastName = document.getElementById('lName').value.trim();\r\n var unitNumber = document.getElementById('unit').value.trim();\r\n var province = document.getElementById('province').value.trim();\r\n var streetNumber = document.getElementById('streetNum').value.trim();\r\n var email = document.getElementById('email').value.trim();\r\n\r\n // Validate\r\n var userName = document.getElementById('username').value.trim();\r\n var passWord = document.getElementById('password').value.trim();\r\n var streetName = document.getElementById('street').value.trim();\r\n var city = document.getElementById('city').value.trim();\r\n var postalCode = document.getElementById('postalCode').value.trim();\r\n var phoneNumber = document.getElementById('phone').value.trim();\r\n\r\n console.log(`Username validation: ${userNameValidation(userName)}`);\r\n console.log(`Password validation: ${passWordValidation(passWord)}`);\r\n console.log(`Phone Number validation: ${phoneValidation(phoneNumber)}`);\r\n console.log(`Zip Code validation: ${zipCodeValidation(postalCode)}`);\r\n console.log(`City validation: ${cityValidation(city)}`);\r\n console.log(`Street Name validation: ${streetNameValidation(streetName)}`);\r\n \r\n return false;\r\n}", "function logIn() {\n //select username/pin values.\n var userName = document.getElementById('userN').value;\n var pin = document.getElementById('pin').value;\n //select alert paragraph for errors if errors occur.\n var alert = document.getElementById('alert');\n //check to see if username length is greater than zero.\n if (userName.length < 1) {\n //fire alertError, passing both the selected alert paragraph \n //as well as the string representative of the invalid input.\n alertError(alert, \"User name. \");\n //refocus to invalid input, add border to indicate validity.\n document.getElementById(\"userN\").focus();\n document.getElementById(\"userN\").style.border = \"4px solid red\";\n //scroll to the top of the page.\n document.body.scrollTop = document.documentElement.scrollTop = 0;\n //return false on invalid data, to prevent form submission\n return false;\n } else if (alert, pin.length < 1) {\n //fire alertError, passing both the selected alert paragraph \n //as well as the string representative of the invalid input.\n alertError(alert, \"PIN. \");\n //refocus to invalid input, add border to indicate validity.\n document.getElementById(\"pin\").focus();\n document.getElementById(\"userN\").style.border = \"4px solid cornflowerblue\";\n document.getElementById(\"pin\").style.border = \"4px solid red\";\n //scroll to the top of the page.\n document.body.scrollTop = document.documentElement.scrollTop = 0;\n return false;\n //return false on invalid data, to prevent form submission\n } else {\n //fire loggedIn, passing in userName and pin to instantiate a user object.\n// loggedIn(userName, pin);\n //set borders back to initial values on valid data entry.\n document.getElementById(\"userN\").style.border = \"4px solid cornflowerblue\";\n document.getElementById(\"pin\").style.border = \"4px solid cornflowerblue\";\n //clear alert.\n alert.innerHTML = \"\";\n }\n\n}", "function checkValidInput() {\n if (userEmail.value) {\n if (userEmail.value === \"\" || userEmail.value === null) {\n emailErr.innerText = \"A valid email is required.\";\n }\n if (userPass.value === \"\" || userPass.val === null) {\n passErr.innerText = \"A valid password is required.\";\n } else {\n console.log(\n \"Email: \" + userEmail.value + \"\\n Password: \" + userPass.value\n );\n validateUserInfo();\n }\n }\n}", "checkInputs() {\n\t\treturn this.state.username && this.state.pass;\n\t}", "async validate () {\n\t\tif (this.stream.get('teamId') !== this.teamId) {\n\t\t\tthrow this.errorHandler.error('streamNoMatchTeam', { info: this.streamId });\n\t\t}\n\t\tif (!this.fromUser.hasTeam(this.teamId)) {\n\t\t\tthis.log(`User ${this.fromUser.id} is not on team ${this.teamId}`);\n\t\t\tthrow this.errorHandler.error('unauthorized');\n\t\t}\n\t\tif (this.parentPost && this.parentPost.get('teamId') !== this.teamId) {\n\t\t\tthrow this.errorHandler.error('parentPostNoMatchTeam', { info: this.parentPostId });\n\t\t}\n\t\tif (this.parentPost && this.parentPost.get('streamId') !== this.streamId) {\n\t\t\tthrow this.errorHandler.error('parentPostNoMatchStream', { info: this.parentPostId });\n\t\t}\n\t}", "function ValidationService() {\n\t}", "function _checkInFail() {\n var err = {\n message: 'Failed to checkin asset.'\n };\n $rootScope.errorModalText(err);\n vm.switchView('validationView');\n vm.loadingState = 'contentSuccess';\n }", "function submitForm(e) {\n const userDate = username.value.trim();\n const mailData = mail.value.trim();\n const passData = pass.value.trim();\n\n if (userDate === \"\") {\n inputChecker(username, \"enter you user name\", 1500);\n }\n if (mailData === \"\") {\n inputChecker(mail, \"enter you mail address\", 1500);\n }\n if (passData === \"\") {\n inputChecker(pass, \"enter you passeord\", 1500);\n }\n}", "function check() {\n checkUsername();\n checkEmail();\n checkPassword1();\n checkPassword2();\n}", "function verifyInput(){\r\n}", "function valida_user2() /* OK */\r\n\t{\r\n \r\n\t}", "function checkForm(e) {\n e.preventDefault();\n \n var userName = input1.value;\n \n\n \n if (userName === \"\") {\n userWarning.innerHTML = \"Please enter your username\";\n loginForm.userName.focus();\n }\n \n \n else {\n \n logIn(userName );\n \n }\n}", "function submitForm(){\n checkRequired(formInputs);\n checkEmail(useremail);\n checkValidUsername(username);\n checkValidPassword(password, password2);\n}", "function validate() {\n return okusername && checkPass();\n}", "async validate() {\n return true\n }", "function checkInputs(){\r\n const fNameValue = fName.value.trim();\r\n const lNameValue = lName.value.trim();\r\n const addressValue =address.value.trim();\r\n const cityValue =city.value.trim();\r\n //const vValue =state.value.trim();\r\n const zipValue = zip.value.trim();\r\n const dobValue = dob.value.trim();\r\n const phoneValue = phone.value.trim();\r\n const emailRValue = emailR.value.trim();\r\n const passwordValue = password.value.trim();\r\n \r\n if(fNameValue === '')\r\n {\r\n setErrorFor(fName)\r\n }else{\r\n setSuccessFor(fName);\r\n }\r\n\r\n if(lNameValue === '')\r\n {\r\n setErrorFor(lName)\r\n }else{\r\n setSuccessFor(lName);\r\n }\r\n\r\n if(addressValue === '')\r\n {\r\n setErrorFor(address)\r\n }else{\r\n \r\n setSuccessFor(address);\r\n }\r\n\r\n if(cityValue === '')\r\n {\r\n setErrorFor(city)\r\n }else{\r\n \r\n setSuccessFor(city);\r\n }\r\n\r\n if(zipValue === '')\r\n {\r\n setErrorFor(zip)\r\n }else{\r\n \r\n setSuccessFor(zip);\r\n }\r\n\r\n if(dobValue === '')\r\n {\r\n setErrorFor(dob)\r\n }else{\r\n \r\n setSuccessFor(dob);\r\n console.log(dobValue)\r\n }\r\n\r\n if(phoneValue === '')\r\n {\r\n setErrorFor(phone)\r\n }else{\r\n \r\n setSuccessFor(phone);\r\n }\r\n\r\n if(emailRValue === '')\r\n {\r\n setErrorFor(emailR)\r\n }else if(!isEmail(emailRValue)){\r\n setErrorFor(emailR)\r\n \r\n }else{\r\n setSuccessFor(emailR);\r\n }\r\n\r\n if(passwordValue === '')\r\n {\r\n setErrorFor(password)\r\n }else{\r\n setSuccessFor(password);\r\n }\r\n}", "function checkUserValidation() {\n const authUser = CACHE.getAuthenticatedUser();\n if (!authUser) {\n $('body').html('You are not authorized to view this page.');\n window.open('/', '_self');\n }\n}", "function checkUserValidation() {\n const authUser = CACHE.getAuthenticatedUser();\n if (!authUser) {\n $('body').html('You are not authorized to view this page.');\n window.open('/', '_self');\n }\n}", "async function validation(obj) {\n // disable the login button while processing\n obj.loginBtn.disabled = true;\n\n // get form\n const form = obj;\n // get all inputs of form\n const inputs = form.elements;\n\n let userInfo = {};\n // check each input\n for (let i = 0; i < inputs.length; i++) {\n if (inputs[i].name !== 'loginBtn') {\n userInfo[inputs[i].name] = inputs[i].value;\n }\n }\n\n // Do client side username and password validation here\n // Just make sure a username and a password is actually in\n let clientValidation = true;\n\n let usernameErr = document.getElementById(\"usernameError\");\n if (userInfo.username.length <= 0) {\n usernameErr.style.display = 'block';\n usernameErr.innerHTML = 'Username is required';\n clientValidation = false;\n } else {\n usernameErr.style.display = 'none';\n usernameErr.innerHTML = '';\n }\n\n let passwordErr = document.getElementById(\"passwordError\");\n if (userInfo.password.length <= 0) {\n passwordErr.style.display = 'block';\n passwordErr.innerHTML = 'Password is required';\n clientValidation = false;\n } else {\n passwordErr.style.display = 'none';\n passwordErr.innerHTML = '';\n }\n\n let validSubmission = false;\n let response = '';\n\n // only send to server if passed client validation\n if (clientValidation) {\n // send a post to server\n await sendLoginRequest(userInfo).then(function (data) {\n console.log(data);\n if (data.success) {\n validSubmission = true;\n } else {\n validSubmission = false;\n response = data.msg;\n }\n });\n }\n\n // send to checkout if valid\n // ** Submit the form **\n if (validSubmission) {\n alert('Successful login');\n\n // Append username to productsForm to pass along user\n // This is a method to attempt to check that only a \n // logged in user is trying to checkouts\n let uninput = document.createElement(\"input\");\n uninput.name = \"username\";\n uninput.value = userInfo.username;\n document.getElementById('productsForm').appendChild(uninput);\n\n // submit the form\n document.getElementById('productsForm').submit();\n } else if (clientValidation && !validSubmission) {\n alert('Invalid login: ' + response);\n } else {\n alert('Invalid login: must completely fill out form.')\n }\n\n // enable login button after we finish\n obj.loginBtn.disabled = false;\n }", "validate() {\n if (this.isDisposed) {\n return;\n }\n this._invalidated = false;\n this._lastArgs = [];\n }", "usersLogIn(e){\n\t\te?e.preventDefault():'';\n\t\tlet {email, password} = this.props.users_controle;\n\t\tif(email&&password){\n\t\t\tthis.props.usersLogIn( email, password, ()=>{\n\t\t\t\tthis.props.usersGetActiveUser();\n\t\t\t\tthis.props.usersControle(this.init());\n\t\t\t\tFlowRouter.go('/');\n\t\t\t} );\n\t\t}else{\n\t\t\t//Trigger alert thanks to Bert meteor package\n\t\t\tBert.alert({\n\t\t\t\ttitle:'Error data for login',\n\t\t\t\tmessage:'give at least email & password ' ,\n\t\t\t\ttype:'info',\n\t\t\t\ticon:'fa-info'\n\t\t\t});\n\t\t}\n\t\t\n\t}", "function checkLogs(){\n\n}", "function validate() {\n handle_enter();\n}", "function formValidator() {\n //create object that will save user's input (empty value)\n let feedback = [];\n //create an array that will save error messages (empty)\n let errors = [];\n //check if full name has a value\n if (fn.value !== ``){\n //if it does, save it\n feedback.fname = fn.value; \n }else {\n //if it doesn't, crete the error message and save it\n errors.push(`<p>Invalid Full Name</p>`);\n }\n \n //for email\n if (em.value !== ``){\n feedback.email = em.value;\n //expression.test(String('my-email@test.com').toLowerCase()); \n }else {\n errors.push(`<p>Invalid Email</p>`);\n }\n\n //for message\n if (mes.value !== ``){\n feedback.message = mes.value;\n }else {\n errors.push(`<p>Write a comment</p>`)\n }\n \n //create either feedback or display all errors\n if (errors.length === 0) {\n console.log(feedback);\n }else {\n console.log(errors);\n }\n //close event handler\n}", "validationDidStart(requestContext) {\n console.log('Validation Started!')\n }", "function validationBegins()\n {\n if (validationInProgress)\n throw new Error(\"Internal error: Validation is already in progress\");\n\n validationInProgress = true;\n }", "function proceed () {\n\t\t\tif (!store.getters.getBearerToken) {\n\t\t\t\tnext ();\n\t\t\t} else {\n\t\t\t\tconsole.log('Already logged in');\n\t\t\t} \n\t\t}", "function loginHandler(){\n\tif((usernameField.value != \"\") & (passwordField.value != \"\")){\n\t\tconsole.log(\"logging in...\");\n\t\tuser.set(\"username\", usernameField.value);\n\t\tuser.set(\"password\", passwordField.value);\n\t\tuser.logIn({\n\t\t\tsuccess:function (user){\n\t\t\t\tconsole.log(\"login worked\");\n\t\t\t\tcurrentUser = Parse.User.current();\n\t\t\t\tloggedIn();\n\t\t\t}, \n\t\t\terror: function (user, error){\n\t\t\t\tconsole.log(\"error \"+ error.code);\n\t\t\t}\n\t\t});\n\t} else if((usernameField.value == \"\") && (passwordField.value != \"\")) {\n\t\talert(\"Please enter your username\");\n\t} else if((usernameField.value != \"\") && (passwordField.value == \"\")) {\n\t\talert(\"Please enter your password\");\n\t} else {\n\t\talert(\"Error\");\n\t}\n}", "function checkReqFields() {\n \n}", "validateLogin(username, password) {\n\t\tconsole.log(\"Validating input\");\n\t\tif (!username | !password) throw \"Must input an email and password!\";\n\t\tif (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(username)) throw \"You entered an invalid email!\"\n\t}", "function authenticationValidate(){\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\tif (user) {\n\t\t\t// User is signed in.\n\t\t\talert('autenticado');\n\t\t} else {\n\t\t\t// No user is signed in.\n\t\t\talert('no autenticado');\n\t\t}\n\t});\n}", "async validate () {\n\t\tconst error = await this.validateAttributes();\n\t\tif (error) {\n\t\t\tthrow this.errorHandler.error('validation', { info: error });\n\t\t}\n\t}", "function validateLogin(inp) {\n const schema = Joi.object({\n email: Joi.string()\n .email()\n .required(),\n\n password: Joi.string()\n .required()\n .min(5)\n .max(1024)\n });\n\n const result = schema.validate(inp);\n return result;\n}", "constructor() {\n super();\n this.name = this.constructor.name;\n this.isUserError = true;\n }", "function validation() {\n const letters = /^[0-9a-zA-Z]+$/;\n !username.match(letters) ? setUsernameError(\"*only numbers and letters are valid\") : setUsernameError(\"\");\n username.length < 4 ? setUsernameError(\"*required, a minimum of 4 characters\") : setUsernameError(\"\");\n password.trim().length < 6 ? setPasswordError(\"*required, a minimum of 6 characters\") : setPasswordError(\"\");\n !email.includes(\"@\") ? setEmailError(\"*required, a valid email\") : setEmailError(\"\");\n\n /*check if username already exists*/\n {\n axios.patch('https://zanko-my-flix.herokuapp.com/users/check/', {\n Username: username,\n }\n )\n .then(response => {\n const data = response.data;\n String(data) == (username + \" is already taken\") ? setUsernameError(\"*\" + data) : setUsernameError(\"\");\n })\n .catch(e => {\n console.log('error registering the user')\n });\n }\n (emailError == \"\" && passwordError == \"\" && usernameError == \"\") ? setValidation(true) : setValidation(false);\n }", "function onValidation() {\n\tclearErrors();\n\n\tvar allValidReq = checkRequiredFields();\n\tvar allValidDob = true;\n\tif ($.inArray(\"dob\", getRequiredFields()) > 0)\n\t{\n\t\tallValidDob = checkValidDob();\n\t}\n\t\n\tvar allValidNames = checkValidNames();\n\n\tif ($(\"#usSocialSecurityNumber\").length) {\n\t\tallValidNames = allValidNames && checkSSN();\n\t}\n\t\n\tvar allValidAddress = true;\n\tif (countryIsUSA()) {\n\t\tallValidAddress = checkValidUSAAddress();\n\t}\n\t\n\treturn allValidReq && allValidDob && allValidNames & allValidAddress;\n}", "validateBeforeLogin() {\n const { email, password } = this.state\n let { emailError, passwordError } = this.state\n\n // set empty input error message if any of inputs are empty\n emailError = !email ? 'Email should not be empty' : emailError\n passwordError = !password ? 'Password should not be empty' : passwordError\n this.setState({ emailError, passwordError })\n\n // return false if the form contains any error\n return !emailError && !passwordError\n }", "function validateConfig() {\n if(conf.private) return;\n if(conf.name.match(/^[a-zA-Z0-9\\-_]+$/).length !== 1) {\n utils.error('Package name can only contain letters, numbers, underscores and dashes');\n process.exit(0);\n }\n if(conf.repo.indexOf('/') === -1) {\n utils.error('Github repo must be in the format username/project');\n process.exit(0);\n }\n}", "function validateInput(){\n\n}", "async validate(){\n \n // ensure classes \n if(!this.apexClassNames || this.apexClassNames.length == 0)\n throw new Error('No Apex classes prescribed in pset.');\n\n // get each of the class bodies via tooling\n this.classBodies = ''; \n try{\n stdio.warn(`Retrieving ${this.apexClassNames.length > 1 ? 'classes' : 'class'} ${this.apexClassNames.join(', ')} from ${ config.mode === 'local' ? 'default local directory...' : 'authorized SF org...' }`);\n for(let apexClass of await tooling.getApex(this.apexClassNames)){\n // replace any instances of static methods with static global-level variables, \n // and remove the static method keywords, such that apex class calls to static methods\n // are immitated\n const name = apexClass.name; \n let body = apexClass.body; \n if(apexClass.body.indexOf(' static ') != -1){\n this.globalVars.push(`// mimic static method(s) in class ${name}\\nstatic ${name} ${name} = new ${name}();`);\n body = body.replace(new RegExp(/ static /, 'gi'), ` /** static method mimicked by var '${name}' **/ `); \n }\n this.classBodies += `${body}\\n\\n`;\n }\n } catch(e){\n throw e; \n }\n\n // construct anonymous body\n try{\n stdio.warn('Constructing tests...'); \n const anonBody = buildAnonTest(this); \n stdio.warn('Validating assertions in authorized org...');\n await tooling.executeAnonApex(anonBody); \n } catch(e){\n throw e; \n }\n\n }", "whenValid() {\n\n }", "isvalidated() {\n return isEmpty(this.state.fname_err) &&\n isEmpty(this.state.lname_err) &&\n isEmpty(this.state.username_err) &&\n isEmpty(this.state.year_err) &&\n isEmpty(this.state.month_err) &&\n isEmpty(this.state.day_err) &&\n isEmpty(this.state.email_err) &&\n isEmpty(this.state.password_err) &&\n isEmpty(this.state.confirmPassword_err);\n }", "checkFields() {\n firebaseApp.auth().onAuthStateChanged(user => {\n if (user) {\n this.setState({ userName: user.displayName });\n }\n })\n\n if (this.state.patientName == '') {\n this.setState({ error: { message: 'Please enter a patient name' } });\n return false;\n }\n else {\n if (this.state.uid == '') {\n this.setState({ error: { message: 'Please enter a unique patient id' } });\n return false;\n }\n }\n return true;\n }", "function handleLogin() {\n if (email === \"\" || password === \"\") {\n alert(\"Please fill out email and password\");\n return;\n }\n dispatch(loginUser(email, password));\n setLoginAttempts(loginAttempts + 1);\n }", "onValidateInput() {\n if (authingUser) {\n return;\n }\n\n authingUser = true;\n\n console.log('Password validate input');\n\n OfflineRequest\n .post(`${config.baseURL}/services/login`, {\n meanOfLogin: 'etuId',\n data : this.sellerCardNum.trim(),\n pin : this.sellerPasswordInput\n })\n .then(response => {\n authingUser = false;\n\n if (response.status === 404) {\n this.throwError('Vendeur inconnu');\n\n return this.onEject();\n } else if (response.status === 401) {\n this.sellerPasswordInput = '';\n\n return this.throwError('Mot de passe invalide');\n }\n\n this.currentSeller = response.user;\n OfflineRequest.setBearer(response.token);\n\n this.sellerCardNum = '';\n this.sellerPasswordInput = '';\n this.sellerConnected = true;\n this.sellerCanReload = true;\n this.sellerAuth = true;\n\n this.loadData();\n })\n .catch(e => {\n if (e.type === 'error') {\n this.throwError('Impossible de se connecter');\n\n return this.onEject();\n }\n });\n }", "handleLogin() {\n this.setState({\n autovalidate: true\n })\n if (this.isValid()) {\n this.props.actions.saveUserInfo(this.state.email, this.state.password)\n this.props.navigation.navigate('Application')\n }\n }", "function validInfo(event){\n event.preventDefault();\n let username = $(\"#input-username\").val();\n let pwd = $(\"#input-pwd\").val();\n\n $(\"#input-username\").removeClass(\"is-invalid\");\n $(\"#username-feedback\").hide();\n $(\"#input-pwd\").removeClass(\"is-invalid\");\n $(\"#pwd-feedback1\").hide();\n let hasError = false;\n if(!validate(username)) {\n $(\"#input-username\").addClass(\"is-invalid\");\n $(\"#username-feedback\").show();\n hasError = true;\n }\n if(!validate(pwd)) {\n $(\"#input-pwd\").addClass(\"is-invalid\");\n $(\"#pwd-feedback1\").show();\n }\n if(!hasError) {\n $.post(\"/signin\",\n {username:username,pwd:pwd},\n function(data){\n if(data == null) {\n $(\"#input-pwd\").addClass(\"is-invalid\");\n $(\"#pwd-feedback2\").show();\n } else {\n localStorage.setItem(\"username\",username);\n $(\"#login-form\").submit();\n }\n },\"json\")\n }\n}", "function LoginClass(_form) {\n\tvar me = this;\n\t// DOM element references\n\tvar _links = DOM.GetNode(\"links\", true);\n\tvar _signupSection = DOM.GetNode(\"signup\", true);\n\tvar _signupHiddenField = DOM.GetNode(\"fldSignup\");\n\tvar _emailNote = DOM.GetNode(\"emailNote\", true);\n\tvar _emailField = DOM.GetNode(\"fldEmail\");\n\tvar _passwordNote = DOM.GetNode(\"passwordNote\", true);\n\tvar _passwordRepeat = DOM.GetNode(\"fldPasswordAgain\", true);\n\tvar _confirmHiddenField = DOM.GetNode(\"fldConfirmation\");\n\tvar _confirmNote = DOM.GetNode(\"confirmNote\", true);\n\tvar _signUpTip;\n\tvar _signInTip;\n\t\n\t// interface members for broker/account.js and validation/account.js -----\n\tthis.Status = Status.Signin;\n\tthis.AllowServerCall = true;\t// false during validation\n\tthis.ConfirmHiddenField = function() { return _confirmHiddenField; }\n\tthis.ConfirmNote = function() { return _confirmNote; }\n\tthis.EmailNote = function() { return _emailNote; }\n\tthis.EmailField = function() { return _emailField; }\n\tthis.ShowConfirmation = function(visible) { return; }\n\tthis.EmailChanged = function() { return true; }\n\tthis.ShowSignup = function(visible) {\n\t\tvar display = (visible) ? \"block\" : \"none\";\n\t\tme.Status = (visible) ? Status.Create : Status.Signin;\n\t\t_emailField.focus();\n\t\t_emailNote.innerHTML = \"a confirmation code will be sent to this address\";\n\t\t_passwordNote.innerHTML = \"at least six characters&mdash;enter twice to verify\";\n\t\t_signupSection.style.display = display;\n\t\t_links.style.display = (visible) ? \"none\" : \"block\";\n\t\t_emailNote.style.display = display\n\t\t_passwordNote.style.display = display\n\t\t_passwordRepeat.style.display = (visible) ? \"inline\" : \"none\";\n\t\t_signupHiddenField.value = visible;\n\t\tShowTip();\n\t}\n\tthis.FatalError = function(errors, message) {\n\t\tvar response = \"Not able to continue. \" + message + \".\";\n\t\tfor (var x = 0; x < errors.length; x++) {\n\t\t\tresponse += \"\\n\\n\" + errors[x];\n\t\t}\n\t\talert(response);\n\t\tlocation.href = \".\";\n\t}\n\t// end interface members -------------------------------------------------\n\n\tUpdateTime();\n\tLoadTips();\n\tShowTip();\n\n\tthis.Validation = new AccountValidation(this);\n\tthis.Broker = new AccountBroker(this);\n\t\n\tfunction UpdateTime() {\tDOM.GetNode(\"fldClientTime\").value = ClientTime();\t}\n\t\n\t/*------------------------------------------------------------------------\n\t\tload DOM references to tip text\n\n\t\tDate:\t\tName:\tDescription:\n\t\t1/28/05\t\tJEA\t\tCreation\n\t------------------------------------------------------------------------*/\n\tfunction LoadTips() {\n\t\tvar tipType = DOM.GetNode(\"fldTipType\");\n\t\tif (tipType != null) {\n\t\t\t_signUpTip = DOM.GetNode(tipType.value + \"SignUp\", true);\n\t\t\t_signInTip = DOM.GetNode(tipType.value + \"SignIn\", true);\n\t\t}\n\t}\n\tfunction ShowTip() {\n\t\tvar tip = (me.Create) ? _signUpTip : _signInTip;\n\t\tvar oldTip = (me.Create) ? _signInTip : _signUpTip;\n\t\tif (typeof(tip) == \"object\") { tip.style.display = \"block\"; }\n\t\tif (typeof(oldTip) == \"object\") { oldTip.style.display = \"none\"; }\n\t}\n\n\t/*------------------------------------------------------------------------\n\t\tget SQL allowed format of client's time\n\n\t\tDate:\t\tName:\tDescription:\n\t\t12/30/02\tJEA\t\tCreation\n\t\t1/31/03\t\tJEA\t\tAccomodate Mozilla bug in .getYear()\n\t------------------------------------------------------------------------*/\n\tfunction ClientTime() {\n\t\tvar now = new Date();\n\t\tvar hour = now.getHours();\n\t\tvar month = now.getMonth() + 1;\t\t\t// getMonth is 0-based\n\t\tvar year = now.getYear() + \"\";\n\t\tvar amPm = (hour >= 12) ? \" PM\" : \" AM\";\n\t\tvar time = (hour > 12) ? hour - 12 : hour;\n\t\ttime += \":\" + PadNumber(now.getMinutes(), 2) + \":\" + PadNumber(now.getSeconds(), 2) + amPm;\n\t\tyear = year.substr(year.length - 2, 2);\t// mozilla was returning \"103\" for the year 2003\n\t\treturn month + \"/\" + now.getDate() + \"/\" + year + \" \" + time;\n\t}\n\t\n\t/*------------------------------------------------------------------------\n\t\tpad number with leading zeros to match given length\n\n\t\tDate:\t\tName:\tDescription:\n\t\t12/30/02\tJEA\t\tCreation\n\t------------------------------------------------------------------------*/\n\tfunction PadNumber(number, length) {\n\t\tnumber += \"\";\n\t\tvar shortBy = length - number.length;\n\t\tif (shortBy > 0) { for (x = 0; x < shortBy; x++) { number = \"0\" + number; } }\n\t\treturn number;\n\t}\n}", "function validate() {\n // Define the data object and include the needed parameters.\n let data = { Token: token };\n // Make the validate API call and assign a callback function.\n authService.Validate(data).then(validateCallback);\n}" ]
[ "0.6311861", "0.6029192", "0.59802645", "0.58178663", "0.57609165", "0.5714934", "0.5630518", "0.56290686", "0.5593758", "0.55768245", "0.5547574", "0.5546879", "0.55218863", "0.55217534", "0.55131286", "0.55107623", "0.54975307", "0.54910046", "0.5447205", "0.5441941", "0.5441941", "0.5435742", "0.54287744", "0.54157656", "0.54153967", "0.54098105", "0.5404193", "0.5398378", "0.53889567", "0.5385174", "0.53826195", "0.5372983", "0.5371427", "0.5364792", "0.5343132", "0.5341876", "0.5340601", "0.5335774", "0.5330471", "0.53303653", "0.53289187", "0.5325202", "0.5325151", "0.53206897", "0.5308765", "0.53074324", "0.5304034", "0.53011245", "0.52917826", "0.5264556", "0.52603763", "0.525848", "0.5245531", "0.52367526", "0.5225858", "0.5220505", "0.5219713", "0.521399", "0.5211829", "0.5206175", "0.5181097", "0.51773643", "0.5172602", "0.51724863", "0.5165548", "0.51574785", "0.5153803", "0.5146798", "0.5136868", "0.5136868", "0.5136318", "0.51311415", "0.5126123", "0.51014614", "0.5101367", "0.50947183", "0.5093302", "0.5091721", "0.5086482", "0.5084147", "0.50806457", "0.50798386", "0.50787055", "0.50776094", "0.5074423", "0.5069095", "0.5068358", "0.50661653", "0.5065649", "0.50588715", "0.5058422", "0.5057965", "0.505226", "0.50517094", "0.50502735", "0.5047829", "0.50439334", "0.5042377", "0.5038266", "0.5028424", "0.5027021" ]
0.0
-1
override Emitter to console.log every event (except Core::update)
verbose() { console.log('GameManager : verbose'); var _this = this; this.log = true; var on = this.on; function newOn() { console.log('GameManager : add listener ', arguments[0]); on.apply(_this, arguments); } this.on = newOn; var emit = this.emit; function newEmit() { if (arguments[0] !== "Core::update") { console.log('GameManager : emit event ', arguments[0]); } emit.apply(_this, arguments); } this.emit = newEmit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emit(...args) {\n const [name, ...params] = args;\n\n if (this.logBlacklist && this.logBlacklist.indexOf(name) === -1) {\n console.info(name, params);\n }\n\n super.emit(...args);\n }", "function Emitter () {}", "function Emitter() {\n }", "emit(...args) {\n // emit the event through own emitter\n EventEmitter.prototype.emit.apply(this, args);\n\n debug('Emitting', args);\n\n // emit the event through all the attached emitters\n this.emitters.forEach((emitter) => {\n emitter.emit(...args);\n });\n }", "replay() {\n for (let event of this.log) {\n console.log(event);\n }\n }", "function emit(msg){\n\tconsole.log(msg);\n}", "emit(...args) {\n this._event_dispatcher.$emit(...args);\n }", "function EventEmitter(){}// Shortcuts to improve speed and size", "function logAndEmit(e) {\n console.log(e.toString());\n this.emit('end');\n}", "function Emitter() {\n this.handlersByEventName = {};\n }", "function Emitter() {\n\t\tthis._listeners = {};\n\t}", "function Emitter() {\n\t\tthis.listeners = {};\n\t\tthis.singleListener = {};\n\t}", "function Emitter(){\nthis.event = {};\n}", "$emit(event, ...args) {\n this.emitter.emit(event, ...args);\n }", "function Emitter() {\r\n this.events = {};\r\n}", "$emit(event, ...args) {\n this.emitter.emit(event, ...args)\n }", "function Emitter() {\r\n\t\tthis.callbacks = {};\r\n\t}", "emit() {\n if (this.active) {\n super.emit.apply(this, arguments);\n } else {\n this.emits.push(arguments);\n }\n }", "function Emitter() {\n this.events = {};\n}", "sendEvent(event) {\n if (!(event instanceof Logger.LogOutputEvent)) {\n // Don't create an infinite loop...\n let objectToLog = event;\n if (event instanceof debugSession_1.OutputEvent && event.body && event.body.data && event.body.data.doNotLogOutput) {\n delete event.body.data.doNotLogOutput;\n objectToLog = Object.assign({}, event);\n objectToLog.body = Object.assign(Object.assign({}, event.body), { output: '<output not logged>' });\n }\n logger.verbose(`To client: ${JSON.stringify(objectToLog)}`);\n }\n super.sendEvent(event);\n }", "function Emitter() {\n this._subscriptions = [];\n}", "function Emitter() {\n\n this.events = {};\n\n\n}", "function Emitter() {\n this.listeners = {};\n}", "function Emitter() {\n//in this object there will be one property\n this.events = {};\n}", "logEmit( stateSnapshot ) {\n\t\t\n\t\tthis.logEvent( \"emit\", { stateSnapshot } );\n\n\t}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "setupLogging() {\n this.on('error', logger.error);\n\n this.on('rss', (body) => logger.silly(`emitted: ${body.id}`));\n this.on('ws:update:raw', (body) => logger.silly(`emitted raw: ${body.platform}`));\n this.on('ws:update:parsed', (body) => logger.silly(`emitted parsed: ${body.platform} in ${body.language}`));\n this.on('ws:update:event', (body) =>\n logger.silly(`emitted event: ${body.id} ${body.platform} in ${body.language}`)\n );\n this.on('tweet', (body) => logger.silly(`emitted: ${body.id}`));\n }", "function Emitter(){\n emitters.set(this, {});\n receivers.set(this, this);\n }", "function EventEmitter() {} // Shortcuts to improve speed and size", "emit() {\n\t\t\tlet currentListeners = listeners;\n\t\t\tfor (let i=0; i<currentListeners.length; i++) {\n\t\t\t\tcurrentListeners[i].apply(null, arguments);\n\t\t\t}\n\t\t}", "onOutput () {}", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "emitUpdate() {\n this._dispatch.call(DISPATCH_EVENT_UPDATE);\n }", "log(message) {\n // Send http request\n console.log(message);\n\n //Raised an event\n // commented out of app.js after adding into logger.js\n\n this.emit('messageLogged', {id: 1, url: 'http:' }); \n }", "emit(event, payload, block, emitter = this._defaultEmitter()) {\n emitter.emit(event, payload, block);\n }", "emitChange() {\n this.changeEmitters.forEach(func => func.call(null));\n }", "initEmittable() {\n /**\n * Event emitter\n * @property emitter\n */\n this.emitter = eventemitter.create({\n wildcard: true,\n });\n }", "log(message){\n // Send an HTTP request\n console.log(message);\n \n // Raise an event\n /*\n \n We first give the name of the event we want to emit. Then, we can pass\n some data. It's good practice to encapsulate the event argument in an\n object where the data is labeled. \n \n */\n this.emit('messageLogged', { id: 1, url: 'http://'});\n }", "emit(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.emit(...args);\n }", "emit(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.emit(...args);\n }", "execute(){\n this.logger.log(`EXECUTING Event: ${this.id}. Message: \"${this.message}\"`);\n }", "function log(){\n\t\tvar array = [\">>> \"];\n\t for (var i = 0; i < arguments.length; i++) {\n\t \tarray.push(arguments[i]);\n\t }\n\t socket.emit('log', array);\n\t}", "function emit() {\n channel.emit.apply(self, arguments);\n self.emit.apply(channel, arguments);\n }", "emit() {\n try {\n this.out.emit.apply(this.out, arguments)\n }\n catch (err) {\n this.out.emit('error', err)\n }\n }", "emit(evt) {\n\t\tif (!Duplex.prototype._flush && evt === 'finish') {\n\t\t\tthis._flush((err) => {\n\t\t\t\tif (err) EventEmitter.prototype.emit.call(this, 'error', err);\n\t\t\t\telse EventEmitter.prototype.emit.call(this, 'finish');\n\t\t\t});\n\t\t} else {\n\t\t\tconst args = Array.prototype.slice.call(arguments);\n\t\t\tEventEmitter.prototype.emit.apply(this, args);\n\t\t}\n\t}", "log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }", "emitChanges() {\n this.app.emit(this.changeActionName, this);\n }", "static emit(emitter, error) {\n\n\t\t// Check for error events listeners\n\t\tif (emitter.listeners('error').length) {\n\t\t\temitter.emit('error', error);\n\t\t} else if (process.stderr.isTTY) {\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error(`\\n${error.stack}\\n`);\n\t\t}\n\t}", "function log() {\n var objs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objs[_i - 0] = arguments[_i];\n }\n var message = new (Array.bind.apply(LogMessage, [null].concat(objs)));\n self[\"port\"].emit(message.name, message);\n}", "function log(){\n\t\tvar array = [\">>> Message from server: \"];\n\t \tarray.push.apply(array,arguments);\n\t socket.emit('log', array);\n\t}", "function EventEmitter(){}", "function EventEmitter(){}", "function Emiter() {}", "log(message) {\n this.stream.write((new Date()).toUTCString() + \" ------ \" + message + \"\\n\");\n this.emit('log', message);\n }", "function emitter() {\n\tvar i;\n\t// store stringified data\n\t// append new line character so can determine end of JSON object\n\tstringified = JSON.stringify(bobj) + '\\n';\n\t// emit data on every socket connection in eList\n\tfor (i in eList)\n\t\teList[i].write(stringified);\n\t// cleanup\n\tstringified = '';\n\tbobj = {};\n}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "emitChange () {\n this.emit(Constants.CHANGE_EVENT);\n }", "function write() {\n console.log(\"TODO: Implement write\", arguments);\n }", "applyAudit() {\n super.applyAudit();\n this.log.debug('This is only another custom messagem from your custom server :)');\n }", "log(message) {\n //send http request\n \n console.log(message);\n this.emit('messageLogged', {id: 1, url: 'http://'}); // making a noise, produce a signaling\n \n }", "execute(client, data) {\n events.log.push(data);\n }", "handleUpdates(){\n\t\t//put per update scripts here\n\t\tconsole.log('update');\n\t}", "function updateLogs() {\r\n updatePositionLogs();\r\n updateContactLogs();\r\n}", "function CallEmitter() {\n EventEmitter.call(this)\n console.log(this)\n}", "log(...params) {\r\n console.log(this.getLogStamp(), ...params);\r\n }", "log() {\n\t\tconsole.log(this.toString());\n\t}", "listener() {\n console.warn(\"no update listener set!\");\n }", "function log() {\n console.log.apply(console, arguments);\n var array = ['Server:'];\n array.push.apply(array, arguments);\n socket.emit('video:log', array);\n }", "log(message) {\n\n // send http request\n console.log(message);\n \n // Raise: messageLogged event\n // - As Logger inherits EventsEmitter, it's base methods can be called too\n // - Pass data through event argument read as eventArg, arg, or whatever\n this.emit('messageLogged', { id: 1, data: {id: 1, url: 'http://...'} });\n \n }", "function DataEmitter() {\n}", "function log() {\n var array = ['Message from server:'];\n array.push.apply(array, arguments);\n socket.emit('log', array);\n console.log(arguments);\n }", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}" ]
[ "0.7375093", "0.66729456", "0.66560537", "0.6615365", "0.66072524", "0.6516114", "0.648806", "0.64845574", "0.645828", "0.64309347", "0.6413441", "0.6362106", "0.63435113", "0.63055646", "0.6297304", "0.62939435", "0.62938607", "0.6259301", "0.6259249", "0.6254181", "0.624818", "0.6203063", "0.6181867", "0.6173277", "0.616156", "0.6144044", "0.6144044", "0.6144044", "0.6144044", "0.6116017", "0.6094398", "0.60660136", "0.6055654", "0.6023491", "0.60049134", "0.60005087", "0.59857976", "0.5985048", "0.59264517", "0.59199065", "0.59121096", "0.5907013", "0.5907013", "0.5890707", "0.5882519", "0.58821106", "0.58716077", "0.587134", "0.5859959", "0.58552986", "0.58323145", "0.5811851", "0.578574", "0.5765293", "0.5765293", "0.5752937", "0.5737938", "0.5732324", "0.57310224", "0.57310224", "0.5730661", "0.5721593", "0.5720371", "0.5718757", "0.5707759", "0.5687017", "0.5676142", "0.567608", "0.56754225", "0.56703186", "0.56673485", "0.5656357", "0.5652055", "0.5648185", "0.56375414", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042", "0.5635042" ]
0.6684667
1
Main loop, emit "Core::update" every frame
main() { // let browser handle frames var _this = this; var loop = function(tFrame){ _this.animationFrameId = window.requestAnimationFrame( loop ); _this.emit("Core::update"); } loop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loop () {\n\t\tthis.update();\n\t\tthis.render();\n\n\t\twindow.requestAnimationFrame( () => this.loop() );\n\t}", "function mainLoop() {\n update();\n draw();\n window.requestAnimationFrame(mainLoop);\n}", "update() {\n console.log(\"Abstract loop.\");\n }", "function loop(){\n stats.begin();\n\n canv_draw();\n \n sim_update();\n\n stats.end();\n \n requestAnimationFrame(loop);\n}", "main() {\n if(this.isRunning)\n {\n /* ENGINE RENDER CHAIN */\n this.engine.renderer.render();\n \n /* UI UPDATES */\n this.update();\n \n /* NEXT FRAME */\n this.timer = requestAnimationFrame(this.main);\n }\n }", "function main() {\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n update(dt);\n render();\n\n lastTime = now;\n win.requestAnimationFrame(main);\n }", "function loop(){\n update();\n draw();\n window.requestAnimationFrame(loop);\n}", "function frame() {\n rAF = requestAnimationFrame(frame);\n\n now = performance.now();\n dt = now - last;\n last = now;\n\n // prevent updating the game with a very large dt if the game were to lose focus\n // and then regain focus later\n if (dt > 1E3) {\n return;\n }\n\n emit('tick');\n accumulator += dt;\n\n while (accumulator >= delta) {\n loop.update(step);\n\n accumulator -= delta;\n }\n\n clearFn(context);\n loop.render();\n }", "function main() {\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n update(dt);\n render();\n\n lastTime = now;\n\n win.requestAnimationFrame(main);\n }", "function loop()\n{\n\trequestAnimationFrame(loop);\n\tupdate();\n\tDoGaugeStuff();\n}", "function loop() {\n drawScene () ;\n updateData () ;\n window.requestAnimationFrame (loop) ;\n}", "function loop() {\n drawScene () ;\n updateData () ;\n window.requestAnimationFrame (loop) ;\n}", "function main() {\n if(!running) {\n return;\n }\n\n var now = Date.now();\n var dt = (now - then) / 1000.0;\n\n//\tupdate(dt);\n render();\n\n then = now;\n requestAnimFrame(main);\n }", "tick() {\n this._update();\n }", "static loop()\n {\n requestAnimationFrame(RPM.loop);\n\n // Update if everything is loaded\n if (RPM.datasGame.loaded)\n {\n if (!RPM.gameStack.isLoading())\n {\n RPM.update();\n }\n if (!RPM.gameStack.isLoading())\n {\n RPM.draw3D();\n }\n }\n RPM.drawHUD();\n\n // Elapsed time\n RPM.elapsedTime = new Date().getTime() - RPM.lastUpdateTime;\n RPM.averageElapsedTime = (RPM.averageElapsedTime + RPM.elapsedTime) / 2;\n RPM.lastUpdateTime = new Date().getTime();\n }", "tick()\n {\n this.update();\n }", "function loop() {\n update();\n draw();\n // When ready to redraw the canvas call the loop function\n // first. Runs about 60 frames a second\n window.requestAnimationFrame(loop);\n}", "function main_game_loop() {\n\tupdate();\n\trender();\n\trequestAnimationFrame(main_game_loop);\n}", "function loop() {\n draw();\n update();\n frames++;\n requestAnimationFrame(loop);\n}", "function loop(){\r\n update(); \r\n draw();\r\n frames++;\r\n requestAnimationFrame(loop);\r\n}", "function main () {\n\tvar now = Date.now();\n\tvar delta = now - then;\n\n\tupdate(delta / 1000);\n\trender(Math.round(1 / (delta / 1000)));\n\n\tthen = now;\n\n\t// Request to do this again ASAP\n\trequestAnimationFrame(main);\n}", "function mainLoop() {\n requestAnimationFrame(mainLoop);\n\n engine.run();\n\n renderer.render(stage);\n}", "function run() {\n\n var loop = function(){\n\n if (!running) {\n return;\n }\n\n update();\n render();\n\n window.requestAnimationFrame(loop, display.canvas);\n };\n window.requestAnimationFrame(loop, display.canvas);\n}", "function main () {\n var now = Date.now()\n var delta = now - then\n\n update(delta / 1000)\n render()\n\n then = now\n\n // Request to do this again ASAP\n window.requestAnimationFrame(main)\n}", "function run(){\r\n requestAnimationFrame(run);\r\n update();\r\n render();\r\n}", "function update() {\r\n paintWorld();\r\n observers.forEach(observer => observer.update());\r\n}", "function update() {\n\t\tfor (let i = 0; i < loop.update.length; i++) {\n\t\t\tloop.update[i](tickCounter);\n\t\t}\n\t\tfor (let i = 0; i < loop.updateLast.length; i++) {\n\t\t\tloop.updateLast[i](tickCounter);\n\t\t}\n\t\ttickCounter++;\n\t\tmouseClicked = false;\n\t}", "function loop() {\r\n update();\r\n // When ready to redraw the canvas call the loop function\r\n // first. Runs about 60 frames a second\r\n window.requestAnimationFrame(loop, canvas);\r\n}", "function mainLoop() {\n\n\n // check if the user is drawing\n if (mouse.click && mouse.move && mouse.pos_prev) {\n // send line to to the server\n socket.emit('draw_line', {\n line: [ mouse.pos, mouse.pos_prev ],\n color: mouse.color\n });\n mouse.move = false;\n\n }\n mouse.pos_prev = {x: mouse.pos.x, y: mouse.pos.y};\n\n setTimeout(mainLoop, 25); //Setting it to run every 25ms for live update\n\n\n }", "function run() {\n\tvar loop = function() {\n\t\tupdate();\n\t\trender();\n\t\twindow.requestAnimationFrame(loop, canvas);\n\t}\n\twindow.requestAnimationFrame(loop, canvas);\n}", "function run() {\n var loop = function(){\n update();\n render();\n window.requestAnimationFrame(loop, canvas); \n };\n window.requestAnimationFrame(loop, canvas);\n}", "function gameLoop()\n\t{\n\t\twindow.requestAnimationFrame( gameLoop, display.canvas );\n\t\tupdate();\n\n\t}", "function update() {\n world.Step(\n 1 / 60 //frame-rate\n , 10 //velocity iterations\n , 10 //position iterations\n );\n world.DrawDebugData();\n world.ClearForces();\n\n requestAnimFrame(update);\n }", "function run() {\n var frame = 0;\n var loop = function() {\n update();\n frame++;\n // update();\n render();\n setTimeout(function() {\n window.requestAnimationFrame(loop, canvas);\n }, 1000/20);\n\n };\n window.requestAnimationFrame(loop, canvas);\n}", "function main() {\n /* Capturar a informaão de tempo delta que é requirida se o jogo\n * requer uma animação mais suave!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* \n */\n update(dt);\n render();\n\n /* \n */\n lastTime = now;\n\n /* \n */\n win.requestAnimationFrame(main);\n }", "function mainLoop()\n\t{\n\t\tself.clock = (self.clock + 1) % self.frames;\n\t\tif (self.clock == self.keyFrame)\n\t\t{\n\t\t\tself.interpretKeys();\n\t\t}\n\t\tif (self.clock === 0)\n\t\t{\n\t\t\tself.doLogic();\n\t\t}\n\t\tvar percent = self.clock / self.frames;\n\t\tvar rx = self.ox * (1 - percent) + self.x * percent;\n\t\tvar ry = self.oy * (1 - percent) + self.y * percent;\n\t\tvar rangle = self.oangle * (1 - percent) + self.angle * percent + 3;\n\t\tmap.movePlayer(rx, ry, rangle);\n\t}", "loop() {\n if (document.hidden) { this.running = false }\n\n let now = Date.now(),\n delta = now - (this.lastRender || now)\n this.lastRender = now;\n\n if (this.running) {\n this.draw(delta)\n this.frames++\n }\n\n requestAnimationFrame(() => this.loop());\n\n // Display fps and position\n if (now - this.lastFps > 999) {\n this.fpsMeter.innerText = this.frames\n this.lastFps = now;\n this.frames = 0;\n }\n }", "function main_loop() {\n updateSim();\n drawSim();\n userCanvasManip=false;\n}", "function loop()\n{\n requestAnimationFrame(loop);\n \n clearScreen();\n \n let state = currentState;\n \n if(state)\n {\n if(state.update)\n state.update();\n \n if(state.draw)\n state.draw();\n }\n}", "function loop() {\n if (gl.destroyed) {//to stop rendering once it is destroyed\n return;\n }\n\n context.__requestFrame_id = post(loop); //do it first, in case it crashes\n\n var now = Context.getTime();\n var dt = (now - time) * 0.001;\n\n context.onUpdate.fire(dt);\n context.onDraw.fire();\n \n time = now;\n }", "function update() {\n // Render the scene.\n render();\n // Schedule the next update frame.\n requestAnimationFrame( update );\n}", "function loop() {\n game.clearScreen();\n game.step();\n game.drawScreen();\n game.updateDebugger();\n window.requestAnimationFrame(loop);\n }", "function main() {\n\t\t// time delta information creates smooth animation based on time\n\t\tvar now = Date.now();\n\t\tvar dt = (now - lastTime) / 1000.0;\n\n\t\t/**\n\t\t * call update function with time delta parameter for smooth\n\t\t * animation and call render to load screen\n\t\t */\n\t\tupdate(dt);\n\t\trender();\n\n\t\t// set lastTime variable to now\n\t\tlastTime = now;\n\n\t\t/**\n\t\t * use browser's requestAnimationFrame function to call main\n\t\t * again when browswer can draw another frame\n\t\t */\n\t\twin.requestAnimationFrame(main);\n\n\t\tkeepScore();\n\t}", "gameLoop() {\n this.update();\n this.render();\n requestAnimationFrame(this.gameLoop.bind(this));\n }", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function loop() {\n redDrawBg();\n reDrawParticles();\n drawLines();\n requestAnimationFrame(loop);\n }", "function world_loop() {\r\n lv_timestamp = Date.now();\r\n\r\n // keep track of number of frames per second\r\n if (lv_this_second == null) {\r\n lv_this_second = Date.now();\r\n } else if( (Date.now() - lv_this_second) > 1000) {\r\n lv_fps = lv_frames_this_second;\r\n// console.log(\"Fps: \", lv_fps);\r\n lv_frames_this_second = 0;\r\n lv_this_second = Date.now();\r\n } else {\r\n lv_frames_this_second++;\r\n }\r\n\r\n // Check if we need to fetch an update from MATRX\r\n var lv_to_update_or_not_to_update = Date.now() > lv_last_update + lv_wait_for_next_tick && !lv_open_update_request;\r\n var lv_update_request = false\r\n // request a MATRX state update\r\n if (lv_to_update_or_not_to_update) {\r\n // save that we requested an update at this time\r\n lv_last_update = Date.now();\r\n lv_open_update_request = true;\r\n lv_update_request = get_MATRX_update();\r\n }\r\n\r\n // we received an update for a different world from our current, so reinitialize the visualization\r\n if (lv_new_world_ID != null && lv_world_ID != lv_new_world_ID) {\r\n console.log(\"New world ID received:\", lv_new_world_ID);\r\n lv_first_tick = false;\r\n lv_reinitialize_vis = true;\r\n sync_play_button(lv_matrx_paused);\r\n return;\r\n }\r\n\r\n // if MATRX didn't have a state update yet, wait for the next frame and check again at that time\r\n if (!lv_to_update_or_not_to_update) {\r\n request_new_frame();\r\n\r\n // if we requested an update check if it was successful\r\n } else {\r\n // after a successful update redraw the screen and go to the next frame\r\n lv_update_request.done(function(data) {\r\n\r\n // the first tick, initialize the visualization with state information, and synch the timing between\r\n // the visualization and MATRX\r\n if (lv_first_tick) {\r\n lv_first_tick = false;\r\n }\r\n\r\n // redraw the screen and go to the next frame\r\n lv_open_update_request = false;\r\n draw(lv_state, lv_world_settings, lv_messages, lv_chatrooms, new_tick = true);\r\n request_new_frame();\r\n })\r\n\r\n // if the request gave an error, print to console and try to reinitialize\r\n lv_update_request.fail(function(data) {\r\n // lv_update_request.fail(function(jqxhr, textStatus, error) {\r\n // var err = textStatus + \", \" + error;\r\n // console.log( \"Error: \" + err );\r\n\r\n console.log(\"Could not connect to MATRX API.\");\r\n console.log(\"Provided error:\", data.responseJSON)\r\n lv_first_tick = false;\r\n lv_reinitialize_vis = true;\r\n return;\r\n });\r\n }\r\n}", "function _run() {\n\n if (events.length) {\n stopped = false;\n window.setTimeout(function () {\n window.requestAnimationFrame(_update);\n }, 120);\n } else {\n stopped = true;\n }\n\n _update();\n }", "function main() {\r\n /* Get our time delta information which is required if your game\r\n * requires smooth animation. Because everyone's computer processes\r\n * instructions at different speeds we need a constant value that\r\n * would be the same for everyone (regardless of how fast their\r\n * computer is) - hurray time!\r\n */\r\n var now = Date.now(),\r\n dt = (now - lastTime) / 1000.0;\r\n\r\n /* Call our update/render functions, pass along the time delta to\r\n * our update function since it may be used for smooth animation.\r\n */\r\n update(dt);\r\n render();\r\n\r\n /* Set our lastTime variable which is used to determine the time delta\r\n * for the next time this function is called.\r\n */\r\n lastTime = now;\r\n\r\n /* Use the browser's requestAnimationFrame function to call this\r\n * function again as soon as the browser is able to draw another frame.\r\n */\r\n win.requestAnimationFrame(main);\r\n }", "function loop(){\r\n // Updates the game\r\n update();\r\n // Calls the \"draw\"-function\r\n draw();\r\n // Counts frames drawn to the canvas\r\n frames++;\r\n // Loops\r\n requestAnimationFrame(loop);\r\n}", "function clockLoop(){\n\t//update the time\n\tupdate();\n\n\t//draw the clock\n\tdraw();\n}", "function main() \n{\n\trender();\n\t// Request to do this again ASAP\n\trequestAnimationFrame(main);\n}", "function run(){\n\t\t\trequestAnimFrame(function(){\n\t\t\t\trun();\n\t\t\t});\n\t\t\tupdate();\n\t}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n let now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt);\n render();\n drawUI();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "_gameLoop () {\r\n\t\tthis.particleThread = setInterval(() => {\r\n\t\t\tthis._draw();\r\n\t\t}, this._cycleTimer);\r\n\t}", "function update() {\n clock += change();\n render();\n }", "function tick() {\n requestAnimationFrame(tick);\n\n drawScene();\n animate();\n}", "function updateLoop(){\n\t\t\t\t\tvar time = this.update();\n\n\t\t\t\t\t// set timer for next update\n\t\t\t\t\tthis.updateTimer = setTimeout(updateLoop.bind(this), 1000 - time.getMilliseconds());\n\t\t\t\t}", "function loop() {\n\tupdate();\n\tdraw();\n\t\n\t//calls loop when canvas is ready to be drawn again\n\twindow.requestAnimationFrame(loop, canvas);\n}", "Loop()\n\t{\n\t\t// Begin fps measurement\n\t\tthis.stats.begin();\t\n\n\t\tthis.t.now = CCUtil.Timestamp();\n\t\tthis.t.ft = this.t.now - this.t.last;\n\n\t\tif(this.t.ft > 0.25)\n\t\t\tthis.t.ft = 0.25;\n\n\t\tthis.t.last = this.t.now; \n\t\tthis.t.acc += this.t.ft;\n\n\t\twhile(this.t.acc >= this.t.dt) \n\t\t{\n\t\t\tthis.Update(this.t.dt);\n\t\t\t\n\t\t\tthis.t.time += this.t.dt;\n\t\t\tthis.t.acc -= this.t.dt;\n\t\t}\n\n\t\tthis.Draw();\n\n\t\t// End fps measurement\n\t\tthis.stats.end();\n\n\t\trequestAnimationFrame(function() { this.Loop(); }.bind(this));\n\t}", "function gameLoop()\r\n{\r\n\t\trequestAnimationFrame(gameLoop);\r\n\r\n\t\tupdate();\r\n\t\trender();\r\n}", "loop() {\n this.display();\n this.draw();\n setTimeout(()=>this.loop(), 200)\n\n }", "function main() { // Internal Main function of the engine. Keeps track of time. Calls for updates, renders, and tells the browser to perform an animation. It appears to do so only once.\n \n var now = Date.now(), // The variable now is defined as a method returning the amount of miliseconds that have transpired since 1970...\n dt = (now - lastTime) / 1000.0; //...the variable dt is defined as the difference between the value of the variable \"now\" and the value of the variable \"lastTime\", divided by 1000.\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n update(dt); // A method which loads messages and returns a promise. \n render(); // Calls the render function.\n\n lastTime = now; // Defines the variable lastTime as the value of Date.now().\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n \n win.requestAnimationFrame(main); // Tells the browser that we wish to perform an animation and requests that the browser perform a function to update the animation before the next repaint.\n victory();\n }", "update () {\n\n this.particleSystem.step(\n this.stopwatch.getElapsedMs() * 0.001)\n\n this.updateChunk ()\n\n // invalidate (needsClear, needsRender, overlayDirty)\n this.viewer.impl.invalidate(true, false, false)\n\n this.emit('fps.tick')\n }", "function gameLoop() {\n update();\n render();\n window.requestAnimationFrame(gameLoop);\n //console.log('swim');\n}", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n if (Map.gameRunning) { update(dt); }\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "gameLoop() {\n if (this.stopped) {\n return;\n }\n\n let now = Date.now();\n let dt = (now - this.lastTime) / 1000.0;\n this.fps = 1 / dt;\n\n this.update(dt);\n this.render();\n\n this.lastTime = now;\n\n window.requestAnimationFrame(() => this.gameLoop());\n }", "_loop () {\n // Start stat recording for this frame\n if (this.stats) this.stats.begin()\n // Clear the canvas if autoclear is set\n if (this._autoClear) this.clear()\n // Loop!\n if (this.loop) this.loop()\n // Increment time\n this._time++\n // End stat recording for this frame\n if (this.stats) this.stats.end()\n this._animationFrame = window.requestAnimationFrame(this._loop.bind(this))\n }", "function main() {\n\tvar now = Date.now();\n\tvar dt = (now - lastTime) / 1000.0; // dt is unused on the client side... for now.\n\tif (!isGamePaused)\n\t{\n\t\t\n\t\tcheckServerTimeout();\n\t\t\n\t\tsendServerUpdatePacket(handleInput());\n\t\t\n\t}\n\tlastTime = now;\n\trequestAnimFrame(main);\n}", "function tick() {\n camera.update();\n stats.begin();\n if (changed) {\n changed = false;\n runLSystem();\n }\n instancedShader.setTime(time);\n flat.setTime(mapVal);\n gl.viewport(0, 0, window.innerWidth, window.innerHeight);\n renderer.clear();\n renderer.render(camera, flat, [screenQuad]);\n renderer.render(camera, instancedShader, [square]);\n renderer.render(camera, planeShader, [plane]);\n renderer.render(camera, buildingShader, [cube]);\n stats.end();\n // Tell the browser to call `tick` again whenever it renders a new frame\n requestAnimationFrame(tick);\n }", "start() {\n var time = new Date;\n var _this = this;\n\n if (this.fps == 60) {\n this.runLoop = displayBind(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = displayBind(tick);\n time = new Date;\n });\n } else {\n this.runLoop = setTimeout(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = setTimeout(tick, 1000 / _this.fps);\n time = new Date;\n }, 1000 / this.fps);\n }\n }", "loopUpdate(){\n setInterval(()=>{\n this.updateNow();\n },updateSecs*1000);\n }", "function gameLoop(event) {\n // start collecting stats for this frame\n stats.begin();\n // calling State's update method\n currentScene.update();\n // redraw/refresh stage every frame\n stage.update();\n // stop collecting stats for this frame\n stats.end();\n}", "function gameLoop(event) {\n // start collecting stats for this frame\n stats.begin();\n // calling State's update method\n currentScene.update();\n // redraw/refresh stage every frame\n stage.update();\n // stop collecting stats for this frame\n stats.end();\n}", "function frame(){\r\n\t\t \t\tupdate();\r\n\t\t \t\tcollides();\r\n\t\t \t\tdraw();\r\n\t\t \t\tloop = requestAnimationFrame(frame);\r\n\t\t \t}", "function frame(){\r\n\t\t \t\tupdate();\r\n\t\t \t\tcollides();\r\n\t\t \t\tdraw();\r\n\t\t \t\tloop = requestAnimationFrame(frame);\r\n\t\t \t}", "function main() {\n\n //Get our time delta information which is required if your game requires smooth animation.\n\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n\n /*\n Call our update/render functions, pass along the time delta to our update function\n since it may be used for smooth animation.\n */\n update(dt);\n render();\n\n /*\n Set our lastTime variable which is used to determine the time delta\n for the next time this function is called.\n */\n lastTime = now;\n\n /*\n Use the browser's requestAnimationFrame function to call this\n function again as soon as the browser is able to draw another frame.\n If game's stop value is set to true, the game will end.\n */\n if(!game.stop){\n win.requestAnimationFrame(main);\n }\n }", "function loop() {\n draw();\n requestAnimFrame(loop);\n}", "function update() {\n world.execute();\n requestAnimationFrame(update);\n}", "function gameLoop(event) {\n // start collecting stats for this frame\n stats.begin();\n\n // calling State's update method\n currentScene.update();\n\n // redraw/refresh stage every frame\n stage.update();\n\n // stop collecting stats for this frame\n stats.end();\n}", "start() {\n this.update();\n }", "function update() {\n\t\t\n\t\t// Logic tick.\n\t\ttick();\n\t\t\n\t\t// Main drawing.\n\t\tif (graphicsDevice.beginFrame()) {\n\t\t\tgraphicsDevice.clear([0.067, 0.067, 0.067, 0.5], 1.0);\n\t\t\tdraw();\n\t\t\tgraphicsDevice.endFrame();\n\t\t}\n\t\t\n\t}", "_startLoop() {\n if (this._isRunning) { return; }; this._isRunning = true\n requestAnimationFrame(this._loop);\n }", "function nextFrame () {\n mainLoop(gameState, keyMovement, mouseMovement)\n }", "function gameLoop() \n{\n window.requestAnimationFrame(gameLoop);\n var now = new Date().getTime();\n var dt = (now - (time || now))/FRAME_RATE;\n\tmyControl.updateGame(myGame,dt);\n time = now;\n \n\t//***DEBUGING text lines example\n //myControl.m_Dev.debugText(myGame.playState,50,50);\n}", "function beginLoop() {\n var frameId = 0;\n var lastFrame = Date.now();\n\n function loop() {\n var thisFrame = Date.now();\n\n var elapsed = thisFrame - lastFrame;\n\n frameId = window.requestAnimationFrame(loop);\n\n currentScreen.update(elapsed, thisFrame);\n currentScreen.draw(surface, elapsed, thisFrame);\n\n lastFrame = thisFrame;\n }\n\n loop();\n }", "function setupUpdate() {\n setInterval(update, 600);\n}", "function tick() {\n // Save the current time\n g_seconds = performance.now() / 1000.0 - g_startTime;\n\n // Draw everything\n renderAllShapes();\n\n // Tell the browser to update again when it has time\n requestAnimationFrame(tick);\n}", "function loop(){\n\t\t\t\tupdate();\n\t\t\t\tif(playing) {\n\t\t\t\t\tdraw();\n\t\t\t\t\twindow.requestAnimationFrame(loop,canvas);\n\t\t\t\t}\n\t\t\t}", "update() { }", "update() { }", "update( )\r\n {\r\n\r\n this.app_state.update( )\r\n Input.update( )\r\n this.render( )\r\n requestAnimationFrame( ( ) =>\r\n {\r\n\r\n this.update( )\r\n\r\n } )\r\n\r\n }", "run() {\n logger.info('Starting game...');\n this.running = true;\n this.update();\n }", "function main() {\n /* Get our time delta information which is required if your game\n * requires smooth animation. Because everyone's computer processes\n * instructions at different speeds we need a constant value that\n * would be the same for everyone (regardless of how fast their\n * computer is) - hurray time!\n */\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n timer += dt;\n\n /* Call our update/render functions, pass along the time delta to\n * our update function since it may be used for smooth animation.\n */\n\n if (!paused) {\n update(dt);\n }\n render();\n\n /* Set our lastTime variable which is used to determine the time delta\n * for the next time this function is called.\n */\n lastTime = now;\n\n /* Use the browser's requestAnimationFrame function to call this\n * function again as soon as the browser is able to draw another frame.\n */\n win.requestAnimationFrame(main);\n }", "function tick(){\n // Save the current time\n g_seconds = performance.now()/1000.0-g_startTime;\n //console.log(g_seconds);\n\n //Update animation angles:\n updateAnimationAngles();\n\n // Draw Everything: \n renderAllShapes();\n\n // Tell the browser to update again when it has time \n requestAnimationFrame(tick);\n}", "function systemLoop () {\n startSystem();\n setInterval(function() {\n updateParticles();\n renderParticles();\n }, animSpeed);\n}", "function mainLoop() {\n if (isGameActive && !isGamePaused) {\n // Update the connected game\n connectedGame.update();\n // Render the connected game\n connectedGame.render();\n }\n }", "function run() {\n update();\n setInterval(update, 3600000);\n}", "function tick() {\n gameLogic();\n drawFrame();\n \n if (gameRunning) setTimeout(tick, 100);\n}" ]
[ "0.7914413", "0.7874368", "0.7740245", "0.7670927", "0.7650344", "0.75931954", "0.75877315", "0.7586551", "0.75863296", "0.7542704", "0.7538175", "0.7538175", "0.7518237", "0.75043625", "0.74887174", "0.74843705", "0.7443909", "0.74141073", "0.74129623", "0.73850405", "0.73820543", "0.73781323", "0.73739684", "0.7365707", "0.7354224", "0.7353922", "0.7344938", "0.7333595", "0.7303213", "0.73000455", "0.72771806", "0.72466993", "0.7244038", "0.72371745", "0.7221967", "0.72071564", "0.7191175", "0.71716607", "0.716697", "0.7157627", "0.71574676", "0.7151594", "0.7149538", "0.7139966", "0.7139069", "0.7139069", "0.7132268", "0.71308184", "0.71089476", "0.7108854", "0.7099741", "0.7098561", "0.709606", "0.7086587", "0.70742023", "0.7072526", "0.70719236", "0.7071407", "0.70628524", "0.704541", "0.70370525", "0.70179814", "0.701211", "0.7009661", "0.7009533", "0.6997459", "0.6980503", "0.69727254", "0.69716173", "0.695619", "0.6949769", "0.69487745", "0.6947488", "0.6940959", "0.6940959", "0.69405425", "0.69405425", "0.69392985", "0.69305074", "0.6922798", "0.6914014", "0.69137067", "0.69118106", "0.6907355", "0.6901394", "0.6901021", "0.6900881", "0.68981403", "0.6897392", "0.6893197", "0.6892416", "0.6892416", "0.6892026", "0.6889975", "0.6885468", "0.686757", "0.6866778", "0.68646365", "0.6863837", "0.6855836" ]
0.8205025
0
end hiding contents from old browsers >
function d2h(decimal) { var j = decimal; var hexchars = "0123456789ABCDEF"; var hv = ""; for (var i = 0; i < 2; i++) { k = j & 15; hv = hexchars.charAt(k) + hv; j = j >> 4; } return (hv); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideContentsQuit (){\n $('.content').hide();\n $(\"#newcanvas, #openfile\").removeClass('inactive').addClass('active');\n $('#closefile, #saveAs, #savefile, #revert, #printdraft, #printfin').addClass('inactive');\n }", "hide() {}", "function _hideContent() {\n btn_intro_launchButton.style.display = \"none\";\n txt_intro_welcomeTxt1.style.display = \"none\";\n txt_intro_welcomeTxt2.style.display = \"none\";\n txt_intro_welcomeTxt3.style.display = \"none\";\n txt_intro_welcomeTxt4.style.display = \"none\";\n txt_intro_welcomeTxt5.style.display = \"none\";\n txt_intro_welcomeTxt6.style.display = \"none\";\n }", "function hide() {\n\t\tdashboardContent.empty();\n\n\t}", "function _hidden() {}", "function hideAllContent() {\n $(\"#overview\").hide();\n $(\"#tips\").hide();\n $(\"#sample1\").hide();\n $(\"#sample2\").hide();\n $(\"#sample3\").hide();\n }", "function hideHack() {\n\t\t\tif (document.body) {\n\t\t\t\tdocument.body.style.visibility = \"hidden\";\n\t\t\t} else {\n\t\t\t\tKilauea.hackTimer = setTimeout(hideHack, 10);\n\t\t\t}\n\t\t}", "function hideContent()\n{\n document.getElementById(\"content\").style.visibility = \"hidden\"; \n}", "function mydoc_off()\n{\n\n\tcheck_advert_status();\n\tcheck_sidepanel_hieght();\n show('map');\n hide('gallery_id');\n\thide('chart_gallery_id')\n\thide('weather_gallery_id')\n\thide('uc_image');\n\n\t//for hide show details window\n\thide('more_info');\n\n}", "function hideContentsSave (){\n //$('.content').hide();\n $(\"#newcanvas, #openfile\").removeClass('inactive').addClass('active');\n $('#closefile, #saveAs, #savefile, #revert, #printdraft, #printfin').addClass('inactive');\n }", "function hide() {\r\n\tluck = \"\";\r\n\t document.getElementById(\"spin\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"results\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"title\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"ui1\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"postForm\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"ui\").style.visibility = \"hidden\"; \r\n\t document.getElementById(\"bucks\").style.visibility = \"hidden\"; \r\n\t \r\n\r\n\t}", "function frame_help_hide() {\n\treturn; \n\tvar aDivs = document.getElementsByName(\"DV_HELPTXT\");\n\tvar i = 0;\n\tfor (i=0;i<aDivs.length;i++ )\n\t{\n\t\t//aDivs[i].style.display = 'none';\n\t}\n}", "function tolggleSignatureContent(content){\n if (content.style.display === \"block\")\n content.style.display = \"none\";\n else content.style.display = \"block\";\n}", "function escapar(){\n var source = document.getElementById(\"impresion\");\n var divv = document.getElementById(\"superDiv\");\n divv.style.display = 'none';\n source.style.visibility = 'hidden';\n}", "function unhideHtml () {\n $('.error').prop('hidden',true);\n $('main').prop('hidden',false);\n $('.slideshow').prop('hidden',true);\n}", "function HideContent(d) {\ndocument.getElementById(d).style.display = \"none\";\n}", "function hide() {\n toogle = 'hide'\n\n }", "function hideuni(hide) {\n\tif(hide){\n\t\tdocument.getElementById(\"content\").setAttribute(\"data-hideuni\",\"true\");\n\t}else{\n\t\tdocument.getElementById(\"content\").setAttribute(\"data-hideuni\",\"false\");\n\t}\n\n\tpropagateVisibility(false);\n}", "function hideStuff(){\n\t$('#layout').fadeOut();\n\tparent.$(\"#exclusionTableWrapper\").hide();\n\t// hide plate exclusion divs\n\t$('.excludedPlateContainer').hide();\n}", "function hidePages(){\n\t$('#content').children('div').hide();\n}", "function end(){\n //window.alert(\"clicked the x\");\n var el = document.getElementById(\"not\");\n el.style.display = 'none';\n }", "function hideDecomp() {\n var decompArea = document.querySelector(\".decompose-current\");\n decompArea.innerHTML = ``;\n}", "function hide_educational()\n{\n change_educational('none', 'block')\n}", "function hide(){\r\n // change display style from block to none\r\n details.style.display='none';\r\n}", "hideView() {\n\t\tthis.content.clear();\n\t}", "hide ()\n\t{\n\t\t//hide the elements of the view\n\t\tthis.root.style.display= 'none';\n\t}", "function hideReader() {\r\n \r\n var readerEmbed = getNode('readerEmbed');\r\n getNode('readerFrame').removeChild(readerEmbed);\r\n readerEmbed = null;\r\n \r\n //Problem with Memory Management?\r\n //readerEmbed.style.display=\"none\"; \r\n \r\n}", "function hideInterferingElements(){\r\n\tdisplaySelectBoxes(false);\r\n\tdocument.getElementById(\"flash_search\").style.display='none';\r\n}", "function xHide(e){return xVisibility(e,0);}", "function hideSelves() {\n els = $('div.hidden-results-self');\n els.hide();\n els.before(permanentMysteryHtml());\n}", "function hideThePage() {\n $('#show').css('visibility', 'visible');\n $('div').hide('slide', {}, 2500);\n $('#show').show('fold', {}, 2500);\n}", "function hideThePage() {\n $('#show').css('visibility', 'visible');\n $('div').hide('slide', {}, 2500);\n $('#show').show('fold', {}, 2500);\n}", "function final() {\n $(\"#cargando\").hide();\n }", "function hideEverything() {\n hideNav();\n hideAllPosts();\n document.getElementById('tags').style.display = 'none';\n document.getElementById('all_posts_container').style.display = 'none';\n document.getElementById('close_tags').style.display = 'none';\n document.getElementById('clear_search_results').style.display = 'none';\n}", "function hideStuff() {\n\thideInv();\n}", "hide()\n\t{\n\t\t// hide the decorations:\n\t\tsuper.hide();\n\n\t\t// hide the stimuli:\n\t\tif (typeof this._items !== \"undefined\")\n\t\t{\n\t\t\tfor (let i = 0; i < this._items.length; ++i)\n\t\t\t{\n\t\t\t\tif (this._visual.visibles[i])\n\t\t\t\t{\n\t\t\t\t\tconst textStim = this._visual.textStims[i];\n\t\t\t\t\ttextStim.hide();\n\n\t\t\t\t\tconst responseStim = this._visual.responseStims[i];\n\t\t\t\t\tif (responseStim)\n\t\t\t\t\t{\n\t\t\t\t\t\tresponseStim.hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// hide the scrollbar:\n\t\t\tthis._scrollbar.hide();\n\t\t}\n\t}", "hideContent() {\n this.content.attr('hidden', 'hidden');\n }", "hide() {\n\t\tthis.style.display = \"none\";\n\t}", "function hide()\n\t{\n\t\t// TODO jQuery.hide function is problematic after Jmol init\n\t\t// Reloading the PDB data throws an error message (Error: Bad NPObject as private data!)\n\t\t// see https://code.google.com/p/gdata-issues/issues/detail?id=4820\n\n\t\t// So, the current workaround is to reposition instead of hiding\n\t\tif (_container != null)\n\t\t{\n\t\t\t//_container.hide();\n\t\t\tvar currentTop = parseInt(_container.css('top'));\n\n\t\t\tif (currentTop > 0)\n\t\t\t{\n\t\t\t\t_prevTop = currentTop;\n\t\t\t}\n\n\t\t\t_container.css('top', -9999);\n\t\t}\n\t}", "function hideSubtitle(elem) {\n elem.html('');\n }", "function doHide(id,formname,fieldname){\nlayer = document.getElementById(id);\nlayer.innerHTML='';\n}", "function hide() {\n\t\t\tdiv.hide();\n\t\t\tEvent.stopObserving(div, 'mouseover', onMouseMove);\n\t\t\tEvent.stopObserving(div, 'click', onClick);\n\t\t\tEvent.stopObserving(document, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'click', hide);\n\t\t\tEvent.stopObserving(textarea, 'keydown', onKeyDown);\n\t\t\tvisible = false;\n\t\t}", "function hideEditContent() {\n\n\t$('#div_edit_content').removeClass('isActive');\n\n\tif (v_canEditContent)\n\t\tv_editContentObject.ht.setDataAtCell(v_editContentObject.row, v_editContentObject.col, v_editContentObject.editor.getValue());\n\n\tv_editContentObject.editor.setValue('');\n\n}", "function hideElement() {\n // let li=this.parentNode.nodeName;\n // if (!body.firstElementChild) {\n if (ob1.style.display == 'none') {\n ob1.style.display = 'block';\n } else {\n ob1.style.display = 'none';\n }\n\n // }\n }", "hideView() {\n\n this.htmlElems.style.display = \"none\"\n this.car.saveCopeParams( this.saveInCarCopeParams() )\t\n this.car = null\n this.dellBullets() \n }", "function hide(el) {\n\t\tel.style.display = 'none';\n\t}", "function hideNonTouchscreenContent() {\n\t$(\".hide-for-touchscreen\").hide();\n}", "function hideAd(){\n\t\tvar ad = find(\"//iframe\", XPFirst);\n\t\tif (ad) ad.style.display = 'none';\n\n\t\t// Comentar el resto de la funcion desde aqui se se produce un efecto de \n\t\t// salto al cargar las paginas\n/*\n\t\tvar a = find(\"//table[@bgcolor='#747273']\", XPFirst);\n\t\tif (a) a.style.display = 'none';\n\n\t\tvar a = find(\"//div[@style]\", XPList);\n\t\tfor (var i = 0; i < a.snapshotLength; i++){\n\t\t\tvar b = a.snapshotItem(i);\n\t\t\tif (b.style.top == '42px') b.style.top = '0px';\n\t\t}\n*/\n\t}", "static hide(obj) {\n obj.setAttribute('visibility', 'hidden');\n }", "function showContent(b) {\r\n if (contents[b].classList.contains(\"hide\")) {\r\n contents[b].classList.add(\"show\");\r\n contents[b].classList.remove(\"hide\"); \r\n }\r\n }", "noIntroduction(){\n document.getElementById('introduction').style.display='none';\n }", "function hideWikiContent() {\n\t// Hide everything but title\n\t$(\"#content.mw-body, #content.mw-body a, .mw-body div, .mw-code, .de1, .de1 span, .mw-body table, .mw-body tr, .mw-body td, .mw-body th, h2, h3, h4, .mw-editsection-bracket, .mw-editsection-divider, #content.mw-body ul, .thumbcaption, .thumb, .noprint, .rquote, .navbox, .catlinks, .external, .infobox\").css({\n\t\tcolor: \"transparent\",\n\t\tbackgroundColor: \"transparent\",\n\t\tborder: \"none\",\n\t});\n\t$(\"img, ul, .external, .mediaContainer, .reference-text, code\").css({\n\t\topacity: 0.0,\n\t});\n\n\t// Style title\n\t$(\".firstHeading span\").css({\n\t\tbackground: \"white\",\n\t\tposition: \"inherit\",\n\t});\n\t$(\".firstHeading\").css({\n\t\tborderBottom: \"none\",\n\t});\n\t$(\"#siteSub\").css({\n\t\tcolor: \"black\",\n\t\tbackground: \"white\",\n\t});\t\n\n\tcontentIsVisible = false;\n\tchrome.storage.sync.set({\"contentIsVisible\": false}, function() {});\n}", "function startHidden() {\n $(\"#hider\").hide();\n }", "function hideAll() {\n standardBox.hide();\n imageBox.hide();\n galleryBox.hide();\n linkBox.hide();\n videoBox.hide();\n audioBox.hide();\n chatBox.hide();\n statusBox.hide();\n quoteBox.hide();\n asideBox.hide();\n }", "_hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this._overlayContainer.getContainerElement();\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n for (let i = siblings.length - 1; i > -1; i--) {\n let sibling = siblings[i];\n if (sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')) {\n this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }", "function hide() {\n $( \"#target\" ).hide();}", "function hideTools() {\n\t\t\thideAllBtn();\n\t\t\t$('#colorelement').css('display','none');\n\t\t\t$('#fntEdit').css('display','none');\n\t\t}", "function hideInfo() {\n $(infoDiv).html(\"\");\n}", "doHidden( root ) {\n root.style.display = 'none';\n }", "showContent() {\n this.content.removeAttr('hidden');\n }", "function hide(){\n // document.getElementById(\"startPage\").style.display = \"none\";\n document.getElementById(\"startPage\").style.setProperty(\"visibility\", \"hidden\", null);\n // document.getElementById(\"Time\").style.display = \"inline\";\n // document.getElementById(\"Score\").style.display = \"inline\";\n // document.getElementById(\"Level\").style.display = \"inline\";\n needName();\n}", "_hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this._overlayContainer.getContainerElement();\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n for (let i = siblings.length - 1; i > -1; i--) {\n const sibling = siblings[i];\n if (sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')) {\n this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }", "hideViewer() {\n this.quote.style.display = '';\n this.viewer.style.display = 'none';\n }", "function show(el) {\n\t\tel.style.display = '';\n\t}", "function hideHints(){\n\t\t\t\t$(\"#posibilidadescontainer\").fadeOut('slow');\n\t\t\t}", "hideContent() {\n let $self = $(`#${this.idDOM}`);\n let $content = $self.children('.article-big-content');\n\n if(this.commentSection !== undefined) {\n this.commentSection.delete();\n this.commentSection = undefined;\n }\n $content.empty();\n this.contentShown = false;\n articlesBigContainer.selectedArticle = undefined;\n }", "function lessContent(){\n less.style.display = 'none';\n}", "function _sh_overview_hidden(){\n\tin_overview = false;\n\twrap_plane_clone.visible = false;\n\tif( paused_preserve ) pause();\n}", "function hideTrends() {\n\tdocument.getElementById('trend_block').innerHTML = \"\";\n}", "function ocultar(){\n $(\"#textoComprobacion\").hide();\n }", "_hideAll() {\n this.views.directorySelection.hide();\n this.views.training.hide();\n this.views.messages.hide();\n this.views.directorySelection.css('visibility', 'hidden');\n this.views.training.css('visibility', 'hidden');\n this.views.messages.css('visibility', 'hidden');\n }", "function hideHTMLById(id) {\n\tdocument.getElementById(id).style.display = \"none\";\n}", "function removeHidden() {\n\t$(\".js-text-report\").removeClass(\"hidden\");\n}", "function hideEmpty(){\n\tvar hidden = ['ce-side-event', 'ce-side-time', 'ce-side-title', 'ce-side-speaker', 'ce-side-bio', 'ce-side-prelude', 'ce-side-article', 'ce-side-postlude', 'ce-side-location'];\n\tfor(var x=0;x<9;x++){\n\t\tif(document.getElementById(hidden[x]) == null){\n\t\t\t//Prevents nullpointer exceptions\n\t\t}else{\n\t\tswitch (document.getElementById(hidden[x]).innerHTML){\n\t\t\tcase 'None': //Empty fields are listed as \"None\"\n\t\t\t\t$('#'+hidden[x]).hide();\n\t\t\t\tdocument.getElementById(hidden[x]).style.visibility = 'hidden';\n\t\t\t\tbreak;\n\t\t\tcase '':\n\t\t\t\t$('#'+hidden[x]).hide();\n\t\t\t\tdocument.getElementById(hidden[x]).style.visibility = 'hidden';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdocument.getElementById(hidden[x]).style.visibility = 'visible';\n\t\t\t\tbreak;\n\t\t}\n\t\t}\n\t}\n\tif(document.getElementById('ce-side-speaker').innerHTML == 'None' || document.getElementById('ce-side-speaker').innerHTML == ''){\n\t\t$('#ce-side-bio').hide();\n\t}\n}", "function hideElement(e) {\n e.style.display = \"none\";\n }", "function clearPage() {\n $('#htmlForSW5').css('display', 'none');\n $('#htmlForSE12').css('display', 'none');\n $('#htmlForSE14').css('display', 'none');\n}", "function hideElement() {\n header.setAttribute(\"style\", \"visibility: hidden\");\n text.setAttribute(\"style\", \"visibility: hidden\");\n startBtn.setAttribute(\"style\", \"visibility: hidden\");\n}", "function fnhideInformation()\r\n\t\t{\r\n\t\t\tmblnOnInfoWindow = false;\r\n\t\t}", "function hideWorkflowEditor()\n {\n $.PercDataList.enableButtons(container);\n $(\"#perc-workflow-name\").val(\"\");\n $(\"#perc-wf-new-editor\").hide();\n dirtyController.setDirty(false);\n }", "function hidePreview() {\n \n setPreviewElements();\n \n // ------------------------------------------\n // Restore the editing area\n // ------------------------------------------\n \n if (RichEdit.mode == RichEdit.DESIGN_MODE) {\n showElement(PreviewElements.f);\n } else {\n showElement(PreviewElements.t);\n }\n showElement(PreviewElements.k);\n hideElement(PreviewElements.p);\n hideElement(PreviewElements.s);\n hideElement(PreviewElements.h1);\n \n setFormatBarElements('block');\n \n if (PreviewElements.b) PreviewElements.b.innerHTML = \"Preview\";\n \n RichEdit.PREVIEW_IS_HIDDEN = true;\n \n // Moz needs to be reminded to have the iframe editable after \n // a display change is made\n if (RichEdit.ENABLE_IFRAME\n && RichEdit.mode == RichEdit.DESIGN_MODE) {\n RichEdit.frameDoc.designMode = \"On\";\n } \n }", "function hideTinyMCE() {\n\t$('#mceu_0').hide();\n}", "hide() {\n this.backgroundDiv.remove();\n this.MiscDiv.remove();\n }", "function hideUnhideAllDivs(action)\n{\n //alert(\"hideUnhideAllDivs()\");\n if(runHide==true)\n {\n runHide=false;\n myDocumentElements=document.getElementsByTagName(\"div\");\n for (i=0;i<myDocumentElements.length;i++)\n {\n divisionNo = \"\" + myDocumentElements[i].id;\n if (divisionNo.indexOf(\"__hide_division_\")==0)\n {\n elem = document.getElementById(divisionNo);\n if (elem){\n //Don't hide if FF and FCK.. let FCK hide all later\n if (document.wysiwyg == \"FCKeditor\" && navigator.product == \"Gecko\")\n {\n }\n else\n {\n elem.style.display =action;\n }\n }\n }\n }\n }\n}", "function showPage() {\r\n document.getElementById(\"lds-ring\").style.display = \"none\";\r\n document.getElementById(\"hide-content\").style.display = \"block\";\r\n}", "function hidePost(l)\r\n{\r\n\tvar contentPreview = l.getElementsByTagName(\"BLOCKQUOTE\")[0].innerHTML.substring(0,previewLength).replace(/<br>/g, \"[BR]\");//Display the first few characters\r\n\t\r\n\tl.style.display = \"none\";\r\n\t\r\n\tl.previousSibling.innerHTML = \"<a onclick='togglePost(this)'>[Sage Hidden]</a> ... \" \r\n\t+ contentPreview + \" ... \";\r\n}", "function exitPrinter() {\n\t$('#header').show();\n\t$('#content').show();\n\t$('#footer').show();\n\t$('#printerFriendly').remove();\n}", "function hideFiles() { showFiles(true,this); }", "function hideChatWizContainer() {\n\t\t\t\tsendPostMessage({\"lpEmbChatWiz\": \"LPNVPF\", \"CMD\" : \"CONTROL\", \"value\" : \"HIDE_CONTAINER\"});\n\t\t\t}", "function hideContentPage(){\n $(\"#user-menu\").attr(\"aria-hidden\", \"true\");\n $(\"#footer\").attr(\"aria-hidden\", \"true\");\n $(\"#content\").attr(\"aria-hidden\", \"true\");\n}", "static hide(obj) {\n obj.setAttribute('visibility', 'hidden');\n }", "function hide_version_detail(){\n\t\n\t$(\"#version_detail\").hide();\n}", "function hideNotWorkingStuff() {\n // Top right account control buttons\n hide('#material-one-right #gb > div > div > div:not(:last-child)');\n style('#material-one-right #gb > div > div > div:last-child',\n { display: 'block', float: 'right' });\n style('#material-one-right #gb > div > div', { display: 'block', float: 'right' });\n cssRule('#material-one-right #gb {min-width: 40px !important}');\n\n // Built in mini player buttons\n hide('.player-top-right-items > paper-icon-button');\n\n // Settings options that won't work\n cssRule('#download { display: none !important }');\n cssRule('#manage-downloads { display: none !important }');\n cssRule('.subscription-gifting-card.settings-card {display: none !important}');\n\n // Hide the upload music button in settings\n cssRule('.music-sources-card.settings-card {display: none !important}');\n\n hide('.upload-dialog-bg', true);\n hide('.upload-dialog', true);\n\n cssRule('.song-menu.goog-menu.now-playing-menu > .goog-menuitem:nth-child(3) { display: none !important; }');\n}", "function hideSectionsFrame() {\r\n $(\"#sectionsFrame\").css(\"visibility\", \"hidden\");\r\n showingSections = false;\r\n }", "function hideEnglish() {\n var x = document.getElementsByTagName()(\"en\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n \n}", "function lessContent(){\n\t//var less = document.getElementById(\"less\"); same concept of why not needed as last problem\n\tless.style.display = \"none\";\n\n\t//you could also do less.HTML = \"\"; or \n\t\n}", "function hide(elem)\n{\n\telem.style.visibility= 'hidden';\n}", "function hideContent(a) {\r\n for (let i = a; i < contents.length; i++) {\r\n const content = contents[i];\r\n content.classList.add(\"hide\");\r\n content.classList.remove(\"show\");\r\n }\r\n }", "function hideTagEditor() {\n document.getElementById(\"tag-container\").style.visibility = 'hidden';\n}", "function dontShowInput1H(){\n document.getElementById(\"hard-block\").style.display = \"none\";\n }", "function hideInstruction() {\n document.getElementById(\"instruction\").style.display = \"none\";\n }", "function hideAll()\r\n{\r\n $(\"#loading\").show();\r\n $(\"#titleTop\").hide()\r\n $(\".pagination-container\").hide();\r\n $(\"#formulaire\").hide();\r\n $(\"#titleMid\").hide();\r\n}" ]
[ "0.7177701", "0.71483", "0.69767606", "0.6876446", "0.68096954", "0.68026465", "0.67573416", "0.67353374", "0.67039055", "0.6668134", "0.6618479", "0.6615184", "0.65973973", "0.6594726", "0.65529066", "0.65340066", "0.6532885", "0.65310776", "0.6528906", "0.65147406", "0.6480111", "0.64789957", "0.6458945", "0.6450798", "0.64422405", "0.64364165", "0.6435258", "0.6428111", "0.64252985", "0.6423988", "0.6419384", "0.6419384", "0.64075327", "0.64008707", "0.6397487", "0.63955826", "0.63875055", "0.6386503", "0.6375166", "0.6362665", "0.63501567", "0.6345593", "0.63421154", "0.6338276", "0.6333608", "0.6327215", "0.63253677", "0.6316702", "0.63162225", "0.63152444", "0.6310539", "0.6294208", "0.6294049", "0.629148", "0.62899214", "0.6288904", "0.62867653", "0.6283492", "0.628137", "0.627174", "0.62705314", "0.6270131", "0.6260208", "0.6257035", "0.6254677", "0.6253231", "0.6252578", "0.6248895", "0.62408334", "0.6236727", "0.6233658", "0.6230501", "0.62282044", "0.622744", "0.6224135", "0.62211496", "0.62191546", "0.6218242", "0.61995", "0.619893", "0.6195179", "0.6194773", "0.6193156", "0.6187859", "0.6187575", "0.6181915", "0.6181206", "0.61808664", "0.6179533", "0.6176122", "0.6174829", "0.6173832", "0.6171678", "0.61633146", "0.61549133", "0.61473346", "0.6143982", "0.6143436", "0.61412936", "0.6138248", "0.6132298" ]
0.0
-1
Generate reports to entered text.
function reportStats() { // Set initial. var wordStarted = false; // Get text from element with id value. reportMy.text = document.getElementById("sample").value; // Through the entire text length, check char. Update stats as appropriately. for ( i = 0; i < reportMy.text.length; i++) { switch ( reportMy.text[i]) { // If PERIOD, QUESTION, EXCLAMATIONPT, update number of sentences. case Punctuation.PERIOD: case Punctuation.QUEST: case Punctuation.EXC: if ( wordStarted === true) { reportMy.numOfSents++; } // break; // If either or COMMA, update number of words, case Punctuation.COMMA: if ( wordStarted === true) { reportMy.numOfWords++; wordStarted = false; } break; // If COMMA, update number of spaces. case Punctuation.SPACE: reportMy.numOfSpaces++; if ( wordStarted === true) { reportMy.numOfWords++; wordStarted = false; } break; // Assumes otherwise we are char in a word. default: { if ( wordStarted === false) { wordStarted = true; } } } } // Once text length has been reached, update average words per sentence. reportMy.aveWordsPerSent = parseInt(reportMy.numOfWords / reportMy.numOfSents); // Return reportMy object. return reportMy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add2Report(text) {\n\t\treport = report + text + '\\n';\n\t\treturn report;\n\t}", "function createTxt(report) {\n const output = entities.decode(report.markdown());\n csvAccumulator.push([report.kind, output]);\n}", "function formSubmission() {\n $(\".js-text-form\").submit(function(event) {\n event.preventDefault();\n var userText = $(this).find(\"#user-text\").val();\n wordReport(normalizeText(userText));\n });\n}", "async function step13(msgText, report) {\n report[0].response = {\n \"text\": \"¿Ha sufrido daños su vivienda? Describalos\"\n }\n report = fillReport(\"cause\", msgText, report);\n return report;\n}", "function wordReport(text) {\n var words = splitText(text);\n var avgWordLength = averageWordLength(words);\n var countedWords = words.length;\n var uniqueWords = uniqueWordCount(words);\n\n var textReport = $(\".js-text-report\");\n textReport.find('.js-word-count').text(countedWords);\n textReport.find('.js-unique-word-count').text(uniqueWords);\n textReport.find('.js-avg-word-length').text(avgWordLength + \" characters\");\n\n textReport.removeClass('hidden');\n\n}", "function customText() {\n let text = document.querySelector(\"textarea\").value;\n let parsedText = validateText(text);\n if (parsedText != null) {\n setInitials();\n displayText(parsedText);\n }\n}", "function export_text_DocGenerator() {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:export_text()-Call\")\n\t//----Create Object/Instance of DocGenerator----\n\t// var vMyInstance = new DocGenerator();\n\t// vMyInstance.export_text();\n\t//-------------------------------------------------------\n\tvar vReturn = \"\";\n\tvar vCR = \"\";\n\tfor (var i=1; i<=this.rows; i++) {\n\t\t//--Before and After Overwrite no insert of new line CR \n\t\tif (this[i][1].charAt(0) == \">\") {\n\t\t\tvCR = \" \";\n\t\t} else {\n\t\t\tvReturn += vCR + this[i][1];\n\t\t\tvCR = \" \\n\";\n\t\t}\n\t};\n\treturn vReturn;\n}", "function generateReport(id, name)\r\n{\r\n\t//Tracker#13895.Removing the invalid Record check and the changed fields check(Previous logic).\r\n\r\n // Tracker#: 13709 ADD ROW_NO FIELD TO CONSTRUCTION_D AND CONST_MODEL_D\r\n\t// Check for valid record to execute process(New logic).\r\n \tif(!isValidRecord(true))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\t//Tracker# 13972 NO MSG IS SHOWN TO THE USER IF THERE ARE CHANGES ON THE SCREEN WHEN USER CLICKS ON THE REPORT LINK\r\n\t//Check for the field data modified or not.\r\n\tvar objHtmlData = _getWorkAreaDefaultObj().checkForNavigation();\r\n\r\n\tif(objHtmlData!=null && objHtmlData.hasUserModifiedData()==true)\r\n {\r\n //perform save operation\r\n objHtmlData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n\t\tvar str = 'report.do?id=' + id + '&reportname=' + name;\r\n \toW('report', str, 800, 650);\r\n }\r\n\r\n}", "function GenerateText(){\n\n var badgeURL;\n if (license == \"MIT License\") badgeURL = \"https://img.shields.io/badge/license-MIT-green\";\n if (license == \"GNU AGPLv3\") badgeURL = \"https://img.shields.io/badge/license-GNU-blue\";\n if (license == \"GNU GPLv3\") badgeURL = \"https://img.shields.io/badge/license-GNU-blue\";\n if (license == \"GNU LGPLv3\") badgeURL = \"https://img.shields.io/badge/license-GNU-blue\";\n if (license == \"Mozilla Public License 2.0\") badgeURL = \"https://img.shields.io/badge/license-Mozilla-orange\";\n if (license == \"Apache License 2.0\") badgeURL = \"https://img.shields.io/badge/license-Apache-yellow\";\n if (license == \"Boost Software License 1.0\") badgeURL = \"https://img.shields.io/badge/license-Boost-purple\";\n if (license == \"No License\") badgeURL = \"https://img.shields.io/badge/license-None-grey\";\n\nreadmeText = \n`\n# ${projectTitle}\n\n![badge](${badgeURL})\n\n\n## Description \n\n${description} \n\n\n## Table of Contents \n \n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n* [Contributing](#contributing)\n* [Tests](#tests)\n* [Questions](#questions)\n\n\n## Installation\n\n${installation}\n\n\n## Usage \n\n${usage}\n\n\n## License\n\n${license}\n\n\n## Contributing\n\n${contributionRules}\n\n\n## Tests\n\n${tests}\n\n\n## Questions\n\nIf you have any questions, please reach out to:\n\n${username} at ${email} ![Profile Picture](https://github.com/${username}.png?size=80)\n\n`\n}", "function txtrresults() {\n\n // First, run reportStats and generate the ReportMy stats to be used.\n reportStats();\n\n // Then setup report using ReportMy data.\n var prompt1 = \"I detect you had entered \" + reportMy.numOfSents\n + \" sentence(s), consisting of \" + reportMy.numOfWords + \" words and \"\n + reportMy.numOfSpaces\n + \" spaces. The average words per sentence therefore is \"\n + reportMy.aveWordsPerSent + \". Thanks for playing!\";\n var noenter = \"I detect you have not entered words in the text area. Ok then.\";\n\n // Create noenter if no words detected in text area.\n if ( reportMy.numOfWords === 0) {\n prompt1 = noenter;\n }\n\n // If word are detected, create page report.\n var showt = document.getElementById(\"showtime\");\n var button1 = document.getElementById(\"button1id\");\n showt.removeChild(button1);\n\n var port = document.getElementById(\"portfolio\");\n var div = appendElementChild(\"div\", showt, \"txtresults\");\n appendTextChild(prompt1, div, \"h4\");\n\n var button2 = appendElementChild(\"button\", div, \"button2id\");\n button2.innerHTML = \"Done!\";\n button2.setAttribute(\"name\", \"button2\");\n button2.setAttribute(\"onClick\", \"portlist()\");\n return;\n}", "function EnterText2(){\n dataProvider = DataProvider.getDataProvider()\n query = \"select * from Regression where CaseName like 'EnterText%'\"\n recSet = dataProvider.execute(query) \n \n if(recSet == null || recSet.EOF){\n Log.Warning(\"Result of the query is empty.\", query);\n return false\n }\n \n recSet.MoveFirst() \n while (!recSet.EOF) {\n InputText(recSet.Fields.Item(\"Param1\").Value) \n recSet.MoveNext();\n }\n \n dataProvider.closeConnection()\n}", "function generateTeamReport() {\n var dialog1 = {\n 'title': 'Response Form',\n 'customTitle': false,\n 'subText': 'Would you like to generate a team report?'\n };\n \n var dialog2 = {\n 'title': 'Enter Time Tracking Response Link',\n 'subText': 'Please enter the response link to generate team report:'\n };\n \n reportDialog(dialog1, createTeamReport, dialog2);\n}", "function generateReport(){\n\t//create reports folder (if it doesn't already exist)\n\tif(!fs.existsSync(\"reports\")){\n\t\tfs.mkdirSync(\"reports\");\n\t}\n\t\n\t//create a file called by timestamp\n\tvar date = new Date();\n\treportfile = \"reports/\"+date.getDate()+\"-\"+date.getMonth()+\"-\"+date.getFullYear()+\"--\"+date.getHours()+\"h\"+date.getMinutes()+\"m.tex\";\n\t\n\twriteReport();\n\tvar err = createPDF();\n\tif(err){\n\t\tconsole.log(\"ERR : Error during creation of PDF report\");\n\t}\n}", "function doResults(text) {\n\tvar wordCountResults = getWordCount(text);\n\tvar uniqueWordResults = getUniqueWord(text);\n\tvar averageLengthResults = getAverageLength(text);\n\t$(\".js-text-report\").find(\".js-word-count\").html(wordCountResults);\n\t$(\".js-text-report\").find(\".js-unique-word\").html(uniqueWordResults);\n\t$(\".js-text-report\").find(\".js-average-length\").html(averageLengthResults);\n}", "function FillSampleText(sampleText) {\n $(\"#inputHelpBlock\").val(sampleText);\n $(\"#Analyze\").click();\n}", "function generate_all_reports()\n{\n report_ToAnswer_emails();\n report_FollowUp_emails();\n report_Work_FollowUp_emails();\n}", "async function step15(msgText, report) {\n //checks if its a number. In case its not it asks for a number\n if (!isNaN(msgText)) {\n report[0].response = {\n \"text\": \"¿Ha habido heridos? Indiquenos la cantidad utilizando un número.\"\n }\n report = fillReport(\"humansDeath\", msgText, report);\n }\n else {\n if (msgText.toLowerCase() == \"no\") {\n report = fillReport(\"humansDeath\", msgText, report);\n report[0].response = {\n \"text\": \"¿Ha habido heridos? Indiquenos la cantidad utilizando un número.\"\n }\n } else {\n report[0].response = {\n \"text\": \"Indiquenos la cantidad utilizando un número.\"\n }\n }\n }\n return report;\n}", "async function step4(msgText, report) {\n console.log(\"Steeeeeeep 4444444444\");\n\n //Checks if any button has been used.\n if (cause.includes(msgText)) {\n //If it is the button Otro replys forthe user to write the cause\n if (msgText == \"Otro\") {\n report[0].response = {\n \"text\": 'Escriba la causa del problema'\n }\n //otherwise update the cause field and response\n } else {\n report[0].response = homeDamagesReply;\n report = fillReport(\"cause\", msgText, report);\n }\n //it the buttons has not been used saves the recive text as the cause\n } else {\n report[0].response = homeDamagesReply;\n report = fillReport(\"cause\", msgText, report);\n }\n\n //Returns the updated report\n return report;\n}", "function print() {\n\tvar text = editor.getText();\n var compiler = new SlickCompiler();\n const input = compiler.compile(text);\n dialog.showSaveDialog({filters: [{name: 'pdf', extensions: ['pdf']},\n]}, function(filename){\n\tconsole.log(filename.toString())\n\t\tprintHelper(filename, input);\n });\n}", "function saveText() {\n\t if (input.value.trim().length > 0) {\n\t var clientX = parseInt(input.style.left, 10);\n\t var clientY = parseInt(input.style.top, 10);\n\t var svg = (0, _utils.findSVGAtPoint)(clientX, clientY);\n\t if (!svg) {\n\t return;\n\t }\n\t\n\t var _getMetadata = (0, _utils.getMetadata)(svg),\n\t documentId = _getMetadata.documentId,\n\t pageNumber = _getMetadata.pageNumber;\n\t\n\t var rect = svg.getBoundingClientRect();\n\t var annotation = Object.assign({\n\t type: 'textbox',\n\t size: _textSize,\n\t color: _textColor,\n\t content: input.value.trim()\n\t }, (0, _utils.scaleDown)(svg, {\n\t x: clientX - rect.left,\n\t y: clientY - rect.top,\n\t width: input.offsetWidth,\n\t height: input.offsetHeight\n\t }));\n\t\n\t _PDFJSAnnotate2.default.getStoreAdapter().addAnnotation(documentId, pageNumber, annotation).then(function (annotation) {\n\t (0, _appendChild2.default)(svg, annotation);\n\t });\n\t }\n\t\n\t closeInput();\n\t}", "gatherOutput(text) {\n this.programOutput += text;\n }", "async function step3(msgText, report) {\n console.log(\"Steeeeeeep 33333333333333333333333333\");\n\n //If uses the buttons fill the correspondent field\n if (msgText == \"Comunidad\" || msgText == \"Hogar\") {\n report[0].response = causeReply;\n report = fillReport(\"homeOrComunitty\", msgText, report);\n\n //insist on using the buttons\n } else {\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": 'Utilice los botones para responder'\n };\n report[0].response = homeOrComunityReply;\n }\n\n return report;\n}", "async function step11(msgText, report) {\n console.log(\"Steeeeeeep 111 111 1 11 11 11\");\n\n report[0].response = anotherReportReply;\n //Saves any text recibed as an observation, and send the report to the arcgis layer\n report = fillReport(\"observation\", msgText, report);\n\n //returns the updated report\n return report;\n}", "async function step7(msgText, report) {\n console.log(\"Steeeeeeep 7777777777777\");\n\n //if the user replys to this las question with the No hubo muertos button, the pertinent field is filled \n //with a 0\n if (msgText == \"No hubo muertos\") {\n report[0].response = imageReply;\n report = fillReport(\"humansDeath\", 0, report)\n\n //Otherwise if the reply is not a number asks for a number\n } else if (isNaN(msgText)) {\n report[0].response = {\n \"text\": \"Señale el numero de muertes utilizando los números del teclado\"\n };\n\n //if it is a number updates this field with the value\n } else {\n report[0].response = imageReply;\n report = fillReport(\"humansDeath\", msgText, report)\n }\n\n //returns the updated report\n return report;\n}", "function TextGenerator(env, data) {\n var container = env.area.appendChild(document.createElement('div'));\n container.setAttribute('id', 'text');\n container.innerHTML = data.subject;\n\n var heRead = function() {\n document.removeEventListener('keyup', heRead);\n env.area.removeEventListener('click', heRead);\n env.io.happen('read');\n };\n document.addEventListener('keyup', heRead);\n env.area.addEventListener('click', heRead);\n}", "textEnter() {}", "function generateTestReport() {\n var fileName = 'FileSystem - Report.pdf';\n FileMapper.clearAllMappingsInConfig();\n Workbook.setActiveWorkbookPath('c:\\\\user\\\\desktop');\n QUnit.load(testFunctions);\n // Run tests and generate html output\n var htmlOutput = QUnit.getHtml();\n htmlOutput.setWidth(1200);\n htmlOutput.setHeight(800);\n // Display test results\n SpreadsheetApp.getUi().showModalDialog(htmlOutput, fileName);\n // Save test results in Google Drive\n var blob = htmlOutput.getBlob();\n var pdf = blob.getAs('application/pdf');\n DriveApp.createFile(pdf).setName(fileName);\n}", "function writeText(text) {\n document.getElementById(\"fieldToComplet\").innerHTML += text + '<br>';\n }", "function EnterText(){\n //throw new Error(\"User Exception.\");\n dataProvider = DataProvider.getDataProvider()\n query = \"select * from Smoke where CaseName like 'EnterText%'\"\n recSet = dataProvider.execute(query) \n \n if(recSet == null || recSet.EOF){\n Log.Warning(\"Result of the query is empty.\", query);\n return false\n }\n \n recSet.MoveFirst() \n while (!recSet.EOF) {\n InputText(recSet.Fields.Item(\"Param1\").Value) \n recSet.MoveNext();\n }\n \n dataProvider.closeConnection()\n}", "function GenerateNewText() {\n this.sentences = [\n \"Nice.\",\n \"Do you have a sound test?\",\n \"Check out my sound test.\",\n \"Instead of asking for a keyboard rec, try building your own keyboard.\",\n \"What switches are those?\",\n \"I don’t know, I’m still waiting on a group buy.\",\n \"My GMK set is delayed.\",\n \"Well regardless, those caps are nice.\",\n \"Please check out my interest check!\",\n \"I built it myself.\",\n \"Sadly, I had to pay after market prices for these.\",\n \"I’m a tactile person myself.\",\n \"This is end game, for sure.\",\n \"I have one pair of hands but 24 keyboards.\",\n \"Specs?\",\n \"I need something to test out my new soldering iron.\",\n \"There’s a new group buy coming up that I’m waiting for.\",\n \"GMK is delayed by a year.\",\n \"Yeah once the caps come in, I’ll have this keyboard done.\", \n \"How much was your latest build?\",\n \"Wow do you use all those keyboards?\",\n \"I forgot to lube my switches.\",\n \"Been thinking about getting a custom handmade wrist rest to match my keyboard.\",\n \"It was supposed to be a budget build.\",\n \"You're a fool if you think the first build will be your last.\",\n \"Hopefully there will be a round 2 for that.\",\n \"I'm pretty sure I saw that on someone's build stream.\",\n \"That's a really nice build.\",\n \"Yeah, I have a custom coiled cable to match my custom mechanical keyboard and custom wrist rest that all fit nicely in my custom keyboard case.\",\n \"Finally had some time to lube these switches.\",\n \"Are those Cherry MX Browns?\",\n \"Really loving the caps!\",\n \"I wonder how long it took for everything to arrive.\", \n \"I find lubing switches to be therapeutic.\",\n \"I'm already thinking about my next build.\",\n \"You have to lube your switches though.\", \n \"Cool build.\",\n \"Thinking about getting an IKEA wall mount to display my boards.\",\n \"I bought that in a group buy a year ago.\",\n \"You won't believe how much shipping was.\",\n \"Not sure when my keyboard will come in honestly.\",\n \"Listen to the type test of this board.\",\n \"Soldered this PCB myself.\",\n \"Imagine buying GMK sets to flip them.\",\n \"My keyboard is stuck in customs.\",\n \"I have a collection of desk mats and only 1 desk.\",\n \"I've seen some cursed builds out there.\",\n \"Keyboards made me broke.\",\n \"I fell in too deep in the rabbit hole.\",\n \"I'm about to spend $500 on a rectangle.\",\n \"Not sure if this is a hobby or hell.\",\n \"Give me some feedback on my first build!\",\n \"The group buy is live now.\",\n \"I think I just forgot to join a group buy.\",\n \"RNG gods please bless me.\",\n \"It's gasket-mounted.\",\n \"But actuation force though.\",\n \"Never really thought of it that way now that you say it.\",\n \"Lots of people get into this hobby without doing their research and it shows.\",\n \"A custom keyboard can change your life, I would know.\",\n \"Group buys have taught me a different type of patience I didn't know I had.\",\n \"This was a group buy, you can't really find this unless you search after market.\"\n ]\n}", "async function step14(msgText, report) {\n report[0].response = {\n \"text\": \"¿Ha habido muertos? Indiquenos la cantidad utilizando un número.\"\n }\n report = fillReport(\"homeDamages\", msgText, report);\n return report;\n}", "function genProcessText(aProcess, aReporters)\n{\n var explicitTree = buildTree(aReporters, 'explicit');\n fixUpExplicitTree(explicitTree, aReporters);\n filterTree(explicitTree._amount, explicitTree);\n var explicitText = genTreeText(explicitTree, aProcess);\n\n var mapTreeText = '';\n kMapTreePaths.forEach(function(t) {\n var tree = buildTree(aReporters, t);\n\n // |tree| will be null if we don't have any reporters for the given path.\n if (tree) {\n filterTree(tree._amount, tree);\n mapTreeText += genTreeText(tree, aProcess);\n }\n });\n\n // We have to call genOtherText after we process all the trees, because it\n // looks at all the reporters which aren't part of a tree.\n var otherText = genOtherText(aReporters, aProcess);\n\n // The newlines give nice spacing if we cut+paste into a text buffer.\n return \"<h1>\" + aProcess + \" Process</h1>\\n\\n\" +\n explicitText + mapTreeText + otherText +\n \"<hr></hr>\";\n}", "function createReport1(tmfile1) {\n\topenfile(tmfile1);\n\tif (reporttype == 0) {\n\t\toframe.ActiveDocument.Application.Run(\"createNormalReport\");\n\t} else {\n\t\toframe.ActiveDocument.Application.Run(\"analyze\");\n\t}\n}", "async function step16(msgText, report) {\n if (!isNaN(msgText)) {\n report[0].response = {\n \"text\": \"Envienos una imagen de los daños provocados\"\n }\n report = fillReport(\"humansHarmed\", msgText, report);\n }\n else {\n if (msgText.toLowerCase() == \"no\") {\n report = fillReport(\"humansHarmed\", msgText, report);\n report[0].response = {\n \"text\": \"Envienos una imagen de los daños provocados\"\n }\n } else {\n report[0].response = {\n \"text\": \"Indiquenos la cantidad utilizando un número.\"\n }\n }\n }\n return report;\n}", "function getText(event) {\n event.preventDefault();\n // Get user textarea input:\n var text = document.getElementById(\"textArea\").value;\n // remove all punctuation\n text = text.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()@\\+\\?><\\[\\]\\+]/gm, \"\");\n\n // Get user line input:\n let lineInput = document.querySelector('input[name=\"lines\"]:checked').value;\n\n var lines = Number(lineInput);\n\n // Get user word input\n var words = Number(document.getElementById(\"wordInput\").value);\n\n //get user vowel input\n var vowels = Number(document.getElementById(\"vowelInput\").value);\n\n //Determine if textarea input has line breaks:\n let test = checkLineBreaks(text); // call check line breaks function\n if (test === true) {\n textArr = splitText(text);\n } else {\n // add line breaks based on whitespace\n textArr = stringLines(text); // call function to format text lines\n }\n\n // identify the which lines will be parsed.\n activeLines(textArr, lines, words, vowels);\n}", "function GenerateNewText() {\n\n this.choices = []; // create this so we don't duplicate the sentences chosen\n\n // Add property to the object\n this.sentences =\n [\n \"The term \\\"tested in an ABM mode\\\" used in Article II of the Treaty refers to: (a) an ABM interceptor missile if while guided by an ABM radar it has intercepted a strategic ballistic missile or its elements in flight trajectory regardless of whether such intercept was successful or not; or if an ABM interceptor missile has been launched from an ABM launcher and guided by an ABM radar. If ABM interceptor missiles are given the capability to carry out interception without the use of ABM radars as the means of guidance, application of the term \\\"tested in an ABM mode\\\" to ABM interceptor missiles in that event shall be subject to additional discussion and agreement in the Standing Consultative Commission; (b) an ABM launcher if it has been used for launching an ABM interceptor missile; (c) an ABM radar if it has tracked a strategic ballistic missile or its elements in flight trajectory and guided an ABM interceptor missile toward them regardless of whether the intercept was successful or not; or tracked and guided an ABM interceptor missile; or tracked a strategic ballistic missile or its elements in flight trajectory in conjunction with an ABM radar, which is tracking a strategic ballistic missile or its elements in flight trajectory and guiding an ABM interceptor missile toward them or is tracking and guiding an ABM interceptor missile.\",\n \"EWO launch: If sequence does not start after coordinated key turn, refer to Fig 2-1 and Notify command post of type deviation, ETOR, and intent to perform TCCPS; Post ETOR to EWO documents.\",\n \"(For classified information on the RV, refer to the 11N series Technical Orders.)\",\n \"Here's my strategry on the Cold War: we win, they lose.\",\n \"The only thing that kept the Cold War cold was the mutual deterrance afforded by nuclear weapons.\",\n \"The weapons of war must be abolished before they abolish us.\",\n \"Ours is a world of nuclear giants and ethical infants.\",\n \"The safety and arming devices are acceleration-type, arming-delay devices that prevent accidental warhead detonation.\",\n \"The immediate fireball reaches temperatures in the ranges of tens of millions of degrees, ie, as hot as the interior temperatures of the sun.\",\n \"In a typical nuclear detonation, because the fireball is so hot, it immediately begins to rise in altitude. As it rises, a vacuum effect is created under the fireball, and air that had been pushed away from the detonation rushes back toward the fireball, causing an upward flow of air and dust that follows it.\",\n \"The RV/G&C van is used to transport and remove/replace the RV and the MGS for the MM II weapon system.\",\n \"Computer components include a VAX 11/750 main computer, an Intel 80186 CPU in the buffer, and the Ethernet LAN which connects the buffer with the main computer.\",\n \"The Specific Force Integrating Receiver (SFIR) is one of the instruments within the IMU of the Missile G&C Set (MGCS) which measures velocity along three orthogonal axes.\",\n \"The SFIR incorporates a pendulous integrating gyro having a specific mass unbalance along the spin axis, and provides correction rates to the Missile Electronics Computer Assembly (MECA) which provides ouputs to the different direction control units resulting in control of the missile flight.\",\n \"SAC has directed that all VAFB flight test systems and the PK LSS will be compatible with the SAC ILSC requirement.\",\n \"The ground shock accompanying the blast is nullified in the control center by a three-level, steel, shock-isolation cage, which is supported by eight shock mounts hung from the domed roof.\",\n \"(Prior to MCL 3252) Fixed vapor sensing equipment consists of an oxidizer vapor detector, a fuel vapor detector, a vapor detector annunciator panel, and associated sensing devices located throughout the silo area.\",\n \"The LAUNCH CONTROL AND MONITOR section contains switches to lock out the system, select a target, initiate a lunch, shutdown and reset.\",\n \"The CMG-1 chassis contains the logic required to control launch.\",\n \"Attention turned to the Nike X concept, a layered system with more than one type of missile.\",\n \"At this point a fight broke out between the Air Force and Army over who had precedence to develop land-based ABM systems.\",\n \"It is such a big explosion, it can smash in buildings and knock signboards over, and break windows all over town, but if you duck and cover, like Bert [the Turtle], you will be much safer.\",\n \"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones.\",\n \"The living will envy the dead.\",\n \"Frequent fear of nuclear war in adolescents seems to be an indicator for an increased risk for common mental disorders and deserves serious attention.\",\n \"The Peacekeeper was the first U.S. ICBM to use cold launch technology.\",\n \"The Protocol to the Agreement with regard to Article III, entitled the United States to have no more than 710 SLBM launchers on 44 modern ballistic missile submarines, and the USSR, no more than 950 SLBM launchers on 62 submarines.\",\n \"Well hell, I'd piss on a spark plug if you thought it would do any good.\",\n \"Do you want to play a game?\",\n \"Gentlemen! You can't fight in here! This is the war room!\",\n \"I do not avoid women, Mandrake. But I do deny them my essence.\",\n \"Mr. Ryan, be careful what you shoot at. Most things here don't react well to bullets.\",\n \"If OPERATE OK on the BVLC does not light in step 5, verify that the proper code is inserted.\",\n \"PEACETIME launch: If abnormal indications occur prior to step 8, report to Launch Director and proceed as directed.\",\n \"The missile silo (figure 1-2) is a reinforced, concrete structure with inside dimensions of approximately 146 feet in depth and 55 feet in diameter.\",\n \"General, you are listening to a machine.\",\n \"The mechanism is... Oh James, James... Will you make love to me all the time in England?\",\n \"I never joke about my work, 007.\", \n \"Eventually Kwajalein Island was selected, as it was 4,800 miles from California, perfect for ICBMs, and already had a US Navy base with considerable housing stocks and an airstrip.\",\n \"From Stettin in the Baltic to Trieste in the Adriatic an iron curtain has descended across the Continent.\",\n \"Whether you like it or not, history is on our side. We will bury you.\",\n \"I like Mr. Gorbachev. We can do business together.\",\n \"Mr. Gorbachev, tear down this wall!\",\n \"Gort! Klaatu barada nikto!\",\n \"It is no concern of ours how you run your own planet. But if you threaten to extend your violence, this Earth of yours will be reduced to a burned-out cinder.\",\n \"The remaining base in North Dakota, the Stanley R. Mickelsen Safeguard Complex, became active on 1 April 1975 and fully operational on 1 October 1975. By that time the House Appropriations Committee had already voted to deativate it. The base was shutdown on 10 February 1976.\"\n\n\n ];\n\n console.log(\"How many sentences? \",this.sentences.length);\n}", "function addTextField(title,response,answer,points,is_graded) {\n\n /*************************************************\n * Obtains the document and gets the body section\n * of the given document.\n **************************************************/\n \n var doc = DocumentApp.getActiveDocument();\n var body = doc.getBody();\n \n /*************************************************\n * Stores all the given variables necessary to\n * customize the text-field question.\n **************************************************/\n \n var question = title;\n var ans = answer;\n var points = points;\n var lines = response;\n \n if(is_graded) {\n questions.push(question);\n answers.push(ans);\n body.appendParagraph(question).setAttributes(questionStyle).appendText(' (' + points + ' pts)').setBold(true);\n }else{\n /*************************************************\n * Creates the initial question, assigns the points,\n * and adds the information text.\n **************************************************/\n \n body.appendParagraph(question).setAttributes(questionStyle).setBold(true);\n }\n \n /*************************************************\n * Creates a table based on the variables given.\n **************************************************/\n \n var table = body.appendTable();\n \n for(var i = 0; i < lines; i++){ \n var tr = table.appendTableRow();\n var td = tr.appendTableCell();\n }\n \n \n table.setAttributes(infoStyle);\n \n if(is_graded){ // adds answer sheet if needed\n for(var i = 0; i < questions.length; i++){\n body.appendParagraph(questions[i]).setAttributes(questionStyle);\n body.appendListItem(answers[i]).setAttributes(infoStyle).setGlyphType(DocumentApp.GlyphType.HOLLOW_BULLET);;\n }\n }\n \n /*************************************************\n * Saves and closes the document.\n **************************************************/\n \n doc.saveAndClose();\n}", "function EndofPrompts() {\r\n fs.writeFileSync(genFilePath, \"\");\r\n let markupData = genStartHtml();\r\n\r\n for (var a in staff) {\r\n markupData += staffHtml(staff[a]);\r\n }\r\n markupData += genFinalHtml();\r\n fs.writeFileSync(genFilePath, markupData);\r\n\r\n }", "function getText() {\n\t$(\"button\").click(function (event) {\n\t\tevent.preventDefault();\n\t\tdoResults($(\"textarea\").val());\n\t\tremoveHidden();\n\t\t\n\t})\n}", "async function step19(msgText, report) {\n report[0].response = byeReply;\n\n report = fillReport(\"observation\", msgText, report);\n return report;\n}", "_exportToText() {\n fs.writeFileSync(this.pathTemplate, '', 'utf-8');\n this.records.forEach(submitTime => fs.appendFileSync(this.pathTemplate, `${submitTime}\\n`));\n }", "function addReportingToolForEvent() {\n var inputField = $('#add-tool-to-event-input');\n var typeField = $('#add-tool-to-event-type');\n var ruleHTML = buildHTMLForEventReport(inputField.val(), typeField.val());\n var reportingBody = $('#reporting-body');\n console.log(reportingBody.html());\n reportingBody.html(reportingBody.html() + ruleHTML);\n}", "function onCreateText() {\n let elText = document.querySelector('.currText').value\n if (elText === '') return;\n createText()\n resetValues()\n draw()\n}", "function textLogger() {\n\tconsole.log(document.querySelector('.txtInput').value);\n\t//push whatever is in the input box to the array\n\tarr.push(document.querySelector('.txtInput').value);\n\tdocument.querySelector('.txtInput').value = '';\n\trender(arr);\n}", "function textreader() {\n\n // Replace \"reserved\" report with feature exercise.\n var port = document.getElementById(\"portfolio\");\n var reserved = document.getElementById(\"reserved\");\n port.removeChild(reserved);\n var div = appendElementChild(\"div\", port, \"showtime\");\n var prompt1 = \"First, a simple exercise. Type complete sentences \"\n + \"in the text area provided then press SUBMIT. I will report \"\n + \"statistics related to your submission. Cool? \";\n appendTextChild(prompt1, div, \"h4\");\n var prompt2 = \"Text Reader and Statistics\";\n var txta = appendElementChild(\"textarea\", div, \"sample\");\n txta.setAttribute(\"name\", \"textReader\");\n txta.setAttribute(\"rows\", \"5\");\n txta.setAttribute(\"cols\", \"30\");\n appendBreakChild(2, div);\n\n // Create button to move to next results page.\n var button1 = appendElementChild(\"button\", div, \"button1id\");\n button1.innerHTML = \"Submit\";\n button1.setAttribute(\"name\", \"button1\");\n button1.setAttribute(\"onClick\", \"txtrresults()\");\n\n return true;\n}", "function generateText(text) {\n let mm = new MarkovMachine(text);\n console.log(mm.makeText());\n}", "function GenerateReadMe(input) {\n let Title;\n let Description;\n const descriptionHead = \"## Description\";\n let tableOfContents;\n const tocHead = \"## Table of Contents\";\n let installArr;\n const installHead = \"## Installation\";\n let Usage;\n const usageHead = \"## Usage\";\n let Contribution;\n const contributionHead = \"## Contribution\";\n let Test;\n const testingHead = \"## Tests\";\n let License = input.license;\n const licenseHead = \"## License\";\n let Questions;\n const questionsHead = \"## Questions\";\n let fullReadME = [];\n\n // Adds Title\n if (input.title == '') {\n Title = '# TITLE';\n } else {\n Title = `# ${input.title}`;\n }\n fullReadME.push(Title);\n\n\n //Adds in license badge here!!\n let badge = `![](https://img.shields.io/badge/license-${License.replace(/ /g, \"%20\")}-blue?style=flat-square)`;\n fullReadME.push(badge);\n\n\n // Adds description\n if (input.description == '') {\n Description = `${descriptionHead}\\n Enter project description here.`;\n } else {\n Description = `${descriptionHead}\\n${input.description}`;\n }\n fullReadME.push(Description);\n\n\n //Adds Table of Contents\n tableOfContents = `${tocHead}\\n* [Installation](#installation)\\n* [Usage](#usage)\\n* [Contribution](#contribution)\\n* [Tests](#tests)\\n* [License](#license)\\n* [Questions](#questions)\\n`;\n fullReadME.push(tableOfContents);\n\n\n // TODO: Create a function to initialize app\n fullReadME.push(`${installHead}`);\n\n installArr = input.install.split(',').map(item => {\n return `${item.trim()}`;\n });\n\n for (var i = 0; i < installArr.length; i++) {\n fullReadME.push(`${i + 1}. ${installArr[i]}`);\n }\n\n\n //Adds Usage\n if (input.usage == '') {\n Usage = `\\n${usageHead}\\n Enter project usage here.`;\n } else {\n Usage = `\\n${usageHead}\\n${input.usage}`;\n }\n fullReadME.push(Usage);\n\n\n //Adds Contributing\n if (input.contribution == '') {\n Contribution = `\\n${contributionHead}\\n Enter project contriburtion information here.`;\n } else {\n Contribution = `\\n${contributionHead}\\n${input.contribution}`;\n }\n fullReadME.push(Contribution);\n\n\n //Adds Tests\n if (input.testing == '') {\n Test = `\\n${testingHead}\\n Enter project testing information here.`;\n } else {\n Test = `\\n${testingHead}\\n${input.testing}`;\n }\n fullReadME.push(Test);\n\n\n //License info\n License = `\\n${licenseHead}\\nThis project is covered under the ${input.license}.`;\n fullReadME.push(License);\n\n\n //Questions section with github link\n Questions = `\\n${questionsHead}\\nFor questions about this project, please see <br> My GitHub at: [${input.github}](https://github.com/${input.github})<br><br> Reach out by email at ${input.email}.`;\n fullReadME.push(Questions);\n\n\n // Function call to initialize app\n const README = fullReadME.join('\\n');\n\n\n // TODO: Create a function to generate markdown for README\n fs.writeFile(\"./Example-ReadME-here.md\", README, (err) => {\n if (err) {\n throw err;\n } else {\n console.log(\"README file successfully generated!\");``\n }\n });\n}", "function textBuilding() {\n if (i < textFull.length) {\n i = i + 1;\n //Building the text on each itteration\n textBuild += (textFull.charAt(i));\n //Posting the current build into the page\n postMessage(textBuild);\n } else {\n w.terminate();\n w = undefined;\n }\n setTimeout(\"textBuilding()\", 250);\n}", "function produceReport(){\n // this is were most functions are called\n\n userURL = getuserURL();\n\n // add this into the website\n vertifyHttps(userURL); // check if the url is http/s\n googleSafeBrowsingAPI(userURL);\n virusTotalAPI(userURL);\n apilityCheck(userURL);\n}", "async function step12(msgText, report) {\n console.log(\"Steeeeeeep 12 12 12 12 12 12\");\n\n //If used button is No, says bye and chane the step so its greater than 19.Case in wich the getStep function will\n //understand thats its necesary to build a new report, for the moment in wich the user could text us again\n if (msgText == \"No\") {\n report[0].response = byeReply;\n\n report = fillReport(\"step\", 20, report);\n\n //If it is reportarit creates a new report\n } else if (msgText == \"Reportar\") {\n\n console.log(\"Step 111 siiiiiiii\");\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": 'Usted ha decidido reportar un nuevo daño'\n }\n //this new report may ster in the third step\n report = create(report[0].sender_id, 3);\n report[0].response = homeOrComunityReply;\n\n //if it is information replys with the pertinent information to the cause\n } else if (msgText = \"Información\") {\n //calls getCause Info to get the info to response\n report = getCauseInfo(report);\n report[0].response = anotherReportReply;\n\n //Otherwise insist on the question\n } else {\n report[0].responseAuxIndicator = 0,\n report[0].response = anotherReportReply;\n }\n\n //resturns the updated report or the new one\n return report;\n}", "function report(text) {\n\tif(DEBUG) {\n\t\tconsole.log('\\x1b[33m[%s]\\x1b[0m', text);\n\t}\n}", "function build_report_txt() {\n\n var txt = [];\n txt.push(\"Page Size Inspector Report\\n\");\n txt.push(\"URL: \"+ tab_url);\n txt.push(Date().toString() + \"\\n\");\n txt.push(build_line(\"REQUEST\", \"REQ\", \"BYTES\", \"CACHEREQ\", \"CACHEBYTES\"));\n\n // total\n var t = table_data.sections.total;\n txt.push(\"\\n\"+build_line(\"TOTAL\", t.reqtransf, t.kbtransf,\n t.reqcached, t.kbcached, \"_\"));\n\n // sections\n var sections = [\"Document\", \"Script\", \"Stylesheet\", \"Image\", \"XHR\",\n \"Font\", \"Other\"];\n const MAX_URL = 45;\n for (const sname of sections) {\n var num = table_data.sections[sname+\"count\"] || {};\n txt.push(\"\\n\"+build_line(sname, num.reqtransf, num.kbtransf,\n num.reqcached, num.kbcached, \"_\"));\n\n var sect = table_data.sections[sname] || [];\n for (const req of sect) {\n var prefix = req.size ? '-' : '+';\n var code = req.code != 200 ? req.code + ' ' : '';\n var url = sanitize_url(req.url, MAX_URL, true) || req.url_display;\n url = prefix + code + url;\n\n txt.push(build_line(url, 0, req.size, 0, req.sizecache));\n }\n }\n\n txt.push(\"\");\n\n var s = txt.join(\"\\n\");\n// deb(s);\n return s;\n}", "function textGenerate() {\n var n = \"\";\n var text = \" Bé thương anh lắm, iu bae của em nữaaa..:333 \";\n var a = Array.from(text);\n var textVal = $('#txtReason').val() ? $('#txtReason').val() : \"\";\n var count = textVal.length;\n if (count > 0) {\n for (let i = 1; i <= count; i++) {\n n = n + a[i];\n if (i == text.length + 1) {\n $('#txtReason').val(\"\");\n n = \"\";\n break;\n }\n }\n }\n $('#txtReason').val(n);\n setTimeout(\"textGenerate()\", 1);\n}", "function printAndSavePerformance()\n{\n // DO NOT CHANGE THESE\n let attempt_duration = (attempt_end_time - attempt_start_time) / 60000; // 60K is number of milliseconds in minute\n let wpm = (letters_entered / 5.0) / attempt_duration; \n let freebie_errors = letters_expected * 0.05; // no penalty if errors are under 5% of chars\n let penalty = max(0, (errors - freebie_errors) / attempt_duration); \n let wpm_w_penalty = max((wpm - penalty),0); // minus because higher WPM is better: NET WPM\n let timestamp = day() + \"/\" + month() + \"/\" + year() + \" \" + hour() + \":\" + minute() + \":\" + second();\n \n background(color(0,0,0)); // clears screen\n cursor(); // shows the cursor again\n \n textFont(\"Arial\", 16); // sets the font to Arial size 16\n fill(color(255,255,255)); //set text fill color to white\n text(timestamp, 100, 20); // display time on screen \n \n text(\"Finished attempt \" + (attempt + 1) + \" out of 2!\", width / 2, height / 2); \n \n // For each trial/phrase\n let h = 20;\n for(i = 0; i < 2; i++, h += 40 ) \n {\n text(\"Target phrase \" + (i+1) + \": \" + phrases[i], width / 2, height / 2 + h);\n text(\"User typed \" + (i+1) + \": \" + entered[i], width / 2, height / 2 + h+20);\n }\n \n text(\"Raw WPM: \" + wpm.toFixed(2), width / 2, height / 2 + h+20);\n text(\"Freebie errors: \" + freebie_errors.toFixed(2), width / 2, height / 2 + h+40);\n text(\"Penalty: \" + penalty.toFixed(2), width / 2, height / 2 + h+60);\n text(\"WPM with penalty: \" + wpm_w_penalty.toFixed(2), width / 2, height / 2 + h+80);\n text(\"CPS: \" + CPS.toFixed(2), width / 2, height / 2 + h+100);\n\n // Saves results (DO NOT CHANGE!)\n let attempt_data = \n {\n project_from: GROUP_NUMBER,\n assessed_by: student_ID,\n attempt_completed_by: timestamp,\n attempt: attempt,\n attempt_duration: attempt_duration,\n raw_wpm: wpm, \n freebie_errors: freebie_errors,\n penalty: penalty,\n wpm_w_penalty: wpm_w_penalty,\n cps: CPS\n }\n \n // Send data to DB (DO NOT CHANGE!)\n if (BAKE_OFF_DAY)\n {\n // Access the Firebase DB\n if (attempt === 0)\n {\n firebase.initializeApp(firebaseConfig);\n database = firebase.database();\n }\n \n // Add user performance results\n let db_ref = database.ref('G' + GROUP_NUMBER);\n db_ref.push(attempt_data);\n }\n}", "function takeDataIn(text) {\n\n console.log(text);\n}", "function sendReport() {\r\n\t framework.sendReport(); \r\n}", "function ui_w(str_text){\n\tdocument.write(str_text);\n}", "async report() {\n const { logger, db } = this[OPTIONS];\n const testedPages = await db.read('tested_pages');\n\n logger.info('Saving JSON report');\n const json = new JSONReporter(this[OPTIONS]);\n await json.open();\n await json.write(testedPages);\n await json.close();\n\n logger.info('Saving HTML Report');\n const html = new HTMLReporter(this[OPTIONS]);\n await html.open();\n await html.write(testedPages);\n await html.close();\n }", "function updateText(){\r\n\r\n\tvar text = document.getElementById(\"simulationtext\").value;\r\n\tdocument.title = text;\r\n\r\n\tif(text.length>0){\r\n\t\tclearSeed();\r\n\t\tsetAnimationFunction();\r\n\t\tenableShare();\r\n\r\n\t\tsimText = text;\r\n\t\tpathIsText = true;\r\n\t\trestart = true;\r\n\t}\r\n}", "function reminderText() {\n textRecognition.start();\n}", "function init() {\n // use inquirer to ask questions (activity 2 from Monday)\n // call generateMarkdown function which will return a string\n // call writeToFile function pass to it a file name and the string returned by the generateMarkdown function\n}", "function TextCell(text){\n//take this text entered into the program\n//splits the string into an array of lines \n this.text = text.split(\"/n\");\n}", "function printAndSavePerformance() {\n // DO NOT CHANGE THESE\n let attempt_duration = (attempt_end_time - attempt_start_time) / 60000; // 60K is number of milliseconds in minute\n let wpm = letters_entered / 5.0 / attempt_duration;\n let freebie_errors = letters_expected * 0.05; // no penalty if errors are under 5% of chars\n let penalty = max(0, (errors - freebie_errors) / attempt_duration);\n let wpm_w_penalty = max(wpm - penalty, 0); // minus because higher WPM is better: NET WPM\n let timestamp =\n day() +\n \"/\" +\n month() +\n \"/\" +\n year() +\n \" \" +\n hour() +\n \":\" +\n minute() +\n \":\" +\n second();\n\n background(color(0, 0, 0)); // clears screen\n cursor(); // shows the cursor again\n\n textFont(\"Arial\", 16); // sets the font to Arial size 16\n fill(color(255, 255, 255)); //set text fill color to white\n text(timestamp, 100, 20); // display time on screen\n\n text(\n \"Finished attempt \" + (attempt + 1) + \" out of 2!\",\n width / 2,\n height / 2\n );\n\n // For each trial/phrase\n let h = 20;\n for (i = 0; i < 2; i++, h += 40) {\n text(\n \"Target phrase \" + (i + 1) + \": \" + phrases[i],\n width / 2,\n height / 2 + h\n );\n text(\n \"User typed \" + (i + 1) + \": \" + entered[i],\n width / 2,\n height / 2 + h + 20\n );\n }\n\n text(\"Raw WPM: \" + wpm.toFixed(2), width / 2, height / 2 + h + 20);\n text(\n \"Freebie errors: \" + freebie_errors.toFixed(2),\n width / 2,\n height / 2 + h + 40\n );\n text(\"Penalty: \" + penalty.toFixed(2), width / 2, height / 2 + h + 60);\n text(\n \"WPM with penalty: \" + wpm_w_penalty.toFixed(2),\n width / 2,\n height / 2 + h + 80\n );\n\n // Saves results (DO NOT CHANGE!)\n let attempt_data = {\n project_from: GROUP_NUMBER,\n assessed_by: student_ID,\n attempt_completed_by: timestamp,\n attempt: attempt,\n attempt_duration: attempt_duration,\n raw_wpm: wpm,\n freebie_errors: freebie_errors,\n penalty: penalty,\n wpm_w_penalty: wpm_w_penalty,\n cps: CPS,\n };\n\n // Send data to DB (DO NOT CHANGE!)\n if (BAKE_OFF_DAY) {\n // Access the Firebase DB\n if (attempt === 0) {\n firebase.initializeApp(firebaseConfig);\n database = firebase.database();\n }\n\n // Add user performance results\n let db_ref = database.ref(\"G\" + GROUP_NUMBER);\n db_ref.push(attempt_data);\n }\n}", "function runProgram() {\n\t// Clear the canvas\n\tbackground(255);\n\n\t// TODO: Get the phrase in the text box and convert it to upper case\n\tvar words;\n\t//... add your code here.\n\n // Draw the Matrix\n\tdrawMatrix(words)\n}", "async function step6(msgText, report) {\n console.log(\"Steeeeeeep 666666666666\");\n\n //If the response is no fills the humansHarmed and humanDetahs fields with a 0\n if (msgText == \"No\") {\n report[0].response = imageReply;\n report = fillReport(\"noHumansHarmed\", msgText, report)\n\n //If its a yesreplys asking for the damaged ppl\n } else if (msgText == \"Si\") {\n report[0].response = harmedPeopleReply;\n\n //if the user replys to this las question with the No hubo heridos button, the pertinent field is filled \n //with a 0\n } else if (msgText == \"No hubo heridos\") {\n report[0].response = deathPeopleReply;\n report = fillReport(\"humansHarmed\", 0, report)\n\n //Otherwise understand that the message is a reply to the humansHarmed question and updates this\n } else {\n\n //IF the msg is not a number asks for replying with a number\n if (isNaN(msgText)) {\n report[0].response = {\n \"text\": \"Señale el numero de heridos utilizando los números del teclado\"\n };\n\n //Otherwise fills the pertinent field\n } else {\n report[0].response = deathPeopleReply;\n report = fillReport(\"humansHarmed\", msgText, report)\n }\n }\n\n //Returns the updated response\n return report;\n}", "function btnRun_OnClick(){\r\n\t$('#footer').text('Processing.....');\t\r\n let sText= $('#txtCodeArea').html();\r\n\t\t$('#txtCodeResult').html(makeString(sText));\r\n\t\r\n\tlet myDate = new Date();\t\r\n\t$('#footer').text('Finished at '+myDate.toLocaleString()+'. String Maker by Alex. Email: Alexlam1822@gmail.com');\t\r\n}", "instructions() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Goal: Avoid the monsters. Reach the princess.',10,105);\n }", "function requestReport(message, str) {\r\n message.reply(str + ' Please report this at www.github.com/TheMalle/fixer');\r\n}", "text(text) {\n // console.log(`Incoming text: ${text.text}`)\n }", "function addTextToResults(text) {\n terminalResultsDiv.innerHTML +=`<p>${directory} ${text}</p>`;\n scrollToBottomOfResults();\n}", "function generateTextFormPage() {\n saveDrawing();\n clearSketchpad();\n renderStaticImage(roundCount);\n renderTextForm();\n changeId('right-col-sketch', 'right-col');\n renderNextSketchButton();\n renderEndBtn();\n roundCount++;\n timer();\n \n}", "function generateText() {\n\n words.clear()\n var textFile = document.getElementById(\"inputFile\")\n //console.log(textFile)\n parseFile(textFile)\n\n}", "function standardsMaker(myString){ \n console.log (\"I will write questions if I'm stuck\");\n}", "function printRecText(readResults) {\n console.log('Recognized text:');\n for (const page in readResults) {\n if (readResults.length > 1) {\n console.log(`==== Page: ${page}`);\n }\n const result = readResults[page];\n if (result.lines.length) {\n for (const line of result.lines) {\n console.log(line.words.map(w => w.text).join(' '));\n }\n }\n else { console.log('No recognized text.'); }\n }\n }", "function expAllTxts()\r\n{\r\n\tif(textAreas != null && textAreas.length > 0)\r\n\t{\r\n\t\tfor(var i=0, max=textAreas.length; i < max; i++)\r\n\t\t{\r\n\t\t\texpTxt(textAreas[i]);\r\n\t\t}\r\n\t}\r\n}", "function processGenerateReportButton() \n{ \n\t//console.log(\"Entereed generateReport\");\n\t//console.log(currentPage);\n\t\n\tif (currentPage == \"Campus\")\n\t{\n\t\tinitCampusReportGeneration();\n\t}\n\telse\n\t{ \n\t\tinitBuildingReportGeneration(currentPage);\n\t}\n\t\n}", "function GenerateNewText() {\n\t//Add property to the object\n\tthis.sentences = \n\t[\n\t\t\"Quote number 1.\",\n\t\t\"Second cool quote.\",\n\t\t\"Another nice quote.\",\n\t\t\"The very last quote.\"\n\t];\n}", "function process() \n{\n\t//Read parameters\n\tvar theform = document.theform;\n\n\touttype = 0;\n\tif (theform.outtype[1].checked) outtype = 1;\n\tif (theform.outtype[2].checked) outtype = 2;\n\n\tprintRules = true; //theform.report.checked;\n\tshowDiff = theform.showdiff.checked;\n\trewout = theform.rewout.checked;\n \n // flush all arrays\n all_rules = [];\n all_rewrites = [];\n all_categories = [];\n applied_rules = {};\n \n\t// Stuff we can do once\n\ts = readStuff();\n\n\t// If that went OK, apply the rules\n\tif (s.length == 0) {\n\n\t\tDoWords();\n\t}\n \n // now, check the goodness of fit\n var goodness = compareAO();\n s += '</li><li>Correct conversions: '+goodness[0] + ' from '+goodness[4] + ' ('+goodness[2]+'%)';\n s += '</li><li>Wrong conversions: '+goodness[1] + ' from '+goodness[4] + ' ('+goodness[3]+'%)';\n s += '</li></ul>';\n if(goodness[2] > 50)\n {\n s += '<span style=\"color:red;font-weight:bold;\">Great, the rules you defined already explain more than half of all words!</span>';\n }\n else\n {\n s += '<span style=\"color:red;font-weight:bold;\">Well, less than half of all words can be explained. Maybe you should try a bit harder...</span>';\n }\n\n // insert the quality of the rules\n s += '<h3>Rule Evaluation</h3><ul>';\n for(rule in applied_rules)\n {\n s += '<li style=\"list-style:circle\"><code>\"'+rule+'\"</code> applies to '+applied_rules[rule]+' words.</li>';\n }\n s += '</ul>';\n\n\t// Set the output field\n\tdocument.getElementById(\"mytext\").innerHTML = s;\n \n}", "function TextData() { }", "function TextData() { }", "function addReport(){\r\n var text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac nisi eu elit rhoncus mattis dignissim vel sem. Donec bibendum augue velit, nec gravida turpis ornare eget. Mauris eu sapien bibendum, blandit risus at, pretium tellus. Donec volutpat non sem a efficitur. Curabitur turpis magna, elementum ac felis nec, congue finibus massa. Quisque laoreet tincidunt quam, sed mollis augue varius egestas. Curabitur quis sollicitudin diam, non tempus tortor. Nam condimentum arcu sed lacus rhoncus, id tincidunt lectus vehicula.\";\r\n var group = 1; //changeable\r\n \r\n //sample populator for report\r\n var ctr = 1;\r\n for(var i = 1; i < 10; i++,ctr++){\r\n if(ctr > 3){\r\n ctr = 1;\r\n }\r\n group = ctr;\r\n document.getElementById(\"report-container\").innerHTML +='<div data-toggle=\"modal\" data-target=\"#report-full\" class=\"card report-card mb-3 \" style=\"min-width:100%\"><div class=\"row no-gutters\"><div class=\"col\"><div class=\"card-body text-wrap\"><span class=\"badge badge-pill\" style=\"background-color:'+colors[group-1]+'\">Group '+ group+'</span><p class=\"text-truncate\">'+text+'</p></div></div></div></div>';\r\n }\r\n}", "report() {}", "function text_check(target,displayed,current,buffer,emmit_wrong){\n if(((current.value.charAt(0)==target.innerHTML.charAt(0)) && started==0)){\n number_of_errors=0;\n d= new Date();\n start_time=d.getTime();\n target0=target.innerHTML.trim();\n started=1;\n }\n if(started==1){\n if(target0.indexOf(current.value)==0){\n target.innerHTML=target0.slice(current.value.length+1);\n displayed.innerHTML=current.value;\n buffer.innerHTML=target0.substr(current.value.length,1);\n buffer.style.color='lime';\n }else{\n buffer.style.color='red';\n number_of_errors=number_of_errors+1;\n if(emmit_wrong==\"1\"){\n current.value=current.value.slice(0,current.value.length-1);\n }\n }\n if(target0==current.value){\n d= new Date();\n end_time=d.getTime();\n var typing_time=end_time-start_time;\n if(emmit_wrong==\"1\"){\n var errors=number_of_errors;\n }else{\n var errors=number_of_errors/2;\n errors=Math.round(errors);\n };\n finished_attempt = new attempt(typing_time,errors);\n $(document).ready(()=>{\n $.post('_save', {time: finished_attempt.time(),time_sec: finished_attempt.time_spent, err: finished_attempt.errors(), text_ref: document.getElementById('text_id').value}, (res)=>{\n $('#myModal').html(res);\n redo();\n })\n });\n }\n }\n}", "async function step5(msgText, report) {\n console.log(\"Steeeeeeep 55555555555\");\n\n //Checks if the buttons has been used\n if (homeDamages.includes(msgText)) {\n //updates the homeDamages field\n report[0].response = humanDamagesReply;\n report = fillReport(\"homeDamages\", msgText, report);\n\n //Oherwise insist on using he buttons\n } else {\n report[0].responseAuxIndicator = 1;\n report[0].responseAux = {\n \"text\": 'Utilice los botones para responder'\n };\n report[0].response = homeDamagesReply;\n }\n\n return report;\n}", "function ontext (text) {\n return text;\n}", "function createPDF(){\n\texec(\"cd reports && pdflatex -interaction=nonstopmode -halt-on-error ../\"+reportfile,function(err,stdout,stderr){\n\t\tif(err){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t});\n}", "function launchReport(script) {\n Launch(script, 'Report', 800, 550);\n}", "function t(text) { return {'macro_name': 'plaintext', 'text': text}; }", "function startWriting(){\nvar input = document.getElementById(\"inputText\").value;\n//var input = prompt(\"Please enter a number: \"); \n//console.log(input);\n//console.log(numberToArrray(input));\n//console.log(addUpToTrillionsText(numberToArrray(input)));\n//console.log(writeOnes(addUpToTrillionsText(numberToArrray(input))));\n//console.log(writeHundreds(writeOnes(addUpToTrillionsText(numberToArrray(input)))));\n//console.log(writeTens(writeHundreds(writeOnes(addUpToTrillionsText(numberToArrray(input))))));\n//console.log(addHundredsWord(writeTens(writeHundreds(writeOnes(addUpToTrillionsText(numberToArrray(input)))))));\n//console.log(textArray_toWords(addHundredsWord(writeTens(writeHundreds(writeOnes(addUpToTrillionsText(numberToArrray(input))))))));\nvar out = textArray_toWords(addHundredsWord(writeTens(writeHundreds(writeOnes(addUpToTrillionsText(numberToArrray(input)))))));\nvar outputPara = document.createElement(\"P\");\noutputPara.innerHTML = addSpacesInNumber(input) + \"<br/> <br/>\" + out;\noutputPara.style.fontSize = \"25px\";\ndocument.getElementById(\"outputArea\").innerHTML=\"\";\ndocument.getElementById(\"outputArea\").appendChild(outputPara);\n}", "function monitorText(event){\r\n\tvar frame = frames['editorText'];\r\n\tvar text = document.getElementById('htmlText');\r\n\r\n\tframe.srcdoc = \"<!DOCTYPE html><html><head><link href='editor/embedded.css' rel='stylesheet' type='text/css'></head><body><pre class='postTextPre'>\" + text.value + \"</pre></body></html>\";\r\n}", "function processText(text) {\n var displayText = \"\";\n var offset = 0;\n var start = -1;\n var positiveRanges = [];\n var negativeRanges = [];\n var marked = [];\n\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n var array = null;\n\n switch (char) {\n case Importance.POSITIVE:\n array = positiveRanges;\n break;\n case Importance.NEGATIVE:\n array = negativeRanges;\n break;\n default:\n displayText += char;\n marked.push(false);\n continue;\n }\n\n var relIndex = i - offset;\n if (start === -1) {\n start = relIndex;\n } else {\n array.push({\n start: start,\n end: relIndex\n });\n start = -1;\n }\n offset++;\n }\n\n vm.game.displayText = displayText;\n vm.game.marked = marked;\n vm.game.ranges = {\n positive: positiveRanges,\n negative: negativeRanges\n };\n }", "_drawSourceText(text) {\n let context = this.getContext();\n context.font = COMPARE_TEXT_FONT;\n\n let yPos = this.cellSize - 25;\n let xPos;\n let textSize;\n for (let i = 0; i < text.length; i++) {\n textSize = context.measureText(text.charAt(i));\n xPos = (this.cellSize * (i + 2)) - Math.round(textSize.width / 2);\n context.fillText(text.charAt(i), xPos, yPos);\n }\n }", "function myExportAllText(myDocumentName){\r\tvar myStory;\r\t//File name for the exported text. Fill in a valid file path on your system.\r\tvar myFileName = \"/c/test.txt\";\r\t//If you want to add a separator line between stories, set myAddSeparator to true.\r\tvar myAddSeparator = true;\r\tvar myNewDocument = app.documents.add();\r\tvar myDocument = app.documents.item(myDocumentName);\r\tvar myTextFrame = myNewDocument.pages.item(0).textFrames.add({geometricBounds:myGetBounds(myNewDocument, myNewDocument.pages.item(0))});\r\tvar myNewStory = myTextFrame.parentStory;\r\tfor(myCounter = 0; myCounter < myDocument.stories.length; myCounter++){\r\t\tmyStory = myDocument.stories.item(myCounter);\r\t\t//Export the story as tagged text.\r\t\tmyStory.exportFile(ExportFormat.taggedText, File(myFileName));\r\t\t//Import (place) the file at the end of the temporary story.\r\t\tmyNewStory.insertionPoints.item(-1).place(File(myFileName));\r\t\t//If the imported text did not end with a return, enter a return\r\t\t//to keep the stories from running together.\r\t\tif(myCounter != myDocument.stories.length -1){\r\t\t\tif(myNewStory.characters.item(-1).contents != \"\\r\"){\r\t\t\t\tmyNewStory.insertionPoints.item(-1).contents = \"\\r\";\r\t\t\t}\r\t\t\tif(myAddSeparator == true){\r\t\t\t\tmyNewStory.insertionPoints.item(-1).contents = \"----------------------------------------\\r\";\r\t\t\t}\r\t\t}\r\t}\r\tmyNewStory.exportFile(ExportFormat.taggedText, File(\"/c/test.txt\"));\r\tmyNewDocument.close(SaveOptions.no);\r}", "function textToView () {\n\n var exhistData = JSON.parse(localStorage.getItem(\"setText\"));\n\n if (exhistData) {\n saveText = exhistData;\n }\n\n textToView();\n}", "function callback(reports) {\n\n let overview = plato.getOverviewReport(reports);\n let {total, average} = overview.summary;\n\n let output = `total\n ----------------------\n eslint: ${total.eslint}\n sloc: ${total.sloc}\n maintainability: ${total.maintainability}\n average\n ----------------------\n eslint: ${average.eslint}\n sloc: ${average.sloc}\n maintainability: ${average.maintainability}`;\n\n console.log(output);\n }", "function showWhatWeTyped() {\n // fill the div with the content of the input field\n theDiv.innerHTML = field.value;\n subtitle.innerHTML = field2.value; \n}", "function main(){\r\n\tif(app.documents.length != 0){\r\n\t\tmyDoc = app.activeDocument;\r\n\t\tif(app.selection.length != 0){\r\n\t\t\tif (myDoc.selection[0].constructor.name != \"Text\") {\r\n\t\t\t\talert (\"This is a \"+app.activeDocument.selection[0].constructor.name+\"\\nPlease select some text\");\r\n\t\t\t\texit(0);\r\n\t\t\t}else{\r\n\t\t\t\t//save measurements units\r\n\t\t\t\tmyOldXUnits = myDoc.viewPreferences.horizontalMeasurementUnits;\r\n\t\t\t\tmyOldYUnits = myDoc.viewPreferences.verticalMeasurementUnits;\r\n\t\t\t\t//set measurements units to points\r\n\t\t\t\tsetRulerUnits(myDoc, MeasurementUnits.points, MeasurementUnits.points);\r\n\t\t\t\t\r\n\t\t\t\t//get data\r\n\t\t\t\tvar myLeading = myDoc.selection[0].leading;\r\n\t\t\t\tif(myLeading == 1635019116){\r\n\t\t\t\t\t//myLeading is set to auto\r\n\t\t\t\t\tmyLeading = (myDoc.selection[0].pointSize/100)*myDoc.selection[0].autoLeading;\r\n\t\t\t\t}\r\n\t\t\t\tmyPageHeight = myDoc.documentPreferences.pageHeight;\r\n\t\t\t\tmyPageWidth = myDoc.documentPreferences.pageWidth;\r\n\t\t\t\t\r\n\t\t\t\t//calculate ideal leading\r\n\t\t\t\tmyLines = doRound(myPageHeight/myLeading, 0);\r\n\t\t\t\t\r\n\t\t\t\tmyIdealLeading = doRound(myPageHeight/myLines,3);\r\n\t\t\t\tShowDialog(myDoc,myIdealLeading);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\talert(\"Nothing selected\\nPlease select some text\");\r\n\t\t}\r\n\t}else{\r\n\t\talert(\"Please open a document and try again.\");\r\n\t}\r\n}", "static set reports(value) {}", "function generate() {\n var skript = $('#skript').val();\n\n var ger_lines = $('#ger').val().split(/\\n/);\n var ger_texts = [];\n for (var i = 0; i < ger_lines.length; i++) {\n if (/\\S/.test(ger_lines[i])) {\n ger_texts.push($.trim(ger_lines[i]));\n }\n }\n\n var eng_uncleaned = $('#eng').val();\n var eng_cleaned = eng_uncleaned.replace(\"Translated with www.DeepL.com/Translator\", \"\");\n var eng_lines = eng_cleaned.split(/\\n/);\n var eng_texts = [];\n for (var i = 0; i < eng_lines.length; i++) {\n if (/\\S/.test(eng_lines[i])) {\n eng_texts.push($.trim(eng_lines[i]));\n }\n }\n\n for (var i = 0; i < eng_lines.length; i++) {\n skript = skript.replace(ger_texts[i], eng_texts[i]);\n }\n\n $(\"#final\").val(skript);\n $(\"#final\").attr(\"disabled\", false);\n $(\"#copy\").attr(\"disabled\", false);\n}", "function printText(text) {\n document.getElementById('messages').value += '- ' + text + '\\n';\n}" ]
[ "0.6413267", "0.5931802", "0.5916326", "0.5870599", "0.57733285", "0.5679199", "0.56426215", "0.563461", "0.55896753", "0.5554627", "0.5548331", "0.5511164", "0.5509642", "0.5492095", "0.54893", "0.5476253", "0.5419184", "0.53936195", "0.5375861", "0.53709", "0.5367341", "0.53647256", "0.5358742", "0.5357027", "0.5353524", "0.534855", "0.5310237", "0.5289579", "0.528754", "0.52672446", "0.52538294", "0.5239193", "0.52105653", "0.5197009", "0.51912004", "0.5188816", "0.5161588", "0.512312", "0.5110798", "0.5107316", "0.5103842", "0.5099632", "0.5099384", "0.5078742", "0.5071095", "0.50693583", "0.5052101", "0.5043112", "0.50351393", "0.50296307", "0.5023194", "0.5019998", "0.50136626", "0.50115067", "0.5007929", "0.5000077", "0.49989933", "0.49960607", "0.49934143", "0.49798176", "0.49677393", "0.4966414", "0.49613154", "0.4960669", "0.4960003", "0.49580714", "0.4956798", "0.49391866", "0.49347603", "0.49280632", "0.49258304", "0.49243125", "0.4915365", "0.4910991", "0.49084213", "0.49083653", "0.4907681", "0.49058726", "0.4896177", "0.4896177", "0.48893434", "0.4888553", "0.48761845", "0.48677707", "0.48625818", "0.4857811", "0.48466977", "0.48396352", "0.4835587", "0.4835533", "0.48315755", "0.481936", "0.48181638", "0.4812945", "0.48064557", "0.48032168", "0.47984365", "0.47981444", "0.47972533", "0.47927776" ]
0.5344016
26
Create a portfolio report of accomplishments.
function portlist() { var port = document.getElementById("portfolio"); var showt = document.getElementById("showtime"); port.removeChild(showt); var div = appendElementChild("div", port, "accomplish"); var dl = appendElementChild("dl", div); // Build accomplishment listing. if ( accomplishMy !== null) { var i = 0; do { var dt = appendElementChild("dt", dl); dt.innerHTML = accomplishMy[i].dt; var dd = appendElementChild("dd", dl); dd.innerHTML = accomplishMy[i].dd; appendBreakChild(2, dl); i++; } while ( i < accomplishMy.length); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SnpCreateAdobePortfolioProject()\r{\r\t/**\r\t The context in which this snippet can run.\r\t @type String\r\t*/\r\tthis.requiredContext = \"\\tExecute against Bridge.\\nBridge must be running and \\n\" \r\t\t+ \"select images for upload to Portfolio\";\r\t$.level = 1; // Debugging level\r}", "function createPortfolio(investments) {\r\n var portfolio = []\r\n for (var i = 0; i < investments.length; i++) {\r\n var crypto_symbol = investments[i][0];\r\n var currency = investments[i][1];\r\n var quantity = investments[i][2];\r\n var cryptoCurr = new CryptoCurrency(crypto_symbol, currency);\r\n portfolio.push(cryptoCurr, quantity);\r\n }\r\n return portfolio;\r\n}", "function PortfolioCreate(portolioObjs) {\n this.projectName = portolioObjs.projectName;\n this.projectURL = portolioObjs.projectURL;\n this.projectDescription = portolioObjs.projectDescription;\n}", "createPortfolio(investments) {\r\n var portfolio = []\r\n for (var i = 0; i < investments.length; i++) {\r\n var crypto_symbol = investments[i][0];\r\n var currency = investments[i][1];\r\n var quantity = investments[i][2];\r\n var cryptoCurr = new CryptoCurrency(crypto_symbol, currency);\r\n portfolio.push(cryptoCurr, quantity);\r\n }\r\n return portfolio;\r\n }", "function buildPortfolio() {\n const queue = [];\n queue.push(publish(Portfolio, {\n pagePath: '/showcase/',\n pageHeading: Portfolio.defaultProps.pageHeading\n }));\n global.DBUSHELL.__pConfig.pages.forEach(props => queue.push(\n publish(Page, {\n ...props,\n pageHeading: props.pageHeading,\n pagePath: `/showcase/${props.slug}/`,\n innerHTML: Page.getHTML(path.join(global.DBUSHELL.__pSrc, `${props.slug}.md`))\n })\n ));\n return Promise.all(queue);\n}", "function createDetailsReport(banDoc, startDate, endDate, cardToPrint) {\r\n\r\n\tvar report = Banana.Report.newReport(\"Details\");\r\n\tvar headerLeft = Banana.document.info(\"Base\",\"HeaderLeft\");\r\n var headerRight = Banana.document.info(\"Base\",\"HeaderRight\");\r\n\r\n\tvar printAssetsLiabilities = false;\r\n\tvar printIncomeExpenses = false;\r\n\tvar printAll = false; \r\n\r\n\tif (cardToPrint === \"Assets / Liabilities\") {\r\n\t\tprintAssetsLiabilities = true;\r\n\t}\r\n\telse if (cardToPrint === \"Income / Expenses\") {\r\n\t\tprintIncomeExpenses = true;\r\n\t}\r\n\telse if (cardToPrint === \"All\") {\r\n\t\tprintAll = true;\r\n\t}\r\n\r\n\r\n\tif (printAssetsLiabilities || printAll) {\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// ASSETS \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Assets with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create the table\r\n\t\tvar assetsTable = report.addTable(\"assetsTable\");\r\n\r\n\t\t//Accounts assets data\r\n\t\tvar assetsAccountForm = [];\r\n\t\tassetsAccountForm = getAccountsAssets(banDoc, assetsAccountForm);\r\n\r\n\t\t//Transactions assets data\r\n\t\tvar assetsTransactionForm = [];\r\n\t\tfor (var i = 0; i < assetsAccountForm.length; i++) {\r\n\t\t\tif (assetsAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, assetsAccountForm[i][\"Account\"], startDate, endDate, assetsTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS ASSETS DETAILS\r\n\t\tfor (var i = 0; i < assetsAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (assetsAccountForm[i][\"Balance\"]) {\r\n\t\t\r\n\t\t\t\t//Account\r\n\t\t\t\tif (assetsAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = assetsTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(assetsAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(assetsAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (assetsAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = assetsTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(assetsAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(assetsAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\"\", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS ASSETS DETAILS\r\n\t\t\t\tfor (var j = 0; j < assetsTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (assetsAccountForm[i][\"Account\"] && assetsTransactionForm[j][\"JAccount\"] === assetsAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttableRow = assetsTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(assetsTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(assetsTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\tif (assetsTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (assetsTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(assetsTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treport.addPageBreak();\r\n\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// LIABILITIES \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Liabilities with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create the table\r\n\t\tvar liabilitiesTable = report.addTable(\"liabilitiesTable\");\r\n\r\n\t\t//Liabilities assets data\r\n\t\tvar liabilitiesAccountForm = [];\r\n\t\tliabilitiesAccountForm = getAccountsLiabilites(banDoc, liabilitiesAccountForm);\r\n\r\n\t\t//Transactions liabilities data\r\n\t\tvar liabilitiesTransactionForm = [];\r\n\t\tfor (var i = 0; i < liabilitiesAccountForm.length; i++) {\r\n\t\t\tif (liabilitiesAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, liabilitiesAccountForm[i][\"Account\"], startDate, endDate, liabilitiesTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS LIABILITIES DETAILS\r\n\t\tfor (var i = 0; i < liabilitiesAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (liabilitiesAccountForm[i][\"Balance\"]) {\r\n\t\t\r\n\t\t\t\t//Account\r\n\t\t\t\tif (liabilitiesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = liabilitiesTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(liabilitiesAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(liabilitiesAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (liabilitiesAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = liabilitiesTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(liabilitiesAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(liabilitiesAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\"\", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS LIABILITIES DETAILS\r\n\t\t\t\tfor (var j = 0; j < liabilitiesTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (liabilitiesAccountForm[i][\"Account\"] && liabilitiesTransactionForm[j][\"JAccount\"] === liabilitiesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttableRow = liabilitiesTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(liabilitiesTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(liabilitiesTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\tif (liabilitiesTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (liabilitiesTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(liabilitiesTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tif (printIncomeExpenses || printAll) {\r\n\r\n\t\tif (printAll) {\r\n\t\t\treport.addPageBreak();\r\n\t\t}\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// INCOME \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Income with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create the table\r\n\t\tvar incomeTable = report.addTable(\"incomeTable\");\r\n\r\n\t\t//Accounts Income data\r\n\t\tvar incomeAccountForm = [];\r\n\t\tincomeAccountForm = getAccountsIncome(banDoc, incomeAccountForm);\r\n\r\n\t\t//Transactions Income data\r\n\t\tvar incomeTransactionForm = [];\r\n\t\tfor (var i = 0; i < incomeAccountForm.length; i++) {\r\n\t\t\tif (incomeAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, incomeAccountForm[i][\"Account\"], startDate, endDate, incomeTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS INCOME DETAILS\r\n\t\tfor (var i = 0; i < incomeAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (incomeAccountForm[i][\"Balance\"]) {\r\n\t\t\r\n\t\t\t\t//Account\r\n\t\t\t\tif (incomeAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = incomeTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(incomeAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(incomeAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (incomeAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = incomeTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(incomeAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(incomeAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\"\", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS INCOME DETAILS\r\n\t\t\t\tfor (var j = 0; j < incomeTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (incomeAccountForm[i][\"Account\"] && incomeTransactionForm[j][\"JAccount\"] === incomeAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttableRow = incomeTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(incomeTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(incomeTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\tif (incomeTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (incomeTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(incomeTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treport.addPageBreak();\r\n\r\n\r\n\t\t//-----------------------------------------------------------------------------//\r\n\t\t// EXPENSES \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t //\r\n\t\t//-----------------------------------------------------------------------------//\r\n\r\n\t\t//Title\r\n\t\treport.addParagraph(headerLeft, \"heading2\");\r\n\t\treport.addParagraph(\"Expenses with transactions details\", \"heading1\");\r\n\t\treport.addParagraph(Banana.Converter.toLocaleDateFormat(startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(endDate), \"heading3\");\r\n\t\treport.addParagraph(\" \");\r\n\t\treport.addParagraph(\" \");\r\n\r\n\t\t//Create table\r\n\t\tvar expensesTable = report.addTable(\"expensesTable\");\r\n\r\n\t\t//Accounts Expenses data\r\n\t\tvar expensesAccountForm = [];\r\n\t\texpensesAccountForm = getAccountsExpenses(banDoc, expensesAccountForm);\r\n\r\n\t\t//Transactions Expenses data\r\n\t\tvar expensesTransactionForm = [];\r\n\t\tfor (var i = 0; i < expensesAccountForm.length; i++) {\r\n\t\t\tif (expensesAccountForm[i][\"Account\"]) {\r\n\t\t\t\tgetTransactions(banDoc, expensesAccountForm[i][\"Account\"], startDate, endDate, expensesTransactionForm);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//ACCOUNTS EXPENSES DETAILS\r\n\t\tfor (var i = 0; i < expensesAccountForm.length; i++) {\r\n\r\n\t\t\t//We take only accounts with a balance value\r\n\t\t\tif (expensesAccountForm[i][\"Balance\"]) {\r\n\r\n\t\t\t\t//Account\r\n\t\t\t\tif (expensesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t \ttableRow = expensesTable.addRow();\r\n\t\t\t\t \ttableRow.addCell(expensesAccountForm[i][\"Account\"], \"\", 1),\r\n\t\t\t\t \ttableRow.addCell(expensesAccountForm[i][\"Description\"], \"\", 3);\r\n\t\t\t\t \ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t \ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesAccountForm[i][\"Balance\"]), \"valueAmount1\", 1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Group\r\n\t\t\t \tif (expensesAccountForm[i][\"Group\"]) {\r\n\t\t\t \t\ttableRow = expensesTable.addRow();\r\n\t\t\t \t\ttableRow.addCell(expensesAccountForm[i][\"Group\"], \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(expensesAccountForm[i][\"Description\"], \"valueAmountText\", 3);\r\n\t\t\t \t\ttableRow.addCell(\" \", \"valueAmountText\", 1);\r\n\t\t\t \t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesAccountForm[i][\"Balance\"]), \"valueTotal\", 1);\r\n\t\t\t \t}\r\n\r\n\t\t\t\t//TRANSACTIONS EXPENSES DETAILS\r\n\t\t\t\tfor (var j = 0; j < expensesTransactionForm.length; j++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//We want only transactions of the current account \r\n\t\t\t\t\tif (expensesAccountForm[i][\"Account\"] && expensesTransactionForm[j][\"JAccount\"] === expensesAccountForm[i][\"Account\"]) {\r\n\t\t\t\t\t\ttableRow = expensesTable.addRow();\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(\" \", \"\", 1);\r\n\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleDateFormat(expensesTransactionForm[j][\"JDate\"]), \"horizontalLine italic\", 1); \r\n\t\t\t\t\t\ttableRow.addCell(expensesTransactionForm[j][\"JDescription\"], \"horizontalLine italic\", 1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (expensesTransactionForm[j][\"JDebitAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesTransactionForm[j][\"JDebitAmount\"]), \"horizontalLine italic right\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (expensesTransactionForm[j][\"JCreditAmount\"]) {\r\n\t\t\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(expensesTransactionForm[j][\"JCreditAmount\"]), \"horizontalLine italic right\", 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttableRow.addCell(\"\",\"horizontalLine italic\",1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//Add a footer to the report\r\n\taddFooter(banDoc, report);\r\n\r\n\treturn report;\r\n}", "function generateReport(options, successCallback) {\n Database.getFullPlan(options.plan, function success(plan) {\n // Initialise data objects\n var resultsMatrix = {};\n var calc = {total: 0, pass: 0, fail: 0, pending: 0};\n Database.getAllWhere(\"results\", \"plan\", options.plan, function(results) {\n // Organise results so they can be accessed by page and criterion ID\n results.forEach(function(result) {\n resultsMatrix[result.page] = resultsMatrix[result.page] || {};\n resultsMatrix[result.page][result.criterion] = result;\n });\n // Generate the report and pass it back as a string\n successCallback(\"<h1>Web Accessibility Report (\" + plan.details.name + \")</h1>\" +\n \"<h4>Generated: \" + Date() + \"</h4>\" +\n \"<hr>\" +\n // Go through each pages group\n plan.pages.map(function(pages_group) {\n return \"<h2>Web page group: \" + pages_group.name + \"</h2>\" +\n \"<ul>\" +\n (pages_group.items.length ?\n // List all pages in this group\n pages_group.items.map(function(page) {\n return \"<li>\" + page.title + \" (\" + page.url + \")</li>\";\n }).join(\"\") +\n \"</ul>\" +\n // Go through each criteria group\n plan.criteria.map(function(criteria_group) {\n return \"<h3>Criteria set: \" + criteria_group.name + \"</h3>\" +\n \"<ul>\" +\n (criteria_group.items.length ?\n // Go through each criterion in this group\n criteria_group.items.map(function(criterion) {\n return \"<li>\" +\n // Include criterion details (where they exist and are requested in the options)\n \"<h4>\" + criterion.name + \"</h4>\" +\n \"<p>\" + criterion.description.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n (options.criteria_details ?\n \"<h5>Why is it important?</h5>\" +\n \"<p>\" + criterion.reasoning.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n \"<h5>Guidance</h5>\" +\n \"<p>\" + criterion.guidance.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\" +\n \"<h5>Documentation</h5>\" +\n \"<p>\" + criterion.links.map(function(link) { return \"<a href='\" + link + \"' target='_blank'>\" + link + \"</a>\"; }).join(\"<br>\") + \"</p>\"\n : \"\") +\n \"<h4>Results</h4>\" +\n // Work out result totals for all pages in this group\n pages_group.items.map(function(page, index) {\n if (index == 0) calc.total = calc.pass = calc.fail = calc.pending = 0;\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n if (options.statuses.indexOf(result.status) != -1) {\n calc.total++;\n calc[result.status]++;\n }\n return \"\";\n }).join(\"\") +\n // Calculate percentages from result totals (for status requested in the options)\n options.statuses.map(function(status) {\n return status.charAt(0).toUpperCase() + status.slice(1) + \": \" + calc[status] + \"/\" + calc.total + \" (\" + (calc.total > 0 ? (Math.round(calc[status] / calc.total * 100) + \"%\") : \"n/a\") + \")<br>\";\n }).join(\"\") +\n (options.level == \"individual\" ?\n // Include information about each individual test on each page (if requested in the options)\n \"<br><ul>\" +\n pages_group.items.map(function(page) {\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n // Only include this test result is it has one of the statuses requested\n return (options.statuses.indexOf(result.status) != -1) ?\n \"<li>\" +\n page.title + \" (\" + page.url + \") - \" + result.status +\n (options.results_annotations && result.annotation ?\n \"<p>\" + result.annotation.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\n/g, \"<br>\") + \"</p>\"\n : \"\") +\n (options.results_images && result.image ?\n \"<p><img src='\" + result.image + \"'></p>\"\n : \"\") +\n \"</li>\"\n : \"\";\n }).join(\"\") +\n \"</ul>\"\n : \"\") +\n \"</li>\";\n }).join(\"\")\n : \"<li><em>No criteria</em></li>\") +\n \"</ul>\" +\n \"\";\n }).join(\"\") +\n (options.tables ?\n // Create a table overview of tests on all the pages in this group\n \"<table border='1' cellspacing='2' cellpadding='2'>\" +\n \"<tr>\" +\n \"<th></th>\" +\n // List all pages on the x-axis\n pages_group.items.map(function(page) {\n return \"<th>\" + page.title + \"</th>\";\n }).join(\"\") +\n \"</tr>\" +\n plan.criteria.map(function(criteria_group) {\n // Include criteria group names\n return \"<tr><td><strong>\" + criteria_group.name + \"</strong></td></tr>\" +\n (criteria_group.items.length ?\n // Go through each criterion in the group\n criteria_group.items.map(function(criterion) {\n return \"<tr>\" +\n \"<td>\" + criterion.name + \"</td>\" +\n pages_group.items.map(function(page) {\n var result = (resultsMatrix[page.id] && resultsMatrix[page.id][criterion.id]) || {status: \"pending\"};\n return \"<td>\" +\n (options.statuses.indexOf(result.status) != -1 ?\n // Include tick icon for passing results\n (result.status == \"pass\" ? \"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMZJREFUOE/FjjEKwkAQRWezdiFJZ29toWfwEoJ6Bw/hRYR4Jru0whYO2AU06B+Z1Y1F1gTEB0N2d/77hP5CwYWV0Ws/REw4KWV6l+ScW8OmJKa7DEr2uoqTcdaSMTfLdqPrbiCKfPiQ17omco2T0FivLczZWAgtGb/+lqumEnmHhcNM9flJVBZU9oFXyVeygIItlk0QdHib4RuXPRCWCNWBcA3O3bIHJQuEL4Ho5ZVG4iA8h3QaJHsgTSAfB8melNORHn8N0QMwhI66An4NAgAAAABJRU5ErkJggg=='> \" : \"\") +\n // Include cross icon for failing results\n (result.status == \"fail\" ? \"<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAKpJREFUOE+lU0EKgCAQ3CD7pPSK+kDQrd7qJehgkO2sJFHqoR0YCHdmWlclIBwHubYdXNctm7WNLGaAGjTQwiMI3kcz0ckMzph1n+dPCNZQEw20CGEvzGMy30TINKUQfD/MNxEyErf0LkSyYev7BsyYI9lLVYExizBfkx/UWiyTtc8tCl5DKhPmzJAFckyllkGu1Y5ZF6DagmqI6mNUXyT1VVY/JuD/cya6APHAd2wGj7MPAAAAAElFTkSuQmCC'> \" : \"\") +\n result.status.charAt(0).toUpperCase() + result.status.slice(1)\n : \"\") +\n \"</td>\";\n }).join(\"\") +\n \"</tr>\";\n }).join(\"\")\n : \"<tr><td colspan='\" + (pages_group.items.length + 1) + \"'><em>No criteria</em></td></tr>\")\n }).join(\"\") +\n \"</table>\"\n : \"\")\n : \"<li><em>No pages</em></li></ul>\");\n }).join(\"\") +\n \"\" +\n \"\");\n });\n });\n}", "function generateUserProjectPortfolio(req, _, callback){\n\n // pre-populate the ESB_PATH for all these services\n req.params.querystring.esb_path = \"RP_LandingPage\";\n\n var fakeContext = {\n done: function(err, data){\n console.log(\"error\", err);\n callback(err, null, data);\n },\n succeed: function(url){\n console.log(\"URL\", url);\n callback(null, null, url);\n }\n };\n\n // auto generate a filename based on the username\n function makeFilename(netid){\n var date = dateFormat(Date.now(), \"isoDateTime\");\n return \"ResearchPortal_\" + (netid || \"report\") + \".\" + date + \".xlsx\";\n }\n\n app.getConfig(function(err, config){\n if (err){\n callback(err);\n } else {\n\n //@TODO: This waits for the 3 requests to respond.\n var counter = 0;\n var reports = {\n sponsored: {},\n non_sponsored: {},\n pending: {},\n protocols: {}\n }\n // delegate for updateing the responseses from services\n var update = function(key, value){\n reports[key] = value;\n counter++;\n if (counter >= 4){\n submit();\n }\n }\n // This is called when the 3 services have returned data.\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 }\n\n // fetch data\n _getProtocols(req, config, function(err, response, data){\n if (err){\n callback(err, null, null);\n } else {\n var rows = data.iacuc.concat(data.irb)\n var headers = [\"protocol_id\", \"protocol_name\", \"expiration_date\", \"protocol_status\", \"initial_approval_date\", \"last_approval_date\"]\n var report = {\n \"rows\": rows,\n \"headers\": headers\n }\n update('protocols', report);\n }\n });\n _getPendingProposals(req, config, function(err, response, data){\n if (err){\n callback(err, null, null);\n } else {\n update('pending', data);\n }\n });\n _getSponsoredProjects(req, config, function(err, response, data){\n if (err){\n callback(err, null, null);\n } else {\n update('sponsored', data);\n }\n });\n _getNonSponsoredProjects(req, config, function(err, response, data){\n if (err){\n callback(err, null, null);\n } else {\n update('non_sponsored', data);\n }\n });\n\n }\n })\n}", "function createPortfolio() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n\n // aggregate positions into accounts\n var accounts = [];\n var positionData = getRowsData_(ss.getSheetByName('positions'));\n for (const r of positionData) {\n if (r.value <= 0) {\n continue; // not very interesting!\n }\n var a = accounts.find(element => element.name === r.account);\n if (a === undefined) {\n // create new account\n a = {\n name: r.account,\n brokerage: r.brokerage,\n type: r.type, \n positions: []\n };\n accounts.push(a);\n }\n\n // add new position\n a.positions.push({\n symbol: r.symbol,\n quantity: r.quantity,\n value: r.value,\n hold: r.hold,\n description: r.description\n });\n }\n\n // cleanup security data\n var securityData = getRowsData_(ss.getSheetByName('securities'));\n securityData = securityData.filter(x => x.hasOwnProperty(\"symbol\"));\n for(const s of securityData) {\n if (s.symbol === s.symbolmap) {\n delete s.symbolmap; // no need for both if they match\n delete s.quantitymap;\n }\n }\n\n // grab rebalance parameters\n var params = getRowsData_(ss.getSheetByName('parameters'))[0];\n\n // create portfolio object\n var portfolio = {};\n portfolio[\"accounts\"] = accounts;\n portfolio[\"securities\"] = securityData;\n portfolio[\"rebalanceparameters\"] = params;\n return portfolio;\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 showPortfolio() {\n document.getElementById('portfolio').innerHTML = \"\";\n clearErrorMsg();\n showLinks(['logoutLink', 'transferLink', 'tradeLink']);\n showView('portfolioView');\n\n sendData({\n cmd: \"dat\",\n tok: token\n }, drawPortfolio);\n}", "function generate_all_reports()\n{\n report_ToAnswer_emails();\n report_FollowUp_emails();\n report_Work_FollowUp_emails();\n}", "function currentPortfolio(currentReport) {\n \n let msg = `${CONSOLE_INDEX++}) today (${moment().format(\"YYYY-MM-DD\")}) you have: \n USD ${parseInt(currentReport.btc_usdt * currentReport.value_btc, 10)}. \n BTC ${currentReport.value_btc}.\n BTC_USDT ${currentReport.btc_usdt}.\n 24H_CHANGE ${currentReport.value_btc_change_24h}.\n 7D_CHANGE ${currentReport.value_btc_change_7d}.\n \n`;\n for(let order of currentReport.orders) {\n msg += `${order.date} ${order.time} - ${order.symbol} - ${order.side} - ${order.filled} * ${order.price} = ${parseFloat((order.filled*order.price).toFixed(8))}\\n`;\n }\nreturn msg + '\\n';\n\n}", "function rebalancePortfolio(e) {\n // clear old recommendation\n deleteRebalanceSheets();\n \n // call rebalance service to get report object\n var portfolio = createPortfolio();\n var rebalanceService = portfolio.rebalanceparameters.url;\n var options = {\n 'method' : 'post',\n 'contentType': 'application/json',\n 'payload' : JSON.stringify(portfolio)\n };\n var response = UrlFetchApp.fetch(rebalanceService, options);\n var responseJson = response.getContentText();\n var report = JSON.parse(responseJson);\n\n // add all sheets\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n Object.keys(report).map(k => createTableSheet(ss, report, k));\n}", "function Portfolio() {\n /**\n * Stocks included in the portfolio.\n *\n * @property stocks\n * @type Object\n */\n this.stocks = {}\n\n /**\n * Total market value for the stock.\n *\n * @property value\n * @type Float\n */\n this.value = 0\n\n /**\n * Risk for the entire portfolio.\n *\n * @property risk\n * @type Float\n */\n this.risk = 0\n\n /**\n * Cache of portfolio securities.\n *\n * @property cache\n * @type String\n */\n this.cache = null\n}", "function createReports() {\r\n var RawDataReport = AdWordsApp.report(\"SELECT Domain, Clicks \" + \"FROM AUTOMATIC_PLACEMENTS_PERFORMANCE_REPORT \" + \"WHERE Clicks > 0 \" + \"AND Conversions < 1 \" + \"DURING LAST_7_DAYS\");\r\n RawDataReport.exportToSheet(RawDataReportSheet);\r\n}", "function portfolio(response){\n console.log(\"Request for handler for portfolio was called.\")\n response.writeHead(200, {\"Content-type\": \"text/plain\"});\n response.write(\"These are some of our portfolio projects\");\n response.end();\n }", "function createTeamReport(report) {\n if(!report.getSheetByName('Team Details')) {\n report.insertSheet('Team Details', 2);\n } else {\n getTeamDetails(report).clear();\n }\n \n getTeamDetails(report).getRange('A:A').getCell(1, 1).setValue('Projects').setFontWeight('bold');\n getTeamDetails(report).getRange('B:B').getCell(1, 1).setValue('Total Members').setFontWeight('bold');\n getTeamDetails(report).getRange('C:C').getCell(1, 1).setValue('Total Percentage').setFontWeight('bold');\n var values = getTeamValues(report);\n\n var nR = 1, nC;\n for(i in values) {\n if(values[i].category != 'TimeOff' && values[i].category != 'New Project') {\n nR++;\n getTeamDetails(report).getRange('A:A').getCell(nR, 1).setValue(values[i].project);\n getTeamDetails(report).getRange('B:B').getCell(nR, 1).setValue(values[i].total);\n getTeamDetails(report).getRange('C:C').getCell(nR, 1).setValue(values[i].percentage);\n for(var v = 0; v < values[i].total; v++) {\n nC = getNextColumn(getTeamDetails(report), nR);\n if(values[i].details[v].fullName) {\n getTeamDetails(report).getRange(nR, nC).setValue(values[i].details[v].fullName);\n } else {\n getTeamDetails(report).getRange(nR, nC).setValue(values[i].details[v].employee);\n } \n var nCC = nC + 1;\n getTeamDetails(report).getRange(nR, nCC).setValue(values[i].details[v].time);\n }\n } else if(values[i].category != 'TimeOff') {\n nR++;\n getTeamDetails(report).getRange('A:A').getCell(nR, 1).setValue(values[i].project).setFontColor('green');\n getTeamDetails(report).getRange('B:B').getCell(nR, 1).setValue(values[i].total).setFontColor('green');\n getTeamDetails(report).getRange('C:C').getCell(nR, 1).setValue(values[i].percentage).setFontColor('green');\n for(var v = 0; v < values[i].total; v++) {\n nC = getNextColumn(getTeamDetails(report), nR);\n if(values[i].details[v].fullName) {\n getTeamDetails(report).getRange(nR, nC).setValue(values[i].details[v].fullName).setFontColor('green');\n } else {\n getTeamDetails(report).getRange(nR, nC).setValue(values[i].details[v].employee).setFontColor('green');\n } \n var nCC = nC + 1;\n getTeamDetails(report).getRange(nR, nCC).setValue(values[i].details[v].time).setFontColor('green');\n }\n } else {\n nR++;\n getTeamDetails(report).getRange('A:A').getCell(nR, 1).setValue(values[i].project).setFontColor('blue');\n getTeamDetails(report).getRange('B:B').getCell(nR, 1).setValue(values[i].total).setFontColor('blue');\n getTeamDetails(report).getRange('C:C').getCell(nR, 1).setValue(values[i].percentage).setFontColor('blue');\n for(var v = 0; v < values[i].total; v++) {\n nC = getNextColumn(getTeamDetails(report), nR);\n if(values[i].details[v].fullName) {\n getTeamDetails(report).getRange(nR, nC).setValue(values[i].details[v].fullName).setFontColor('blue');\n } else {\n getTeamDetails(report).getRange(nR, nC).setValue(values[i].details[v].employee).setFontColor('blue');\n } \n var nCC = nC + 1;\n getTeamDetails(report).getRange(nR, nCC).setValue(values[i].details[v].time).setFontColor('blue');\n }\n }\n }\n \n createEnterpriseReport(report);\n}", "function GenerateBudgetSheets() {\r\n GenerateActualMatrix();\r\n GenerateCharts();\r\n GenerateChangeMatrix();\r\n}", "function prepareReport(spreadsheet,report) {\n\n spreadsheet.addEditor(\"alan@webfordoctors.com\");\n report.exportToSheet(spreadsheet.getActiveSheet()); \n var sheet = spreadsheet.getActiveSheet();\n Logger.log(sheet.getSheetName());\n //increase numColumns if you want to run reports with more than 9 category headlines\n var numColumns = 9;\n for (var i = 1; i < numColumns; i++) {\n \n sheet.autoResizeColumn(i);\n \n }\n \n \n //sheet.insertColumnBefore(1); \n //if you want to add some space/margin to the left hand side.\n sheet.insertRows(1);\n \n //checks the report type and if this is a campaign report \n //it resets certain headers to make it more readable.\n if (sheet.getSheetName() === \"campaign\") {\n \n sheet.getRange(2, 2).setValue(\"Budget\");\n sheet.getRange(2, 8).setValue(\"Phone Calls\");\n \n }\n \n \n /*here we could check to see if its a call details report\n \n \n if (sheet.getSheetName() === \"campaign\") \n \n \n \n and then filter out all calls except for last month's */\n \n \n \n //this gets the name of the current month and the previous month for later use in a comparison statement\n //to later insert in the spreadsheet and email as needed.\n var date = new Date();\n var month = date.getMonth();\n var day = date.getDay();\n var year = date.getYear();\n var months = [\"january\",\"february\",\"march\",\"april\",\"may\",\"june\",\"july\",\"august\",\"september\",\"october\",\"november\",\"december\"];\n for (var i = 1; i < 13; i++) {\n \n if (month === i && i === 1) {\n \n month = months[0];\n \n }\n \n else if (month === i) {\n \n month = months[i-1];\n var othermonth = months[i-2];\n \n }\n }\n \n //you can customize the comparison string here:\n var dateRange = \"showing data from \" + month + \"as compared to \" + othermonth + \" \";\n //put this message in the top left cell\n sheet.getRange(1,1).setValue(dateRange);\n \n //prints summary to last row and sets number formats\n getTotals(2);\n getTotals(3);\n getTotals(4);\n getTotals(8);\n getTotals(9);\n getCtr(5);\n getAverageCPC();\n getAveragePos();\n \n return dateRange;\n }", "function projectPendInvReport() {\n window.open(\n 'Report?' +\n 'id=' +\n projectID +\n '&type=Project PendInv Report ' +\n '~' +\n $('#pendingInvoiceSelector2').val()\n );\n}", "async function createInitialReports() {\n try {\n console.log('Trying to create reports...');\n\n const reportOne = await createReport({\n title: 'ET spotted outside of Area 51',\n location: 'Roswell, NM',\n description: 'I saw what can only be described as a very slender, very tall humanoid walking behind the fences at...',\n password: '51isTheKey'\n });\n\n const reportTwo = await createReport({\n title: 'Fairy lights in my backyard',\n location: 'Utica, NY',\n description: 'I saw floating lights in my backyard... on inspection they weren\\'t fireflies...',\n password: 'iLoveF4ri3s'\n });\n\n const reportThree = await createReport({\n title: 'Corner of metal object sticking up out of the ground in the woods...',\n location: 'Haven, Maine',\n description: 'Late last night and the night before\\n Tommyknockers, Tommyknockers\\n knocking at the door',\n password: 'kingwasright'\n })\n\n console.log('Success creating reports!');\n\n return [reportOne, reportTwo, reportThree]\n } catch (error) {\n console.error('Error while creating reports!');\n throw (error);\n }\n}", "function printProjectData(name, type, hourlyRate, dueDate) {\n var projectRowEl = $('<tr>');\n\n var projectNameTdEl = $('<td>').addClass('p-2').text(name);\n\n var projectTypeTdEl = $('<td>').addClass('p-2').text(type);\n\n var rateTdEl = $('<td>').addClass('p-2').text(hourlyRate);\n\n var dueDateTdEl = $('<td>').addClass('p-2').text(dueDate);\n\n var daysToDate = moment(dueDate, 'MM/DD').diff(moment(), 'days');\n var daysLeftTdEl = $('<td>').addClass('p-2').text(daysToDate);\n\n var totalEarnings = calculateTotalEarnings(hourlyRate, daysToDate);\n\n // You can also chain methods onto new lines to keep code clean\n var totalTdEl = $('<td>')\n .addClass('p-2')\n .text('$' + totalEarnings);\n\n var deleteProjectBtn = $('<td>')\n .addClass('p-2 delete-project-btn text-center')\n .text('X');\n\n // By listing each `<td>` variable as an argument, each one will be appended in that order\n projectRowEl.append(\n projectNameTdEl,\n projectTypeTdEl,\n rateTdEl,\n dueDateTdEl,\n daysLeftTdEl,\n totalTdEl,\n deleteProjectBtn\n );\n\n projectDisplayEl.append(projectRowEl);\n\n projectModalEl.modal('hide');\n}", "function createContent(profolio){\n\n var content = [];\n\n // MedProfolio image\n content.push({\n image: 'medprofolioLogo',\n width: 500\n });\n\n // Name of user\n content.push({\n text: profolio.name,\n margin: [0,30,0,0],\n alignment: 'center',\n fontSize: 30,\n bold: true\n });\n\n // Certifications and licenses\n content.push({\n text: 'Certifications and Licenses',\n margin: [0,50,0,0],\n alignment: 'center',\n fontSize: 22\n });\n\n // Generated on [M/D/YYYY]\n var today = new Date();\n var d = today.getDate();\n var m = today.getMonth()+1;\n var yyyy = today.getFullYear();\n today = m+'/'+d+'/'+yyyy;\n content.push({\n text: '[Generated on ' + today + ']',\n alignment: 'center',\n fontSize: 18\n });\n\n // Table of Contents that lists all of the certifications\n\n console.log(profolio.certs.length);\n var tocBody = [];\n tocBody.push([{text: 'Title', style: 'tableHeader'}, { text: 'Expiration', style: 'tableHeader'}]);\n for(var i = 0; i < profolio.certs.length; i++){\n //console.log(profolio.certs[i].attributes.title);\n //console.log(profolio.certs[i].attributes.expiration);\n var expireString = \"\";\n if(profolio.certs[i].attributes.expiration) {\n var expire = new Date(profolio.certs[i].attributes.expiration);\n expireString = (expire.getMonth() +1) + '/' + expire.getDate() + '/' + expire.getFullYear();\n }\n tocBody.push([profolio.certs[i].attributes.title, expireString]);\n }\n\n var t = {\n align: 'center',\n margin: [0,20,0,0], // [left, top, right, bottom]\n table: {\n widths: [400, 100],\n headerRows: 1,\n body: tocBody\n }\n };\n\n content.push(t);\n\n // add each certificate\n for(var i = 0; i < profolio.certs.length; i++){\n\n // Title of Certificate\n content.push({\n text: profolio.certs[i].attributes.title,\n alignment: 'center',\n fontSize: 30,\n bold: true,\n underline: true,\n pageBreak: 'before',\n margin: [0,20,0,40] // [left, top, right, bottom]\n });\n\n // Image of Certificate\n\n if(profolio.certs[i].imageData) {\n content.push({\n image: profolio.certs[i].imageData,\n width: 400,\n alignment: 'center'\n });\n } else {\n content.push({\n text: 'No picture of ' + profolio.certs[i].attributes.title + ' was uploaded',\n alignment: 'center',\n fontSize: 20,\n italic: true\n });\n }\n\n // Issued, Expires, Notes\n var issuedString = \"\";\n if(profolio.certs[i].attributes.issued) {\n var issued = new Date(profolio.certs[i].attributes.issued);\n issuedString = (issued.getMonth() + 1) + '/' + issued.getDate() + '/' + issued.getFullYear();\n }\n\n var expireString = \"\";\n if(profolio.certs[i].attributes.expiration) {\n var expire = new Date(profolio.certs[i].attributes.expiration);\n expireString = (expire.getMonth() + 1) + '/' + expire.getDate() + '/' + expire.getFullYear();\n }\n\n content.push({\n margin: [20,20,20,0],\n table: {\n widths: [40,'auto'],\n body: [\n [ { text: 'Issued', bold: true}, issuedString ],\n [ { text: 'Expires:', bold: true}, expireString],\n [ { text: 'Notes:', bold: true}, profolio.certs[i].attributes.notes]\n ]\n },\n layout: 'noBorders'\n });\n }\n\n console.log('content created');\n return content;\n }", "exportReport() {\n this.TestReportService.download(this.project.id, this.report.id);\n }", "function onClickPortfolio(){\n if(compname === \"\"){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operation Success',\n description:\n `${compname} has been added to the portfolio. `,\n });\n }\n }", "async function mainExport(report, project) {\n await Report.find({ _id: report._id })\n .populate(\"photos\")\n .exec(function (err, report) {\n\n //creating the outputs for the various arrays inside the report\n let purpose = report[0].purposeOfReview\n .map(note => `<li style=\"font-size:18px; margin-top:5px;\">${note}</li>`)\n .join(\"\");\n let deficiencies = report[0].deficienciesNoted\n .map(note => `<li style=\"font-size:18px; margin-top:5px;\">${note}</li>`)\n .join(\"\");\n let miscNotes = report[0].miscellaneousNotes\n .map(note => `<li style=\"font-size:18px; margin-top:5px;\">${note}</li>`)\n .join(\"\");\n let date = report[0].date;\n let time = report[0].time;\n let weather = report[0].weather;\n let reportNumber = report[0].reportNumber;\n let contractors = project.contractors;\n let projectNumber = project.projectNumber;\n let projectName = project.projectName;\n let location = project.location;\n\n let workCompleted = report[0].workCompleted\n .map(\n section =>\n `<li><h3 style='margin-bottom:5px;font-size:20px; text-transform: capitalize;'>${\n section.title\n }</h3><ul style='margin-top: 0; padding-left: 20px;'>${section.notes\n .map(\n note =>\n `<li style=\"font-size: 18px; font-weight:normal\">${note}</li>`\n )\n .join(\"\")}</ul></li>`\n )\n .join(\"\");\n\n const emailBody = `\n <section style='font-family: Arial, Helvetica, sans-serif; color:#202020'>\n <h1 style='margin-bottom: 0;font-size:25px;'>\n Site Visit Report ${reportNumber}\n </h1>\n <div>\n <table>\n <tbody>\n <tr>\n <td style='font-weight: 600; font-size:18px; text-align: right;'>Project:</td>\n <td style='font-size:18px;'>${projectName}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Location:</td>\n <td style='font-size:18px;'>${location}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Date:</td>\n <td style='font-size:18px;'>${date}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Time:</td>\n <td style='font-size:18px;'>${time}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Weather:</td>\n <td style='font-size:18px;'>${weather}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>File Number:</td>\n <td style='font-size:18px;'>${projectNumber}</td>\n </tr>\n <tr>\n <td style='font-weight: 600;font-size:18px; text-align: right;'>Contractors:</td>\n <td style='font-size:18px;'>${contractors.join(\", \") ||\n \"Dale Shlass\"}</td>\n </tr>\n </tbody>\n </table>\n\n <section>\n <h2 style='font-size:22px; margin-bottom: 0; text-decoration: underline'>Purpose of Review</h2>\n <ul style='margin-top: 0; padding-left: 20px;'>\n ${purpose ||\n '<li style=\"font-size:18px; margin-top:5px;\">None noted.</li>'}\n </ul>\n </section>\n\n <section>\n <h2 style='font-size:22px; margin-bottom: 0; text-decoration: underline'>Deficiencies Noted</h2>\n <ul style='margin-top: 0; padding-left: 20px;'>\n ${deficiencies ||\n '<li style=\"font-size:18px; margin-top: 5px;\">None noted.</li>'}\n </ul>\n </section>\n\n <section>\n <h2 style=' font-size:22px; margin-bottom: 0; text-decoration: underline'>\n Work Underway/Completed\n </h2>\n ${\n workCompleted\n ? `<ol style='font-weight: 600; font-size: 20px;'>${workCompleted}<ol>`\n : '<ul style=\"margin-top: 0; padding-left: 20px;\"><li style=\"font-size:18px; margin-top: 5px;\">No work in progress at the time of site visit.</li></ul>'\n }\n </section>\n\n <section>\n <h2 style=' font-size:22px; margin-bottom: 0; text-decoration: underline'>Miscellaneous Notes</h2>\n <ul style='margin-top: 0; padding-left: 20px;'>\n ${miscNotes ||\n '<li style=\"font-size:18px; margin-top: 5px;\">None noted.</li>'}\n </ul>\n </section>\n </div>\n <section>\n <h2 style=' font-size:22px; margin-bottom: 0; text-decoration: underline'>Photos</h2>\n <p style='margin-top: 5px; font-size:18px;'>Please see attachments.</p>\n </section>\n <section>\n <p style=\"font-size: 18px; margin-bottom: 20px;\">Should you have any questions, please contact the undersigned.</p>\n <p style=\"font-size: 18px; margin-bottom: 20px;\">Site Assistant Built By:</p>\n <p style=\"font-size: 18px; margin-bottom: 5px;\">Dale Shlass, EIT</p>\n <p style=\"font-size: 18px; margin-bottom: 5px;margin-top: 0px;\">Web Developer</p>\n <a style=\"display: block;font-size: 18px;text-decoration: none;color: rgba(32, 32, 32, 1); \" href='tel:+14169187713'>416-918-7713</a>\n <a style=\"display: block;font-size: 18px;text-decoration: none;color: rgba(32, 32, 32, 1); margin-bottom: 5px;\" href='mailto:dale@shlass.com'>dale@shlass.com</a>\n <a style=\"display: block;font-size: 18px;text-decoration: none; margin-top: 10px;float: left; background: #0077B5;color: white;padding: 5px 20px;border-radius: 20px;\" href='https://www.linkedin.com/in/dshlass/'>LinkedIn</a>\n <a style=\"display: block;font-size: 18px;text-decoration: none; margin-top: 10px;float: left; border: 1px solid #24292E; background: #fff; color: #24292E; padding: 5px 20px; border-radius: 20px; margin-left: 40px;\" href='https://www.github.com/dshlass/'>GitHub</a>\n </section>\n </div>\n </section>`;\n\n let photoSection = [];\n\n for (let image of report[0].photos) {\n var base64data = Buffer.from(image.image, \"binary\").toString(\"base64\");\n photoSection.push({\n filename: `ReportPhoto.png`,\n content: base64data,\n encoding: \"base64\"\n });\n }\n\n var transporter = nodemailer.createTransport({\n service: \"gmail\",\n auth: {\n user: process.env.NODEMAIL_USER,\n pass: process.env.NODEMAIL_PASS\n }\n });\n\n console.log(transporter);\n\n let info = transporter.sendMail({\n from: `\"Site Assistant ✅\" <${process.env.NODEMAIL_USER}>`, // sender address\n to: `${project.recipients}`, // list of receivers\n subject: `${project.projectName} Site Visit ${[\"#\"].toString()}${\n report[0].reportNumber\n }`, // Subject line\n text: \"Your site report\", // plain text body\n html: emailBody,\n attachments: photoSection\n });\n\n console.log(\"Message sent to\", project.recipients.join(\" \"));\n });\n}", "function singleClickGenerateAllReports(){\n\n\n\t //PENDING --> TOTAL CALCULATED ROUND OFFFFF\n\t console.log('PENDING API --> TOTAL CALCULATED ROUND OFFFFF')\n\t \n\n\t\trunReportAnimation(95); //of Step 11 which completed the data processing\n\n\n\t\t//Get staff info.\n\t\tvar loggedInStaffInfo = window.localStorage.loggedInStaffData ? JSON.parse(window.localStorage.loggedInStaffData) : {};\n\t\t\n\t\tif(jQuery.isEmptyObject(loggedInStaffInfo)){\n\t\t\tloggedInStaffInfo.name = 'Staff';\n\t\t\tloggedInStaffInfo.code = '0000000000';\n\t\t}\t\n\n\n\t\tvar reportInfo_branch = window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '';\n\t\t\t\n\t\tif(reportInfo_branch == ''){\n\t\t\tshowToast('System Error: Branch name not found. Please contact Accelerate Support.', '#e74c3c');\n\t\t\treturn '';\n\t\t}\n\n\t\tvar temp_address_modified = (window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '') + ' - ' + (window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '');\n\t\tvar data_custom_footer_address = window.localStorage.bill_custom_footer_address ? window.localStorage.bill_custom_footer_address : '';\n\n\t\tvar reportInfo_admin = loggedInStaffInfo.name;\n\t\tvar reportInfo_time = moment().format('h:mm a, DD-MM-YYYY');\n\t\tvar reportInfo_address = data_custom_footer_address != '' ? data_custom_footer_address : temp_address_modified;\n\n\n\t\t//Reset Token Number and KOT Number (if preference set)\n\t\tresetBillingCounters();\n\n\t\tgenerateReportContentDownload();\n\n\t\tfunction generateReportContentDownload(){\n\n\t\t\t//To display weekly graph or not\n\t\t\tvar hasWeeklyGraphAttached = false;\n\t\t\tif(window.localStorage.graphImageDataWeekly && window.localStorage.graphImageDataWeekly != ''){\n\t\t\t\thasWeeklyGraphAttached = true;\n\t\t\t}\n\n\t\t\tvar graphRenderSectionContent = '';\n\t\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\t\tif(fromDate != toDate){\n\t\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t\t}\n\t\t else{ //Render graph only if report is for a day\n\n\t\t if(hasWeeklyGraphAttached){\n\n\t\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t\t graphRenderSectionContent = ''+\n\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t '<div class=\"summaryTableSection\">'+\n\t\t '<div class=\"tableQuickHeader\">'+\n\t\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t\t '</div>'+\n\t\t '<div class=\"weeklyGraph\">'+\n\t\t '<img src=\"'+window.localStorage.graphImageDataWeekly+'\" style=\"max-width: 90%\">'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '</div>';\n\t\t }\n\t\t }\n\n\t\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\t\t //Quick Summary Content\n\t\t var quickSummaryRendererContent = '';\n\n\t\t var a = 0;\n\t\t while(reportInfoExtras[a]){\n\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t\t a++;\n\t\t }\n\n\n\t\t var b = 1; //first one contains total paid\n\t\t while(completeReportInfo[b]){\n\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t\t b++;\n\t\t }\n\n\n\t\t //Sales by Billing Modes Content\n\t\t var salesByBillingModeRenderContent = '';\n\t\t var c = 0;\n\t\t var billSharePercentage = 0;\n\t\t while(detailedListByBillingMode[c]){\n\t\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t\t c++;\n\t\t }\n\n\t\t\t//To display bills graph or not\n\t\t\tvar hasBillsGraphAttached = false;\n\t\t\tif(window.localStorage.graphImageDataBills && window.localStorage.graphImageDataBills != '' && window.localStorage.graphImageDataBills != 'data:,'){\n\t\t\t\thasBillsGraphAttached = true;\n\t\t\t}\n\n\t\t var salesByBillingModeRenderContentFinal = '';\n\t\t if(salesByBillingModeRenderContent != ''){\n\n\t\t \tif(hasBillsGraphAttached){\n\t\t\t\t salesByBillingModeRenderContentFinal = ''+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t \t'<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t\t\t\t \t'</div>'+\n\t\t\t\t \t'<div class=\"tableGraphRow\">'+\n\t\t\t\t\t\t '<div class=\"tableGraph_Graph\"> <img src=\"'+window.localStorage.graphImageDataBills+'\" width=\"200px\"> </div>'+\n\t\t\t\t\t\t '<div class=\"tableGraph_Table\">'+\t\n\t\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t\t salesByBillingModeRenderContent+\n\t\t\t\t\t '</table>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '</div>'+\t\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t salesByBillingModeRenderContentFinal = ''+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t salesByBillingModeRenderContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>';\t\t\t\t\n\t\t\t\t}\n\t\t }\n\n\n\t\t //Sales by Payment Types Content\n\t\t var salesByPaymentTypeRenderContent = '';\n\t\t var d = 0;\n\t\t var paymentSharePercentage = 0;\n\t\t while(detailedListByPaymentMode[d]){\n\t\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t\t d++;\n\t\t }\n\n\t\t\t//To display payment graph or not\n\t\t\tvar hasPaymentsGraphAttached = false;\n\t\t\tif(window.localStorage.graphImageDataPayments && window.localStorage.graphImageDataPayments != '' && window.localStorage.graphImageDataPayments != 'data:,'){\n\t\t\t\thasPaymentsGraphAttached = true;\n\t\t\t}\n\n\t\t var salesByPaymentTypeRenderContentFinal = '';\n\t\t if(salesByPaymentTypeRenderContent != ''){\n\n\t\t \tif(hasPaymentsGraphAttached){\n\t\t\t salesByPaymentTypeRenderContentFinal = ''+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t \t'<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t\t\t \t'</div>'+\n\t\t\t \t'<div class=\"tableGraphRow\">'+\n\t\t\t\t\t '<div class=\"tableGraph_Graph\"> <img src=\"'+window.localStorage.graphImageDataPayments+'\" width=\"200px\"> </div>'+\n\t\t\t\t\t '<div class=\"tableGraph_Table\">'+\t\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t salesByPaymentTypeRenderContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>';\n\t\t\t }\n\t\t\t else{\n\t\t\t \tsalesByPaymentTypeRenderContentFinal = ''+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t salesByPaymentTypeRenderContent+\n\t\t\t '</table>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>';\n\t\t\t }\n\t\t }\n\n\t\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px;text-align:center}.factsBox{margin-right: 5px; width:18%; display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:35%;display:block;text-align:center;float:right;position:absolute;top:20px;left:62%}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:55%;display:block;min-height:250px;}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t\t \n\t\t var finalReport_downloadContent = cssData+\n\t\t\t '<body>'+\n\t\t\t '<div class=\"mainHeader\">'+\n\t\t\t '<div class=\"headerLeftBox\">'+\n\t\t\t '<div id=\"logo\">'+\n\t\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t\t '</div>'+\n\t\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"headerRightBox\">'+\n\t\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"introFacts\">'+\n\t\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t\t '<div class=\"factsArea\">'+\n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+graphRenderSectionContent+\n\t\t\t (hasWeeklyGraphAttached ? '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>' : '')+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Amount</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t\t quickSummaryRendererContent+\n\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t\t '</table>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>'+\n\t\t\t salesByBillingModeRenderContentFinal+\n\t\t\t salesByPaymentTypeRenderContentFinal+\n\t\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t\t '<p class=\"footerNote\">www.accelerate.net.in | support@accelerate.net.in</p>'+\n\t\t\t '</div>'+\n\t\t\t '</body>';\n\n\t\t\t\tvar finalContent_EncodedDownload = encodeURI(finalReport_downloadContent);\n\t\t\t\t$('#reportActionButtonDownload').attr('data-hold', finalContent_EncodedDownload);\n\n\t\t\t\tvar finalContent_EncodedText = encodeURI(fancy_report_title_name);\n\t\t\t\t$('#reportActionButtonDownload').attr('text-hold', finalContent_EncodedText);\n\n\t\t\t\tgenerateReportContentEmail();\n\n\t\t}\n\n\t\tfunction generateReportContentEmail(){\n\n\t\t\t\trunReportAnimation(97);\n\n\t\t\t\t//To display weekly graph or not\n\t\t\t\tvar hasWeeklyGraphAttached = false;\n\t\t\t\tif(window.localStorage.graphImageDataWeekly && window.localStorage.graphImageDataWeekly != ''){\n\t\t\t\t\thasWeeklyGraphAttached = true;\n\t\t\t\t}\n\n\t\t\t\tvar temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\n\t\t\t\tvar graphRenderSectionContent = '';\n\t\t\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\t\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\t\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\t\t\tif(fromDate != toDate){\n\t\t\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t\t\t}\n\t\t\t else{ //Render graph only if report is for a day\n\n\t\t\t if(hasWeeklyGraphAttached){\n\n\t\t\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t\t\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t\t\t graphRenderSectionContent = ''+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"weeklyGraph\">'+\n\t\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/report_trend_images_repo/'+temp_image_name+'.png\" style=\"max-width: 90%\">'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>';\n\t\t\t }\n\t\t\t }\n\n\t\t\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\t\t\t //Quick Summary Content\n\t\t\t var quickSummaryRendererContent = '';\n\n\t\t\t var a = 0;\n\t\t\t while(reportInfoExtras[a]){\n\t\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t\t\t a++;\n\t\t\t }\n\n\n\t\t\t var b = 1; //first one contains total paid\n\t\t\t while(completeReportInfo[b]){\n\t\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t\t\t b++;\n\t\t\t }\n\n\n\t\t\t //Sales by Billing Modes Content\n\t\t\t var salesByBillingModeRenderContent = '';\n\t\t\t var c = 0;\n\t\t\t var billSharePercentage = 0;\n\t\t\t while(detailedListByBillingMode[c]){\n\t\t\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t\t\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t\t\t c++;\n\t\t\t }\n\n\t\t\t\t//To display bills graph or not\n\t\t\t\tvar hasBillsGraphAttached = false;\n\t\t\t\tif(window.localStorage.graphImageDataBills && window.localStorage.graphImageDataBills != '' && window.localStorage.graphImageDataBills != 'data:,'){\n\t\t\t\t\thasBillsGraphAttached = true;\n\t\t\t\t}\n\n\t\t\t var salesByBillingModeRenderContentFinal = '';\n\t\t\t if(salesByBillingModeRenderContent != ''){\n\t\t\t\t\t salesByBillingModeRenderContentFinal = ''+\n\t\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t\t salesByBillingModeRenderContent+\n\t\t\t\t\t '</table>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '</div>';\n\t\t\t }\n\n\n\t\t\t //Sales by Payment Types Content\n\t\t\t var salesByPaymentTypeRenderContent = '';\n\t\t\t var d = 0;\n\t\t\t var paymentSharePercentage = 0;\n\t\t\t while(detailedListByPaymentMode[d]){\n\t\t\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t\t\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t\t\t d++;\n\t\t\t }\n\n\t\t\t var salesByPaymentTypeRenderContentFinal = '';\n\t\t\t if(salesByPaymentTypeRenderContent != ''){\n\t\t\t\t \tsalesByPaymentTypeRenderContentFinal = ''+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t salesByPaymentTypeRenderContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>';\n\t\t\t }\n\n\t\t\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t\t\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px;text-align:center}.factsBox{margin-right: 5px; width:18%; display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:35%;display:block;text-align:center;float:right;position:absolute;top:20px;left:62%}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:55%;display:block;min-height:250px;}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t\t\t \n\t\t\t var finalReport_emailContent = '<html>'+cssData+\n\t\t\t\t '<body>'+\n\t\t\t\t '<div class=\"mainHeader\">'+\n\t\t\t\t '<div class=\"headerLeftBox\">'+\n\t\t\t\t '<div id=\"logo\">'+\n\t\t\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"headerRightBox\">'+\n\t\t\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"introFacts\">'+\n\t\t\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t\t\t '<div class=\"factsArea\">'+\n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+graphRenderSectionContent+\n\t\t\t\t (hasWeeklyGraphAttached ? '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>' : '')+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Sales</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t\t\t quickSummaryRendererContent+\n\t\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>'+\n\t\t\t\t salesByBillingModeRenderContentFinal+\n\t\t\t\t salesByPaymentTypeRenderContentFinal+\n\t\t\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t\t\t '<p class=\"footerNote\">www.accelerate.net.in | support@accelerate.net.in</p>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</body>'+\n\t\t\t\t '<html>';\n\n\t\t\t\tvar finalContent_EncodedEmail = encodeURI(finalReport_emailContent);\n\t\t\t\t$('#reportActionButtonEmail').attr('data-hold', finalContent_EncodedEmail);\n\n\t\t\t\tvar myFinalCollectionText = {\n\t\t\t\t\t\"reportTitle\" : fancy_report_title_name,\n\t\t\t\t\t\"imageName\": reportInfo_branch+'_'+fromDate\n\t\t\t\t}\n\n\t\t\t\tvar finalContent_EncodedText = encodeURI(JSON.stringify(myFinalCollectionText));\n\t\t\t\t$('#reportActionButtonEmail').attr('text-hold', finalContent_EncodedText);\t\n\n\t\t\t\tgenerateReportContentPrint();\t\t\n\t\t}\n\n\t\tfunction generateReportContentPrint(){\n\n\t\t\trunReportAnimation(99);\n\n\t\t\tvar graphRenderSectionContent = '';\n\t\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\t\tif(fromDate != toDate){\n\t\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t\t}\n\n\n\t\t //Quick Summary Content\n\t\t var quickSummaryRendererContent = '';\n\n\t\t var a = 0;\n\t\t while(reportInfoExtras[a]){\n\t\t quickSummaryRendererContent += '<tr><td style=\"font-size: 11px\">'+reportInfoExtras[a].name+'</td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t\t a++;\n\t\t }\n\n\t\t var b = 1; //first one contains total paid\n\t\t while(completeReportInfo[b]){\n\t\t quickSummaryRendererContent += '<tr><td style=\"font-size: 11px\">'+completeReportInfo[b].name+'</td><td style=\"font-size: 11px; text-align: right\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span style=\"font-size: 60%\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t\t b++;\n\t\t }\n\n\t\t var printSummaryAll = ''+\n\t\t \t'<div class=\"KOTContent\">'+\n\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">OVERALL SUMMARY</h2>'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t '<tr><td style=\"font-size: 11px\"><b>Gross Sales</b></td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t\t quickSummaryRendererContent+\n\t\t\t '<tr><td style=\"font-size: 13px\"><b>Net Sales</b></td><td style=\"font-size: 13px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t\t '</table>'+\n\t\t\t '</div>';\n\n\t\t //Sales by Billing Modes Content\n\t\t var printSummaryBillsContent = '';\n\t\t var c = 0;\n\t\t var billSharePercentage = 0;\n\t\t while(detailedListByBillingMode[c]){\n\t\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t\t printSummaryBillsContent += '<tr><td style=\"font-size: 11px\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span style=\"font-style:italic; font-size: 60%; display: block;\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t\t c++;\n\t\t }\n\n\t\t var printSummaryBills = '';\n\t\t if(printSummaryBillsContent != ''){\n\t\t\t\tprintSummaryBills = ''+\n\t\t\t \t'<div class=\"KOTContent\">'+\n\t\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">BILLING MODES</h2>'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t\t printSummaryBillsContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>';\t\n\t\t }\n\n\n\t\t //Sales by Payment Types Content\n\t\t var printSummaryPaymentContent = '';\n\t\t var d = 0;\n\t\t var paymentSharePercentage = 0;\n\t\t while(detailedListByPaymentMode[d]){\n\t\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t\t printSummaryPaymentContent += '<tr><td style=\"font-size: 11px\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span style=\"font-style:italic; font-size: 60%; display: block;\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>'; \n\t\t d++;\n\t\t }\n\n\t\t var printSummaryPayment = '';\n\t\t if(printSummaryPaymentContent != ''){\n\t\t\t printSummaryPayment = ''+\n\t\t\t \t'<div class=\"KOTContent\">'+\n\t\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">PAYMENT TYPES</h2>'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t\t printSummaryPaymentContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>';\t\n\t\t }\n\n\n\t\t var printSummaryCounts = ''+\n\t\t\t \t'<div class=\"KOTContent\">'+\n\t\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">OTHER DETAILS</h2>'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t\t '<tr><td style=\"font-size: 10px\">Total Guests</td><td style=\"font-size: 13px\">'+netGuestsCount+'</td></tr>'+\n\t\t\t\t '<tr><td style=\"font-size: 10px\">Total Bills</td><td style=\"font-size: 13px\">'+completeReportInfo[0].count+'</td></tr>'+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>';\n\n\n\n\n\t\t var cssData = '<head> <style type=\"text/css\"> .KOTContent,.KOTHeader,.KOTNumberArea,.KOTSummary{width:100%;background-color:none}.subLabel,body{font-family:sans-serif}.KOTNumber,.invoiceNumber,.subLabel{letter-spacing:2px}#logo{min-height:60px;width:100%;border-bottom:2px solid #000}.KOTHeader,.KOTNumberArea{min-height:30px;padding:5px 0;border-bottom:1px solid #7b7b7b}.KOTContent{min-height:100px;font-size:11px;padding-top:6px;border-bottom:2px solid}.KOTSummary{font-size:11px;padding:5px 0;border-bottom:1px solid}.KOTContent td,.KOTContent table{border-collapse:collapse}.KOTContent td{border-bottom:1px dashed #444;padding:7px 0}.invoiceHeader,.invoiceNumberArea{padding:5px 0;border-bottom:1px solid #7b7b7b;width:100%;background-color:none}.KOTSpecialComments{min-height:20px;width:100%;background-color:none;padding:5px 0}.invoiceNumberArea{min-height:30px}.invoiceContent{min-height:100px;width:100%;background-color:none;font-size:11px;padding-top:6px;border-bottom:1px solid}.invoiceCharges{min-height:90px;font-size:11px;width:100%;background-color:none;padding:5px 0;border-bottom:2px solid}.invoiceCustomText,.invoicePaymentsLink{background-color:none;border-bottom:1px solid;width:100%}.invoicePaymentsLink{min-height:72px}.invoiceCustomText{padding:5px 0;font-size:12px;text-align:center}.subLabel{display:block;font-size:8px;font-weight:300;text-transform:uppercase;margin-bottom:5px}p{margin:0}.itemComments,.itemOldComments{font-style:italic;margin-left:10px}.serviceType{border:1px solid;padding:4px;font-size:12px;display:block;text-align:center;margin-bottom:8px}.tokenNumber{display:block;font-size:16px;font-weight:700}.billingAddress,.timeStamp{font-weight:300;display:block}.billingAddress{font-size:12px;line-height:1.2em}.mobileNumber{display:block;margin-top:8px;font-size:12px}.timeStamp{font-size:11px}.KOTNumber{font-size:15px;font-weight:700}.commentsSubText{font-size:12px;font-style:italic;font-weight:300;display:block}.invoiceNumber{font-size:15px;font-weight:700}.timeDisplay{font-size:75%;display:block}.rs{font-size:60%}.paymentSubText{font-size:10px;font-weight:300;display:block}.paymentSubHead{font-size:12px;font-weight:700;display:block}.qrCode{width:100%;max-width:120px;text-align:right}.addressContact,.addressText{color:gray;text-align:center}.addressText{font-size:10px;padding:5px 0}.addressContact{font-size:9px;padding:0 0 5px}.gstNumber{font-weight:700;font-size:10px}.attendantName,.itemQuantity{font-size:12px}#defaultScreen{position:fixed;left:0;top:0;z-index:100001;width:100%;height:100%;overflow:visible;background-image:url(../data/photos/brand/pattern.jpg);background-repeat:repeat;padding-top:100px}.attendantName{font-weight:300;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.itemComments,.itemQuantity{font-weight:700;display:block}.itemOldComments{display:block;text-decoration:line-through}.itemOldQuantity{font-size:12px;text-decoration:line-through;display:block} </style> </head>';\n\n\t\t var data_custom_header_image = window.localStorage.bill_custom_header_image ? window.localStorage.bill_custom_header_image : '';\n\n\t\t var data_custom_header_client_name = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '';\n\t\t\tif(data_custom_header_client_name == ''){\n\t\t\t data_custom_header_client_name = 'Report';\n\t\t\t}\n\n\t\t var finalReport_printContent = cssData +\n\t\t \t'<body>'+\n\t\t\t '<div id=\"logo\">'+\n\t\t\t (data_custom_header_image != '' ? '<center><img style=\"max-width: 90%\" src=\\''+data_custom_header_image+'\\'/></center>' : '<h1 style=\"text-align: center\">'+data_custom_header_client_name+'</h1>')+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"KOTHeader\" style=\"padding: 0; background: #444;\">'+\n\t\t\t \t'<p style=\"text-align: center; font-size: 16px; font-weight: bold; text-transform: uppercase; padding-top: 6px; color: #FFF;\">'+reportInfo_branch+'</p>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"KOTNumberArea\">'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 50%\">'+\n\t\t\t '<col style=\"width: 50%\">'+\n\t\t\t '<tr>'+\n\t\t\t '<td style=\"vertical-align: top\">'+\n\t\t\t '<p>'+\n\t\t\t '<tag class=\"subLabel\">Admin</tag>'+\n\t\t\t '<tag class=\"KOTNumber\" style=\"font-size: 13; font-weight: 300; letter-spacing: unset;\">'+reportInfo_admin+'</tag>'+\n\t\t\t '</p>'+\n\t\t\t '</td>'+\n\t\t\t '<td style=\"vertical-align: top\">'+\n\t\t\t '<p style=\" text-align: right; float: right\">'+\n\t\t\t '<tag class=\"subLabel\">TIME STAMP</tag>'+\n\t\t\t '<tag class=\"timeStamp\">'+reportInfo_time+'</tag>'+\n\t\t\t '</p>'+\n\t\t\t '</td>'+\n\t\t\t '</tr>'+\n\t\t\t '</table>'+\n\t\t\t '</div>'+\n\t\t\t '<h1 style=\"margin: 6px 3px; padding-bottom: 5px; font-weight: 400; text-align: center; font-size: 15px; border-bottom: 2px solid; }\">'+reportInfo_title+'</h1>'+\n\t\t\t \t printSummaryAll+printSummaryBills+printSummaryPayment+printSummaryCounts+\n\t\t\t \t'</body>';\n\n\t\t\t\tvar finalContent_EncodedPrint = encodeURI(finalReport_printContent);\n\t\t\t\t$('#reportActionButtonPrint').attr('data-hold', finalContent_EncodedPrint);\n\n\t\t\t\trunReportAnimation(100); //Done!\n\t\t}\n\t}", "async function CreateIndex() {\n\nlet Title;\nlet Project;\nlet Install;\nlet Guideline;\nlet Contribution;\nlet Test;\nlet Git;\nlet Email;\nlet License;\nlet Badge; \nlet Badged;\n\n\n const MIT = {\n name:\"MIT\",\n description:\"'A short, permissive software license. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. There are many variations of this license in use.' - exerpt from 'https://tldrlegal.com/license/mit-license'\",\n badge:\"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\" \n }\n\n const Apache = {\n name:\"Apache\",\n description: \"'A permissive, BSD-3 Clause style license with restrictions on trademark use and the requirement of including 'this product includes software developed by the Apache Group for use in the Apache HTTP server project (http://www.apache.org/).' - exerpt from 'https://tldrlegal.com/license/apache-license-1.0-(apache-1.0)'\",\n\n badge:\"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\"\n }\n\n const BSD2 ={\n description: \"'The BSD 2-clause license allows you almost unlimited freedom with the software so long as you include the BSD copyright notice in it (found in Fulltext). Many other licenses are influenced by this one.'- exerpt from 'https://tldrlegal.com/license/bsd-2-clause-license-(freebsd)'\",\n badge: \"[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)\"\n }\n\n const BSD3 ={\n name:\"BSD3\",\n\n description:\"'The BSD 3-clause license allows you almost unlimited freedom with the software so long as you include the BSD copyright and license notice in it (found in Fulltext).' -exerpt from 'https://tldrlegal.com/license/bsd-3-clause-license-(revised)' \",\n\n badge: \"[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\"\n }\n\n const GPL = {\n name:\"GPL\",\n description:\"'You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.' - exerpt from 'https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)'\",\n\n badge:\"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) \"\n }\n const LGPL ={\n name:\"LGPL\",\n description:\"'This license is mainly applied to libraries. You may copy, distribute and modify the software provided that modifications are described and licensed for free under LGPL. Derivatives works (including modifications or anything statically linked to the library) can only be redistributed under LGPL, but applications that use the library don't have to be.' - exerpt from 'https://tldrlegal.com/license/gnu-lesser-general-public-license-v3-(lgpl-3)'\",\n\n badge:\"[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\"\n }\n const MPL2 ={\n name: \"MPL2\",\n description:\"'MPL is a copyleft license that is easy to comply with. You must make the source code for any of your changes available under MPL, but you can combine the MPL software with proprietary code, as long as you keep the MPL code in separate files. Version 2.0 is, by default, compatible with LGPL and GPL version 2 or greater. You can distribute binaries under a proprietary license, as long as you make the source available under MPL.' - 'excerpt is from https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)'\",\n badge:\"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\"\n }\n\n const CC0 ={\n name:\"CC0\",\n\n description:\"'Releases software into the public domain, or otherwise grants permission to use it for any purpose. Disclaims patent licenses.'-exerpt from 'https://tldrlegal.com/license/creative-commons-cc0-1.0-universal' \",\n\n badge:\"[![License: CC0-1.0](https://licensebuttons.net/l/zero/1.0/80x15.png)](http://creativecommons.org/publicdomain/zero/1.0/)\"\n }\n\n const badges =[MIT,Apache,BSD2,BSD3,GPL,LGPL,MPL2,CC0]\n\n const licenses = [\"MIT\", \"Apache\",\"BSD2\", \"BSD3\",\"GPL\", \"LGPL\", \"MPL2\", \"CC0\"]\n\n const names =[\"title\",\"project\",\"install\",\"guideline\",\"contribution\",\"test\", \"git\",\"email\",\"license\"]\n\n const questions = [\"What is the project title?\",\"Describe your project\",\"What are your installation instructions?\",\"What are the guidelines for use?\",\"What are the guidelines for contributions?\",\"What are the test instructions?\",\"What is your github username\",\"What is your email address?\", \"What liscense will you be using?\" ]\n\n try {\n const{ title } = await inquirer.prompt({\n message: questions[0],\n name: names[0],\n });\n Title = title\n console.log(Title)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ project } = await inquirer.prompt({\n message: questions[1],\n name: names[1],\n });\n Project = project;\n console.log(Project)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ install } = await inquirer.prompt({\n message: questions[2],\n name: names[2],\n });\n Install = install\n console.log(Install)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ guideline } = await inquirer.prompt({\n message: questions[3],\n name: names[3],\n });\n Guideline = guideline\n console.log(Guideline)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ contribution } = await inquirer.prompt({\n message: questions[4],\n name: names[4],\n });\n Contribution = contribution;\n console.log(Contribution)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ test } = await inquirer.prompt({\n message: questions[5],\n name: names[5],\n });\n Test = test;\n console.log(Test)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ git } = await inquirer.prompt({\n message: questions[6],\n name: names[6],\n });\n Git= \"https://www.github.com/\"+ git\n console.log(Git)\n } catch (err) {\n console.log(err);\n }\n try {\n const{ email } = await inquirer.prompt({\n message: questions[7],\n name: names[7],\n });\n Email = email\n console.log(Email)\n } catch (err) {\n console.log(err);\n }\n\n try {\n const{ license } = await inquirer.prompt({\n type: 'list',\n message: questions[8],\n choices: licenses ,\n name: names[8]\n });\n License = license\n console.log(License)\nfor(var i = 0; i< badges.length; i++){\n if(License == badges[i].name){\n Badge = badges[i].badge;\n Badged = badges[i].description;\n\n } \n }\n } catch (err) {\n console.log(err);\n }\n \n \n\nvar read = `# ${Title}\n\n## Description\n<br>\n${Project}\n\n\n### Licenses\n${Badge}\n<br>\n${Badged}\n\n## Table of Contents\n<br>\n* <a href=\"#install\">Installation</a>\n<br>\n* <a href =\"#use\">Usage Information</a>\n<br>\n* <a href=\"#test\">Test Instructions</a>\n<br>\n* <a href=\"#q\">Questions</a>\n\n<h3 id= \"install\" > Installation</h3>\n<br>\n${Install}\n\n\n<h3 id = \"use\"> Usage Information</h3>\n<br>\n*Guidelines for use:*\n<br>\n${Guideline}\n<br>\n*Guidelines for Contribution:* \n<br>\n${Contribution}\n\n<h3 id=\"test\"> Test Instructions</h3>\n${Test}\n\n\n<h2 id = \"q\"> Questions</h2>\n\nIf you have Questions you can check out:\n<br>\n<a href=\"${Git}\">${Git}</a><br>\nor email:\n${Email}`\n\n\n\n await fs.writeFile(\"README.md\",read, err =>{\n if(err){\n throw err\n }\nconsole.log(\"Your page has been made\")\n\n });\n}", "function drawPortfolio(data) {\n if (!data.err) {\n let html = \"<table class='portfolio'>\";\n let totalShareValue = 0;\n\n document.getElementById('stockField').value = \"\";\n document.getElementById('quantField').value = \"\";\n\n html += \"<th>Stock</th><th>Qty.</th><th>Est. Value</th>\";\n\n if (Object.keys(data.shr).length !== 0) {\n for (let stock in data.shr) {\n let shareValue = data.shr[stock]*prices[stock];\n\n totalShareValue += shareValue;\n\n html += \"<tr>\";\n html += \"<td>\" + stock + \"</td>\";\n html += \"<td>\" + data.shr[stock] + \"</td>\";\n html += \"<td>\" + shareValue.toFixed(2) + \"</td>\";\n html += \"</tr>\";\n }\n } else {\n html += \"<tr><td colspan='3'>None</td></tr>\";\n }\n html += \"<tr><td colspan='3'><hr></td></tr>\";\n html += \"<tr><td colspan='2'>Est. Portfolio Value</td><td>\" +\n totalShareValue.toFixed(2) + \"</td></tr>\";\n html += \"<tr><td colspan='2'>Cash Balance</td><td>\" + data.bal.toFixed(2) + \"</td></tr>\";\n html += \"<tr><td colspan='2'>Est. Account Value</td><td>\" +\n (totalShareValue + data.bal).toFixed(2) + \"</td></tr>\";\n html += \"</table>\";\n document.getElementById('portfolio').innerHTML = html;\n } else {\n showErrorMsg(data.err);\n }\n}", "function pushSummaries() {\n buttonwood.getPortfolioSummaries().then(function(portfolioSummaries) {\n _.each(portfolioSummaries, function(portfolioSummary) {\n var botInstance = bot.botManager.getBot(portfolioSummary.applicationPlatformEntity);\n botInstance.sendPrivateMessage(portfolioSummary);\n });\n });\n}", "addNewReport() {\n \n }", "async function weeklyReports(){\n // github.fetchData();\n var orgList = await db.listAllOrgId();\n for (var org_id of orgList) {\n var reportLinks = await report.generateReportLinks(org_id);\n // console.log(reportLinks);\n // Send report links\n for (var user in reportLinks) {\n await mattermost.postReports(config.incoming_webhook_url, '@' + user, reportLinks[user]);\n }\n }\n // schedule.scheduleJob('0 56 0 * * 5', async function() {\n // console.log('scheduleCronstyle:' + new Date());\n // // // fetch data from github and store into db\n // await github.fetchData();\n // });\n //\n // schedule.scheduleJob('0 56 0 * * 5', async function() {\n // // generate all weekly reports\n // var orgList = db.listAllOrgId();\n // for (var org_id of orgList) {\n // var reportLinks = report.generateReportLinks(org_id);\n // // console.log(reportLinks);\n // // Send report links\n // for (var user in reportLinks) {\n // mattermost.postReports(config.incoming_webhook_url, '@' + user, reportLinks[user]);\n // }\n // }\n // });\n }", "function displayResults() {\n var body = document.getElementById(\"parent\");\n var div10 = document.createElement(\"div\");\n var portfolioChart = document.createElement(\"div\");\n var projectGrowth = document.createTextNode(\"Projected Growth\");\n\n div10.style.width = \"90%\";\n div10.style.marginLeft = \"5%\";\n div10.style.marginRight = \"5%\";\n div10.style.borderStyle = \"solid\";\n div10.id = \"portfolio_Div\";\n\n portfolioChart.id = \"portfolio_Chart\";\n\n if (body.childElementCount == 5) {\n body.appendChild(div10);\n body.appendChild(portfolioChart);\n div10.appendChild(projectGrowth);\n div10.appendChild(portfolioChart);\n }\n\n var result1 = parseFloat(document.getElementById(\"401K_Income_Input\").value);\n var result2 = parseFloat(document.getElementById(\"401K_EmpMatch_Input\").value);\n var result3 = parseFloat(document.getElementById(\"401K_Contribution_Input\").value);\n var result4 = parseFloat(document.getElementById(\"stocks_principleAmt_Input\").value);\n var result5 = parseFloat(document.getElementById(\"stocks_annualContribution_Input\").value);\n var result6 = parseFloat(document.getElementById(\"RE_houseValue_Input\").value);\n var result7 = parseFloat(document.getElementById(\"RE_rentalIncome_Input\").value);\n var result8 = parseFloat(document.getElementById(\"RE_annualAppreciation_Input\").value);\n var result9 = parseFloat(document.getElementById(\"num_Years\").value);\n var result10 = parseFloat(document.getElementById(\"ror_401K_Input\").value);\n var result11 = parseFloat(document.getElementById(\"ror_IRA_Input\").value);\n var result12 = parseFloat(document.getElementById(\"ror_Stocks_Input\").value);\n\n var result13 = parseFloat(document.getElementById(\"contribution_Range\").value);\n\n var rowList = [];\n var incrementer = 2019;\n var endYear = incrementer + result9;\n var maxContribution401K = 0;\n var userContribution401K = result1 / result3;\n\n\n if (userContribution401K <= result2) {\n maxContribution401K = result3 * 2;\n } else {\n maxContribution401K = result3 + (result1 * result2);\n }\n\n var w = result4;\n var x = 0;\n var y = 0;\n var z = result6;\n var inc = 0;\n\n rowList[0]= [incrementer.toString(), 0, 0, 0, result6];\n\n for (incrementer; incrementer < endYear; incrementer++) {\n x = (x + maxContribution401K) * result10;\n y = (y + result13) * result11;\n z = (z * result8) + result7;\n w = (w + result5) * result12;\n\n rowList[inc+1] = [(incrementer+1).toString(), parseFloat(x.toFixed(2)), parseFloat(y.toFixed(2)), parseFloat(w.toFixed(2)), parseFloat(z.toFixed(2))];\n inc = inc + 1;\n }\n\n for (var k = 0; k < rowList.length; k++) {\n console.log(rowList[k]);\n }\n\n google.charts.load('current', {packages: ['corechart', 'line']});\n google.charts.setOnLoadCallback(drawPortfolioChart);\n\n function drawPortfolioChart() {\n\n var portfolioData = new google.visualization.DataTable();\n portfolioData.addColumn(\"string\", \"Year\");\n portfolioData.addColumn(\"number\", \"401K\");\n portfolioData.addColumn(\"number\", \"IRA\");\n portfolioData.addColumn(\"number\", \"Stocks\");\n portfolioData.addColumn(\"number\", \"Real Estate\");\n\n var p;\n\n for (p = 0; p < rowList.length; p++) {\n portfolioData.addRow(rowList[p]);\n }\n\n var options = {\n fontName: 'Major Mono Display',\n backgroundColor: 'transparent',\n vAxis: {\n title: \"amount\"\n },\n hAxis: {\n title: \"year\"\n },\n width: 750,\n height: 650,\n chartArea: {\n top: \"5%\",\n left: '38%',\n //right: '0%',\n },\n legend: {\n fontName: 'Major Mono Display',\n position: 'bottom'\n }\n };\n\n\n var chart = new google.visualization.LineChart(document.getElementById('portfolio_Chart'));\n\n chart.draw(portfolioData, options);\n }\n}", "function printReport_RendicontoModA(report, banDoc, fileLastYear, userParam, reportGroups, accountsMap) {\r\n\r\n\t// Calcolo automatico accantonamento\r\n\tincomeAcc = \"\";\r\n\texpensesAcc = \"\";\r\n\r\n\tlet thisYear = Banana.Converter.toDate(banDoc.info(\"AccountingDataBase\",\"OpeningDate\")).getFullYear();\r\n\tlet lastYear = \"\";\r\n\tif (fileLastYear) {\r\n\t\tlastYear = Banana.Converter.toDate(fileLastYear.info(\"AccountingDataBase\",\"OpeningDate\")).getFullYear();\r\n\t}\r\n\r\n\tlet annofinanziario = \"\";\r\n\tif (fileLastYear) {\r\n\t\tannofinanziario = lastYear + \"-\" + thisYear;\r\n\t} else {\r\n\t\tannofinanziario = thisYear;\r\n\t}\r\n\treport.addParagraph(\"Rendiconto anno finanziario \" + annofinanziario, \"description bold\");\r\n\r\n\tlet table = report.addTable(\"table\");\r\n\tlet col1Table = table.addColumn(\"col1Table\");\r\n\tlet col2Table = table.addColumn(\"col2Table\");\r\n\tlet col3Table = table.addColumn(\"col3Table\");\r\n\tlet col4Table = table.addColumn(\"col4Table\");\r\n\t\r\n\ttableRow = table.addRow();\r\n\ttableRow.addCell(getDescription(banDoc, userParam.segment5XM), \"\", 2);\r\n\ttableRow.addCell(userParam.segment5XM, \"alignRight\", 2);\r\n\r\n\ttableRow = table.addRow();\r\n\ttableRow.addCell(\"Data di percezione del contributo\", \"\", 2);\r\n\ttableRow.addCell(userParam.dataPercezione, \"alignRight\", 2);\r\n\r\n\t// tableRow = table.addRow();\r\n\t// tableRow.addCell(\" \", \"\", 4);\r\n\r\n\ttableRow = table.addRow();\r\n\r\n\r\n\r\n\t/**\r\n\t * ENTRATE\r\n\t * - gruppo 0, Importo percepito\r\n\t * \r\n\t * USCITE\r\n\t * - gruppo 1, Risorse umane\r\n\t * - gruppo 2, Spese funzionamento\r\n\t * - gruppo 3, Spese per acquisto beni e servizi\r\n\t * - gruppo 4, Spese per attività di interesse generale dell'ente\r\n\t * - gruppo 4.1, Acquisto beni o servizi strumentali oggetto di donazione\r\n\t * - gruppo 4.2, Erogazioni a proprie articolazioni territoriali e a soggetti collegati o affiliati\r\n\t * - gruppo 4.3, Erogazioni a enti terzi\r\n\t * - gruppo 4.4, Erogazioni a persone fisiche\r\n\t * - gruppo 4.5, Altre spese per attività di interesse generale\r\n\t * - gruppo 5, Accantonamento\r\n\t */\r\n for (let i = 0; i < reportGroups.length; i++) {\r\n\t\t\r\n let groupObj = getObject(reportGroups, reportGroups[i][\"group\"]);\r\n\r\n\t\t//ENTRATE\r\n\t\tif (groupObj.income) {\r\n\t\t\ttableRow = table.addRow();\r\n\t\t\ttableRow.addCell(\"IMPORTO PERCEPITO\", \"\", 2);\r\n\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(groupObj.total), \"alignRight total\", 1);\r\n\t\t\ttableRow.addCell(\"EUR\", \"alignRight\",1);\r\n\r\n\t\t\t// Per il calcolo automatico dell'accantonamento\r\n incomeAcc = groupObj.total;\r\n\t\t}\r\n\r\n\t\t//USCITE\r\n\t\telse {\r\n\r\n\t\t\t// gruppi 1, 2, 3\r\n\t\t\tif (groupObj.group === \"1\" || groupObj.group === \"2\" || groupObj.group === \"3\") {\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(\" \", \"\", 4);\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(groupObj.group +\".\", \"bold\", 1);\r\n\t\t\t\ttableRow.addCell(groupObj.title, \"bold\", 1);\r\n\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(groupObj.total), \"alignRight total\", 1);\r\n\t\t\t\ttableRow.addCell(\"EUR\", \"alignRight\",1);\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(groupObj.text, \"\", 2);\r\n\r\n\t\t\t\t// Per il calcolo automatico dell'accantonamento\r\n\t\t\t\texpensesAcc = Banana.SDecimal.add(expensesAcc,groupObj.total);\r\n\t\t\t}\r\n\r\n\t\t\t// gruppo 4\r\n\t\t\telse if (groupObj.group === \"4\") {\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(\" \", \"\", 4);\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(groupObj.group +\".\", \"bold\", 1);\r\n\t\t\t\ttableRow.addCell(groupObj.title, \"bold\", 1);\r\n\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\ttableRow.addCell(\"\", \"\",1);\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(groupObj.text, \"\", 2);\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(\" \", \"\", 4);\r\n\t\t\t}\r\n\r\n\t\t\t// gruppi 4.1, 4.2, 4.3, 4.4, 4.5\r\n\t\t\telse if (groupObj.group === \"4.1\" || groupObj.group === \"4.2\" || groupObj.group === \"4.3\" || groupObj.group === \"4.4\" || groupObj.group === \"4.5\") {\r\n\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\ttableRow.addCell(\"\", \"\", 1);\r\n\t\t\t\ttableRow.addCell(groupObj.group + \" \" + groupObj.title, \"\", 1);\r\n\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(groupObj.total), \"alignRight total\", 1);\r\n\t\t\t\ttableRow.addCell(\"EUR\", \"alignRight\",1);\r\n\r\n\t\t\t\t// Per il calcolo automatico dell'accantonamento\r\n\t\t\t\texpensesAcc = Banana.SDecimal.add(expensesAcc,groupObj.total);\r\n\t\t\t}\r\n\r\n\t\t\t// gruppo 5\r\n\t\t\telse if (groupObj.group === \"5\") {\r\n\r\n\t\t\t\t// importo da registrazione accantonamento\r\n\t\t\t\tif (!userParam.calcolaAccantonamento) {\r\n\t\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\t\ttableRow.addCell(\" \", \"\", 4);\r\n\t\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\t\ttableRow.addCell(groupObj.group +\".\", \"bold\", 1);\r\n\t\t\t\t\ttableRow.addCell(groupObj.title, \"bold\", 1);\r\n\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(groupObj.total), \"alignRight total\", 1);\r\n\t\t\t\t\ttableRow.addCell(\"EUR\", \"alignRight\",1);\r\n\t\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\t\ttableRow.addCell(groupObj.text, \"\", 2);\r\n\r\n\t\t\t\t\t//controlla importo totale gruppo accantonamento\r\n\t\t\t\t\tcontrolloAccantonamento(banDoc, groupObj.total, incomeAcc, expensesAcc);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// importo calcolato come differenza\r\n\t\t\t\t// \"Importo percepito\" - \"Totale costi (gruppi 1,2,3,4)\"\r\n\t\t\t\telse {\r\n var totAccantonamento = Banana.SDecimal.subtract(incomeAcc,expensesAcc);\r\n\t\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\t\ttableRow.addCell(\" \", \"\", 4);\r\n\t\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\t\ttableRow.addCell(groupObj.group +\".\", \"bold\", 1);\r\n\t\t\t\t\ttableRow.addCell(groupObj.title, \"bold\", 1);\r\n\t\t\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(totAccantonamento), \"alignRight total\", 1);\r\n\t\t\t\t\ttableRow.addCell(\"EUR\", \"alignRight\",1);\r\n\t\t\t\t\ttableRow = table.addRow();\r\n\t\t\t\t\ttableRow.addCell(groupObj.text, \"\", 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Final total\r\n\t */\r\n\tfor (let i = 0; i < reportGroups.length; i++) {\r\n\r\n\t\tlet groupObj = getObject(reportGroups, reportGroups[i][\"group\"]);\r\n\r\n\t\tif (groupObj.group === \"total\") {\r\n\t\t\t\r\n\t\t\t// quando l'accantonamento è calcolato come differenza, aggiunge l'importo calcolato al totale\r\n\t\t\tif (userParam.calcolaAccantonamento) {\r\n\t\t\t\tgroupObj.totalExpenses = Banana.SDecimal.add(groupObj.totalExpenses,totAccantonamento);\r\n\t\t\t}\r\n\r\n\t\t\ttableRow = table.addRow();\r\n\t\t\ttableRow.addCell(\" \", \"\", 4);\r\n\t\t\ttableRow = table.addRow();\r\n\t\t\ttableRow.addCell(\"TOTALE\", \"bold\", 2);\r\n\t\t\ttableRow.addCell(Banana.Converter.toLocaleNumberFormat(groupObj.totalExpenses), \"alignRight bold total\", 1);\r\n\t\t\ttableRow.addCell(\"EUR\", \"bold alignRight\",1);\r\n\t\t}\r\n\t}\r\n}", "function build_trades(papers, panelDesc) {\n\n if (papers && papers.length > 0) {\n\n // Break the papers down into entries\n console.log('breaking papers into individual entries');\n var entries = [];\n for (var paper in papers) {\n var broken_up = paper_to_entries(papers[paper]);\n entries = entries.concat(broken_up);\n }\n console.log(\"Displaying\", papers.length, \"papers as\", entries.length, \"entries\");\n\n // If no panel is given, assume this is the trade panel\n if (!panelDesc) {\n panelDesc = panels[0];\n }\n\n entries.sort(sort_selected);\n if (sort_reversed) entries.reverse();\n\n // Display each entry as a row in the table\n var rows = [];\n for (var i in entries) {\n console.log('!', entries[i]);\n\n if (entries[i].quantity > 0) {\t\t\t\t\t\t\t\t\t\t\t\t\t//cannot buy when there are none\n\n if (excluded(entries[i], filter)) {\n var style;\n if (user.name.toLowerCase() === entries[i].owner.toLowerCase()) {\n //cannot buy my own stuff\n style = 'invalid';\n }\n else if (entries[i].issuer.toLowerCase() !== entries[i].owner.toLowerCase()) {\n //cannot buy stuff already bought\n style = 'invalid';\n } else {\n style = null;\n }\n\n // Create a row for each valid trade\n var data = [\n formatDate(Number(entries[i].issueDate), '%M/%d %I:%m%P'),\n entries[i].cusip,\n escapeHtml(entries[i].ticker.toUpperCase()),\n formatMoney(entries[i].par),\n //entries[i].quantity,\n //entries[i].discount,\n //entries[i].maturity,\n entries[i].issuer,\n entries[i].owner\n ];\n\n var row = createRow(data);\n style && row.classList.add(style);\n\n // Only the trade panel should allow you to interact with trades\n if (panelDesc.name === \"ledger\") {\n var disabled = false\n if (user.name.toLowerCase() === entries[i].owner.toLowerCase()) disabled = true;\t\t\t//cannot buy my own stuff\n if (entries[i].issuer.toLowerCase() !== entries[i].owner.toLowerCase()) disabled = true;\n var button = buyButton(disabled, entries[i].cusip, entries[i].issuer);\n row.appendChild(button);\n }\n rows.push(row);\n }\n }\n\n }\n\n // Placeholder for an empty table\n var html = '';\n if (rows.length == 0) {\n if (panelDesc.name === 'ledger')\n html = '<tr><td>nothing here...</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';\n else if (panelDesc.name === 'audit')\n html = '<tr><td>nothing here...</td><td></td><td></td><td></td><td></td><td></td></tr>'; // No action column\n $(panelDesc.tableID).html(html);\n } else {\n // Remove the existing table data\n console.log(\"clearing existing table data\");\n var tableBody = $(panelDesc.tableID);\n tableBody.empty();\n\n\n // Add the new rows to the table\n console.log(\"populating new table data\");\n var row;\n while (rows.length > 0) {\n row = rows.shift();\n tableBody.append(row);\n }\n }\n } else {\n if (panelDesc.name === 'ledger')\n html = '<tr><td>nothing here...</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';\n else if (panelDesc.name === 'audit')\n html = '<tr><td>nothing here...</td><td></td><td></td><td></td><td></td><td></td></tr>'; // No action column\n $(panelDesc.tableID).html(html);\n }\n}", "function createReportStocktake() {\n \n var TEMPLATE_ID = '1jww1efQoKL1KWcRuNSZcdmAZsyfyy2VO8P7M-c7KIXU' // dry stocktake template\n var FOLDER_ID = '1Ur9LaAUeYzlIFxQ77bO3oj0hJ0UIDULc' // reports go to dry/reports\n \n var packDate = getPackDateFromFilename()\n var PDF_FILE_NAME = Utilities.formatDate(packDate, \"GMT+12:00\", \"yyyy-MM-dd\") + ' Stocktake'\n \n // Set up the docs and the spreadsheet access\n \n var copyFile = DriveApp.getFileById(TEMPLATE_ID).makeCopy(DriveApp.getFolderById(FOLDER_ID)) \n var doc = DocumentApp.openById(copyFile.getId())\n var body = doc.getBody()\n var header = doc.getHeader()\n \n // get a copy of templated tables and clear the document\n var templateOrdersTable = body.getTables()[0]\n body.clear()\n \n // copy and remove the template order row\n var dataRow = templateOrdersTable.getRow(1).removeFromParent()\n \n // Document Heading - set the packdate\n header.replaceText('%PACKDATE%', Utilities.formatDate(packDate, \"GMT+12:00\", \"EEEE, d MMMM yyyy\"))\n\n // create a separate table for each measuring-type of product\n var weighables = templateOrdersTable.copy().replaceText(\"%type%\", \"Weighables (kg)\")\n var countables = templateOrdersTable.copy().replaceText(\"%type%\", \"Countables\")\n var pourables = templateOrdersTable.copy().replaceText(\"%type%\", \"Pourables (litres)\")\n\n // Get products\n var products = getProducts() \n \n // add a row for each product to one of the tables\n for (var i = 0; i < products.length; i++){\n var product = products[i]\n var newRow = dataRow.copy()\n \n // newRow.replaceText(\"%tweak%\", (order.tweak == 0 ? \"\" : order.tweak))\n newRow.replaceText(\"%product%\", product.product)\n \n if (product.unit == \"kg\" || product.product.toLowerCase() == \"coconut oil\") {\n newRow = weighables.appendTableRow(newRow)\n } else if (product.unit == \"litre\") {\n newRow = pourables.appendTableRow(newRow)\n } else {\n newRow = countables.appendTableRow(newRow) \n }\n }\n \n if (countables.getNumRows() > 1) {body.appendTable(countables)}\n body.appendPageBreak()\n if (weighables.getNumRows() > 1) {body.appendTable(weighables)}\n if (pourables.getNumRows() > 1) {body.appendTable(pourables)}\n\n\n //------------------------------------------\n // Create PDF from doc, rename it if required and delete the doc\n \n doc.saveAndClose()\n \n var pdf = DriveApp.getFolderById(FOLDER_ID).createFile(copyFile.getAs('application/pdf')) \n if (PDF_FILE_NAME !== '') {\n pdf.setName(PDF_FILE_NAME)\n } \n sharePdfPacksheets(pdf)\n copyFile.setTrashed(true)\n}", "function launchReport(script) {\n Launch(script, 'Report', 800, 550);\n}", "function displayMyPortDetails() {\n var portfolioHTML = \"\";\n $('.data').html(portfolioHTML);\n for (var i = 0; i < userAccount.length; i++) {\n var invbalance = currencyFormat.format(userAccount[i].balance);\n var progress = +(userAccount[i].balance / +userBalance * 100).toFixed(2) + \"%\";\n portfolioHTML += `<div class=\"${userAccount[i].ticker} inv-container\" data-toggle=\"modal\" data-target=\"#modal-inv\">${userAccount[i].category}<span class=\"pull-right\">${invbalance}</span>\n <div class=\"progress\"><div class=\"progress-bar\" style=\"width: ${progress}; background-color: ${userAccount[i].color};\"></div></div></div> `;\n }\n $('.data').html(portfolioHTML);\n}", "function portfolioTemplate() {\n\n\t\t// There's for sure a better way to make multiple Objects with different properties and differing child Objects.\n\n\t\t// I just had more important things to optimize last night.\n\n\t\ttemplate = {\n\n\t\t\tdiv0: makeObject(),\n\n\t\t\tdiv2: makeObject(),\n\n\t\t\tdiv3: makeObject(),\n\n\t\t\tdiv1: makeObject(),\n\n\t\t\tdiv5: makeObject(),\n\n\t\t\tdiv4: makeObject(),\n\n\t\t\tdiv6: makeObject(),\n\n\t\t\tdiv8: makeObject(),\n\n\t\t\tdiv7: makeObject(),\n\n\t\t\tdiv9: makeObject(),\n\n\t\t\tdiv11: makeObject(),\n\n\t\t\tdiv10: makeObject(),\n\n\t\t\tdiv12: makeObject(),\n\n\t\t\tdiv14: makeObject(),\n\n\t\t\tdiv13: makeObject(),\n\n\t\t\tdiv15: makeObject(),\n\n\t\t\tdiv17: makeObject(),\n\n\t\t\tdiv16: makeObject(),\n\n\t\t\tdiv18: makeObject(),\n\n\t\t\tdiv19: makeObject()\n\n\t\t}\n\n\t\ttemplate.tag();\n\n\t}", "outputDataToCSV(self) {\n let portfolio = new Portfolio(self.stocksToRetrieve);\n\n let displayArray = [];\n\n portfolio.displayItems.forEach((item) => {\n displayArray.push(item.displayObjects);\n });\n\n let csv = CsvUtils.jsonArrayToCsv(displayArray);\n \n CsvUtils.writeToFile(stockOutputCsvPath, csv);\n }", "function onOpen() {\n //creates a menu item to run createMaturitySheet() function below\n SpreadsheetApp.getUi()\n .createMenu('TBM Assessment')\n .addItem('Create new TBM maturity worksheet', 'createMaturitySheet')\n .addItem('Show average TBM maturity results', 'createAveragesChart')\n .addItem('Show average TBM priority rankings','createRankChart')\n .addToUi();\n}", "function complete(err, result){\n console.log(\"RESULT\");\n\n var overview_data = result[0];\n var itd_data = result[1];\n var expenses_by_month_data = result[2];\n var cost_share_data = result[3];\n var payments_data = result[4];\n var subcontracts_data = result[5];\n\n\n // AGGREGATION - enrich the results with the respective 'selection'.\n overview_data.selection = \"RD006\";\n itd_data.selection = \"RD007\";\n expenses_by_month_data.selection = \"RD008\";\n cost_share_data.selection = \"RD009\";\n payments_data.selection = \"RD016\";\n subcontracts_data.selection = \"RD017\";\n\n var event = {\n report_title: \"Sponsored Project Report (Project ID: \"+ project_id + \")\",\n reports: {\n project_overview: overview_data,\n by_month: expenses_by_month_data,\n cost_share_detail: cost_share_data,\n inception_to_date: itd_data,\n payments: payments_data,\n subcontracts: subcontracts_data\n }\n }\n\n event.reports.inception_to_date.projections = [];\n\n event.reports.project_overview.title = \"Overview \";\n event.reports.inception_to_date.title = \"Inception to Date\";\n event.reports.inception_to_date.headers.push(\"PROJECTIONS\"); // @TODO: move this to rdash-exports.js\n event.reports.by_month.title = \"Expenses By Month\";\n event.reports.cost_share_detail.title = \"Cost Share Detail\";\n event.reports.payments.title = \"Payments\";\n event.reports.subcontracts.title = \"Subcontracts\";\n\n // set the filename for the Excel export\n // auto generate a filename based on the username\n function makeFilename(project_id){\n var date = dateFormat(Date.now(), \"isoDateTime\");\n return \"ResearchPortal_SponsoredProject_\" + (project_id || \"report\") + \".\" + date + \".xlsx\";\n }\n event.filename = makeFilename(project_id);\n\n // ProjectExport.generateExcelPivot(event, handleResponse);\n ProjectExport.generateExcelSponsored(event, handleResponse);\n }", "function displayProjects() {\n const portfolio = document.querySelector(\".portfolio_flex\");\n let projectHTML = \"\";\n projects.forEach((project, i) => {\n projectHTML += `\n <div class=\"portfolio_images\" data-index=\"${i}\">\n <img src=\"images/${project.image}.jpg\">\n <div class=\"portfolio_button\">\n <button class=\"btn_info\">Info</button>\n </div> \n </div>\n `;\n });\n // making the projects visible\n portfolio.innerHTML = projectHTML;\n }", "function main(){\r\n\r\n //create all of your stocks\r\n let s1 = new Stock(Google,googl,NASDAQ,104.21,100);\r\n let s2 = new Stock(Yahoo,abba,BAS,70.20,100);\r\n let s3 = new Stock(Potbellys,Pbpb,NASDAQ,11.14,100);\r\n let s4 = new Stock(ActivisionBlizzard,Attvi,NASDAQ,62,100);\r\n\r\n //build your Portfolio\r\n let myport = new Portfolio();\r\n myport.add(stk1);\r\n myport.add(stk2);\r\n myport.add(stk3);\r\n myport.add(stk4);\r\n\r\n\r\nconsole.log(myport.totalValue());\r\nconsole.log(\"------------\");\r\nconsole.log(myport);\r\n\r\n //generate a test forcast\r\n //build prediction\r\n}", "function logJiraInfo() {\n initializeMetaData();\n let storiesDumpSheet = SpreadsheetApp.getActive().getSheetByName('StoriesDump');\n let storiesAnalysisSheet = SpreadsheetApp.getActive().getSheetByName('StoriesChart');\n \n let data = storiesDumpSheet.getDataRange().getValues();\n //First get the indexes right for the Actual Start Date, Actual End Date, Planned Start Date and Due Date\n let storyIdIndex = data[0].indexOf(storyIdField);\n let podIndex = data[0].indexOf(podField);\n let assigneeIndex = data[0].indexOf(assigneeField);\n let storyPointsIndex = data[0].indexOf(storyPointsField);\n let actualEndDateColumnIndex = data[0].indexOf(actualEndDateColumnField);\n let plannedEndDateColumnIndex = data[0].indexOf(plannedEndDateColumnField);\n let originalEstimateIndex = data[0].indexOf(originalEstimateField);\n let timeSpentIndex = data[0].indexOf(timeSpentField);\n let remainingTimeIndex = data[0].indexOf(remainingTimeField);\n let storyStatusIndex = data[0].indexOf(storyStatusField);\n\n let today = new Date();\n\n storiesAnalysisSheet.clear();\n storiesAnalysisSheet.appendRow([\"Key\", \"<ProjectName> POD\", \"Delay in Start - Not yet started\", \"Delay In Progress - Due date based\", \"ETC - Not yet Started\", \"ETC - In Progress Stories\", \"Delay - Completed\", \"Story Status\", \"Original Estimate\", \"Remaining Effort\", \"Time Already Spent\", \"Assignee\", \"JIRA Status\", \"Story Points\", \"Planned Due Date\", \"Projected Due Date\"]);\n\n let finalStoriesArray = [];\n\n for (let rownum = 1; rownum < data.length; rownum++) {\n\n let storyKey = data[rownum][storyIdIndex];\n let storyPoints = data[rownum][storyPointsIndex];\n if (storyPoints === \"\") {\n storyPoints = 0;\n }\n let jiraStatus = data[rownum][storyStatusIndex];\n\n let effortRemaining = data[rownum][remainingTimeIndex] / 28800;\n let plannedDueDate = data[rownum][plannedEndDateColumnIndex];\n\n let projectedDueDate = new Date();\n\n let storyStatusCategory;\n\n //If the story does not have a planned date, skip it\n if (plannedDueDate === \"\") {\n continue;\n } else {\n plannedDueDate = new Date(data[rownum][plannedEndDateColumnIndex]);\n plannedDueDate.setHours(23, 59, 59);\n }\n\n //Status for not started Story\n let yetToStart_delayInStart = 0;\n let yetToStart_ETC = roundToTwo((data[rownum][originalEstimateIndex]) / 28800);;\n\n if ((devNotStartedString.indexOf(data[rownum][storyStatusIndex])) !== -1) {\n\n let plannedStartDate = new Date(plannedDueDate.getTime() - effortRemaining * (24 * 3600 * 1000));\n\n if ((plannedStartDate.getDay() > 5) || (plannedStartDate.getDay() < 1)) {\n plannedStartDate.setDate(plannedStartDate.getDate() - 2);\n }\n if (plannedStartDate < today) {\n yetToStart_delayInStart = roundToTwo((today.getTime() - plannedStartDate.getTime()) / (24 * 3600 * 1000)) - getNonWorkingDaysBtwTwoDates(plannedStartDate, today);\n }\n\n if (yetToStart_delayInStart === 0) {\n projectedDueDate = plannedDueDate;\n } else {\n projectedDueDate.setDate(plannedDueDate.getDate() + roundToTwo(yetToStart_ETC));\n projectedDueDate.setDate(projectedDueDate.getDate() + getNonWorkingDaysBtwTwoDates(plannedDueDate, projectedDueDate));\n }\n\n storyStatusCategory = \"Not yet Started\";\n }\n\n //Status for in-progress Story\n let delayInProgress_DueDateBased = 0;\n let delayInProgress_ETC = 0;\n\n if ((incompleteStatusString.indexOf(data[rownum][storyStatusIndex])) !== -1) {\n\n let estimatedCompletionDate = new Date(today.getTime() + effortRemaining * (24 * 3600 * 1000));\n if ((estimatedCompletionDate.getDay() > 5) || (estimatedCompletionDate.getDay() < 1)) {\n estimatedCompletionDate.setDate(estimatedCompletionDate.getDate() + 2);\n }\n\n let nonWorkingDays_InProgress;\n\n if (estimatedCompletionDate < plannedDueDate) {\n nonWorkingDays_InProgress = getNonWorkingDaysBtwTwoDates(estimatedCompletionDate, plannedDueDate);\n delayInProgress_DueDateBased = -1.0 * (roundToTwo(((plannedDueDate.getTime() - estimatedCompletionDate.getTime()) / (24 * 3600 * 1000))) - nonWorkingDays_InProgress);\n console.log(\"Story id: \" + storyKey + \"::::\" + plannedDueDate + \"::::\" + estimatedCompletionDate);\n } else {\n nonWorkingDays_InProgress = getNonWorkingDaysBtwTwoDates(plannedDueDate, estimatedCompletionDate);\n delayInProgress_DueDateBased = roundToTwo(((estimatedCompletionDate.getTime() - plannedDueDate.getTime()) / (24 * 3600 * 1000))) - nonWorkingDays_InProgress;\n console.log(\"Story id: \" + storyKey + \"::::\" + plannedDueDate + \"::::\" + estimatedCompletionDate + \"::::\" + delayInProgress_DueDateBased);\n }\n\n projectedDueDate = estimatedCompletionDate;\n delayInProgress_ETC = roundToTwo((data[rownum][remainingTimeIndex]) / 28800);\n storyStatusCategory = \"In Progress\";\n }\n\n //Status for completed Story\n let delayInCompletion_Completed = 0;\n if ((completeStatusString.indexOf(data[rownum][storyStatusIndex])) !== -1) {\n let actualCompletionDate = data[rownum][actualEndDateColumnIndex];\n storyStatusCategory = \"Dev Complete\";\n if (actualCompletionDate !== \"\") {\n // Need to account for non-working days - remove them\n delayInCompletion_Completed = roundToTwo((actualCompletionDate.getTime() - plannedDueDate.getTime()) / (24 * 3600 * 1000));\n }\n }\n \n finalStoriesArray.push([data[rownum][storyIdIndex], data[rownum][podIndex], yetToStart_delayInStart, delayInProgress_DueDateBased, yetToStart_ETC, delayInProgress_ETC, delayInCompletion_Completed, storyStatusCategory, data[rownum][originalEstimateIndex], data[rownum][remainingTimeIndex], data[rownum][timeSpentIndex], data[rownum][assigneeIndex], jiraStatus, storyPoints, plannedDueDate, projectedDueDate]);\n }\n // Batch Update\n storiesAnalysisSheet.getRange(storiesAnalysisSheet.getLastRow() + 1, 1, finalStoriesArray.length, finalStoriesArray[0].length).setValues(finalStoriesArray);\n getPODStatusGeneric();\n}", "function portfolio(){\r\n\r\n $('#js-grid-mosaic-flat').cubeportfolio({\r\n layoutMode: 'mosaic',\r\n sortByDimension: true,\r\n mediaQueries: [ {\r\n width: 800,\r\n cols: 3,\r\n }, {\r\n width: 767,\r\n cols: 2,\r\n }, {\r\n width: 480,\r\n cols: 1,\r\n }],\r\n gapHorizontal: 15,\r\n gapVertical: 15,\r\n gridAdjustment: 'responsive',\r\n caption: 'zoom',\r\n\r\n // lightbox\r\n lightboxDelegate: '.cbp-lightbox',\r\n lightboxGallery: true,\r\n lightboxTitleSrc: 'data-title',\r\n });\r\n }", "function makeGeneralPage(sprSheet,recentReleases,oldORPDetails) {\n var milestones=releaseList()\n var pendingInfo=oldORPDetails['pending'] //these are the items left to add to the new meeting agenda\n \n var genSheet=sprSheet.getSheetByName(\"General\") //get the right sheet\n genSheet.clear() //remove any content already there\n\n // generic header information\n var nRow=1\n nRow=addRows(genSheet,[{'cols' : ['Welcome to the CMSSW release meeting'], 'isBold':true, 'fontSize':18 }],nRow);\n nRow=addBlankRows(genSheet,{'nRows':2},nRow)\n nRow=addRows(genSheet,[{'cols' : ['General information'], 'isBold':true, 'fontSize':16 }],nRow);\n nRow=addRows(genSheet,[{'cols' : ['Viydo'], \n 'forms' : ['=HYPERLINK(\"http://vidyoportal.cern.ch/flex.html?roomdirect.html&key=uFVZiCsN6DIb\",\"(Vidyo: Weekly_Offline_Meetings room, Extension: 9226777)\")'],\n 'fontSize':14 }],nRow);\n nRow=addBlankRows(genSheet,{'nRows':2},nRow)\n\n nRow=addRows(genSheet,[{'cols' : ['General topics'], 'fontSize':14 }],nRow); \n\n //add in releases created since the last CMSSW release meeting - one per line\n //in case this is recreation of a meeting page, any descriptions are retained\n //via the existingReleases information from the old ORP (which is not old in this case) \n nRow=addRows(genSheet,[{'cols' : ['Recent releases'], 'fontSize':14 }],nRow);\n nRow=addRows(genSheet,[{'cols' : ['Release name','Date created','Primary purpose'], 'fontSize': 12}],nRow); \n var nRowReleaseStart=nRow //cache for where and how many releases there are - needed to create the existingReleases info next time\n var savedReleaseInfo=oldORPDetails['existingReleases']\n\n //See if there is some notes about the releases to save\n for ( var rel in recentReleases) {\n releaseComment=\"To fill in\"\n for ( var i in savedReleaseInfo) {\n if ( i == recentReleases[rel][0] ) {\n releaseComment=savedReleaseInfo[recentReleases[rel][0]]\n }\n }\n //add a link to the release notes\n nRow=addRows(genSheet,[{'cols' : ['',readableDate(extractDate(recentReleases[rel][1])),releaseComment],\n 'forms':['=HYPERLINK(\"https://github.com/cms-sw/cmssw/releases/'+recentReleases[rel][0]+'\",\"'+recentReleases[rel][0]+'\")' ]}],nRow);\n }\n nRow=addBlankRows(genSheet,{'nRows':1},nRow)\n\n //list of general items for discussion (or items that don't fit elsewhere\n nRow=addRows(genSheet,[{'cols' : ['General items for discussion'], 'fontSize':14 }],nRow);\n var genRowTop=nRow\n if ( (pendingInfo['general'] != null) && (pendingInfo['general'].length > 0 )){\n for ( var i in pendingInfo['general']) {\n if ( pendingInfo['general'][i][1].substr(0,1) == \"=\" ) { //watch for hyperlinks that need to be treated separately\n nRow=addRows(genSheet,[{'cols': [pendingInfo['general'][i][0],''],\n 'forms': ['',pendingInfo['general'][i][1]],\n 'isBold':false, 'fontSize':10}],nRow)\n }\n else{ //handle hyperlinks\n nRow=addRows(genSheet,[{'cols': pendingInfo['general'][i], 'isBold':false, 'fontSize':10}],nRow)\n }\n genSheet.getRange(nRow-1,2).setFontSize(8)\n }\n }\n \n \n var genRow=nRow //cache for later\n nRow=nRow+1 //not sure why I did this - it seems to be the same as adding a blank line\n \n nRow=addBlankRows(genSheet,{'nRows':1},nRow)\n \n var saveRows=[]\n // now loop over the active releases and add a stanza in the agenda for each one\n for ( var r in milestones) {\n var m=milestones[r]\n var savedRow=[m]\n nRow=addBlankRows(genSheet,{'nRows':1,'color':'blue'},nRow)\n nRow=addRows(genSheet,[{'cols' : [m], 'isBold':true, 'fontSize':16 }],nRow); //title row\n savedRow.push(nRow)\n nRow=addRows(genSheet,[{'cols' : ['Pending issues'], 'isBold':true, 'fontSize':12 }],nRow); //Pending issues\n \n //now add the pending issues - watch for hyperlinks and handle them separately\n if ( (pendingInfo[m] != null) && (pendingInfo[m].length > 0 )){\n for ( var i in pendingInfo[m]) {\n if ( pendingInfo[m][i][1].substr(0,1) == \"=\" ) {\n nRow=addRows(genSheet,[{'cols': [pendingInfo[m][i][0],''],\n 'forms': ['',pendingInfo[m][i][1]],\n 'isBold':false, 'fontSize':10}],nRow)\n }\n else{\n nRow=addRows(genSheet,[{'cols': pendingInfo[m][i], 'isBold':false, 'fontSize':10}],nRow)\n }\n genSheet.getRange(nRow-1,2).setFontSize(8)\n }\n }\n savedRow.push(nRow)\n\n // Stanza for new external package requests for discussion\n nRow=addRows(genSheet,[{'cols' : ['External package requests'], 'isBold':true, 'fontSize':12 }],nRow);\n savedRow.push(nRow)\n\n // Stanza for new CMSSW requests for discussion\n nRow=addRows(genSheet,[{'cols' : ['CMSSW requests'], 'isBold':true, 'fontSize':12 }],nRow);\n savedRow.push(nRow)\n nRow=nRow+1\n \n saveRows.push(savedRow)\n }\n nRow=addBlankRows(genSheet,{'nRows':1,'color':'blue'},nRow)\n\n //done with release-by-release section. Finish with AOB section\n nRow=addRows(genSheet,[{'cols' : ['AOB'], 'fontSize':14 }],nRow);\n var aobRow=nRow\n saveRows.push(['Misc info',aobRow,genRow,genRowTop,recentReleases.length+\" from \"+nRowReleaseStart])\n nRow=nRow+1//buildAOBMenu(genSheet,nRow)\n nRow=addBlankRows(genSheet,{'nRows':1},nRow)\n\n //Done - now format sheet\n var range=genSheet.getRange(nRow,1,saveRows.length,5)\n range.setValues(saveRows)\n genSheet.getRange(1,1,genSheet.getLastRow(),5).setWrap(true)\n \n genSheet.hideRows(nRow,saveRows.length)\n nRow=nRow+saveRows.length\n Logger.log('Total general rows'+nRow)\n\n //hardwired column widths \n var pixNums=[40,170,150,250,250]\n for ( var i=0; i<pixNums.length; i++) {\n genSheet.setColumnWidth(i+1,pixNums[i])\n }\n\n //trim off the extra rows and columns\n if ( genSheet.getMaxRows() > nRow) {\n genSheet.deleteRows(nRow,genSheet.getMaxRows()-(nRow-1))\n }\n if ( genSheet.getMaxColumns() > 5 ) {\n genSheet.deleteColumns(6,genSheet.getMaxColumns()-5)\n }\n \n //only \"I\" can edit this page\n var me = Session.getEffectiveUser();\n var protection = genSheet.protect().setDescription('Sample protected range');\n protection.addEditor(me);\n protection.removeEditors(protection.getEditors());\n if (protection.canDomainEdit()) {\n protection.setDomainEdit(false);\n }\n \n\n return genSheet \n}", "function createStyleSheet() {\n //Create stylesheet\n var stylesheet = Banana.Report.newStyleSheet();\n \n //Set page layout\n var pageStyle = stylesheet.addStyle(\"@page\");\n\n //Set the margins\n pageStyle.setAttribute(\"margin\", \"15mm 10mm 10mm 20mm\");\n\n //Set the page landscape\n //pageStyle.setAttribute(\"size\", \"landscape\");\n \n //Set the font\n stylesheet.addStyle(\"body\", \"font-family : Helvetica\");\n \n style = stylesheet.addStyle(\".footer\");\n style.setAttribute(\"text-align\", \"right\");\n style.setAttribute(\"font-size\", \"8px\");\n style.setAttribute(\"font-family\", \"Courier New\");\n\n style = stylesheet.addStyle(\".heading1\");\n style.setAttribute(\"font-size\", \"14px\");\n style.setAttribute(\"font-weight\", \"bold\");\n\n style = stylesheet.addStyle(\".img\");\n style.setAttribute(\"height\", \"40\");\n style.setAttribute(\"width\", \"120\");\n \n //Set Table styles\n style = stylesheet.addStyle(\"table\");\n style.setAttribute(\"width\", \"100%\");\n style.setAttribute(\"font-size\", \"8px\");\n stylesheet.addStyle(\"table.table td\", \"border: thin solid black; padding-bottom: 2px; padding-top: 5px\");\n\n stylesheet.addStyle(\".col1\", \"width:15%\");\n stylesheet.addStyle(\".col2\", \"width:10%\");\n stylesheet.addStyle(\".col3\", \"width:40%\");\n stylesheet.addStyle(\".col4\", \"width:12%\");\n stylesheet.addStyle(\".col5\", \"width:12%\");\n stylesheet.addStyle(\".col6\", \"width:12%\");\n\n stylesheet.addStyle(\".col1a\", \"width:15%\");\n stylesheet.addStyle(\".col2a\", \"width:10%\");\n stylesheet.addStyle(\".col3a\", \"width:40%\");\n stylesheet.addStyle(\".col4a\", \"width:12%\");\n stylesheet.addStyle(\".col5a\", \"width:12%\");\n stylesheet.addStyle(\".col6a\", \"width:12%\");\n\n stylesheet.addStyle(\".col1b\", \"width:15%\");\n stylesheet.addStyle(\".col2b\", \"width:10%\");\n stylesheet.addStyle(\".col3b\", \"width:40%\");\n stylesheet.addStyle(\".col4b\", \"width:12%\");\n stylesheet.addStyle(\".col5b\", \"width:12%\");\n stylesheet.addStyle(\".col6b\", \"width:12%\");\n\n style = stylesheet.addStyle(\".styleTableHeader\");\n style.setAttribute(\"background-color\", \"#464e7e\"); \n style.setAttribute(\"border-bottom\", \"1px double black\");\n style.setAttribute(\"color\", \"#fff\");\n\n style = stylesheet.addStyle(\".bold\");\n style.setAttribute(\"font-weight\", \"bold\");\n\n style = stylesheet.addStyle(\".alignRight\");\n style.setAttribute(\"text-align\", \"right\");\n\n style = stylesheet.addStyle(\".alignCenter\");\n style.setAttribute(\"text-align\", \"center\");\n\n style = stylesheet.addStyle(\".styleTitle\");\n style.setAttribute(\"font-weight\", \"bold\");\n style.setAttribute(\"background-color\", \"#eeeeee\");\n //style.setAttribute(\"padding-bottom\", \"5px\");\n\n style = stylesheet.addStyle(\".bordersLeftRight\");\n style.setAttribute(\"border-left\", \"thin solid black\");\n style.setAttribute(\"border-right\", \"thin solid black\");\n style.setAttribute(\"padding\", \"2px\");\n \n return stylesheet;\n}", "async createPlan() {\n return await this.testrail.addPlan(this.projectId, {\n name: \"[#ccid - test plan]\",\n milestone_id: this.milestone_id,\n entries: [\n { suite_id: 24, name: \"[#ccid] - test suite config\" },\n { suite_id: 25, name: \"[#ccid] - test suite - user\" }\n ]\n });\n }", "function Portfolio() {\n _s();\n\n var _this = this;\n\n var portfolio = [{\n title: \"Software Landing Page Design\",\n category: [\"all\", \"web_design\", \"branding\"],\n imageSrc: \"/images/projects/pic4.jpg\",\n img: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/images/projects/pic1.jpg\",\n layout: \"responsive\",\n width: 370,\n height: 370\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 9\n }, this),\n author: \"Jhone Doe\"\n }, {\n title: \"Software Landing Page Design\",\n category: [\"all\", \"web_development\", \"branding\"],\n imageSrc: \"/images/projects/pic4.jpg\",\n img: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/images/projects/pic2.jpg\",\n layout: \"responsive\",\n width: 370,\n height: 370\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 9\n }, this),\n author: \"Jhone Doe\"\n }, {\n title: \"Software Landing Page Design\",\n category: [\"all\", \"web_design\", \"seo\"],\n imageSrc: \"/images/projects/pic4.jpg\",\n img: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/images/projects/pic3.jpg\",\n layout: \"responsive\",\n width: 370,\n height: 370\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this),\n author: \"Jhone Doe\"\n }, {\n title: \"Software Landing Page Design\",\n category: [\"all\", \"web_design\", \"branding\"],\n imageSrc: \"/images/projects/pic4.jpg\",\n img: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/images/projects/pic4.jpg\",\n layout: \"responsive\",\n width: 370,\n height: 370\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 9\n }, this),\n author: \"Jhone Doe\"\n }, {\n title: \"Software Landing Page Design\",\n category: [\"all\", \"mobile_app\", \"seo\"],\n imageSrc: \"/images/projects/pic4.jpg\",\n img: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/images/projects/pic5.jpg\",\n layout: \"responsive\",\n width: 370,\n height: 370\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 9\n }, this),\n author: \"Jhone Doe\"\n }, {\n title: \"Software Landing Page Design\",\n category: [\"all\", \"branding\", \"seo\"],\n imageSrc: \"/images/projects/pic4.jpg\",\n img: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/images/projects/pic6.jpg\",\n layout: \"responsive\",\n width: 370,\n height: 370\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 9\n }, this),\n author: \"Jhone Doe\"\n }];\n\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(\"all\"),\n filter = _useState[0],\n setFilter = _useState[1];\n\n var _useState2 = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]),\n projects = _useState2[0],\n setProjects = _useState2[1];\n\n var _useLightbox = (0,simple_react_lightbox__WEBPACK_IMPORTED_MODULE_4__.useLightbox)(),\n openLightbox = _useLightbox.openLightbox;\n\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n setProjects(portfolio);\n }, []);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n setProjects([]);\n var filtered = portfolio.map(function (p) {\n return _objectSpread(_objectSpread({}, p), {}, {\n filtered: p.category.includes(filter)\n });\n });\n setProjects(filtered);\n }, [filter]);\n return /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"site-filters style-1 clearfix center m-b40\",\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"ul\", {\n className: \"filters\",\n children: [/*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"btn \".concat(filter === \"all\" ? \"active\" : \"\"),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n active: filter === \"all\",\n onClick: function onClick() {\n return setFilter(\"all\");\n },\n children: \"All\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 19\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"btn \".concat(filter === \"web_design\" ? \"active\" : \"\"),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n active: filter === \"web_design\",\n onClick: function onClick() {\n return setFilter(\"web_design\");\n },\n children: \"Web Design\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 19\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"btn \".concat(filter === \"web_development\" ? \"active\" : \"\"),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n active: filter === \"web_development\",\n onClick: function onClick() {\n return setFilter(\"web_development\");\n },\n children: \"Web Development\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 130,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 19\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"btn \".concat(filter === \"branding\" ? \"active\" : \"\"),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n active: filter === \"branding\",\n onClick: function onClick() {\n return setFilter(\"branding\");\n },\n children: \"Branding\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 138,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 137,\n columnNumber: 19\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"btn \".concat(filter === \"mobile_app\" ? \"active\" : \"\"),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n active: filter === \"mobile_app\",\n onClick: function onClick() {\n return setFilter(\"mobile_app\");\n },\n children: \"Mobile App\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 146,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 145,\n columnNumber: 19\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"btn \".concat(filter === \"seo\" ? \"active\" : \"\"),\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n active: filter === \"seo\",\n onClick: function onClick() {\n return setFilter(\"seo\");\n },\n children: \"SEO\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 154,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 153,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 13\n }, this), /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(simple_react_lightbox__WEBPACK_IMPORTED_MODULE_4__.default, {\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(simple_react_lightbox__WEBPACK_IMPORTED_MODULE_4__.SRLWrapper, {\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"clearfix\",\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"ul\", {\n id: \"masonry\",\n className: \"row\",\n \"data-column-width\": \"3\",\n children: projects.map(function (item) {\n return item.filtered === true ? /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"li\", {\n className: \"card-container col-lg-4 col-md-6 col-sm-6 web_design wow fadeInUp\",\n \"data-wow-duration\": \"2s\",\n \"data-wow-delay\": \"0.1s\",\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"dlab-box style-1 m-b30\",\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"dlab-media\",\n children: /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"\",\n children: [\" \", item.img]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 174,\n columnNumber: 45\n }, _this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 173,\n columnNumber: 41\n }, _this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 172,\n columnNumber: 37\n }, _this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 167,\n columnNumber: 33\n }, _this)\n }, void 0, false) : \"\";\n })\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 163,\n columnNumber: 25\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 162,\n columnNumber: 21\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 161,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 160,\n columnNumber: 13\n }, this)]\n }, void 0, true);\n}", "function _makeReport() {\n document.getElementById(\"reportTable\").hidden = false;\n document.getElementById(\"chartContainer\").hidden = false;\n updateReportFromDB();\n}", "function generateChart(story,projectName) {\n\t\t$(\"#div1\").show();\n\t\tvar ds;\n\t\tvar finish=0,create=0,working=0;\n\t\t\n\t\tfor (i = 0; i < story.length; i++){\n\t\t\tds = [];\n\t\t\tif (story[i].fields.theme == \"sticky-note-green-theme\")\n\t\t\t\tfinish++;\n\t\t\telse if (story[i].fields.theme == \"sticky-note-blue-theme\")\n\t\t\t\tcreate++;\n\t\t\telse \n\t\t\t\tworking++;\n\t\t\t\n\t\t\t$('#mytitle').html(\"Project : \" + projectName);\n\t\t\tds.push(finish);ds.push(working);ds.push(create);\n\t\t\tconfig.data.datasets.forEach(function(dataset) {dataset.data = ds;});\t\t\t\t\n\t\t\tconfig.data.labels = ['Finish','On Progress','New'];\n\t\t\tmyDoughnut.update();\n\t\t}\t\n\t}", "function apply_portfolio(portfolio, position) {\r\n const instrument = position[\"instrument\"][\"name\"];\r\n var shares = position[\"shares\"];\r\n var capital = position[\"capital\"];\r\n\r\n //if there is a portfolio and the instrument is not in it ther filter it out\r\n if (portfolio != null && !(instrument in portfolio)) {\r\n return { shares: -1 };\r\n }\r\n\r\n return { shares: shares, capital: capital };\r\n}", "function produceReport(){\n // this is were most functions are called\n\n userURL = getuserURL();\n\n // add this into the website\n vertifyHttps(userURL); // check if the url is http/s\n googleSafeBrowsingAPI(userURL);\n virusTotalAPI(userURL);\n apilityCheck(userURL);\n}", "function getPortfolio(request, response) {\r\n let SQL = 'SELECT * FROM portfolio;';\r\n\r\n return client.query(SQL)\r\n .then(result => {\r\n response.render('pages/portfolio', { regret: result.rows })\r\n })\r\n .catch(error => {\r\n request.error = error;\r\n getError(request, response);\r\n });\r\n}", "function main() {\n ObjPortfolioController = new PortfolioController();\n ObjPortfolioController.ocultarElemento(\"formulario\");\n ObjPortfolioController.getTodosTable(divPortfolios);\n ObjPortfolioController.registrarEvento()\n}", "function assembleReport() {\n var key, element, component, errorBool = false;\n \n //assemble whitelist report\n esprimaReport = esprimaReport.concat('Whitelist: <br>');\n for (element in parameters.whitelist) {\n if (parameters.whitelist[element] !== true) {\n errorBool = true;\n esprimaReport = esprimaReport.concat('&nbsp Error: You are missing a ' + element + '.');\n }\n }\n if (!errorBool) {\n esprimaReport = esprimaReport.concat('&nbsp No issues!<br>');\n } else {\n esprimaReport = esprimaReport.concat('<br>');\n }\n \n //assemble blacklist report\n esprimaReport = esprimaReport.concat('Blacklist:');\n if (reports.blacklist.length > 0) {\n esprimaReport = esprimaReport.concat('<br>');\n reports.blacklist.forEach(function (element) {\n esprimaReport = esprimaReport.concat('&nbsp Error: You have a ' + element.type + ' on line ' + element.location + '.<br>');\n });\n } else {\n esprimaReport = esprimaReport.concat(' No issues! <br>');\n }\n \n //assemble structure report\n esprimaReport = esprimaReport.concat('Structure: <br>');\n if (parameters.structure.integrity) {\n esprimaReport = esprimaReport.concat('&nbsp No issues! <br>');\n } else {\n parameters.structure.components.some(function (component, index) {\n if (index === 0) {\n esprimaReport = esprimaReport.concat('&nbsp Error: You are missing a ');\n }\n component.array.forEach(function (element, index) {\n esprimaReport = esprimaReport.concat(element);\n if (index < component.array.length - 1) {\n esprimaReport = esprimaReport.concat(' enclosing a ');\n }\n });\n if (index < component.array.length - 1) {\n esprimaReport = esprimaReport.concat(', followed by a <br>');\n }\n });\n esprimaReport = esprimaReport.concat('.<br>');\n }\n }", "function getPortfolio() {\n console.log(\"Portfolio request is\", \"/api/portfolio/\" + userId)\n fetch('/api/portfolio/' + userId)\n .then((response) => response.json())\n .then((data) => {\n console.log(\"Client: Loaded portfolio data\", data);\n console.log(\"User info is, \", user)\n setPortfolioData(data);\n computeSectors(data)\n computeMarketCaps(data)\n profitLossCalculator(data)\n })\n\n\n\n // Also get the amount of cash that user currently has\n fetch('/api/users/' + user.name)\n .then((response) => response.json())\n .then((data) => {\n console.log('data is', data)\n setCash(data[0].cash);\n })\n\n // Also get the portfolio value history\n fetch('/api/portfolioValueHistory/' + user['id'])\n .then((response) => response.json())\n .then((data) => {\n console.log('Portfoliovaluehistory is', data)\n setPortfolioHistory(data);\n\n })\n }", "function createReportOrders() {\n \n var TEMPLATE_ID = '1IQKKvDM8AMvvxi5VsNmARzzFdiWWk3nstC6POTQzDNQ' // dry pack list template\n var FOLDER_ID = '1Ur9LaAUeYzlIFxQ77bO3oj0hJ0UIDULc' // reports go to dry/reports\n \n var packDate = getPackDateFromFilename()\n var PDF_FILE_NAME = Utilities.formatDate(packDate, \"GMT+12:00\", \"yyyy-MM-dd\") + ' Orders'\n \n if (TEMPLATE_ID === '') { \n SpreadsheetApp.getUi().alert('TEMPLATE_ID needs to be defined in code.gs')\n return\n }\n \n // Set up the docs and the spreadsheet access\n \n var copyFile = DriveApp.getFileById(TEMPLATE_ID).makeCopy(DriveApp.getFolderById(FOLDER_ID)) \n var doc = DocumentApp.openById(copyFile.getId())\n var body = doc.getBody()\n var header = doc.getHeader()\n \n // get a copy of templated tables and clear the document\n var templateMemberTable = body.getTables()[0]\n var templateOrdersTable = body.getTables()[1]\n body.clear()\n \n // copy and remove the template order row\n var dataRow = templateOrdersTable.getRow(1).removeFromParent()\n \n // Document Heading - set the packdate\n header.replaceText('%PACKDATE%', Utilities.formatDate(packDate, \"GMT+12:00\", \"EEEE, d MMMM yyyy\"))\n\n // Get orders\n var memberOrders = getDryOrdersByMember() //.reverse()\n\n \n //------------------------------------------------------------------------------------------------\n // for each member, on a new page, add a member header and then a table for each type of product\n //------------------------------------------------------------------------------------------------\n \n for (var i = 0; i < memberOrders.length; i++){\n var member = memberOrders[i]\n \n if (i>0) {body.appendPageBreak()}\n\n // create and insert member header\n var memberTable = templateMemberTable.copy()\n memberTable.replaceText(\"%member%\", member.name)\n memberTable.replaceText(\"%id%\", member.id)\n memberTable = body.appendTable(memberTable)\n \n \n // create a separate table for each measuring-type of product\n var weighables = templateOrdersTable.copy().replaceText(\"%type%\", \"Weighables (kg)\")\n var countables = templateOrdersTable.copy().replaceText(\"%type%\", \"Countables\")\n var pourables = templateOrdersTable.copy().replaceText(\"%type%\", \"Pourables (litres)\")\n \n // add a row for each order to one of the tables\n for (var j = 0; j < member.orders.length; j++) {\n var order = member.orders[j]\n var newRow = dataRow.copy()\n \n // newRow.replaceText(\"%tweak%\", (order.tweak == 0 ? \"\" : order.tweak))\n newRow.replaceText(\"%product%\", order.product)\n newRow.replaceText(\"%qty%\", order.qty)\n \n if (order.unit == \"kg\" || order.product.toLowerCase() == \"coconut oil\") {\n newRow = weighables.appendTableRow(newRow)\n } else if (order.unit == \"litre\") {\n newRow = pourables.appendTableRow(newRow)\n } else {\n newRow = countables.appendTableRow(newRow) \n }\n } \n if (countables.getNumRows() > 1) {body.appendTable(countables)}\n if (weighables.getNumRows() > 1) {body.appendTable(weighables)}\n if (pourables.getNumRows() > 1) {body.appendTable(pourables)}\n }\n\n //------------------------------------------\n // Create PDF from doc, rename it if required and delete the doc\n \n doc.saveAndClose()\n \n var pdf = DriveApp.getFolderById(FOLDER_ID).createFile(copyFile.getAs('application/pdf')) \n if (PDF_FILE_NAME !== '') {\n pdf.setName(PDF_FILE_NAME)\n } \n sharePdfPacksheets(pdf)\n \n copyFile.setTrashed(true)\n\n}", "function displayWork() {\n if (work['jobs'].length > 0) {\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart)\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer)\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title)\n var formattedEmployerTitle = formattedEmployer + formattedTitle\n var formattedWorkDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates)\n var formattedWorkLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location)\n var formattedWorkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description)\n $(\".work-entry:last\").append(formattedEmployerTitle, formattedWorkDates, formattedWorkLocation, formattedWorkDescription,HTMLaccompstart)\n if (work.jobs[job].accomplishments) {\n if (work.jobs[job].accomplishments.length > 0) {\n for (accomp in work.jobs[job].accomplishments){\n var formattedAccomplishment = HTMLaccomplishment.replace(\"%data%\",work.jobs[job].accomplishments[accomp])\n $('.accomp-start:last').append(formattedAccomplishment)\n };//end for accomp\n };//end if accomp.lenghth\n };//end if accomplishment\n };\n };\n}", "function createReport() {\n let month = document.getElementById(\"reportMonth\").value;\n let thisMonthOper = JSON.parse(localStorage.getItem(\"operations\"));\n let reportObj = {};\n document.querySelector(\"tbody\").innerHTML = \"\";\n if (thisMonthOper === null) {\n thisMonthOper = [];\n }\n for (var i = 0; i < thisMonthOper.length; i++) {\n let operationsMonth = thisMonthOper[i].date[0]+thisMonthOper[i].date[1]+thisMonthOper[i].date[2]+thisMonthOper[i].date[3]+thisMonthOper[i].date[4]+thisMonthOper[i].date[5]+thisMonthOper[i].date[6];\n //create object from LS info\n if (operationsMonth === month) {\n if (reportObj.hasOwnProperty(thisMonthOper[i].item)) {\n reportObj[thisMonthOper[i].item] += thisMonthOper[i].sum;\n } else {\n reportObj[thisMonthOper[i].item] = thisMonthOper[i].sum;\n }\n }\n }\n //create report table\n let items = Object.keys(reportObj);\n let values = Object.values(reportObj);\n for (var i = 0; i < items.length; i++) {\n let newRow = tbody.insertRow();\n let rows = table.getElementsByTagName(\"tr\");\n let num = rows.length - 2;\n newRow.innerHTML = `\n <td>${num}</td>\n <td>${items[i]}</td>\n <td>${parseFloat(values[i] / 100 * 100).toFixed(2)}</td>\n <td>${months[month.slice(5,7)-1] + \"-\" + month.slice(0,4)}</td>\n `;\n }\n}", "function createVATDeclaration(current, startDate, endDate) {\n\n // Accounting period for the current year file\n var currentStartDate = current.info(\"AccountingDataBase\",\"OpeningDate\");\n var currentEndDate = current.info(\"AccountingDataBase\",\"ClosureDate\");\n var currentYear = Banana.Converter.toDate(currentStartDate).getFullYear();\n var company = current.info(\"AccountingDataBase\",\"Company\");\n var address = current.info(\"AccountingDataBase\",\"Address1\");\n var city = current.info(\"AccountingDataBase\",\"City\");\n var state = current.info(\"AccountingDataBase\",\"State\");\n var fiscalNumber = current.info(\"AccountingDataBase\",\"FiscalNumber\");\n var vatNumber = current.info(\"AccountingDataBase\",\"VatNumber\"); \n var phoneNumber = current.info(\"AccountingDataBase\",\"Phone\");\n var email = current.info(\"AccountingDataBase\",\"Email\");\n\n // Extract data from journal and calculate balances\n var transactions = VatGetJournal(current, startDate, endDate);\n\n if (!report) {\n var report = Banana.Report.newReport(\"VAT Declaration\");\n }\n\n // Header of the report\n var table = report.addTable(\"table\");\n\n var col1 = table.addColumn(\"c1\");\n col1.setStyleAttributes(\"width:25%\");\n var col2 = table.addColumn(\"c2\");\n col2.setStyleAttributes(\"width:25%\");\n var col3 = table.addColumn(\"c3\");\n col3.setStyleAttributes(\"width:25%\");\n var col4 = table.addColumn(\"c4\");\n col4.setStyleAttributes(\"width:25%\");\n \n \n tableRow = table.addRow();\n tableRow.addCell(\"RÉPUBLIQUE DÉMOCRATIQUE DU CONGO\", \"\",4); \n\n tableRow = table.addRow();\n tableRow.addCell(\"MINISTÈRE DES FINANCES\", \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addImage(\"images/logo.jpg\", \"1.9cm\", \"1.9cm\", \"logostyle\");\n cell_in = tableRow.addCell(\"\", \"\", 2);\n\n var insideTable = cell_in.addTable(\"inTable\");\n\n row_in = insideTable.addRow();\n row_in.addCell(\"\", \"\", 5);\n row_in = insideTable.addRow();\n row_in.addCell(\"DÉCLARATION DE LA TAXE SUR LA VALEUR AJOUTÉE\", \"center bold\", 1).setStyleAttributes(\"border-top:thin solid black\");\n row_in = insideTable.addRow();\n row_in.addCell(\"Mois de (2):\", \"center bold\", 1).setStyleAttributes(\"border-left:thin solid black\");\n row_in = insideTable.addRow();\n row_in.addCell(\"(à souscrire obligatoirement au plus tard le 15 du mois suivant)\", \"center bold\", 1);\n row_in = insideTable.addRow();\n row_in.addCell(\"\", \"center bold\", 1);\n\n tableRow = table.addRow();\n tableRow.addCell(\"SERVICE (1):\", \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\"\", \"\", 4);\n\n // VAT table\n var table = report.addTable(\"vatTable\");\n var col1 = table.addColumn(\"colTable1\");\n col1.setStyleAttributes(\"width:5%\");\n var col2 = table.addColumn(\"colTable2\");\n col2.setStyleAttributes(\"width:5%\");\n var col3 = table.addColumn(\"colTable3\");\n col3.setStyleAttributes(\"width:5%\");\n var col4 = table.addColumn(\"colTable4\");\n col4.setStyleAttributes(\"width:5%\");\n var col5 = table.addColumn(\"colTable5\");\n col5.setStyleAttributes(\"width:5%\");\n var col6 = table.addColumn(\"colTable6\");\n col6.setStyleAttributes(\"width:5%\");\n var col7 = table.addColumn(\"colTable7\");\n col7.setStyleAttributes(\"width:5%\");\n var col8 = table.addColumn(\"colTable8\");\n col8.setStyleAttributes(\"width:5%\");\n var col9 = table.addColumn(\"colTable9\");\n col9.setStyleAttributes(\"width:5%\");\n var col10 = table.addColumn(\"colTable10\");\n col10.setStyleAttributes(\"width:5%\");\n var col11 = table.addColumn(\"colTable11\");\n col11.setStyleAttributes(\"width:5%\");\n var col12 = table.addColumn(\"colTable12\");\n col12.setStyleAttributes(\"width:5%\");\n var col13 = table.addColumn(\"colTable13\");\n col13.setStyleAttributes(\"width:5%\");\n var col14 = table.addColumn(\"colTable14\");\n col14.setStyleAttributes(\"width:5%\");\n var col15 = table.addColumn(\"colTable15\");\n col15.setStyleAttributes(\"width:5%\");\n var col16 = table.addColumn(\"colTable16\");\n col16.setStyleAttributes(\"width:5%\");\n var col17 = table.addColumn(\"colTable17\");\n col17.setStyleAttributes(\"width:5%\");\n var col18 = table.addColumn(\"colTable18\");\n col18.setStyleAttributes(\"width:5%\");\n var col19 = table.addColumn(\"colTable19\");\n col19.setStyleAttributes(\"width:5%\");\n var col20 = table.addColumn(\"colTable20\");\n col20.setStyleAttributes(\"width:5%\");\n \n var tableRow = table.addRow();\n tableRow.addCell(\"I. IDENTIFICATION DU REDEVABLE (3)\", \"bold\", 11).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"\", 9);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Nom ou Raison sociale: \" + company, \"\",8).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"NUMÉRO IMPÔT\", \"\", 3).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(fiscalNumber, \"\", 9).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"Sigle:\", \"\", 8).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Adresse Postale:\", \"\", 3).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"\", 9).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"Adresse Physique:\", \"\", 8).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Nº téléphone:\", \"\", 3).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(phoneNumber, \"\", 9).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(address, \"\", 8).setStyleAttributes(\"border-top:thin black solid;border-bottom:0px black solid\");\n tableRow.addCell(\"Fax:\", \"\", 3).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"\", 9).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"\", \"\", 8).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"E-mail:\", \"\", 3).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(email, \"\", 9).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 20);\n\n tableRow = table.addRow();\n tableRow.addCell(\"II. OPÉRATIONS RÉALISÉES (4)\", \"bold\", 12).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Chiffre d'affaires (a)\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"TVA Collectée(b)=a * 16%\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 1: Livraisons de biens */\n tableRow = table.addRow();\n tableRow.addCell(\"1\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Livraisons de biens\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v1Taxable = VatGetGr1Balance(current, transactions, \"1\", 2, startDate, endDate);\n var v1Amount = VatGetGr1Balance(current, transactions, \"1\", 4, startDate, endDate);\n tableRow.addCell(formatNumber(v1Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(v1Amount), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 2: Prestations de services */\n tableRow = table.addRow();\n tableRow.addCell(\"2\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Prestations de services\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v2Taxable = VatGetGr1Balance(current, transactions, \"2\", 2, startDate, endDate);\n var v2Amount = VatGetGr1Balance(current, transactions, \"2\", 4, startDate, endDate);\n tableRow.addCell(formatNumber(v2Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(v2Amount), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 3: Livraisons de biens à soi-même */\n tableRow = table.addRow();\n tableRow.addCell(\"3\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Livraisons de biens à soi-même\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v3Taxable = VatGetGr1Balance(current, transactions, \"3\", 2, startDate, endDate);\n var v3Amount = VatGetGr1Balance(current, transactions, \"3\", 4, startDate, endDate);\n tableRow.addCell(formatNumber(v3Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(v3Amount), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 4: Prestations de services à soi-même */\n tableRow = table.addRow();\n tableRow.addCell(\"4\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Prestations de services à soi-même\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v4Taxable = VatGetGr1Balance(current, transactions, \"4\", 2, startDate, endDate);\n var v4Amount = VatGetGr1Balance(current, transactions, \"4\", 4, startDate, endDate);\n tableRow.addCell(formatNumber(v4Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(v4Amount), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 5: Opérations afférentes aux marchés publics à financement extérieur */\n tableRow = table.addRow();\n tableRow.addCell(\"5\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Opérations afférentes aux marchés publics à financement extérieur\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v5Taxable = VatGetGr1Balance(current, transactions, \"5\", 2, startDate, endDate);\n var v5Amount = VatGetGr1Balance(current, transactions, \"5\", 4, startDate, endDate);\n tableRow.addCell(formatNumber(v5Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(v5Amount), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 6: Exportations et opérations assimilées */\n tableRow = table.addRow();\n tableRow.addCell(\"6\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Exportations et opérations assimilées\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v6Taxable = VatGetGr1Balance(current, transactions, \"6\", 2, startDate, endDate);\n tableRow.addCell(formatNumber(v6Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"greyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 7: Opérations exonérées */\n tableRow = table.addRow();\n tableRow.addCell(\"7\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Opérations exonérées\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v7Taxable = VatGetGr1Balance(current, transactions, \"7\", 2, startDate, endDate);\n tableRow.addCell(formatNumber(v7Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"greyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 8: Opérations non imposables */\n tableRow = table.addRow();\n tableRow.addCell(\"8\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Opérations non imposables\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n var v8Taxable = VatGetGr1Balance(current, transactions, \"8\", 2, startDate, endDate);\n tableRow.addCell(formatNumber(v8Taxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"greyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 9: Total */\n tableRow = table.addRow();\n tableRow.addCell(\"9\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Total\", \"bold\", 11).setStyleAttributes(\"border:thin black solid\");\n var totalTaxable = 0;\n var totalVatAmount = 0;\n totalTaxable = Banana.SDecimal.add(totalTaxable, v1Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v2Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v3Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v4Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v5Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v6Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v7Taxable);\n totalTaxable = Banana.SDecimal.add(totalTaxable, v8Taxable);\n\n totalVatAmount = Banana.SDecimal.add(totalVatAmount, v1Amount);\n totalVatAmount = Banana.SDecimal.add(totalVatAmount, v2Amount);\n totalVatAmount = Banana.SDecimal.add(totalVatAmount, v3Amount);\n totalVatAmount = Banana.SDecimal.add(totalVatAmount, v4Amount);\n totalVatAmount = Banana.SDecimal.add(totalVatAmount, v5Amount);\n tableRow.addCell(formatNumber(totalTaxable), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(totalVatAmount, \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 20);\n\n tableRow = table.addRow();\n tableRow.addCell(\"III. PRESTATIONS REÇUES DES PRESTATAIRES NON ÉTABLIS EN RDC (5)\", \"bold\", 12).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Montant des factures (c)\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"TVA Collectée(d)=c * 16%\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 10: Prestations reçues des prestataires non établis en RDC */\n tableRow = table.addRow();\n tableRow.addCell(\"10\",\"center\",1).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Prestations reçues des prestataires non établis en RDC\", \"\", 11).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"\", 4).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 20);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Prorata(6) : %\", \"bold\", 8);\n tableRow.addCell(\" \", \"\", 12);\n\n tableRow = table.addRow();\n tableRow.addCell(\"IV. DÉDUCTIONS/Taxe déductible sur:(7)\", \"bold\", 8).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Importations (e)\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Local (f)\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"Total(g)=e + f\", \"bold center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 11: Immobilisations */\n tableRow = table.addRow();\n tableRow.addCell(\"11\", \"center\", 1);\n tableRow.addCell(\"Immobilisations\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var d11AmountE = VatGetGr1BalanceExtraInfo(current, transactions, \"11\", 3, \"IMP\", startDate, endDate);\n var d11AmountF = VatGetGr1BalanceExtraInfo(current, transactions, \"11\", 3, \"\", startDate, endDate);\n var total11G = 0;\n total11G = Banana.SDecimal.add(total11G, d11AmountE);\n total11G = Banana.SDecimal.add(total11G, d11AmountF);\n tableRow.addCell(formatNumber(d11AmountE), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(d11AmountF), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(total11G), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 12: Marchandises */\n tableRow = table.addRow();\n tableRow.addCell(\"12\", \"center\", 1);\n tableRow.addCell(\"Marchandises\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var d12AmountE = VatGetGr1BalanceExtraInfo(current, transactions, \"12\", 3, \"IMP\", startDate, endDate);\n var d12AmountF = VatGetGr1BalanceExtraInfo(current, transactions, \"12\", 3, \"\", startDate, endDate);\n var total12G = 0;\n total12G = Banana.SDecimal.add(total12G, d12AmountE);\n total12G = Banana.SDecimal.add(total12G, d12AmountF);\n tableRow.addCell(formatNumber(d12AmountE), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(d12AmountF), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(total12G), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 13: Matières premières */\n tableRow = table.addRow();\n tableRow.addCell(\"13\", \"center\", 1);\n tableRow.addCell(\"Matières premières\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var d13AmountE = VatGetGr1BalanceExtraInfo(current, transactions, \"13\", 3, \"IMP\", startDate, endDate);\n var d13AmountF = VatGetGr1BalanceExtraInfo(current, transactions, \"13\", 3, \"\", startDate, endDate);\n var total13G = 0;\n total13G = Banana.SDecimal.add(total13G, d13AmountE);\n total13G = Banana.SDecimal.add(total13G, d13AmountF);\n tableRow.addCell(formatNumber(d13AmountE), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(d13AmountF), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(total13G), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 14: Autres biens et services */\n tableRow = table.addRow();\n tableRow.addCell(\"14\", \"center\", 1);\n tableRow.addCell(\"Autres biens et services\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var d14AmountE = VatGetGr1BalanceExtraInfo(current, transactions, \"14\", 3, \"IMP\", startDate, endDate);\n var d14AmountF = VatGetGr1BalanceExtraInfo(current, transactions, \"14\", 3, \"\", startDate, endDate);\n var total14G = 0;\n total14G = Banana.SDecimal.add(total14G, d14AmountE);\n total14G = Banana.SDecimal.add(total14G, d14AmountF);\n tableRow.addCell(formatNumber(d14AmountE), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(d14AmountF), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(total14G), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 15: Total TVA déductible */\n tableRow = table.addRow();\n tableRow.addCell(\"15\", \"center\", 1);\n tableRow.addCell(\"Total TVA déductible (g11+g12+g13+g14)\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var total15E = 0;\n var total15F = 0;\n var total15G = 0;\n total15E = Banana.SDecimal.add(total15E, d11AmountE);\n total15E = Banana.SDecimal.add(total15E, d12AmountE);\n total15E = Banana.SDecimal.add(total15E, d13AmountE);\n total15E = Banana.SDecimal.add(total15E, d14AmountE);\n total15F = Banana.SDecimal.add(total15F, d11AmountF);\n total15F = Banana.SDecimal.add(total15F, d11AmountF);\n total15F = Banana.SDecimal.add(total15F, d11AmountF);\n total15F = Banana.SDecimal.add(total15F, d11AmountF);\n total15G = Banana.SDecimal.add(total15G, total11G);\n total15G = Banana.SDecimal.add(total15G, total12G);\n total15G = Banana.SDecimal.add(total15G, total13G);\n total15G = Banana.SDecimal.add(total15G, total14G);\n tableRow.addCell(formatNumber(total15E), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(total15F), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(total15G), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 16: Report de crédit du mois précédent */\n tableRow = table.addRow();\n tableRow.addCell(\"16\", \"center\", 1);\n tableRow.addCell(\"Report de crédit du mois précédent (déclaration précédente, ligne 24)\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var previousMonthCredit = getCredit(current, startDate, endDate);\n tableRow.addCell(\"\", \"lightGreyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"lightGreyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(previousMonthCredit), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n /* Row 17: Montant de la TVA déductible */\n tableRow = table.addRow();\n tableRow.addCell(\"17\", \"center\", 1);\n tableRow.addCell(\"Montant de la TVA déductible (g15+g16)\", \"\", 7).setStyleAttributes(\"border:thin black solid\");\n var vatAmountDeductible = 0;\n vatAmountDeductible = Banana.SDecimal.add(vatAmountDeductible, total15G);\n vatAmountDeductible = Banana.SDecimal.add(vatAmountDeductible, previousMonthCredit);\n tableRow.addCell(\"\", \"lightGreyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(\"\", \"lightGreyCell\", 4).setStyleAttributes(\"border:thin black solid\");\n tableRow.addCell(formatNumber(vatAmountDeductible), \"center\", 4).setStyleAttributes(\"border:thin black solid\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"V. RÉGULARISATIONS (8)\", \"bold\", 8);\n tableRow.addCell(\"h\", \"center\", 8);\n\n /* Row 18: Reversement de TVA */\n tableRow = table.addRow();\n tableRow.addCell(\"18\", \"center\", 1);\n tableRow.addCell(\"Reversement de TVA\", \"\", 7);\n var r18Amount = VatGetGr1BalanceExtraInfo(current, transactions, \"V-18\", 3, \"\", startDate, endDate);\n tableRow.addCell(formatNumber(Banana.SDecimal.invert(r18Amount)), \"center\", 4);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n\n /* Row 19: Complément de déduction */\n tableRow = table.addRow();\n tableRow.addCell(\"19\", \"center\", 1);\n tableRow.addCell(\"Complément de déduction\", \"\", 7);\n var r19Amount = VatGetGr1BalanceExtraInfo(current, transactions, \"V-19\", 3, \"\", startDate, endDate);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n tableRow.addCell(formatNumber(r19Amount), \"center\", 4);\n\n /* Row 20: Récupération de la TVA déductible sur marchés publics à financement extérieur */\n tableRow = table.addRow();\n tableRow.addCell(\"20\", \"center\", 1);\n tableRow.addCell(\"Récupération de la TVA déductible sur marchés publics à financement extérieur\", \"\", 7);\n var r20Amount = VatGetGr1BalanceExtraInfo(current, transactions, \"V-20\", 3, \"\", startDate, endDate);\n tableRow.addCell(formatNumber(r20Amount), \"center\", 4);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 20);\n\n tableRow = table.addRow();\n tableRow.addCell(\"VI. CALCUL DE L'IMPÔT (9)\", \"bold\", 8);\n tableRow.addCell(\"i\", \"center\", 8);\n\n /* Row 21: TVA nette à verser */\n tableRow = table.addRow();\n tableRow.addCell(\"21\", \"center\", 1);\n tableRow.addCell(\"TVA nette à verser (b9+d10+h18+h20-g17-h19-b5)\", \"\", 7);\n var netVatAmount = 0;\n var vatCredit = 0;\n if(totalVatAmount > vatAmountDeductible) {\n vatCredit = \"\";\n netVatAmount = Banana.SDecimal.add(netVatAmount, totalVatAmount);\n netVatAmount = Banana.SDecimal.add(netVatAmount, Banana.SDecimal.invert(r18Amount));\n netVatAmount = Banana.SDecimal.add(netVatAmount, r20Amount);\n netVatAmount = Banana.SDecimal.subtract(netVatAmount, vatAmountDeductible);\n netVatAmount = Banana.SDecimal.subtract(netVatAmount, r19Amount);\n //netVatAmount = Banana.SDecimal.subtract(netVatAmount, )\n } else {\n netVatAmount = \"\";\n vatCredit = Banana.SDecimal.add(vatCredit, vatAmountDeductible);\n vatCredit = Banana.SDecimal.add(vatCredit, r19Amount);\n vatCredit = Banana.SDecimal.subtract(vatCredit, totalVatAmount);\n vatCredit = Banana.SDecimal.subtract(vatCredit, Banana.SDecimal.invert(r18Amount));\n vatCredit = Banana.SDecimal.subtract(vatCredit, r20Amount);\n }\n tableRow.addCell(formatNumber(netVatAmount), \"center\", 4);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n\n /* Row 22: Crédit de TVA */\n tableRow = table.addRow();\n tableRow.addCell(\"22\", \"center\", 1);\n tableRow.addCell(\"Crédit de TVA (g17+h19+b5-b9-d10-h18-h20)\", \"\", 7);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n tableRow.addCell(formatNumber(vatCredit), \"center\", 4);\n\n /* Row 23: Remboursement de crédit de TVA demandé */\n tableRow = table.addRow();\n tableRow.addCell(\"23\", \"center\", 1);\n tableRow.addCell(\"Remboursement de crédit de TVA demandé (montant figurant sur la demande de remboursement)\", \"\", 7);\n tableRow.addCell(\"\", \"center\", 4);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n\n /* Row 24: Crédit de TVA reportable */\n tableRow = table.addRow();\n tableRow.addCell(\"24\", \"center\", 1);\n tableRow.addCell(\"Crédit de TVA reportable (i22-i23)\", \"\", 7);\n tableRow.addCell(\"\", \"darkGreyCell\", 4);\n tableRow.addCell(\"\", \"center\", 4);\n\n /* Row 25: TVA sur marchés publics à financement extérieur */\n tableRow = table.addRow();\n tableRow.addCell(\"25\", \"center\", 1);\n tableRow.addCell(\"TVA sur marchés publics à financement extérieur (case b5)\", \"\", 7);\n tableRow.addCell(\"\", \"center\", 4);\n tableRow.addCell(\"\", \"greyCell\", 4);\n\n /* Row 26: TVA POUR COMPTE DES TIERS */\n tableRow = table.addRow();\n tableRow.addCell(\"26\", \"center\", 1);\n tableRow.addCell(\"TVA POUR COMPTE DES TIERS\", \"bold\", 7);\n tableRow.addCell(\"\", \"center\", 4);\n tableRow.addCell(\"\", \"greyCell\", 4);\n\n /* Row 27: MONTANT À PAYER */\n tableRow = table.addRow();\n tableRow.addCell(\"27\", \"center\", 1);\n tableRow.addCell(\"MONTANT À PAYER (i21+i25+i26)\", \"bold\", 7);\n tableRow.addCell(\"\", \"center\", 4);\n tableRow.addCell(\"\", \"greyCell\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\"MODE DE PAIEMENT (10)\", \"bold\", 8);\n tableRow.addCell(\" \", \"\", 12);\n\n tableRow = table.addRow();\n tableRow.addCell(\"AVIS DE CERTIFICATION\", \"\", 8);\n tableRow.addCell(\"\", \"\", 2);\n tableRow.addCell(\"CHÈQUE CERTIFIÉ\", \"\", 3).setStyleAttributes(\"padding-left:10px\");\n tableRow.addCell(\"\", \"\", 2);\n tableRow.addCell(\"VIREMENT\", \"center\", 3);\n tableRow.addCell(\"\", \"\", 2);\n\n // Signature and others\n\n var table = report.addTable(\"table\");\n\n var col1 = table.addColumn(\"c1\");\n col1.setStyleAttributes(\"width:25%\");\n var col2 = table.addColumn(\"c2\");\n col2.setStyleAttributes(\"width:25%\");\n var col3 = table.addColumn(\"c3\");\n col3.setStyleAttributes(\"width:25%\");\n var col4 = table.addColumn(\"c4\");\n col4.setStyleAttributes(\"width:25%\");\n\n var tableRow = table.addRow();\n tableRow.addCell(\"\", \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\"\", \"\", 2);\n tableRow.addCell(\"Fait à \" + city, \"\", 1).setStyleAttributes(\"font-size:6.5px;font-weight:bold\"); \n tableRow.addCell(\",le \", \"\", 1).setStyleAttributes(\"font-size:6.5px;font-weight:bold\"); \n\n tableRow = table.addRow();\n tableRow.addCell(\"Déclaré conforme à nos écritures,\", \"\", 4).setStyleAttributes(\"padding-left:40px;font-size:6.5px;font-weight:bold\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"Sceau de l'entreprise\", \"\", 1).setStyleAttributes(\"font-size:6.5px;font-weight:bold\");\n tableRow.addCell(\"Nom et qualité du signataire (11)\", \"\", 2).setStyleAttributes(\"font-size:6.5px;font-weight:bold\"); \n tableRow.addCell(\"Signature\", \"\", 1).setStyleAttributes(\"font-size:6.5px;font-weight:bold\"); \n\n tableRow = table.addRow();\n tableRow.addCell(\"\", \"\", 4);\n\n var table = report.addTable(\"vatTable\");\n var col1 = table.addColumn(\"colTable1\");\n col1.setStyleAttributes(\"width:5%\");\n var col2 = table.addColumn(\"colTable2\");\n col2.setStyleAttributes(\"width:5%\");\n var col3 = table.addColumn(\"colTable3\");\n col3.setStyleAttributes(\"width:5%\");\n var col4 = table.addColumn(\"colTable4\");\n col4.setStyleAttributes(\"width:5%\");\n var col5 = table.addColumn(\"colTable5\");\n col5.setStyleAttributes(\"width:5%\");\n var col6 = table.addColumn(\"colTable6\");\n col6.setStyleAttributes(\"width:5%\");\n var col7 = table.addColumn(\"colTable7\");\n col7.setStyleAttributes(\"width:5%\");\n var col8 = table.addColumn(\"colTable8\");\n col8.setStyleAttributes(\"width:5%\");\n var col9 = table.addColumn(\"colTable9\");\n col9.setStyleAttributes(\"width:5%\");\n var col10 = table.addColumn(\"colTable10\");\n col10.setStyleAttributes(\"width:5%\");\n var col11 = table.addColumn(\"colTable11\");\n col11.setStyleAttributes(\"width:5%\");\n var col12 = table.addColumn(\"colTable12\");\n col12.setStyleAttributes(\"width:5%\");\n var col13 = table.addColumn(\"colTable13\");\n col13.setStyleAttributes(\"width:5%\");\n var col14 = table.addColumn(\"colTable14\");\n col14.setStyleAttributes(\"width:5%\");\n var col15 = table.addColumn(\"colTable15\");\n col15.setStyleAttributes(\"width:5%\");\n var col16 = table.addColumn(\"colTable16\");\n col16.setStyleAttributes(\"width:5%\");\n var col17 = table.addColumn(\"colTable17\");\n col17.setStyleAttributes(\"width:5%\");\n var col18 = table.addColumn(\"colTable18\");\n col18.setStyleAttributes(\"width:5%\");\n var col19 = table.addColumn(\"colTable19\");\n col19.setStyleAttributes(\"width:5%\");\n var col20 = table.addColumn(\"colTable20\");\n col20.setStyleAttributes(\"width:5%\");\n\n var tableRow = table.addRow();\n tableRow.addCell(\"VIII. RÉSERVÉ À L'ADMINISTRATION (12)\", \"bold\", 20);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Nº de la Quittance\", \"\", 7);\n tableRow.addCell(\"Date de la Quittance\", \"\", 6);\n tableRow.addCell(\"Cachet de l'Administration\", \"\", 7);\n\n tableRow = table.addRow();\n tableRow.addCell(\"\", \"\", 7);\n tableRow.addCell(\"\", \"\", 6);\n tableRow.addCell(\"\", \"\", 7);\n\n var table = report.addTable(\"table\");\n\n var col1 = table.addColumn(\"c1\");\n col1.setStyleAttributes(\"width:25%\");\n var col2 = table.addColumn(\"c2\");\n col2.setStyleAttributes(\"width:25%\");\n var col3 = table.addColumn(\"c3\");\n col3.setStyleAttributes(\"width:25%\");\n var col4 = table.addColumn(\"c4\");\n col4.setStyleAttributes(\"width:25%\");\n\n var tableRow = table.addRow();\n tableRow.addCell(\"IMPORTANT\", \"bold italic\", 20).setStyleAttributes(\"font-size:7px;padding-left:15px\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"* Lire attentivement la notice au verso avant de remplir la déclaration. \" + \n \"En cas d'hésitation, se référer au service de la DGI du lieu de souscription.\", \"\", 20).setStyleAttributes(\"font-size:7px;padding-left:15px\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"* Le montant de la TVA payé par l'assujetti bénéficiaire de marché public \" +\n \"à financement extérieur ne comprend pas la TVA prise en charge par l'État.\", \"\", 20).setStyleAttributes(\"font-size:7px;padding-left:15px\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"* Remplir correctement en majuscule toutes les cases.\", \"\", 20).setStyleAttributes(\"font-size:7px;padding-left:15px\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"* En cas de rature ou de surcharge, la déclaration ne sera pas acceptée.\", \"\", 20).setStyleAttributes(\"font-size:7px;padding-left:15px\");\n\n\n return report;\n}", "function generateProjects(page = 0){\n\tlet projectsData = currentProjects;\n\n\tif (page < 0){\n\t\tpage = 0;\n\t}\n\n\tlet max_pages = Math.ceil(projectsData.length/3);\n\n\tif (page >= max_pages){\n\t\tpage = max_pages - 1;\n\t}\n\n\tsetCurrentPagination(page);\n\n\t// init areas\n\tlet projectsArea = document.getElementById(\"portfolio-build-section\");\n\tlet proj_templ = document.getElementsByTagName(\"template\")[0]; // portfolio template\n\n\t// clear area\n\tprojectsArea.textContent = '';\n\n\t// init template pointers\n\tlet proj_label = proj_templ.content.getElementById(\"project-label\");\n\tlet img_preview = proj_templ.content.getElementById(\"project-image\");\n\tlet proj_link = proj_templ.content.getElementById(\"project-link\");\n\tlet proj_decription = proj_templ.content.getElementById(\"project-description\");\n\tlet proj_category = proj_templ.content.getElementById(\"project-single-wrapper\");\n\n\t// Shows max 3 per page\n\tfor (let i= (page * 3);i< (page * 3) + 3;i++){\n\t\tlet d = projectsData[i];\n\t\tif (!d){\n\t\t\tbreak;\n\t\t}\n\t\tproj_category.setAttribute('class', 'w3-third w3-container w3-margin-bottom all ' + d.Category);\n\t\t// proj_category.innerText = d.Category;\n\t\tproj_label.innerHTML = '<b>' + d.PrivateName + '</b>';\n\t\timg_preview.setAttribute('src', d.Preview);\n\t\tproj_link.setAttribute('href', d.Link);\n\t\tproj_decription.innerText = d.Description;\n\n\t\t// clone node\n\t\tlet proj_node = proj_templ.content.cloneNode(true);\n\n\t\t// append\n\t\tprojectsArea.appendChild(proj_node);\n\t}\n}", "function daily_office() {\n _daily_report_(WORK_LIST,OFFICE);\n}", "static generateHTMLReport(capabilities) {\n const os = require(\"os\");\n\n report.generate({\n jsonDir: path.resolve('./test/'),\n reportPath: path.resolve('./test/'),\n metadata: {\n browser: {\n name: capabilities.get('browserName'),\n version: capabilities.get('version')\n },\n device: \"PC\",\n platform: {\n name: os.platform() === \"win32\" ? \"windows\" : os.platform(),\n version: os.release()\n }\n }\n });\n }", "function placeProjects() {\n // place projects when scroll to project section\n if (window.pageYOffset + window.innerHeight <= projectOffsetHeight) { return }\n // get elements\n const projectSection = document.querySelector('.section-project .row')\n // switch status to placed\n projectPlaced = true\n // generate html for each project\n projects.forEach(project => {\n // Get all icon links\n const icons = getIconLinks(project.links)\n // Gather all accomplishments\n const accomplishments = getAccomplishments(project.accomplishments)\n\n projectSection.innerHTML += `\n <div class=\"col s12 m6 animated flipInX\">\n <div class=\"card sticky-action hoverable\">\n <div class=\"card-image waves-effect waves-block waves-light\">\n <img class=\"responsive-img activator\" src=${project.image}\n alt=\"${project.image} Project Cover Photo\">\n <div class=\"overlay\"></div>\n <span class=\"card-title activator\">${project.title}</span>\n </div>\n <div class=\"card-action\">\n <p class=\"activator truncate\"><span class=\"new badge right activator\"\n data-badge-caption=\"${project.badgeCaption}\"></span>${project.title}</p>\n </div>\n <div class=\"card-reveal\">\n <div class=\"overlay\"></div>\n <span class=\"card-title white-text\">Accomplishments<i class=\"material-icons right\">close</i></span>\n <ul class=\"white-text\">\n ${accomplishments}\n </ul>\n <div id=\"card-reveal-icons\">\n ${icons}\n </div>\n </div>\n </div>\n </div>\n <div class=\"col m5 hide-on-med-and-down offset-m1 valign-wrapper\">\n <h5 class=\"blue-grey-text text-darken-1\">${project.title}</h5>\n <span class=\"blue-grey-text text-lighten-1\">${project.description}</span>\n </div>\n `\n })\n }", "function getProjectsResponse(data) {\n // response = JSON.parse(response);\n\n // add projects to the page\n for (var i = 0; i < data.length; i++) {\n addSectionToPortfolio(data[i], i);\n // addPortfolioModal(response[i], i);\n };\n}", "function main(){\r\n\r\n //create all of your stocks\r\n let s1 = new Stock(\"Microsoft Corp\",\"MSFT\",\"NASDAQ\",83.94,113);\r\n let s2 = new Stock(\"Ubisoft Entertainment\",\"UBSFF\",\"OTC\",82.40,88);\r\n let s3 = new Stock(\"McDonald's Corp\",\"MCD\",\"NYSE\",168.48,100);\r\n let s4 = new Stock(\"Netflix\",\"NFLX\",\"NASDAQ\",193.11,85);\r\n\r\n //build your Portfolio\r\n let myport = new Portfolio();\r\n myport.add(s1);\r\n myport.add(s2);\r\n myport.add(s3);\r\n myport.add(s4);\r\n\r\n console.log(myport.totalValue());\r\n console.log(\"-----------------------\");\r\n console.log(myport);\r\n\r\n //build prediction\r\n}", "function printReport(startDate, endDate) {\n\n\t//Add a name to the report\n\tvar report = Banana.Report.newReport(\"Trial Balance\");\n\n\t//Add a title\n\treport.addParagraph(\"Trial Balance\", \"heading1\");\n\treport.addParagraph(\" \", \"\");\n\n\t//Create a table for the report\n\tvar table = report.addTable(\"table\");\n\t\n\t//Add column titles to the table\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \"\", 1);\n\ttableRow.addCell(\"Trial Balance at \" + Banana.Converter.toLocaleDateFormat(endDate), \"alignRight bold\", 3);\n\n\ttableRow = table.addRow();\n\ttableRow.addCell(\"\", \" bold borderBottom\");\n\ttableRow.addCell(\"\", \" bold borderBottom\");\n\ttableRow.addCell(\"Debit\", \"alignCenter bold borderBottom\");\n\ttableRow.addCell(\"Credit\", \"alignCenter bold borderBottom\");\n\n\t/* 1. Print the balance sheet */\n\tprintBalanceSheet(startDate, endDate, report, table);\n\n\t/* 2. Print the profit & loss statement */\n\tprintProfitLossStatement(startDate, endDate, report, table);\n\n\t/* 3. Print totals */\n\tprintTotals(report, table);\n\n\t//Add a footer to the report\n\taddFooter(report);\n\n\t//Print the report\n\tvar stylesheet = createStyleSheet();\n\tBanana.Report.preview(report, stylesheet);\n}", "function affichageSolutions()\n\t{\n\t var i = null;\n\t var j = null;\n\t \n\t document.write('<br /><table border=\"1\">');\n\t \n\t for(i = 0; i < this.solutions.length; i++)\n\t {\n document.write('<tr>');\n\t for(j = 0; j < this.solutions[i].length; j++)\n\t {\n\t document.write('<td>'+this.solutions[i][j]+'</td>');\n\t }\n\t document.write('</tr>');\n\t }\n\t}", "function getAllProjects() {\n //get all the projects (up to 500)\n allProjects = new Array();\n var response = UrlFetchApp.fetch('https://api.10000ft.com/api/v1/projects?per_page=500&fields=custom_field_values,tags,phase_count', params);\n\n var jsonProjects = JSON.parse(response.getContentText()); //JSONified response\n\n\n //now we'll loop over each element in the jsonProject.data structure - each one is a project\n jsonProjects.data.forEach(function(element){ //this is also a good place to limit what to process. i.e. if element.state != internal\n var proj = new Object();\n proj.id = element.id;\n proj.link10K = \"=HYPERLINK(\" + \"\\\"https://app.10000ft.com/viewproject?id=\" + element.id +\"\\\"\" + \",\" + \"\\\"Link\\\")\";\n proj.name = element.name;\n proj.startDate = element.starts_at;\n proj.endDate = element.ends_at;\n proj.description = element.description;\n proj.projectCode = element.project_code;\n proj.client = element.client;\n proj.state = element.project_state;\n proj.phaseCount = element.phase_count;\n proj.beneficiaries = \"\";\n //get the custom fields\n element.custom_field_values.data.forEach(function(custFieldVal) {\n switch (custFieldVal.custom_field_id) {\n case PROJ_PHASE_ID: proj.phase = custFieldVal.value;\n break;\n case PROJ_MGR_ID: proj.projectManager = custFieldVal.value;\n break;\n case PROJ_STRAT_OBJ_ID: proj.strategicObjective = custFieldVal.value;\n break;\n case PROJ_ARCH_PARTNER_ID: proj.architectPartner = custFieldVal.value;\n break;\n case PROJ_STATUS_ID: proj.status = custFieldVal.value;\n break;\n case PROJ_BENEFICIARY: proj.beneficiaries += custFieldVal.value + \" \";\n break;\n case PROJ_PARENT_PGM: proj.programID = custFieldVal.value;\n break;\n case PROJ_DIRECTOR: proj.director = custFieldVal.value;\n break;\n case PROJ_GSB_PRIO: proj.gsbPrioStatus = custFieldVal.value;\n break;\n case PROJ_EFFORT: proj.effort = custFieldVal.value;\n break;\n case PROJ_VALUE: proj.valueToSchool = custFieldVal.value;\n break;\n case PROJ_MICITI: proj.miciti = custFieldVal.value;\n break;\n case PROJ_NOTES: proj.notes = custFieldVal.value;\n break;\n case PROJ_PRMY_CONTACT: proj.primaryContact = custFieldVal.value;\n break;\n case PROJ_NONCOMP_COST: proj.nonCompCost = custFieldVal.value;\n break;\n case PROJ_HI_BENE_IMPACT: proj.hiBeneImpact = custFieldVal.value;\n break;\n case PROJ_FORCE_PRIO: proj.forceGsbPrioritization = custFieldVal.value;\n break;\n case PROJ_FOLDER:\n //proj.folder = custFieldVal.value;\n proj.folder = \"=HYPERLINK(\" + \"\\\"\" + custFieldVal.value + \"\\\"\" + \",\\\"Link\\\")\";\n break;\n case PROJ_PMO_DECK: proj.pmoDeck = custFieldVal.value;\n break;\n case PROJ_RECORD_MGR: proj.recordMgr = custFieldVal.value;\n break;\n case PROJ_OP_PRIO: proj.operPrioStatus = custFieldVal.value;\n break;\n default:Logger.log(\"default reached in custom field line 147 or therabouts\");\n };\n });\n\n //get the project tags\n proj.tags = \"\";\n element.tags.data.forEach(function(element) {\n proj.tags += element.value;\n });\n\n //derive the external status\n if (proj.phase == \"Pre-concept\" || proj.phase == \"Concept\") {proj.externalStatus = \"Exploration\"}\n else if (proj.phase == \"High Level Design\" || proj.phase == \"Pitch\") {proj.externalStatus = \"Queued\"}\n else {proj.externalStatus = \"Active\"};\n\n /////////////////START PRIORITIZATION STUFF////////////////////\n\n // Set some defaults\n proj.gsbPrioFlag = false;\n proj.operPrioFlag = false;\n proj.inconsistencyErrors = [];\n\n\n\n\n if (proj.state == \"Internal\") {\n if (isPrioritized(proj.gsbPrioStatus) || isPrioritized(proj.operPrioStatus)) {\n proj.inconsistencyErrors.push(\"Project is internal so it shouldn't be GSB or DS prioritized.\");\n }\n }\n // Derive prioritization\n else {\n //derive if project should get gsb level prioritization\n if (proj.forceGsbPrioritization == \"Yes\" || levelHigherThan(proj.effort, 'Low') || levelHigherThan(proj.nonCompCost, 'Low')){proj.gsbPrioFlag = true}\n\n // Determine inconsistency\n\n // If it is currently not set to be prioritized.\n if (proj.gsbPrioStatus == \"No\" || proj.gsbPrioStatus == \"TBD\") {\n // Check Effort\n if (proj.effort == \"Medium\" || proj.effort == \"High\") {\n proj.inconsistencyErrors.push(\"Effort is greater than Low, but it is not set to be GSB prioritized.\");\n }\n\n // Check Non-Comp Cost\n if (proj.nonCompCost == \"Medium\" || proj.nonCompCost == \"High\") {\n proj.inconsistencyErrors.push(\"Non-Comp Cost is greater than Low, but it is not set to be GSB prioritized.\");\n }\n\n // Check Force Prioritization.\n if (proj.forceGsbPrioritization == \"Yes\") {\n proj.inconsistencyErrors.push(\"Force prioritization is selected, but it is not set to be GSB prioritized.\");\n }\n }\n // If we calculate that it shouldn't be prioritized but it is.\n else if (!proj.gsbPrioFlag) {\n proj.inconsistencyErrors.push(\"Nothing warrants it to be prioritized, but it is set to be GSB prioritized.\");\n }\n\n //derive DS prioritization\n if (!proj.gsbPrioFlag) {\n if (proj.effort == \"High\" || proj.effort == \"Medium\" || proj.effort == \"Low\" || proj.nonCompCost == \"High\" || proj.nonCompCost == \"Medium\" || proj.nonCompCost == \"Low\"){proj.operPrioFlag = true}\n\n // Check for inconsistency\n if (proj.operPrioStatus == \"No\" || proj.operPrioStatus == \"TBD\") {\n // Check Effort\n if (proj.effort == \"Low\") {\n proj.inconsistencyErrors.push(\"Effort is Low, but it is not set to be DS prioritized.\");\n }\n\n // Check Non-Comp Cost\n if (proj.nonCompCost == \"Low\") {\n proj.inconsistencyErrors.push(\"Non-Comp Cost is Low, but it is not set to be DS prioritized.\");\n }\n }\n }\n else {\n // Check for consistency\n if (proj.operPrioStatus != \"No\") {\n proj.inconsistencyErrors.push(\"It is GSB prioritized so DS prioritization should be No.\")\n }\n }\n }\n\n\n // If there are no errors set the message to none.\n // Otherwise join the errors together with new lines and * as bullet points.\n if (!proj.inconsistencyErrors.length) {\n proj.inconsistencyMessage = '-None-';\n }\n else {\n proj.inconsistencyMessage = \"* \" + proj.inconsistencyErrors.join(\"\\n\\n* \");\n }\n\n //////////////////////END PRIORITIZATION STUFF//////////////////////////\n\n //get current resources\n proj.team = getStringifiedProjectResources(proj.id);\n\n\n //if the project has phases then get the current ones (if any)\n if (proj.phaseCount > 0) {\n proj.activePhases = getStringifiedCurrentPhases(proj.id);\n }\n else {\n //get the phase from the DS phase mapping\n proj.activePhases = \"None\";\n }\n //add the project to the list\n allProjects.push(proj);\n });\n\n //order the projectDetailedObjects in alpha order of element.name\n allProjects.sort(function(a,b) {\n var nameA = a.name.toUpperCase();\n var nameB = b.name.toUpperCase();\n return (nameA < nameB) ? -1 : (nameA > nameB) ? 1 : 0;\n });\n\n //now that we have all the projects with names in an array we can populate the programName if any\n allProjects.forEach(function(p){\n if (p.programID) {\n p.programName = getProjectName(p.programID);\n }\n else {\n p.programName = \"None\";\n }\n })\n\n\n}", "function mailReport() {\n \n \n \n \n if (RECIPIENT_EMAIL) {\n \n var SUBJECT = \"test\"\n //here is where we can customize the body of the report\n var BODY = \"campaign report: \" + campSpreadsheet.getUrl() +\n \" ad performance report: \" + adSpreadsheet.getUrl() +\n \" call details report: \" + callSpreadsheet.getUrl()\n \n MailApp.sendEmail(RECIPIENT_EMAIL,\n SUBJECT,\n BODY \n );\n \n }\n \n }", "static get reports() {}", "function doExport() {\n\tvar item;\n\twhile(item = Zotero.nextItem()) {\n\t\t\n\t\tvar creatorsS = item.creators[0].lastName;\n\t\t\t\tif (item.creators.length>2)\n\t\t\t\t\tcreatorsS += \" et al.\";\n\t\t\t\telse if (item.creators.length==2)\n\t\t\t\t\tcreatorsS += \" and \" + item.creators[1].lastName;\n\t\t\n\t\tvar date = Zotero.Utilities.strToDate(item.date);\n\t\tvar dateS = (date.year) ? date.year : item.date;\n\t\t\n\t\tvar titleS = (item.title) ? item.title.replace(/&/g,'&amp;').replace(/\"/g,'&quot;') : \"(no title)\";\n\t\t\n\t\tZotero.write(\"Zotero PDF(s):: [\" + creatorsS + '_' + dateS + \"_\" + titleS + \"]\" + \"(zotero://open-pdf/library/items/\"+item.key+\")\");\n\t}\n}", "function displayAssessmentReport(result){\n var keys=Object.keys(result[0]);\n\n //tempArray is used to store one type of grade (hw,exam,or proj) at a time:\n var tempArray=[];\n\n //outter for is to loop on the keys that are available in each student object,\n //i.e gives one grade type at a time.\n for (var i=0; i<=keys.length-1; i++){\n\n //the inside foreach loops on all students.\n result.forEach(function(element){\n if (element[keys[i]] !== null){\n tempArray.push(element[keys[i]]);\n }\n });\n\n //if it is not an empty array then scale it and update the view.\n if(tempArray.length > 0){\n //scale one grade type at a time:\n scale(tempArray);\n\n //re empty the tempArray for the next iteration.\n tempArray=[];\n\n //Updating the View:\n var $tr=$(\"<tr class='assessment-report'>\"), $th=$(\"<th>\"), $tdT=$(\"<td>\"), $tdAB=$(\"<td>\"), $tdC=$(\"<td>\"), $tdDF=$(\"<td>\");\n\n //appending table data tags to a table row.\n $th.text(keys[i]);\n $tr.append($th);\n $tdT.text(assessmentScale.total);\n $tr.append($tdT);\n $tdAB.text(assessmentScale.satisfactory);\n $tr.append($tdAB);\n $tdC.text(assessmentScale.developing);\n $tr.append($tdC);\n $tdDF.text(assessmentScale.unsatisfactory);\n $tr.append($tdDF);\n\n //populating download obj and array with data, this data is sent to the server when generating pdf report.\n var assessmentObj={workType:\"\", totalNum:\"\", satisfactory:\"\", developing:\"\", unsatisfactory:\"\"};\n assessmentObj.workType= keys[i];\n assessmentObj.totalNum= assessmentScale.total;\n assessmentObj.satisfactory= assessmentScale.satisfactory;\n assessmentObj.developing= assessmentScale.developing;\n assessmentObj.unsatisfactory= assessmentScale.unsatisfactory;\n assessmentArray.push(assessmentObj);\n\n //appending the table row to the whole table.\n $(\".assessment-report-table\").append($tr);\n }//end if\n }//end of outter for.\n}//end of displayAssessmentReport function.", "function composeSection3()\n {\n\n methods.addTOC( \"Equity Portfolio\", \"Four panes\" )\n addHeader( 'Equity Portfolio' );\n\n //============================== \n // //\\\\ master placeholders\n //==============================\n var built = \n fm.layt({\n margin : [ 0,0,0,0 ],\n widths : [ '70%', '30%' ],\n pads : { left:10, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, true, true ], [true, false, false, false] ]\n ],\n cols : 2,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n }).tbl;\n ddCont.push( built );\n\n buildTopLeftTable( built.table.body[0][0] );\n buildTopRightTable( built.table.body[0][1] )\n\n\n var built = \n fm.layt({\n margin : [ 0,0,0,0 ],\n widths : [ '30%', '70%' ],\n pads : { left:10, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, true, true ], [true, false, false, false] ]\n ],\n cols : 2,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n }).tbl;\n ddCont.push( built );\n buildBottomLeftTable( built.table.body[0][0] )\n buildBottomRightTable( built.table.body[0][1] )\n\n ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n //============================== \n // \\\\// master placeholders\n //==============================\n }", "function getReport(){\n\n }", "function generateTestReport() {\n var fileName = 'FileSystem - Report.pdf';\n FileMapper.clearAllMappingsInConfig();\n Workbook.setActiveWorkbookPath('c:\\\\user\\\\desktop');\n QUnit.load(testFunctions);\n // Run tests and generate html output\n var htmlOutput = QUnit.getHtml();\n htmlOutput.setWidth(1200);\n htmlOutput.setHeight(800);\n // Display test results\n SpreadsheetApp.getUi().showModalDialog(htmlOutput, fileName);\n // Save test results in Google Drive\n var blob = htmlOutput.getBlob();\n var pdf = blob.getAs('application/pdf');\n DriveApp.createFile(pdf).setName(fileName);\n}", "async report() {\n const { logger, db } = this[OPTIONS];\n const testedPages = await db.read('tested_pages');\n\n logger.info('Saving JSON report');\n const json = new JSONReporter(this[OPTIONS]);\n await json.open();\n await json.write(testedPages);\n await json.close();\n\n logger.info('Saving HTML Report');\n const html = new HTMLReporter(this[OPTIONS]);\n await html.open();\n await html.write(testedPages);\n await html.close();\n }", "function purchaseExcelReport(data_record_po) {\n\n}", "function makeProject(tittle, synopsis, tumbnailURL, numbLikes, numbViews, dateOri, dateModi) {\n let project = {\n tittle: tittle,\n synopsis: synopsis,\n tumbnailURL: tumbnailURL,\n assets: [],\n numbLikes: numbLikes,\n numbViews: numbViews,\n dateOri: dateOri,\n dateModi: dateModi,\n //function adds objects in \"assets\"\n addingAssets: function (...asset) {\n this.assets = asset //misshcine veranderen naar argumetns\n }\n }\n //returns an object\n return project\n\n }", "function createDraftContestRequest(projectName, projectType) {\r\n var projectHeader = mainWidget.softwareCompetition.projectHeader;\r\n var assetDTO = mainWidget.softwareCompetition.assetDTO;\r\n\r\n mainWidget.competitionType = \"SOFTWARE\";\r\n\r\n projectHeader.projectCategory = {};\r\n projectHeader.projectCategory.id = 29;\r\n projectHeader.projectCategory.name = \"Copilot Posting\";\r\n projectHeader.projectCategory.projectType = {};\r\n projectHeader.projectCategory.projectType.id = 2;\r\n projectHeader.projectCategory.projectType.name = \"Application\";\r\n projectHeader.setConfidentialityTypePublic();\r\n\r\n var contestName = projectName + \" Copilot Opportunity\";\r\n assetDTO.name = contestName;\r\n assetDTO.directjsDesignNeeded = false;\r\n assetDTO.directjsDesignId = -1;\r\n \r\n projectHeader.tcDirectProjectName = projectName;\r\n projectHeader.projectSpec.privateDescription = \"\";\r\n projectHeader.setProjectName(contestName);\r\n\r\n\tif (projectType == PROJECT_TYPE_MOBILE) {\r\n projectHeader.projectSpec.detailedRequirements = createCopilotContestDescription_MobileProject();\r\n } else if (projectType == PROJECT_TYPE_PRESENTATION) {\r\n projectHeader.projectSpec.detailedRequirements = createCopilotContestDescription_PresentationProject();\r\n } else if (projectType == PROJECT_TYPE_ANALYTICS) {\r\n projectHeader.projectSpec.detailedRequirements = createCopilotContestDescription_AnalyticsProject();\r\n }\r\n\t\r\n var amount = 150.0;\r\n projectHeader.setFirstPlaceCost(amount);\r\n // set all prize to 0 except first place cost\r\n projectHeader.setSecondPlaceCost(75.0);\r\n projectHeader.setReviewCost(0);\r\n projectHeader.setReliabilityBonusCost(0);\r\n projectHeader.setDRPoints(0);\r\n projectHeader.setCheckpointBonusCost(0);\r\n projectHeader.setAdminFee(0);\r\n projectHeader.setSpecReviewCost(0);\r\n\r\n var prizes = [];\r\n prizes.push(new com.topcoder.direct.Prize(1, amount, CONTEST_PRIZE_TYPE_ID, 1));\r\n projectHeader.prizes = prizes;\r\n projectHeader.setBillingProject(0);\r\n delete mainWidget.softwareCompetition.assetDTO.productionDate;\r\n\r\n var request = saveAsDraftRequestSoftware();\r\n request['createCopilotPosting'] = true;\r\n if (projectType == PROJECT_TYPE_PRESENTATION) {\r\n request['presentationProject'] = true;\r\n }\r\n return request;\r\n}", "function printToTable(projectName, projectType, hourlyRate, dueDate) {\n //delete button variable and add\n var newRow = '<tr><td>' + projectName +\n '</td><td>' + projectType +\n '</td><td>$' + hourlyRate +\n '</td><td>' + dueDate +\n '</td><td>' + calculateDaysLeft(dueDate) +\n '</td><td>$' + calculatePotentialEarnings(hourlyRate, dueDate) + '</td><td><button type=\"button\" class=\"btn btn-danger delete-button\">Delete</button></td></tr>';\n projectTableEl.append(newRow);\n deleteButton = $(\".delete-button\");\n }", "function enterReport(proj_name, proj_address, proj_city, proj_county, proj_state, proj_desc, bldg_size, proj_mgr, proj_sup, architect, civil_eng, mech_eng, elec_eng, plumb_eng, land_arch, int_design, sched_start, sched_compl, actual_start, actual_compl, sched_reason, init_budget, final_budget, budget_reason, sector, const_type, awards, proj_challenges, proj_strengths, UserId) {\n var UserId = currentUser.id;\n // function enterReport(pers_spir, pers_emot, pers_health, pers_pr_req) {\n $.post(\"/api/reportentry\", {\n proj_name: proj_name,\n proj_address: proj_address,\n proj_city: proj_city,\n proj_county: proj_county,\n proj_state: proj_state,\n proj_desc: proj_desc,\n bldg_size: bldg_size,\n proj_mgr: proj_mgr,\n proj_sup: proj_sup,\n architect: architect,\n civil_eng: civil_eng,\n mech_eng: mech_eng,\n elec_eng: elec_eng,\n plumb_eng: plumb_eng,\n land_arch: land_arch,\n int_design: int_design,\n sched_start: sched_start,\n sched_compl: sched_compl,\n actual_start: actual_start,\n actual_compl: actual_compl,\n sched_reason: sched_reason,\n init_budget: init_budget,\n final_budget: final_budget,\n budget_reason: budget_reason,\n sector: sector,\n const_type: const_type,\n awards: awards,\n proj_challenges: proj_challenges,\n proj_strengths: proj_strengths,\n UserId: UserId\n\n }).then(function (data) {\n console.log(\"abcde\")\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n }).catch(handleLoginErr);\n }", "function processPortfolio(data, parentEl) {\n // Get all the items, and the assets\n const items = data.items.reverse();\n const assets = data.includes.Asset;\n\n // Iterate all the items, and create the portfolio cards\n items.forEach((item) => {\n // Create the card\n let cardEl = document.createElement(\"div\");\n cardEl.setAttribute(\"class\", \"portfolio-card\");\n\n // Get all item data\n let title = item.fields.portfolioTitle;\n let description = item.fields.portfolioDescription;\n let link = item.fields.portfolioLink;\n\n // Get the image URL\n let imageUrl = getImageUrl(item.fields.portfolioImage.sys.id, assets);\n\n // Give properties to the portfolio card\n cardEl.innerHTML = `<img class=\"portfolio-card__image\" />\n <article class=\"portfolio-card__article\">\n <h3 class=\"portfolio-card__title\">${title}</h3>\n <p class=\"portfolio-card__description\">${description}</p>\n <a class=\"portfolio-card__link\" target=\"_blank\">Ver más</a>\n </article>`;\n\n // Give the remaining attributes\n cardEl\n .querySelector(\".portfolio-card__image\")\n .setAttribute(\"src\", imageUrl);\n cardEl\n .querySelector(\".portfolio-card__link\")\n .setAttribute(\"href\", link);\n\n // Append the portfolio card\n parentEl.appendChild(cardEl);\n });\n}", "function callback(reports) {\n\n let overview = plato.getOverviewReport(reports);\n let {total, average} = overview.summary;\n\n let output = `total\n ----------------------\n eslint: ${total.eslint}\n sloc: ${total.sloc}\n maintainability: ${total.maintainability}\n average\n ----------------------\n eslint: ${average.eslint}\n sloc: ${average.sloc}\n maintainability: ${average.maintainability}`;\n\n console.log(output);\n }", "function displayNewAssignments() {\n\n\tvar present = getPresent();\n\n\tfor (var i = 0; i < present.length; i++) {\n\t\t$('#new').append('<div class=\"text\">' + '<b>' + present[i].name + '</b>: ' + present[i].dailyList() + '</div>');\n\t\t\t// + ' - ' + present[i].dailyList() + '</div>');\n\t\t// console.log (present[i].dailyList())\n\t}\n}", "function report(title,description,addtionalInfo) {\r\n\trefreshReports();\r\n\tvar jsonObj = {\r\n key: [getDateTime()],\r\n response: [\"Title of bug:\"+title+\" \\n Description:\"+description+\" \\n Addtional information:\"+addtionalInfo]\r\n };\r\n JsonArrayReports.push(jsonObj);\r\n var newFile = fsReports.writeFileSync(\"./Dictionary/Report_Log.json\",JSON.stringify(JsonArrayReports, null, \"\\t\"));\r\n}", "function createStyleSheet() {\r\n\tvar stylesheet = Banana.Report.newStyleSheet();\r\n\r\n var pageStyle = stylesheet.addStyle(\"@page\");\r\n pageStyle.setAttribute(\"margin\", \"20mm 15mm 15mm 25mm\");\r\n\r\n var style = \"\";\r\n\r\n //Text style\r\n stylesheet.addStyle(\"body\", \"font-family : Times New Roman\");\r\n\r\n\tstyle = stylesheet.addStyle(\".footer\");\r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\tstyle.setAttribute(\"font-size\", \"8px\");\r\n\tstyle.setAttribute(\"font-family\", \"Courier New\");\r\n\r\n\tstyle = stylesheet.addStyle(\".description\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\");\r\n\tstyle.setAttribute(\"padding-top\", \"5px\");\r\n\tstyle.setAttribute(\"font-size\", \"10px\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading1\");\r\n\tstyle.setAttribute(\"font-size\", \"20px\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading2\");\r\n\tstyle.setAttribute(\"font-size\", \"16px\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading3\");\r\n\tstyle.setAttribute(\"font-size\", \"11px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".bold\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".italic\");\r\n\tstyle.setAttribute(\"font-style\", \"italic\");\r\n\r\n\tstyle = stylesheet.addStyle(\".alignRight\");\r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\r\n\tstyle = stylesheet.addStyle(\".alignCenter\");\r\n\tstyle.setAttribute(\"text-align\", \"center\");\r\n\r\n\tstyle = stylesheet.addStyle(\".underline\");\r\n\tstyle.setAttribute(\"text-decoration\", \"underline\");\r\n\r\n\t//Image style\r\n\tstyle = stylesheet.addStyle(\".img\");\r\n\tstyle.setAttribute(\"height\", \"60\");\r\n\tstyle.setAttribute(\"width\", \"60\");\r\n\r\n\t//Table style\r\n\tstyle = stylesheet.addStyle(\"table\");\r\n\tstyle.setAttribute(\"width\", \"100%\");\r\n\tstyle.setAttribute(\"font-size\", \"10px\");\r\n\tstylesheet.addStyle(\"table.table td\", \"border: thin solid black\");\r\n\r\n\treturn stylesheet;\r\n}", "function report(REPORT_NAME,spreadSheet,COLUMN_NAMES,REPORT_TYPE){\r\n var ACCOUNT = ['463-431-6322']; // comma delimited, single quoted list of account ids from Adwords (not the account names)\r\n var FILTER = \"Impressions > 0\"; \r\n var DATE_RANGE = \"LAST_30_DAYS\"; \r\n var column = COLUMN_NAMES.split(\",\"); \r\n \r\n var accountIterator = MccApp.accounts().withIds(ACCOUNT).get();; \r\n while (accountIterator.hasNext()) { \r\n var account = accountIterator.next(); \r\n MccApp.select(account); \r\n \r\n var mccSheet = spreadSheet.getActiveSheet();\r\n mccSheet.setName(account.getName()); //renames active sheet to account name\r\n mccSheet.clear(); \r\n mccSheet.appendRow(column); \r\n var adwordsSheet = spreadSheet.insertSheet();\r\n\r\n Logger.log(\"Checking for existing file\");\r\n \r\n Logger.log(\"Querying data for \" + account.getName()); \r\n \r\n var REPORT = AdWordsApp.report(\r\n 'SELECT ' + COLUMN_NAMES + \r\n ' FROM ' + REPORT_TYPE + \r\n ' WHERE ' + FILTER + ' DURING ' + DATE_RANGE\r\n ); \r\n\r\n REPORT.exportToSheet(adwordsSheet); \r\n adwordsSheet.deleteRow(1); \r\n var rowNumber = adwordsSheet.getLastRow(); \r\n var rangeToCopy = adwordsSheet.getDataRange(); \r\n mccSheet.insertRowAfter(mccSheet.getLastRow());\r\n rangeToCopy.copyTo(mccSheet.getRange(mccSheet.getLastRow() + 1, 1)); \r\n Logger.log(\"Data successfully added to file (\" + rowNumber + \" rows)\" + account.getCustomerId());\r\n } \r\n spreadSheet.deleteSheet(adwordsSheet); \r\n Logger.log(\"File update complete (\" + (mccSheet.getLastRow()-1) + \" rows) \" + spreadSheet.getUrl());\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\r\n}", "function Fundamentals() {\n\n }", "function createStyleSheet() {\r\n\tvar stylesheet = Banana.Report.newStyleSheet();\r\n\r\n var pageStyle = stylesheet.addStyle(\"@page\");\r\n pageStyle.setAttribute(\"margin\", \"10mm 20mm 10mm 20mm\");\r\n\r\n\tvar style = \"\";\r\n\r\n\tstyle = stylesheet.addStyle(\".footer\");\r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\tstyle.setAttribute(\"font-size\", \"8px\");\r\n\tstyle.setAttribute(\"font\", \"Times New Roman\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading1\");\r\n\tstyle.setAttribute(\"font-size\", \"16px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\t\r\n\tstyle = stylesheet.addStyle(\".heading2\");\r\n\tstyle.setAttribute(\"font-size\", \"14px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading3\");\r\n\tstyle.setAttribute(\"font-size\", \"11px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".heading4\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".valueAmount1\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\"); \r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\r\n\tstyle = stylesheet.addStyle(\".valueAmountText\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\"); \r\n\tstyle.setAttribute(\"background-color\", \"#eeeeee\"); \r\n\r\n\tstyle = stylesheet.addStyle(\".bold\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\r\n\tstyle = stylesheet.addStyle(\".right\");\r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\r\n\tstyle = stylesheet.addStyle(\".italic\");\r\n\t//style.setAttribute(\"font-style\", \"italic\");\r\n\tstyle.setAttribute(\"font-family\", \"Courier New\");\r\n\r\n\tstyle = stylesheet.addStyle(\".horizontalLine\");\r\n\tstyle.setAttribute(\"border-top\", \"1px solid black\");\r\n\t\r\n\tstyle = stylesheet.addStyle(\".valueTotal\");\r\n\tstyle.setAttribute(\"font-size\", \"9px\");\r\n\tstyle.setAttribute(\"font-weight\", \"bold\");\r\n\tstyle.setAttribute(\"padding-bottom\", \"5px\"); \r\n\tstyle.setAttribute(\"background-color\", \"#eeeeee\"); \r\n\tstyle.setAttribute(\"text-align\", \"right\");\r\n\tstyle.setAttribute(\"border-bottom\", \"1px double black\");\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".assetsTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\t\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".liabilitiesTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\t\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".incomeTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\t\r\n\t//stylesheet.addStyle(\"table.incomeTable td\", \"border: thin solid black\");\r\n\r\n\tvar tableStyle = stylesheet.addStyle(\".expensesTable\");\r\n\ttableStyle.setAttribute(\"width\", \"100%\");\r\n\ttableStyle.setAttribute(\"font-size\", \"8px\");\r\n\t//stylesheet.addStyle(\"table.expensesTable td\", \"border: thin solid black\");\t\r\n\r\n\treturn stylesheet;\r\n}", "generateFinalReport() {\n const obj = {\n environment: \"Dev\",\n numberOfTestSuites: this._numberOfTestSuites,\n totalTests: this._numberOfTests,\n browsers: this.browsers,\n testsState: [{\n state: this.standardTestState('Passed'),\n total: this._numberOfPassedTests\n }, {\n state: this.standardTestState('Failed'),\n total: this._numberOfFailedTests\n }, {\n state: this.standardTestState('Skipped'),\n total: this._numberOfSkippedTests\n\n }],\n testsPerBrowserPerState: this._testsCountPerBrowserPerState,\n testsPerSuitePerState: this._testsCountPerSuitePerState,\n testsWeatherState: this.weatherState,\n totalDuration: this._totalDuration,\n testsPerBrowser: this._testsPerBrowser\n };\n\n jsonfile.writeFile(this._finalReport, obj, {\n spaces: 2\n }, function(err) {\n if (err !== null) {\n console.error('Error saving JSON to file:', err)\n }\n console.info('Report generated successfully.');\n });\n }", "function makeAchievementList() {\n\n}", "function createReport(report, docNumber) {\n \n addFooter(report);\n\n //Table Journal\n var journal = Banana.document.journal(Banana.document.ORIGINTYPE_CURRENT, Banana.document.ACCOUNTTYPE_NORMAL);\n var totDebit = \"\";\n var totCredit = \"\";\n var date = \"\";\n var description = \"\";\n var vouchernumber = \"\";\n \n report.addParagraph(\" \", \"\");\n\n //Create the table that will be printed on the report\n var table = report.addTable(\"table\");\n var col1 = table.addColumn(\"col1\");\n var col2 = table.addColumn(\"col2\");\n var col3 = table.addColumn(\"col3\");\n var col4 = table.addColumn(\"col4\");\n var col5 = table.addColumn(\"col5\");\n var col6 = table.addColumn(\"col6\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"Transaction Voucher\", \"styleTitle heading1 alignCenter\", 6);\n\n tableRow = table.addRow();\n var imageCell = tableRow.addCell(\"\",\"\",3);\n \n //If the table Documents contains an image we use it\n var documentsTable = Banana.document.table(\"Documents\");\n if (documentsTable) {\n for (var i = 0; i < documentsTable.rowCount; i++) {\n var tRow = documentsTable.row(i);\n if (tRow.value(\"RowId\") === \"transaction_voucher_image\") {\n imageCell.addImage(\"documents:transaction_voucher_image\", \"3.5cm\", \"1cm\");\n }\n }\n }\n\n //Takes data of the selected doc number transaction\n for (i = 0; i < journal.rowCount; i++) {\n var tRow = journal.row(i);\n if (docNumber && tRow.value('Doc') === docNumber) {\n date = tRow.value(\"Date\");\n description = tRow.value(\"Description\");\n vouchernumber = tRow.value(\"DocOriginal\");\n }\n }\n\n var headerCell = tableRow.addCell(\"\", \"styleTitle borderBottom\", 1);\n headerCell.addParagraph(\"Date\", \"\");\n headerCell.addParagraph(\" \", \"\");\n headerCell.addParagraph(\"Voucher No.\", \"\");\n\n var dateAndDocCell = tableRow.addCell(\"\", \"borderBottom\", 2);\n dateAndDocCell.addParagraph(Banana.Converter.toLocaleDateFormat(date), \"\");\n dateAndDocCell.addParagraph(\" \", \"\");\n dateAndDocCell.addParagraph(docNumber, \"\"); //docNumber or vouchernumber\n\n var project = Banana.document.info(\"Base\",\"HeaderLeft\");\n var projectnumber = project.split(\"-\")[0].trim();\n //var projectname = project.split(\"-\")[1].trim();\n\n tableRow = table.addRow();\n tableRow.addCell(\"Project Number\", \"styleTitle \", 2);\n tableRow.addCell(projectnumber, \"\", 4);\n\n // tableRow = table.addRow();\n // tableRow.addCell(\"Project Name\", \"styleTitle \", 2);\n // tableRow.addCell(projectname, \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Currency\", \"styleTitle \", 2);\n tableRow.addCell(Banana.document.info(\"AccountingDataBase\",\"BasicCurrency\"), \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 6);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Paid to\", \"styleTitle \", 2);\n tableRow.addCell(param[\"paidTo\"], \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 6);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Description\", \"styleTitle \", 2);\n tableRow.addCell(description, \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 6);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Paid In\", \"styleTitle \", 2);\n tableRow.addCell(param[\"paidIn\"], \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Cheque No.\", \"styleTitle \", 2);\n if (param[\"paidIn\"] === \"Cheque\") {\n tableRow.addCell(param[\"chequeNumber\"], \"\", 4);\n } else { \n tableRow.addCell(\"\", \"\", 4);\n }\n\n tableRow = table.addRow();\n tableRow.addCell(\" \", \"\", 6);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Payment Received by\", \"styleTitle\", 2);\n tableRow.addCell(param[\"paymentReceivedBy\"], \"\", 4);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Paid by\", \"styleTitle\", 2);\n tableRow.addCell(param[\"paidBy\"], \"\", 4);\n\n report.addParagraph(\" \", \"\");\n\n /***********************************************************************************************************/\n\n // Column header\n var table = report.addTable(\"table\");\n var col1a = table.addColumn(\"col1a\");\n var col2a = table.addColumn(\"col2a\");\n var col3a = table.addColumn(\"col3a\");\n var col4a = table.addColumn(\"col4a\");\n var col5a = table.addColumn(\"col5a\");\n var col6a = table.addColumn(\"col6a\");\n var tableHeader = table.getHeader();\n tableRow = tableHeader.addRow(); \n\n //tableRow = table.addRow(); \n tableRow.addCell(\"Date\", \"styleTitle alignCenter\", 1);\n tableRow.addCell(\"Doc Original\", \"styleTitle alignCenter\", 1);\n tableRow.addCell(\"Description\", \"styleTitle alignCenter\", 1);\n tableRow.addCell(\"Debit A/C\", \"styleTitle alignCenter\", 1);\n tableRow.addCell(\"Credit A/C\", \"styleTitle alignCenter\", 1);\n tableRow.addCell(\"Amount\", \"styleTitle alignCenter\", 1);\n\n\n var transactionRowOrigin = \"\";\n var transactionDocOriginal = \"\";\n var transactionDescription = \"\";\n var transactionDebitAccount = \"\";\n var transactionCreditAccount = \"\";\n var transactionTotalAmount = \"\";\n\n //Print transactions row\n for (i = 0; i < journal.rowCount; i++) {\n var tRow = journal.row(i);\n\n //Take the row from the journal that has the same \"Doc\" as the one selectet by the user (cursor)\n if (tRow.value('Doc') === docNumber) {\n \n var amount = Banana.SDecimal.abs(tRow.value('JAmount'));\n\n if (Banana.SDecimal.sign(tRow.value('JAmount')) > 0 ) { //Debit\n totDebit = Banana.SDecimal.add(totDebit, amount, {'decimals':0});\n } else { //Credit\n totCredit = Banana.SDecimal.add(totCredit, amount, {'decimals':0});\n }\n\n //Get the value and print in one row\n if (transactionRowOrigin != tRow.value('JRowOrigin')) {\n\n transactionRowOrigin = tRow.value('JRowOrigin');\n transactionDocOriginal = tRow.value('DocOriginal');\n transactionDescription = tRow.value('Description');\n transactionDebitAccount = tRow.value('JAccount');;\n transactionCreditAccount = tRow.value('JContraAccount');;\n transactionAmount = tRow.value('JAmount');\n\n tableRow = table.addRow();\n tableRow.addCell(Banana.Converter.toLocaleDateFormat(tRow.value('Date')), \"\", 1);\n tableRow.addCell(transactionDocOriginal, \"\", 1);\n tableRow.addCell(transactionDescription, \"\", 1);\n tableRow.addCell(transactionDebitAccount, \"\", 1);\n tableRow.addCell(transactionCreditAccount, \"\", 1);\n tableRow.addCell(Banana.Converter.toLocaleNumberFormat(transactionAmount), \"alignRight\", 1);\n }\n }\n }\n\n transactionTotalAmount = totDebit; //totDebit and totCredit have the same value\n\n\n //Total Line\n tableRow = table.addRow();\n tableRow.addCell(\"Total Amount\",\"bold styleTitle\", 2);\n tableRow.addCell(\"\",\"\", 3);\n //tableRow.addCell(Banana.Converter.toLocaleNumberFormat(amount), \"bold alignRight\", 1);\n //tableRow.addCell(Banana.Converter.toLocaleNumberFormat(totDebit), \"bold alignRight\", 1);\n tableRow.addCell(Banana.Converter.toLocaleNumberFormat(transactionTotalAmount), \"bold alignRight\", 1);\n\n tableRow = table.addRow();\n tableRow.addCell(\"In Words\", \"bold styleTitle\", 2);\n tableRow.addCell(numberToEnglish(transactionTotalAmount), \"alignRight\", 4);\n\n /***********************************************************************************************************/\n \n report.addParagraph(\" \", \"\");\n var table = report.addTable(\"table\");\n var col1b = table.addColumn(\"col1b\");\n var col2b = table.addColumn(\"col2b\");\n var col3b = table.addColumn(\"col3b\");\n var col4b = table.addColumn(\"col4b\");\n var col5b = table.addColumn(\"col5b\");\n var col6b = table.addColumn(\"col6b\");\n\n tableRow = table.addRow();\n tableRow.addCell(\"Name and Signature\", \"styleTitle alignCenter\", 3);\n tableRow.addCell(\"Designation\", \"styleTitle\", 3);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Prepared by\", \"styleTitle\", 1);\n tableRow.addCell(param[\"preparedBy\"], \"\", 2);\n tableRow.addCell(\"\", \"\", 3);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Verified by\", \"styleTitle\", 1);\n tableRow.addCell(param[\"verifiedBy\"], \"\", 2);\n tableRow.addCell(\"\", \"\", 3);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Recommended by\", \"styleTitle\", 1);\n tableRow.addCell(param[\"recommendedBy\"], \"\", 2);\n tableRow.addCell(\"\", \"\", 3);\n\n tableRow = table.addRow();\n tableRow.addCell(\"Approved by\", \"styleTitle\", 1);\n tableRow.addCell(param[\"approvedBy\"], \"\", 2);\n tableRow.addCell(\"\", \"\", 3);\n\n}", "function composeSection1()\n {\n\n\n // //\\\\ config\n var tconf =\n {\n compCol :\n {\n \"Equity\" : nheap.companyColors['orange_master'],\n \"Debt\" : nheap.companyColors['yellow'],\n \"Cash & Cash Equivalents\" : nheap.companyColors['green'],\n \"Real Estate\" : nheap.companyColors['blue_master'],\n }\n };\n // \\\\// config\n\n\n\n methods.addTOC( \"Portfolio Summary\", \"Overall Summary\" )\n addHeader( 'Portfolio Snapshot' );\n\n //============================== \n // //\\\\ master placeholder\n //==============================\n ddCont.push(\n fm.layt({\n margin : [ 0,15,0,0 ],\n widths : [ '50%', '50%' ],\n pads : { left:2, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, true, true ], [true, false, false, false] ],\n [ [false, true, true, false ], [true, true, false, false] ]\n ],\n cols : 2,\n rows : 2,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body :\n [\n [fm.section1LeftTop(), fm.section1RightTop( null, tconf )],\n [fm.section1LeftBottom(), fm.section1RightBottom( null, tconf )]\n ]\n }).tbl\n );\n ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n //============================== \n // \\\\// master placeholder\n //==============================\n }", "function writeCalculation(){\n archiveData();\n // get date from date of weeks range\n var tempp = dateRange.getValues();\n var arrayofDates = [];\n // filter out empty entry\n tempp.forEach(function(eachDate){\n if (eachDate[0]){\n if (eachDate[0] != 'Week of'){\n arrayofDates.push(eachDate);\n }\n };\n });\n arrayofDates = arrayofDates[arrayofDates.length-1];\n \n // get actions from actionRange range\n var arrayofActions = actionRange.getValues()[0];\n var result = [];\n var resultArray = [];\n\n //Loop the result (i and j) and perform a calculate function for the combination of date and action\n var date = arrayofDates[0];\n Logger.log(date);\n for (var j = 0; j < arrayofActions.length; j++){\n result.push(calculate(arrayofActions[j].toLowerCase(), date));\n }\n resultArray.push(result);\n \n Logger.log(resultArray);\n // store the result on summarySheet\n //var row = actionRange.getRow()+1;\n var row = summarySheet.getLastRow();\n var col = actionRange.getColumn();\n var maxcol = resultArray[0].length;\n var maxrow = resultArray.length;\n summarySheet.getRange(row, col, summarySheet.getLastRow(), summarySheet.getLastColumn()).clearContent();\n summarySheet.getRange(row, col, maxrow, maxcol).setValues(resultArray);\n}", "function sprintStories(){\n return getsprintStories().then((data) => {\n console.log(data);\n agent.add(data)\n }).catch((err) => {\n agent.add(\"No Stories in active sprint in JIRA\", err);\n }); \n }", "function employeeReport() {\n console.log(\"\");\n for (let i= 0; i < employees.length; i++){\n console.log(employees[i].toString().padEnd(35, \" \") + employees[i].getPay());\n }\n }" ]
[ "0.5995793", "0.5920672", "0.5910673", "0.58650875", "0.574", "0.570962", "0.56519663", "0.56435215", "0.5492765", "0.54525954", "0.5337647", "0.533048", "0.53211385", "0.53088665", "0.52887416", "0.5242493", "0.5216842", "0.5187829", "0.5170897", "0.515615", "0.5126888", "0.51074433", "0.5084782", "0.5050325", "0.5022531", "0.5020696", "0.50053835", "0.5001299", "0.4981232", "0.49498132", "0.49476588", "0.49318704", "0.4922868", "0.48985538", "0.4895706", "0.4889873", "0.4888445", "0.48805273", "0.48734272", "0.48713323", "0.48689017", "0.4868415", "0.48650107", "0.48565656", "0.48534197", "0.4852568", "0.4849537", "0.48484197", "0.48363435", "0.48190778", "0.48165804", "0.48165205", "0.48157573", "0.4808832", "0.48087177", "0.48044658", "0.48042297", "0.48008823", "0.4800295", "0.47951418", "0.47772145", "0.47694895", "0.47621676", "0.47402555", "0.47396734", "0.47391927", "0.47368333", "0.47366732", "0.47366568", "0.47347844", "0.47333673", "0.47271362", "0.47244418", "0.47171465", "0.4712248", "0.47112992", "0.47037402", "0.47010016", "0.46980464", "0.46970186", "0.4680854", "0.4673273", "0.46728507", "0.4672286", "0.46686652", "0.46666062", "0.46615687", "0.4649172", "0.4633782", "0.46320578", "0.46277738", "0.46251974", "0.46190682", "0.4613628", "0.46100554", "0.460241", "0.45971686", "0.45960453", "0.45931637", "0.4582383" ]
0.49203712
33
Create a page with the textreader exercise.
function textreader() { // Replace "reserved" report with feature exercise. var port = document.getElementById("portfolio"); var reserved = document.getElementById("reserved"); port.removeChild(reserved); var div = appendElementChild("div", port, "showtime"); var prompt1 = "First, a simple exercise. Type complete sentences " + "in the text area provided then press SUBMIT. I will report " + "statistics related to your submission. Cool? "; appendTextChild(prompt1, div, "h4"); var prompt2 = "Text Reader and Statistics"; var txta = appendElementChild("textarea", div, "sample"); txta.setAttribute("name", "textReader"); txta.setAttribute("rows", "5"); txta.setAttribute("cols", "30"); appendBreakChild(2, div); // Create button to move to next results page. var button1 = appendElementChild("button", div, "button1id"); button1.innerHTML = "Submit"; button1.setAttribute("name", "button1"); button1.setAttribute("onClick", "txtrresults()"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPage() {\n init();\n generateCard();\n makeCommentsWork();\n makeCommentIconsWork();\n makeReactionsWork();\n displayCharLimit();\n}", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: ( align && isPrevious ),\n next: ( align && isNext )\n };\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: ( align && isPrevious ),\n next: ( align && isNext )\n };\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: ( align && isPrevious ),\n next: ( align && isNext )\n };\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: align && isPrevious,\n next: align && isNext\n };\n }", "function makePage(number, text, isActive) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tnumber: number,\n\t\t\t\t\t\ttext: text,\n\t\t\t\t\t\tactive: isActive\n\t\t\t\t\t};\n\t\t\t\t}", "function makePage(number, text, isActive) {\n\t return {\n\t number: number,\n\t text: text,\n\t active: isActive\n\t };\n\t }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }", "function createPage() {\n // Clear the preview div.\n $('#previewDiv').empty();\n \n // Add a new page.\n addPage(new Page());\n}", "function makePage(number, text, isActive, isDisabled) {\n return {\n number: number,\n text: text,\n active: isActive,\n disabled: isDisabled\n };\n }", "function makePage(number, text, isActive, isDisabled) {\n return {\n number: number,\n text: text,\n active: isActive,\n disabled: isDisabled\n };\n }", "function makePage(number, text, isActive, isDisabled) {\n return {\n number: number,\n text: text,\n active: isActive,\n disabled: isDisabled\n };\n }", "function makePage(number, text, isActive, isDisabled) {\n return {\n number: number,\n text: text,\n active: isActive,\n disabled: isDisabled\n };\n }", "function makePage(number, text, isActive, isDisabled) {\n return {\n number: number,\n text: text,\n active: isActive,\n disabled: isDisabled\n };\n }", "function init() {\n inquirer.prompt(questions)\n .then(answers => {return generatePage(answers);})\n .then(data => {\n const fileName = 'test.md';\n return writeToFile(fileName, data);\n })\n}", "function Page() {}", "function storyPrint(page) {\n leftImage(page.image);\n rightTitle(page.title);\n storyText(page.text);\n playerState(page.state);\n userQuestions(page.questions);\n chapter(page.chapter);\n return page.id == 0 || page.id == 1 ? pageNumber(page.id):pageNumber(parseInt(pageNumberDoc.innerHTML));\n}", "function draw() {\n b.textSize(220);\n\n\n // -- create something to play with --\n // add 4 new pages, now threre a 5 pages in the document\n for (var i = 0; i < 4; i++) {\n b.addPage();\n };\n\n // create on every page a textframe\n // give the textframe a name for future reference\n // you can change/check the names in the 'Layers' window of indesign\n for (var i = 1; i <= 5; i++) {\n b.page(i);\n var txtFrame = b.text(\"this is page #\"+i, 0,0,b.width,b.height);\n txtFrame.name = \"page count big\";\n };\n\n\n // -- let's change the textframe on page 3 --\n // go to the page\n b.page(3);\n // select the the textframe with the name \"page count big\"\n var txtOnPage3 = b.nameOnPage(\"page count big\");\n // change it\n txtOnPage3.contents = \"Found it! :)\";\n\n}", "function createPage() {\r\n\r\n clearSection(setPoolSize);\r\n clearSection(setPlayerNames);\r\n clearSection(setRatings);\r\n clearSection(playerPool);\r\n clearSection(generator);\r\n clearSection(prepTeam);\r\n\r\n homeTeam.className = \"col card bg-light border-dark\";\r\n awayTeam.className = \"col card bg-light border-dark\";\r\n \r\n populateSection(homeTeam, \"H3\", \"Home Team\");\r\n home.forEach((home)=>populateSection(homeTeam, \"P\", home.getName() + \" / \" + home.getRating() ));\r\n populateSection(homeTeam, \"H4\", \"Rating: \" + homeScore)\r\n \r\n populateSection(awayTeam, \"H3\", \"Away Team\");\r\n away.forEach((away)=>populateSection(awayTeam, \"P\", away.getName() + \" / \" + away.getRating() ));\r\n populateSection(awayTeam, \"H4\", \"Rating: \" + awayScore);\r\n\r\n reset.focus();\r\n }", "function from_file(page) {\n let str = require('fs').readFileSync('./tests/cache/' + page.toLowerCase() + '.txt', 'utf-8');\n // console.log(wtf.plaintext(str));\n let r = wtf.parse(str);\n console.log(r.translations);\n // console.log(JSON.stringify(r.sections, null, 2));\n}", "function createPage(country, age, author, downloads, lastKlicked, categories) {\n\n getBlogPost(author, categories)\n\n getProdukte(categories)\n\n getDownloads(downloads)\n\n getLastKlickedEntries(lastKlicked)\n}", "function createText(text){\n let mm = new markov.MarkovMachine(text)\n console.log(mm.makeText())\n}", "function painter (pages) {\n\n}", "newPage() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n let scope;\n // ask for the \"scope\" if the scope feature is enabled\n if (this.props.features.scopes &&\n Object.keys((_a = this._scopes) !== null && _a !== void 0 ? _a : {}).length) {\n // ask for the page scope\n scope = yield this._ask('scope', {\n image: {\n url: 'https://picsum.photos/600/600?v=scope',\n },\n });\n }\n const result = yield this._ask('pageMetas', {\n image: {\n url: 'https://picsum.photos/600/600?v=pageMetas',\n },\n scope,\n });\n _console.log('COCO', result);\n });\n }", "function convertWordsIntoPages(){\n return ()=>{\n return new Promise((resolve,reject)=>{\n let doc = new PDFDocument;\n doc.pipe(fs.createWriteStream('definitions.pdf'));\n allWords.forEach((wordObject)=>{\n if((wordObject)&&(wordObject.length>0)){\n doc.addPage();\n doc.font('SourceSansPro-Regular.ttf')\n .fontSize(40)\n .text(wordObject[0].word, 100, 100);\n wordObject[0].definitions.forEach((definition)=>{\n let examples = definition.split(';');\n examples.forEach((example)=>{\n //first example is title\n doc.fontSize(30).text(example.trim() + '\\n');\n });\n });\n }\n });\n console.log('Done converting to PDF');\n doc.end();\n setTimeout(()=>{\n resolve();\n },2000);\n });\n }\n}", "function createPage() {\n\t\t\t\t// Request creating a toolbar when the page is created.\n\t\t\t\tfinder.once( 'page:create:MyPage', function() {\n\t\t\t\t\tfinder.request( 'toolbar:create', { name: 'MyToolbar', page: 'MyPage' } );\n\t\t\t\t} );\n\n\t\t\t\t// Request resetting the toolbar when the page is shown.\n\t\t\t\tfinder.once( 'page:show:MyPage', function() {\n\t\t\t\t\tfinder.request( 'toolbar:reset', { name: 'MyToolbar' } );\n\t\t\t\t} );\n\n\t\t\t\t// When MyToolbar is reset, add a button to it.\n\t\t\t\tfinder.on( 'toolbar:reset:MyToolbar', function( evt ) {\n\t\t\t\t\tevt.data.toolbar.push( {\n\t\t\t\t\t\ttype: 'button',\n\t\t\t\t\t\tlabel: 'Exit',\n\t\t\t\t\t\ticon: 'ckf-cancel',\n\t\t\t\t\t\taction: function() {\n\t\t\t\t\t\t\tfinder.request( 'page:hide', { name: 'MyPage' } );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\t// Create a View class to be displayed in the page.\n\t\t\t\tvar MyViewClass = Marionette.ItemView.extend( {\n\t\t\t\t\ttemplate: doT.template( '<h2>{{=it.title}}</h2><button data-inline=\"true\">Back to CKFinder</button>' ),\n\t\t\t\t\t// An example of handling events inside a page.\n\t\t\t\t\tevents: {\n\t\t\t\t\t\t'click button': function() {\n\t\t\t\t\t\t\tfinder.request( 'page:hide', { name: 'MyPage' } );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\t// Create a View instance to be rendered in the page.\n\t\t\t\tvar myView = new MyViewClass( {\n\t\t\t\t\tmodel: new Backbone.Model( { title: 'My own page' } )\n\t\t\t\t} );\n\n\t\t\t\t// Last but not least, create the page.\n\t\t\t\tfinder.request( 'page:create', {\n\t\t\t\t\tview: myView,\n\t\t\t\t\ttitle: 'My page',\n\t\t\t\t\tname: 'MyPage',\n\t\t\t\t\tclassName: 'ckf-mypage'\n\t\t\t\t} );\n\n\t\t\t\tpageCreated = true;\n\t\t\t}", "function main(){\r// setup some variables\rvar d = app.documents.add(); // active doc\rvar pg = d.pages.item(0); // first page\rvar tf = pg.textFrames.add(); // the one textframe that is there\r\r// the function buildBounds(app.documents.item());\r// calculates the size of the textframe\rtf.geometricBounds = buildBounds(d);\r\r\rtf.contents = \"Hello World\";\r\r// now we can loop thru the text\r\rfor(var i = 0;i < tf.characters.length; i++){\r\tvar c = tf.characters[i];\r\t// the next line loops thru all characters in the text\r\tc.pointSize = calcVal(23);\r\t}\r\r\r}", "function objPage(funLoad, strPrereq, funTest)\n {\n\tthis.funLoad = funLoad;\n\tthis.strPrereq = strPrereq;\n\tthis.funTest = funTest;\n }", "createPage(input, cursorPos) {\n const page = new Page(this.document)\n page.setTheme(this.settings.get('theme'))\n this.pages.push(page)\n this.current_page = this.pages.length - 1\n if (input) {\n this.getCurrentPage().editor.setValue(input)\n this.getCurrentPage().editor.setCursor(cursorPos)\n }\n }", "function read(pages) {\n var i;\n var message;\n\n console.log('You started reading.');\n for (i = 0; i < pages; i += 1 ) {\n message = 'You read page ' + String(i);\n console.log(message);\n }\n}", "function from_file(page) {\n let str = require('fs').readFileSync('./tests/cache/' + page.toLowerCase() + '.txt', 'utf-8');\n let r = wtf.parse(str);\n console.log(r.citations);\n return r;\n}", "function read(pages) {\n var message;\n var i;\n\n console.log('You started reading.');\n for (i = 0; i < pages; i += 1) {\n message = 'You read page '+ i;\n console.log(message);\n }\n}", "function make_pages(lines, page_height){\n function take(n, xs){\n return n === 0 ? [] : pair(head(xs), take(n-1, tail(xs)));\n }\n function drop(n, xs){\n return n === 0 ? xs : drop(n-1, tail(xs));\n }\n if(is_empty_list(lines)){\n return [];\n } else {\n const len = length(lines);\n if(len < page_height){\n return list(lines);\n } else {\n return pair(take(page_height, lines), make_pages(drop(page_height, lines), page_height));\n }\n }\n}", "function createPage () {\n if (config.wgCanonicalNamespace + ':' + config.wgTitle !== 'Special:DiscussionsActivity') {\n return;\n }\n document.title = i18n('document_title_new').escape() + ' |' + document.title.split('|').slice(1).join('|');\n document.getElementById('PageHeader').getElementsByTagName('h1')[0].textContent = i18n('document_title_new').plain();\n container = document.getElementById('mw-content-text');\n container.innerHTML = '<span class=\"rda-loading\">' + i18n('loading_discussions').escape() + '</span>';\n }", "function readNewspaper() {\n console.log(newspaper_page + 'の' + newspaper_page + 'ページを読みました。');\n}", "function buildPage(file, data) {\n // Create a file called teamprofilepage.html, adding the input data transformed by generateHTML.js formatting.\n fs.writeFile(\"./dist/teampage.html\", generateHTML(data), function (error) {\n // If file created successfull, notify user of success in the command line interface. If error, notify user in the command line interface.\n if(error) {\n console.log(\"An unknown error occurred.\")\n }\n else {\n console.log(\"Your teampage.html file has been created successfully!\")\n }\n })\n}", "function makePages(lines) {\n const result = [];\n let lineTop = 0, id = 0;\n for (const line of lines) {\n const lineHeight = line.reduce(function(maxHeight, pair) {\n return Math.max(maxHeight, pair[1]);\n }, 0);\n let offsetLeft = -BORDER_WIDTH;\n for (const [clientWidth, clientHeight] of line) {\n const offsetTop =\n lineTop + (lineHeight - clientHeight) / 2 - BORDER_WIDTH;\n const div = {\n offsetLeft, offsetTop, clientWidth, clientHeight,\n clientLeft: BORDER_WIDTH, clientTop: BORDER_WIDTH,\n };\n result.push({ id, div, });\n ++id;\n offsetLeft += clientWidth + SPACING;\n }\n lineTop += lineHeight + SPACING;\n }\n return result;\n }", "function read(pages) {\n console.log('You started reading.');\n for (let page=0; page<pages; page += 1) {\n let message = 'You read page '+page;\n console.log(message);\n }\n}", "function init() {\n inquirer.prompt(questions).then((answers) => {\n console.log(answers)\n var readMe = generateMarkdown(answers)\n console.log(\"generate succcess!\", readMe);\n writeFile(\"readMe.md\", readMe)\n });\n \n}", "function createPages() {\r\n newDiv = document.createElement('div');\r\n newDiv.innerHTML = myLibrary[i].pages; \r\n library.appendChild(newDiv);\r\n }", "function renderChapters() {\n let firstChapter = createAndPushChapter('Chapter 1', 'The Lab', 'url(../img/background/thelabbg.png)');\n chapterArray[0].addParagraph(`You sit at your desk, looking over a beautiful ${userInfo[1]} sunset, working on your latest research in genetics. Everyone else in the office has gone home at this point. You check the clock and realize it is 11:00PM and you must have lost track of time! While getting up to call it a night, you notice something odd out of the corner of your eye... The gap under the door of your boss, Tamira\\'s office is radiating a blue glow. It is time to investigate...`)\n chapterArray[0].addParagraph('Opening Tamira\\'s door, you see a box shaking around on her desk and it is the source of the blue light. Should you really be in here, snooping around your bosses office? After some hesitation, you decide you cant resist the urge to look.');\n chapterArray[0].addParagraph('As you approach the box, the glowing becomes brighter and brighter, and begins to make a buzzing sound. You look inside and see an egg. It isn\\'t a normal egg... it is the size of a football and the source of the blue light. It is vibrating wildly. You touch the egg and the vibrating slows and the egg begins to hatch...');\n chapterArray[0].addParagraph('Watching the egg hatch, your heart begins to race. What could possibly hatch out of a blue glowing egg? You aren\\'t sure if you want to know, but it is impossible to look away now.');\n chapterArray[0].addParagraph('The egg hatches and out comes a... creature. It lacks features, and is mostly just a blob with a face. It lunges out of the box and clings to the wall like one of those quarter machine sticky hand prizes. It rolls down the wall, and starts walking its way towards you.');\n chapterArray[0].addParagraph('You have a choice... Do you try to scare it away? You don\\'t know what this strange creature can do... Maybe you should just leave the office and pretend like you never saw this creature or its egg... wipe your hands clean. It does look a little cute though... ');\n \n let secondChapter = createAndPushChapter('Chapter 2', 'Home', 'url(../img/background/homebg.png)');\n chapterArray[1].addParagraph('Before you have time to do anything, the creature contorts its body like it\\'s made of clay and vanishes from sight, and moments later reappears next to your shoulder bag. You run to grab your bag but the creature hops inside and the zipper seals itself. ');\n chapterArray[1].addParagraph('You try to pry it out, but it has shut the zipper and locked your bag shut with some sort of magical power. You rip at the zipper but it will not budge. With your bag in hand, you run out of the office and out the door of your building and head back home.');\n chapterArray[1].addParagraph('When you get home, you throw the bag on the kitchen floor. The zipper slowly opens by itself and the creature flops out of your bag... but it\\s body is much larger than the inside of your bag. How is this possible? It stares you straight in the eyes. It begins to let out a banshee-like shriek, and lays on its side. It is more annoying than threatening, but what does it need?');\n chapterArray[1].addParagraph('It occurs to you... maybe it\\'s hungry! After all, it did just hatch from an egg, and hasn\\'t had a meal. You definitely don\\'t want it to get any bad ideas and think of you as food, so maybe it\\'s best to offer it something.');\n chapterArray[1].addParagraph('What would be best for this creature? Maybe it needs protein... you open your fridge and you have a pack of hotdogs, and some leftover vegetarian stir fry. Maybe it doesn\\'t eat any of those things though... Your garbage can is overflowing... you could just let it go to town on your trash.');\n \n let thirdChapter = createAndPushChapter('Chapter 3', 'The Text Message', 'url(../img/background/textmessagebg.png)');\n chapterArray[2].addParagraph('Offering this creature food has instantaneously shut it up. It swallows its meal whole and in the next breath it vanishes and appears as it did before in the lab.');\n chapterArray[2].addParagraph('There is a crash in your living room and you rush in to find that the creature has shoved all the books off your bookshelf and squeezed its body into the top shelf. It\\'s skin looks different now, and it has fallen asleep.');\n chapterArray[2].addParagraph(`What do you do with this creature, ${userInfo[0]}? Surely, you can\\'t keep it forever. What will Tamira say when she finds out you hatched her creature in her office? What was she even doing with the egg and where did it come from? So many questions are racing through your mind, but the creature doesn\\'t seem to be doing anymore damage right now. Maybe you should let it sleep and try to do the same.`);\n chapterArray[2].addParagraph(`You wake early and with a start! The creature is lying at the foot of your bed watching you with it\\'s beady gaze once again. You look at your phone and Tamira has texted you. \"${userInfo[0]}!! Were you at work late last night?!\"`);\n chapterArray[2].addParagraph('Can you trust her? Will she be upset that you stole her weird creature? It did hop into your bag and seal it shut so it isn\\'t really your fault. Does she even know about the egg or did that egg appear in her office out of nowhere? Maybe she has an explanation for all of this.');\n \n let fourthChapter = createAndPushChapter('Chapter 4', 'The Strangers', 'url(../img/background/strangersbg.png)');\n chapterArray[3].addParagraph('Your phone vanishes out of your hand before you have time to make your decision. You look up at the creature and it has changed form again. All of this is so strange. You can no longer contact anyone, and you decide you cannot go into work and face Tamira.');\n chapterArray[3].addParagraph('You pace around the house and try to take your mind of things. click, click, click... the creature is on top of your laptop, clicking buttons and rolling across the keyboard. Shooing it away, a local news site has been pulled up. Headlines today are about unexpected meteor showers from everywhere around the globe, and that the government is mobilizing the National Guard in all 50 states.');\n chapterArray[3].addParagraph('At that moment, there is a banging on your front door! You sneak a look out the side kitchen window and see a mysterious unmarked black van and two men in suits.. You hide upstairs, and think about what you are going to do next.');\n chapterArray[3].addParagraph('The creature is growing agitated, and panicked. It looks like it\\'s motioning towards the window like you need to escape quickly. How did you get caught up in this alien conspiracy?');\n chapterArray[3].addParagraph('You weigh your options. You could answer the door and hand this creature over. Presumably, that is why they are here banging on your door. Alternatively, you could hop out the window with the creature, but you are on the second floor or you could try to sneak out the back door risking being seen.');\n \n let fifthChapter = createAndPushChapter('Chapter 5', 'The Escape', 'url(../img/background/escapebg.png)');\n chapterArray[4].addParagraph(`CRASH! You don\\'t have time to decide. The two men are yelling through the house. They have smashed through the window and are rushing up to you. \\'WE KNOW WHAT YOU HAVE ${userInfo[0]}!\\' They shout, and you can hear them rushing up the stairs. You turn towards the creature and it has changed form once again. Instinctively, you hop on its back and proceed out the window.`);\n chapterArray[4].addParagraph('What are you doing? This creature needs to be brought back to where it came from, but where is that exactly? At the same time, you feel a bond growing between you and it. It could have left without you... it has the ability to disappear! It must have chosen to wait for you. Where are you two going though? You can\\'t go into hiding with a strange creature.');\n chapterArray[4].addParagraph('Up in the sky in the distance is a floating triangular black shape. It definitely isn\\'t a plane. It is shiny, huge and moving slowly. Is this where the creature came from? Why is he taking you in the opposite direction towards the woods? Maybe he doesn\\'t see the floating triangle. You are at the edge of the woods now, and the creature has stopped. You hop off its back and it turns back towards you. You try asking it where it came from, you point out the triangle in the sky, you are just looking for any lead! \\\"WHAT DO YOU WANT?\\\" you beg... The creature gazes at you, and your mind stops racing. Miraculously, you find a sense of calm, and coming from within your head, you hear the word \\\"HOME.\\\"');\n chapterArray[4].addParagraph('It talked to you. Maybe not verbally, but it communicated telepathically. \\\"You want to go home?\\\" you ask. The creature nods. \\\"Where is that? Please, just tell me. I can take you there.\\\" No response.');\n chapterArray[4].addParagraph('Where do you take the creature? You could bring it back to the lab with your boss who may have more information. You could bring it to the black triangle in the sky since it is your only strong lead on where home could be for this creature. You have a strong gut feeling about going into the forest where you can safely hide, but why would the creature stop at the forest edge instead of going straight in?');\n \n let resoulutionChapterWorst = createAndPushChapter('The End', 'Oh No!', 'url(../img/background/worstend.png)');\n chapterArray[5].addParagraph('You have gone down this insane path to bring the creature back home. Your adventure has brought you here, but then you notice just how still the night is... It is dark, and there are no more leads. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here? Just then, the ground begins to shake and your creature starts pulsating with an otherworldly glow.');\n chapterArray[5].addParagraph('The creature starts writhing and twitching and you back away...its eyes go bloodshot red and start bulging from its head. It starts making an awful sound... a high pitched screeching and it beings foaming at the mouth. In the distance, the sky becomes littered with black triangle spaceships and realization hits you. The invasion has begun... The spaceships have lazers and are burning everything in sight. Do you run? Do you hide? There is no escape for you or the rest of humanity. ');\n chapterArray[5].addParagraph('The creature gives you a dark look... It grows tentacle after tentacle... and with no time to react it lunges forward and pins you to the ground. It wraps your body with its tentacled body and winds its wet tongue around your head. You are devoured whole and the world goes black....');\n chapterArray[5].addParagraph('THE WORLD HAS BEEN DESTROYED AND YOU LOSE EVERYTHING!!!')\n \n let resolutionChapterNegative = createAndPushChapter('The End', 'It was a mistake...', 'url(../img/background/badend.png)');\n chapterArray[6].addParagraph('You have gone down this insane path to bring the creature back home. Your adventure has brought you here, but then you notice just how still the night is... It is dark, and you have no more leads. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here? Just then, the ground begins to shake and your creature starts pulsating with an otherworldly glow.');\n chapterArray[6].addParagraph('The creature starts writhing and twitching and you back away...its eyes go bloodshot red and start bulging from its head. It starts making an awful sound... a high pitched screeching and it beings foaming at the mouth. It gives you a dark look.. and with no time to react it lunges forward and pins you to the ground. You cannot escape... it devours you whole and the world goes black....');\n chapterArray[6].addParagraph('YOU LOSE');\n \n let resolutionChapterNeutral = createAndPushChapter('The End', 'Was it all real?', 'url(../img/background/neutralend.png)');\n chapterArray[7].addParagraph('You have done everything you think you can to protect this creature. You have gone down this insane path to bring the creature back home. You notice just how still the night is... It is dark. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here?');\n chapterArray[7].addParagraph('There is a FLASH and a CRACK and you are back home waking with start! You had a crazy dream of evolving creatures and some otherworldly conspiracy but all of the details are hazy now. In your living room all your books are on the floor and the top shelf of the bookcase is empty. This seems familiar... but you can\\'t quite remember why. You pick up the books and continue about your day');\n chapterArray[7].addParagraph('THE END');\n \n \n let resolutionChapterPositive = createAndPushChapter('The End', 'Bringing the creature home', 'url(../img/background/goodend.png)');\n chapterArray[8].addParagraph('You have done everything you think you can to protect this creature. You have gone down this insane path to bring the creature back home. You notice just how still the night is... It is dark. A moment of panic hits you, as your realize you may have made the wrong choice... Why are you here?');\n chapterArray[8].addParagraph('Just then, the ground begins to shake and your creature starts pulsating with an otherworldly glow. There is a FLASH and a CRACK and all of a sudden you are inside of a foreign looking vessel of some kind. The walls are lined with glowing veins resembling the glow from your creature. Are you inside the black triangle spaceship? How did you get here?');\n chapterArray[8].addParagraph('Appearing out of nowhere, a creature resembling yours but much much larger approaches you and stares at you intensely. The memories of your adventure with the creature flash through your mind like a movie in fast forward. It looks at you, and with a last understanding glance, heads toward his family. The elder thanks you for protecting one of his kind. Then another FLASH and CRACK you are back at home, and all is calm.. no broken window, no black van, no triangle in the sky. You don\\'t even have the message from your boss.');\n chapterArray[8].addParagraph('CONGRATULATIONS! YOU WIN!')\n \n let resolutionChapterBest = createAndPushChapter('The End', 'Into the forest', 'url(../img/background/bestend.png)');\n chapterArray[9].addParagraph('Trusting yours and the monster\\'s insticts, you head away from the spaceship and into the forest. You aren\\'t sure why, but the creature doesn\\'t seem to want to go to the spaceship, and taking it back to the lab means potentially putting it in harms way. The agents in the black van have some agenda with this creature, and they would most certainly be able to track it back to the lab.');\n chapterArray[9].addParagraph('You push deper and deeper into the forest. You aren\\'t sure this is the right choice, but the connection with your strangely developing friend pushes you further forward. You have arrived at your destination, and there is nothing here... It is late now. You commited to coming to this spot, trusting the creature and yourself, but you stand in the dark with no more leads and the men in the suits could be arriving any moment on your trail. You are standing at forest clearing) and nothing seems to be happening.');\n chapterArray[9].addParagraph('All of a sudden, the trees start pulsating with a glowing aura... and through the darkness, appearing from nowhere an entire group of creatures identical to your friend, but much, much larger! Maybe the creature wasn\\'t an alien creature, but actually from earth all along, hidden in the forest. Just then, the creature begins radiating with this same glow and develops his last limbs.');\n chapterArray[9].addParagraph('The adults approach you slowly and gently. They stare at you with intense contemplation, almost as if they are reading your mind. All of your recent events with your creature start flashing through your mind like a movie in fast forward, and you know they are learning of your journey through some sort of telepathy. Then, the eldest of the group of creatures starts speaking to you through your mind. It thanks you for protecting the creature and says it is time for them to take leave with your friend but before leaving, they want to give you a gift!');\n chapterArray[9].addParagraph('The elder reaches out a hand, and in it is a simple acorn. When you touch the acorn, a huge WHOOSH of leaves and wind raise you into the air and then you lower to the ground. You have been given the power of the creatures - the power to appear and dissapear at will. This must be how they can live in the forest without being seen. Your creature friend runs over and nuzzles against you, and after one last understood glance, it runs towards its family. They thank you one last time, and vanish into the trees.');\n chapterArray[9].addParagraph('When you leave the forest, the black triangle is gone. You head back home, knowing if there is any trouble you can disappear anyway. When you get home, you are shocked to find there is no black van, the window isn\\'t smashed in, and everything is calm and fine. Your phone is sitting on your bed, and you don\\'t even have any messages from Tamira. You sigh and lay down and fall asleep..');\n chapterArray[9].addParagraph('CONGRATULATIONS! YOU HAVE MADE GREAT DECISIONS AND RETURNED YOUR CREATURE SAFELY TO ITS HOME! YOU WIN!');\n console.log(chapterArray);\n}", "render(): void {\n // Render text for current page\n const startAt = (this._page - 1) * this._numCharsPage;\n const pageText = this._text.substr(startAt, this._numCharsPage);\n output.cursorTo(0, output.contentStartRow);\n console.log(pageText);\n }", "function create_textpart_DocGenerator(pString) {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:create_textpart(pString)-Call\")\n\t//----Create Object/Instance of DocGenerator----\n\t// var vMyInstance = new DocGenerator();\n\t// vMyInstance.create_textpart(pString);\n\t//-------------------------------------------------------\n\tvar vReturn = new MatrixColumn();\n\tvReturn.add(pString);\n\tvReturn.add(0); //Application Counter of Part\n\treturn vReturn;\n}", "function makeQuestionPage(index) {\n\tclearPage();\n\tif (questionNum > 9) {\n\t\tmakeEndPage();\n\t\treturn;\n\t}\n\tvar questDisplay = $(\"<h2>\");\n\tquestDisplay.addClass(\"question\");\n\tquestDisplay.attr(\"data-name\", questions[index]);\n\tquestDisplay.text(questions[index].q);\n\t$(\"#questDiv\").append(questDisplay);\n\tfor (var k = 0; k < 4; k++) {\n\t\tvar answerButton;\n\t\tanswerButton = $(\"<button>\");\n\t\tanswerButton.addClass(\"answer\");\n\t\tanswerButton.attr(\"number\", k);\n\t\tanswerButton.text(questions[index].answers[k]);\n\t\t$(\"#buttonDiv\").append(answerButton);\n\t}\n\tsessionTime = setTimeout(function() {makeAnswerPage(index, null);}, 1000 * 25);\n\ttimeLeft = 25;\n\tintervalID = setInterval(showTime, 1000);\n}", "function page_format(words, page_width, page_height){\n return make_pages(make_lines(words, page_width), page_height);\n}", "pageNext(num) {\n this.setPage(num)\n }", "async function reviewsGenerator(page) {}", "function makePageForEpisodes(episodeList) {\n const rootElem = document.getElementById(\"root\");\n //rootElem.textContent = `Got ${episodeList[0].id} episode(s)`;\n for (let i = 0; i < episodeList.length; i++) {\n let container = document.createElement(\"div\");\n let element = document.createElement(\"h4\");\n let image = document.createElement(\"img\");\n let text = document.createElement(\"p\");\n element.textContent = `${episodeList[i].name} - S0${episodeList[i].season}E0${episodeList[i].number}`;\n image.src = episodeList[i].image.medium;\n text.innerHTML = `${\n episodeList[i].summary.length < 50\n ? episodeList[i].summary\n : episodeList[i].summary.substring(0, 400)\n }....`;\n element.classList.add(\"title\");\n image.classList.add(\"image\");\n text.classList.add(\"text\");\n container.classList.add(\"container\");\n\n container.appendChild(element);\n container.appendChild(image);\n container.appendChild(text);\n rootElem.appendChild(container);\n }\n\n return rootElem;\n}", "function generatePage() {\n let pageSec = document.getElementById('pageNumber');\n notice.innerText = `Showing ${ 0} to ${ 10}`;\n for (let i = 1; i <= pageNumbers; i++) {\n let aTag = document.createElement('a');\n aTag.classList.add('paginate_button');\n aTag.innerText = i;\n pageSec.appendChild(aTag);\n }\n}", "function createPage(name, div, button, links, butRef) {\r\n\t// Create page object\r\n\tconst obj = {};\r\n\t// Assign the variables to the page object\r\n\tobj.name = name;\r\n\tobj.div = div;\r\n\tobj.button = button;\r\n\tobj.videoLinks = [];\r\n\tobj.id = \"#\"+name;\r\n\tobj.vidLinks = links;\r\n\tobj.buttonName = butRef;\r\n\t// Return the page object\r\n\treturn obj;\r\n}", "function createStory() {\n // In this example you need to initialise these in reverse order, so that\n // when you assign a target it already exists. I.e., start at the end!\n lunarEnd4B = new StorySection(\n \"The Escavator explodes, falling backwards into one of the many craters of the moon. It was a brief explosion but it brightened up the hull of your ship for a moment before leaving behind a fiery mess near the Lunar Base.\\n\\n Ending 4 - Sacrifice \",\n \"(A) Next\", //Text for option 1\n lunarEnd4B, //For end sections, there is no target\n \"\", //Text for option 1\n lunarEnd4B //For end sections, there is no target\n ); // best environment ending //blow up the escavator\n lunarEnd4A = new StorySection(\n \"You follow West's idea. You asked the Colonel about the Escavator and left the backpack in a closet when no one was looking. You the Colonel you'll be in touch, as leave the station into a loose orbit around the moon. \\n\\n It doesn't take much longer when you see it happen. \",\n \"(A) Next\", //Text for option 1\n lunarEnd4B, //For end sections, there is no target\n \"\", //Text for option 1\n lunarEnd4B //For end sections, there is no target\n ); // best environment ending //blow up the escavator\n lunarEnd3 = new StorySection(\n \"You end up telling the Colonel that if he doesn't shut down the drill, that you would report him to both the UN and his superiors about the situation. This holds up the US in its expansion plans, and inevitable helps the other nations catch up in technology and resources. The space race is still ongoing.\\n\\n Ending 3 - Morality\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // okay ending //blackmail the colonel into not selling the drill materials\n lunarEnd2B = new StorySection(\n \"You report Lt. Colonel West's dissapearance, and the rest of the situation to both your superiors and the Colonel. You were never able to figure out why the Colonel was actually so defensive about you being there, but it doesn't matter much. The world spurs faster than ever with an increase of the materials dug from the moon.\\n\\nEnding 2-Helplessness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // bad ending //report the lt Colonel\n lunarEnd2A = new StorySection(\n \"You report Lt. Colonel West to both your superiors and the Colonel about his plans. You were never able to figure out if the Colonel was actually privately earning money through this trade but it doesn't matter much. The world spurs faster than ever with an increase of the materials dug from the moon.\\n\\nEnding 2-Helplessness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // bad ending //report the lt Colonel\n lunarEnd1 = new StorySection(\n \"You leave the Lunar station with more questions than answers but ultimately decided it wasn't within your power to stop anything that was happening. You stay in orbit for about a week when you hear news about the Giant Moon Excavator being finished. The Colonel was right, the minerals they mined ended up being full of crucial elements. It propelled the US to being a space superpower and only furthered their ambitions in space. China was somehow able to acquire much of these rare materials and used to to further their stocks. \\n\\n Ending 1 - Idleness\", //Descrption for scene\n \"\", //Text for option 1\n null, //For end sections, there is no target\n \"\", //Text for option 1\n null //For end sections, there is no target\n ); // worst ending // do nothing after finding out everything\n //moon ending\n moonChoice3B = new StorySection(\n \"You ponder what's happened here so far. You've been threatened by the Colonel, and you saw a man with a backpack that was clearly plotting something. You can't find the Lt Colonel either. What should you do?\",\n \"(A) Leave Now\",\n lunarEnd1,\n \"(D) Report the Lt. Colonel\",\n lunarEnd2B\n );\n moonChoice3A = new StorySection(\n \"Well this has escalated quickly. There's no way you're blowing up an escavator, corruption or not, that'll only give them international support. But if you tell Ramos about West's intentions, there won't be anyone to stop him in the future.\\\\What should you do?\",\n \"(A) Leave Now\",\n lunarEnd1,\n \"(D) Report the Lt. Colonel\",\n lunarEnd2A\n );\n //final decision for the moon\n investigation9 = new StorySection(\n \"You head straight to the Colonel and tell him immediately of Colonel West's dissapearance, the man you saw in the cafeteria, and even the explosives you found in your ship. He tells you that he will handle it and everything will be fine. He sends you off and you end up not being able to do much else but spectate.\",\n \"(A) Next\",\n lunarEnd2B,\n \"\",\n investigation8\n );\n investigation8 = new StorySection(\n \"You get back to your ship and ponder who you saw in the cafeteria, when you get back to your ship and find a backpack. You open it, and see that it...contains C-4 explosives?! You immediately check if it is armed but it's just raw C-4. This is bad, what shoud you? \",\n \"(A) Tell the Colonel\",\n investigation9,\n \"(D) Put it in your ship and leave now\",\n lunarEnd1\n );\n investigation7 = new StorySection(\n \"You look in the cafeteria after a day of looking around and pondering, and its remarkably dark here. You stumble around to see if there is other rooms when you see one room with a light on. You open the door see a man with a large backpack, and make brief eyecontact before he bolts and runs through another door into the darkness of the cafeteria where you lose him.\",\n \"(A) Tell the Colonel\",\n investigation8,\n \"(D) Go back to your ship to think\",\n moonChoice3B\n ); // decision for your plan\n investigation6 = new StorySection(\n \"As he walks away, you look inside the bag, and check what he gave you. You immediately recognize it to be military grade C4 explosives. He...wants to blow up the excavator?! What can- what should you do?\",\n \"(A) Follow his plan\",\n lunarEnd4A,\n \"(D) Go back to your ship to think\",\n moonChoice3A\n );\n investigation5 = new StorySection(\n \"Good. Since you haven't ratted me out, that means you're on my side,''He hands you a backpack that was behind him. ''I've heard you're experienced, you should know how to use these. Tell the Colonel you want to see the the Excavator tonight before you leave, and leave this in there. I'll handle the rest.''\",\n \"(A) Take the bag\",\n investigation6,\n \"(D) Don't take the bag\",\n moonChoice3B\n ); // Lt. Colonel whistleblower\n investigation4B = new StorySection(\n \"You asked around to find the Lt. Colonel but he wasn't anywhere to be found. One of the base soldiers told you that he likes to hang around the cafeteria, so you head over there. \",\n \"(A) Next\",\n investigation7,\n \"\",\n investigation7\n ); // Lt Colonel has the metal tube\n investigation4AB = new StorySection(\n \"You walk forward not sure why he signalled and he points at the ceiling as you walk through a camera's field of view. That's when West takes out a small device and points it at the camera which immediately powers down.\\n\\n He looks even more dissapointed than he was earlier and says, ''You really can't take a hint can you?'' as rushes off behind you and into the hangar. \",\n \"(A) Next\",\n investigation5,\n \"(D) Continue\",\n investigation4AB\n ); //goes through camera\n investigation4AA = new StorySection(\n \"You stop as you look at him in confusion, and he points at the ceiling where a camera is panning left and right. He takes out a small device and points it at the camera which immediately powers down.\\n\\n He walks up to you and whispers, did you read it?\",\n \"(A) Yes\",\n investigation5,\n \"\",\n investigation5\n ); //doesn't go through camera\n investigation4A = new StorySection(\n \"It doesn't take long for you to find West. He was quite literally around the corner of the entrance of the hangar waiting for you. As you approach him, he puts his hand up to signal for you to stop.\",\n \"(A) Stop\",\n investigation4AA,\n \"(D) Continue\",\n investigation4AB\n ); // You have read the contents of the tube, looking for Lt Colonel West\n interrogation3 = new StorySection(\n \"''I don't have to tell you anything. Get off my station.'' he says as he gets up, clearly agitated about this coming to light. His guards walk in and escort you to your ship, where you're forced to leave the base.\",\n \"(A) Next\",\n lunarEnd1,\n \"\",\n lunarEnd1\n );\n interrogation2B = new StorySection(\n \"''You decide its better not to say. ''I can't say, but the allegations are pretty serious either way. Is that what you planned to do with the drill? The moon is international land, did the UN sanction your privatization of the moon?\",\n \"(A) Next\",\n interrogation3,\n \"\",\n interrogation3\n );\n interrogation2A = new StorySection(\n \"You decide to tell him, ''Your Lt. Colonel West did. He managed to hand me and I'm here to get your side of the story.''\\n\\n ''My 'side' of the story? The truth is that we are here as a nation to build the forward station to humanity. I have nothing to do wtih China,''\",\n \"(A) Next\",\n interrogation3,\n \"\",\n interrogation3\n );\n interrogation1A = new StorySection(\n \"You put the note on to Ramo's desk as he walks overs and picks it up. He looks at you obviously furious, but still attempt to put a facade of calmness. ''This is quite the allegation. Who may I ask, gave you this?''he says with a tinge of frustration.\",\n \"(A) Tell him\",\n interrogation2A,\n \"(D) Don't tell him\",\n interrogation2B\n ); //Lt Colonel West has the letter\n investigation3 = new StorySection(\n \"Colonel Ramos is sitting at his desk reading something on his desk screen when you walk in abruptly. ''Ah, to what do I owe the pleasure?'' Ramos says as he leans back on his chair and stares you down.\",\n \"(A) Show him the letter\",\n interrogation1A,\n \"(D) Accuse him without the letter\",\n interrogation2B\n );\n scroll2 = new StorySection(\n \"Well that explains the drill and the speed of them building everything up so fast. How long has it been, 3 months since the US came here, and they already have a drill almost fully built? Although, why would Lt Colonel West reveal this to you? What should you do?\",\n \"(A) Confront Colonel Ramos\",\n investigation3,\n \"(D) Confront Lt. Colonel West\",\n investigation4A\n );\n scroll1 = new StorySection(\n \"It reads, ''The US had the means, but China funded the way\\nRamos made private deal with China for minerals exports''\",\n \"(A) Next\",\n scroll2,\n \"\",\n scroll2\n );\n investigation2 = new StorySection(\n \"You look at the 2 inch metallic tube and see that there's a very thin line in the middle. Is this a container? You pulled as hard as you can and it pops open abruptly, revealing a scrolled piece of paper that drops onto the floor.\",\n \"(A) Read it\",\n scroll1,\n \"\",\n scroll1\n );\n investigation1B = new StorySection(\n \"You return to the hangar and sit near your ship. \\nYou take out the tube in your pocket. You wonder what this is?\",\n \"(A) Inspect the metal tube\",\n investigation2,\n \"\",\n investigation2\n ); // you have the letter\n investigation1A = new StorySection(\n \"You return to the hangar and sit near your ship. \\nWhat should you do?\",\n \"(A) Look around the base\",\n investigation7,\n \"(D) Talk to the Lt. Colonel\",\n investigation4B\n ); // you don't have the letter\n //unfinished section\n // investigation of the moon\n lunarLieutenant6 = new StorySection(\n \"Day 1, 8:31 AM\\n\\n''Well, if there's nothing else to discuss,''he lifts his hand and gestures to the door. ''You're free to go.'' You get up and briskly walk to the door and leave back into the hall way. \",\n \"(A) Next\",\n investigation1B,\n \"\",\n investigation1B\n );\n lunarLieutenant5 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I know why you're here. Command told me you were coming as the UN's representative to keep an eye on this station, and the US. Now, I'm going to tell you this once, I will let you stay, but if you get in the way of my men, I will personally launch you and your ''ship'', back to Earth faster than you can say, 'oops'. \",\n \"(A) Next\",\n lunarLieutenant6,\n \"\",\n lunarLieutenant6\n );\n lunarLieutenant4 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou get a good look at Colonel Ramos as he relaxes into his seat. While standing he was quite tall, but now you can see that his face is scarred with cuts and burns. His face is stoic as he locks eyes with you.\",\n \"(A) Next\",\n lunarLieutenant5,\n \"\",\n lunarLieutenant5\n );\n lunarLieutenant3B = new StorySection(\n \"Day 1, 8:30 AM\\n\\nThe Colonel turns and raises his eyebrow at you. ''Lieutenant Colonel West? He's just jittery.'', he says as he takes a seat into his large office chair.\",\n \"(A) Next\",\n lunarLieutenant4,\n \"\",\n lunarLieutenant4\n );\n lunarLieutenant3A = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I hope the ride wasn't unpleasant in your...aircraft.'', he says somewhat mockingly. He turns around and sits back into this large office chair.\",\n \"(A) Next\",\n lunarLieutenant4,\n \"\",\n lunarLieutenant4\n );\n lunarLieutenant2 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''Hello,'' said the Colonel calmly, from behind his desk looking out the window overlooking the base. The Lieutenant Colonel steps out and closes the door behind you. \",\n \"(A) Hello, sir.\",\n lunarLieutenant3A,\n \"(D) Is your Lieutenant Colonel alright?\",\n lunarLieutenant3B\n ); //unique dialogue choice (edit later to differ from other dialogue)\n lunarLieutenant1 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou pick it up and put it in your pocket, as you catch back up to the officer. When you get to him, you find him standing next to a locked door as he waits for you. He whispers something to you under his breath that sounds like ''read it later'', he swipes a card on the door in front of you and it opens up.\",\n \"(A) Next\",\n lunarLieutenant2,\n \"\",\n lunarLieutenant2\n );\n //keeping it timeline ^\n lunarCommander6 = new StorySection(\n \"Day 1, 8:31 AM\\n\\n''Well, if there's nothing else to discuss,'' lifts his hand and gestures to the door. ''You're free to go.''. You get up and briskly walk to the door and leave back into the hall way. \",\n \"(A) Next\",\n investigation1A,\n \"\",\n investigation1A\n );\n lunarCommander5 = new StorySection(\n \"Day 1, 8:30 AM\\n\\n''I know why you're here. Command told me you were coming as the UN's representative to keep an eye on this station, and the US. Now, I'm going to tell you this once, I will let you stay, but if you get in the way of my men, I will personally launch you and your ''ship'', back to Earth faster than you can say, 'oops'. \",\n \"(A) Next\",\n lunarCommander6,\n \"\",\n lunarCommander6\n );\n lunarCommander4 = new StorySection(\n \"Day 1, 8:30 AM\\n\\nYou get a good look at Colonel Ramos as he relaxes into his seat. While standing he was quite tall, but now you can see that his face is scarred with cuts and burns. His face is stoic as he locks eyes with you.\",\n \"(A) Next\",\n lunarCommander5,\n \"\",\n lunarCommander5\n );\n lunarCommander3B = new StorySection(\n \"Day 1, 8:30 AM\\n\\nThe Colonel turns and raises his eyebrow at you. ''Lieutenant Colonel West? He's just jittery.'', he says as he takes a seat into his large office chair.\",\n \"(A) Next\",\n lunarCommander4,\n \"\",\n lunarCommander4\n );\n lunarCommander3A = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n''I hope the ride wasn't unpleasant in your...aircraft.'', he says somewhat mockingly. He turns around and sits back into this large office chair.\",\n \"(A) Next\",\n lunarCommander4,\n \"\",\n lunarCommander4\n );\n lunarCommander2 = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n''Hello,'' said the Colonel calmly, from behind his desk looking out the window overlooking the base. The Lieutenant Colonel steps out and closes the door behind you. \",\n \"(A) Hello, sir.\",\n lunarCommander3A,\n \"(D) Is your Lieutenant Colonel alright?\",\n lunarCommander3B\n ); //unique dialogue choice\n lunarCommander1 = new StorySection(\n \"Day 1, 8:30 AM (Earth Time)\\n\\n You pick it up and catch up to the officer ahead of you. ''Excuse me sir, you dropped this,'' and hand it back to him. He looks at you profoundly surprised and quickly puts it back into his pocket. He shakes his head, seemingly dissapointed in you. You get a good look at his insignia and see that he is the Lieutenant Colonel here.\\n\\nBefore you can get a word in, he swipes a card on the door in front of you and it opens up.\",\n \"(A) Next\",\n lunarCommander2,\n \"\",\n lunarCommander2\n );\n\n //Giving it back timeline ^\n moonChoice1 = new StorySection(\n \"Day 1, 8:29 AM (Earth Time)\\n\\n You are greeted entering the station by an officer patiently waiting near the decompression chamber. He waits for you and shakes your hand and leads the way through the pristine hallways. \\n\\n Suddenly, he drops something on the floor as he walks ahead of you. He strangely didn't seem to notice. It seems to be a tiny metallic tube. What should you do?\",\n \"(A) Pick it up and keep it\",\n lunarLieutenant1,\n \"(D) Pick it up and give it back\",\n lunarCommander1\n );\n //moon dialogue\n moonIntro8B = new StorySection(\n \"Day 1, 7:55 AM\\n\\n The most surprising thing though, was the giant land escavator that towered behind the base. It made the buildings around it look grossly disproportionate. It is still in contruction but it looks like it could be done anytime.\",\n \"(A) Next\",\n moonChoice1,\n \"\",\n moonChoice1\n );\n moonIntro7B = new StorySection(\n \"Day 1, 7:52 AM\\n\\n'Dock your ship in the hangar bay. You'll meet me in my office', Ramos orders you as you begin your lunar descent. You follow what he says and that's when you are able to finally see the station in its full glory.\\n\\n Its a true military base, complimented with multiple barracks and opertational buildings and even components for an airfield. \",\n \"(A) Next\",\n moonIntro8B,\n \"\",\n moonIntro8B\n );\n moonIntro6B = new StorySection(\n \"Day 1, 7:43 AM\\n\\nYou navigate your ship to the Moon's Lunar Station. As the moon comes into view, it's not hard to spot the station as it shines a bright metallic orange in the plain grey surface of the Moon. Before you even thought of it, a buzz comes from your radio tranciever.\\n\\n'Welcome to Luna, Peacekeeper.', a deep and raspy voice announces to you. I am Colonel Ramos, Commanding Officer of the United States Lunar Station.\",\n \"(A) Next\",\n moonIntro7B,\n \"\",\n moonIntro7B\n );\n moonIntro5B = new StorySection(\n \"Day 1, 7:30 AM\\n\\nYou contact your superiors and tell them the launch went well. They tell you that over the next few months they will launch the rest of your force, but for now you are to report to the US Lunar Station to oversee the US operations. You will be alone, but the US is still part of the United Nations and they should still respect his authority.\",\n \"(A) Next\",\n moonIntro6B,\n \"\",\n moonIntro6B\n );\n moonIntro4B = new StorySection(\n \"Day 1, 6:20 AM\\n\\nYou look out around and see Earth, in all its glory. Suddenly, you feel insignificant to its size. How you were just a dot, living on this massive planet. You remember your family and wonder how they're doing, if they watched your launch this morning. Maybe you should've brought the photo.\",\n \"(A) Next\",\n moonIntro5B,\n \"\",\n moonIntro5B\n );\n moonIntro3B = new StorySection(\n \"Day 1, 6:00 AM\\n\\nYou hear the countdown and count with them as you launch the ignition. Training prepared you for this moment, but nothing could be compared to the weight of the Earth leaving you. You feel every shake of the hull, every shudder of ship as it rips through the atmosphere. Eventually it subsides and the ship slows down to dead still.\\n\\nNothing but the faint buzzing of your flight instruments echoing in the void of space.\",\n \"(A) Next\",\n moonIntro4B,\n \"\",\n moonIntro4B\n );\n moonIntro2B = new StorySection(\n \"Day 1, 5:59 AM\\n\\nYou follow the launch procedures and prepare the ship for ignition. \",\n \"(A) Next\",\n moonIntro3B,\n \"\",\n moonIntro3B\n );\n moonIntro1B = new StorySection(\n \"Day 1, 5:54 AM\\n\\nYou enter your small ship and inspect the controls. You spent the last 6 months in training for this moment but it still feels surreal.\",\n \"(A) Next\",\n moonIntro2B,\n \"\",\n moonIntro2B\n );\n //second branch - no photo timeline (B)\n moonIntro8A = new StorySection(\n \"Day 1, 7:55 AM\\n\\n The most surprising thing though, was the giant land escavator that towered behind the base. It made the buildings around it look grossly disproportionate. It is still in contruction but it looks like it could be done anytime.\",\n \"(A) Next\",\n moonChoice1,\n \"\",\n moonChoice1\n );\n moonIntro7A = new StorySection(\n \"Day 1, 7:52 AM\\n\\n'Dock your ship in the hangar bay. You'll meet me in my office', Ramos orders you as you begin your lunar descent. You follow what he says and that's when you are able to finally see the station in its full glory.\\n\\n Its a true military base, complimented with multiple barracks and opertational buildings and even components for an airfield. \",\n \"(A) Next\",\n moonIntro8A,\n \"\",\n moonIntro8A\n );\n moonIntro6A = new StorySection(\n \"Day 1, 7:43 AM\\n\\nYou navigate your ship to the Moon's Lunar Station. As the moon comes into view, it's not hard to spot the station as it shines a bright metallic orange in the plain grey surface of the Moon. Before you even thought of it, a buzz comes from your radio tranciever.\\n\\n'Welcome to Luna, Peacekeeper.', a deep and raspy voice announces to you. I am Colonel Ramos, Commanding Officer of the United States Lunar Station.\",\n \"(A) Next\",\n moonIntro7A,\n \"\",\n moonIntro7A\n );\n moonIntro5A = new StorySection(\n \"Day 1, 7:30 AM\\n\\nYou contact your superiors and tell them the launch went well. They tell you that over the next few months they will launch the rest of your force, but for now you are to report to the US Lunar Station to oversee the US operations. You will be alone, but the US is still part of the United Nations and they should still respect his authority.\",\n \"(A) Next\",\n moonIntro6A,\n \"\",\n moonIntro6A\n );\n moonIntro4A = new StorySection(\n \"Day 1, 6:20 AM\\n\\nYou look out around and see Earth, in all its glory. Suddenly, you feel insignificant to its size. How you were just a dot, living on this massive planet. You remember your family and wonder how they're doing, if they watched your launch this morning. You take out the photo from your spacesuit's pockets. You stare at it and it comforts you a bit.\",\n \"(A) Next\",\n moonIntro5A,\n \"\",\n moonIntro5A\n );\n moonIntro3A = new StorySection(\n \"Day 1, 6:00 AM\\n\\nYou hear the countdown and count with them as you launch the ignition. Training prepared you for this moment, but nothing could be compared to the weight of the Earth leaving you. You feel every shake of the hull, every shudder of ship as it rips through the atmosphere. Eventually it subsides and the ship slows down to dead still.\\n\\nNothing but the faint buzzing of your flight instruments echoing in the void of space.\",\n \"(A) Next\",\n moonIntro4A,\n \"\",\n moonIntro4A\n );\n moonIntro2A = new StorySection(\n \"Day 1, 5:59 AM\\n\\nYou follow the launch procedures and prepare the ship for ignition. \",\n \"(A) Next\",\n moonIntro3A,\n \"\",\n moonIntro3A\n );\n moonIntro1A = new StorySection(\n \"Day 1, 5:54 AM\\n\\nYou enter your small ship and inspect the controls. You spent the last 6 months in training for this moment but it still feels surreal.\",\n \"(A) Next\",\n moonIntro2A,\n \"\",\n moonIntro2A\n );\n //first branch - photo timeline (A)\n //moon story\n leaveThePhoto = new StorySection(\n \"Day 1, 4:05 AM\\n\\nYou decide against it. You will be back, and it's probably better to leave it here than to lose it somewhere else. Especially Space.\",\n \"(A) Next\",\n moonIntro1B, //B = no photo\n \"\",\n moonIntro1B\n );\n keepThePhoto = new StorySection(\n \"Day 1, 4:05 AM\\n\\nYou take the photo out of the frame, and put it in your pocket. There's no telling how long it will be out there, might as well keep something to remember them.\",\n \"(A) Next\",\n moonIntro1A, //A = with photo\n \"\",\n moonIntro1A\n );\n choice1 = new StorySection(\n \"Day 1, 4:00 AM\\n\\nYou wake up in your house for the last time, in a long time. You're about to leave when you realize you should check if you forgot anything you wanted to bring with you. You walk through your hallway and see a picture of you and your family, one taken a long time ago, before your peacekeeping days. It's been a long time since then.\\n\\nShould you keep it?\",\n \"(A) Keep the photo\", // text for option 1\n keepThePhoto, //object target option 1\n \"(D) Leave the photo\",\n leaveThePhoto\n );\n backstory2 = new StorySection(\n \"The United Nations has been working hard to send you and your force of 25 military spacejets to be the among the first to be sent into space. You have led multiple sucessful peacekeeping campaigns before, and the United Nations trust that you will influence the best decisions in this uncharted terrority.\",\n \"(A) Next\", //Text for option 1\n choice1, //Object target for option 1\n \"\",\n choice1\n );\n backstory1 = new StorySection(\n \"You have been selected to be in charge of the new and impossibly difficult task, to be a neutral force to observe the nation's actions and respond accordingly in space.\\n\\nA Space Peacekeeper.\",\n \"(A) Next\", //Text for option 1\n backstory2, //Object target option 1\n \"\",\n backstory2\n );\n //story start\n openingPassage3 = new StorySection(\n \"This caused the other nations to scramble and organize their own methods to reach the moon and stake a claim before all of it was gone and before international law would have a chance to stop it and regulate it. \\n\\nThe World's second Space Race had officially begun.\",\n \"(A) Next\", //Text for option 1\n backstory1, //Object target for option 1\n \"\",\n backstory1\n );\n openingPassage2 = new StorySection(\n \"Whether we wanted it or not, space colonization and travel is in full boom. The United States were the first to put make a Space Force that set the standard for United Nations. But before the United Nations could do much to regulate it, the United States had already established the Moon as the first extraterrestrial object to be used by their private industries.\",\n \"(A) Next\", //Text for option 1\n openingPassage3, //Object target for option 1\n \"\",\n openingPassage3\n );\n openingPassage1 = new StorySection(\n \"Humans are not like any other creature in the known universe. We have effectively conquered the Earth in ways animals could not even being to understand. To our current knowledge, we know that we are the only intelligent and sentient creatures that is in our system.\\n\\nIf no other creature claims the barren planets of our system, does it not belong to all of us?\", //Description for scene\n \"(A) Next\", //Text for option 1\n openingPassage2, //Object target for option 1\n \"\",\n openingPassage2\n );\n beginningQuote = new StorySection(\n \"''The cognizance of any creature increases by the amount of progression they make. The greater the cognizance, the larger the conscience.''\", //Beginnning quote by me\n \"(A) Next\", //Text for option 1\n openingPassage1, //Object target for option 1\n \"\",\n openingPassage1\n );\n title = new StorySection(\n \"The Golden Age\\n\\nThe Lunar Storm\\n\\n\\nControls are A and D on the keyboard.\",\n \"(A) Next\", //Text for option 1\n beginningQuote, //Object target for option 1\n \"by Melvin Mingoa\",\n beginningQuote\n );\n //introduction\n}", "function init() {\n //using inquirer, \n //have our questioins go through node to collect our data\n inquire\n .prompt(questions)\n //then take the data and pass through write to file\n .then((data) => {\n let markdownPageContent = generateMarkdown(data);\n const filename = 'README.md';\n writeToFile(filename, markdownPageContent);\n })\n}", "function nextPage() {\n\n if (pastContests.length > pastEndIndex + 30) {\n pastStartIndex = pastStartIndex + 30;\n pastEndIndex = pastEndIndex + 30;\n }\n\n if (nonPastContests.length >= nonPastEndIndex + 30) {\n nonPastStartIndex = nonPastStartIndex + 30;\n nonPastEndIndex = nonPastEndIndex + 30;\n }\n\n makePastCards(pastContests);\n makeNonPastCards(presentContests, futureContests);\n}", "function arrayLoad(){\n var info, qtext, i;\n info = text.split(\"\\n\");//info is an array of every line of text in the file \n var q = [];//primative array (non OOP arrays in js act like java arraylists) of questions for this page\n var arraycounter=0;\n for(i = 0; i<info.length;i++){\n var ans = info[i];\n i++;\n qtext=\"\";\n while((info[i].trim()) !== \"ZzZ\"){\n qtext+=info[i] + \"<br>\";\n i++;\n }\n i++;//to get out of the ZzZ indicator\n\n q[arraycounter] = new quest(ans, qtext, info[i], info[i+1], info[i+2], info[i+3], info[i+4]);\n arraycounter++; \n \n i+=4;\n }\n //all questions from the doc are now in the array q\n q = shuffle(q);\n return q;\n}", "function findTehellim() {\n let data = '';\n\n fetch(url + chapter)\n .then(result => result.json())\n .then(jsonData => data = jsonData)\n .then(function() {\n \n //Create English Text\n\n if (searchLanguage === \"eng\"){\n for(i=0;i<data.text.length;i++) {\n outputText += \"<div class='verse'>\" + (i+1) + \". \" + data.text[i] + \"</div>\";\n }\n }\n\n //Create English and Hebrew Text\n\n if (searchLanguage === \"engHeb\"){\n for(i=0;i<data.text.length;i++) {\n outputText += \"<div class='verse'>\" + (i+1) + \". \" + data.he[i] + \"</div>\" + \"<div class='verse'>\" + (i+1) + \". \" + data.text[i] + \"</div>\";\n }\n }\n\n //Create Hebrew Text\n\n if (searchLanguage === \"heb\"){\n for(i=0;i<data.text.length;i++) {\n outputText += \"<div class='verse'>\" + (i+1) + \". \" + data.he[i] + \"</div>\";\n }\n }\n\n //Appending Generated Text To Page\n\n textField.innerHTML = (outputText);\n });\n }", "addPagination() {\n if (this.pdfBuilder.includePageNumber) {\n const { doc, margins, documentFont } = this.pdfBuilder;\n let text = this.currentPage;\n doc.font(documentFont);\n doc.fontSize(9);\n\n if (this.docTitle.length > 0) {\n text = `${this.docTitle} - ${text}`;\n }\n doc.text(text, margins.left, this.height + margins.bottom, { align: 'right', width: this.width });\n }\n }", "function book(title, author, pageNum, read) { //constructor\n \n this.title = title\n this.author = author\n this.pageNum = pageNum\n this.read = read\n \n}", "function createPage () {\n\t$(\"ul li\").each(function(index) {\n\t\tobj = $(this)\n\t\tdivCount += 1\n\t\t\tif (divCount < 10) {\n\t\t\t\tobj.show()\n\t\t\t} else {\n\t\t\t\tobj.hide()\n\t\t\t}\n\t\t\tif (index % 10 === 0) {\n\t\t\t\tnewTag += \"<li id=\\\"page\\\"><a href=\\\"#\\\">\" + countCreate + \"</a></li>\"\n\t\t\t\tcountCreate++;\n\t\t\t}\n\t});\n\tif (newTag !== null) {\n\t\t$(\"ul\").append(\"<nav aria-label=\\\"Page navigation\\\"><ul class=\\\"pagination\\\">\" + newTag + \"</ul></nav>\");\n\t}\n\n}", "function showFeature() {\n\n textreader();\n}", "function init() {\n // use inquirer to ask questions (activity 2 from Monday)\n // call generateMarkdown function which will return a string\n // call writeToFile function pass to it a file name and the string returned by the generateMarkdown function\n}", "function generateText(text) {\n let mm = new MarkovMachine(text);\n console.log(mm.makeText());\n}", "function createTitlePages() {\n let titleInfo = [\n { num:'1', title:'General Provisions' },\n { num:'2', title:'Elections'},\n { num:'3', title:'Legislature'},\n { num:'4', title:'State Organization and Administration, Generally'},\n { num:'5', title:'State Financial Administration'},\n { num:'6', title:'County Organization and Administration'},\n { num:'7', title:'Public Officers and Employees'},\n { num:'8', title:'Public Proceedings and Records'},\n { num:'9', title:'Public Property, Purchasing and Contracting'},\n { num:'10', title:'Public Safety and Internal Security'},\n { num:'11', title:'Agriculture and Animals'},\n { num:'12', title:'Conservation and Resources'},\n { num:'13', title:'Planning and Economic Development'},\n { num:'14', title:'Taxation'},\n { num:'15', title:'Transportation and Utilities'},\n { num:'16', title:'Intoxicating Liquor'},\n { num:'17', title:'Motor and Other Vehicles'},\n { num:'18', title:'Education'},\n { num:'19', title:'Health'},\n { num:'20', title:'Social Services'},\n { num:'21', title:'Labor and Industrial Relations'},\n { num:'22', title:'Banks and Financial Institutions'},\n { num:'23', title:'Corporations and Partnerships'},\n { num:'23a', title:'Other Business Entities'},\n { num:'24', title:'Insurance'},\n { num:'25', title:'Professions and Occupations'},\n { num:'25a', title:'General Business Provisions'},\n { num:'26', title:'Trade Regulation and Practice'},\n { num:'27', title:'Uniform Commercial Code'},\n { num:'28', title:'Property'},\n { num:'29', title:'Decedents\\' Estates'},\n { num:'30', title:'Guardians and Trustees'},\n { num:'30a', title:'Uniform Probate Code'},\n { num:'31', title:'Family'},\n { num:'32', title:'Courts and Court Officers'},\n { num:'33', title:'Evidence'},\n { num:'34', title:'Pleadings and Procedure'},\n { num:'35', title:'Appeal and Error'},\n { num:'36', title:'Civil Remedies and Defenses and Special Proceedings'},\n { num:'37', title:'Hawaii Penal Code'},\n { num:'38', title:'Procedural and Supplementary Provisions'}\n ];\n\n let re = new RegExp(/^([0-9]+)/i);\n\n let allPromises = [];\n\n //loop thru titles\n for (let i=0; i<titleInfo.length; i++) {\n\n let division = '';\n let volume = '';\n\n let r = titleInfo[i].num.match(re);\n let titleNumOnly = parseInt(r[1]);\n \n if (titleNumOnly < 22) division = '1';\n else if (titleNumOnly < 28) division = '2';\n else if (titleNumOnly < 32) division = '3';\n else if (titleNumOnly < 37) division = '4';\n else division = '5';\n\n if (titleNumOnly < 6) volume = '1';\n else if (titleNumOnly < 10) volume = '2';\n else if (titleNumOnly < 13) volume = '3';\n else if (titleNumOnly < 15) volume = '4';\n else if (titleNumOnly < 19) volume = '5';\n else if (titleNumOnly < 20) volume = '6';\n else if (titleNumOnly < 22) volume = '7';\n else if (titleNumOnly < 24) volume = '8';\n else if (titleNumOnly < 25) volume = '9';\n else if (titleNumOnly < 26) volume = '10';\n else if (titleNumOnly < 27) volume = '11';\n else if (titleNumOnly < 32) volume = '12';\n else if (titleNumOnly < 37) volume = '13';\n else volume = '14';\n\n // Create meta\n let meta = {\n hrs_structure: {\n division: division,\n volume: volume,\n title: titleInfo[i].num,\n chapter: '',\n section: ''\n },\n type: 'title',\n menu: {\n hrs: {\n identifier: `title${titleInfo[i].num}`,\n name: `Title ${titleInfo[i].num}. ${titleInfo[i].title}`\n }\n },\n weight: (5 * (i + 1)),\n title: titleInfo[i].title,\n full_title: `Title ${titleInfo[i].num}. ${titleInfo[i].title}`\n };\n let allMeta = Object.assign({}, meta, addCustomMetaAllFiles);\n\n //write file\n let path = Path.join(destFileDir, `title-${titleInfo[i].num}`, '_index.md');\n allPromises.push(writeFile(path, \"---\\n\" + yaml.safeDump(allMeta) + \"---\\n\"));\n \n } \n\n return Promise.all(allPromises).then((val)=>val);\n}", "function gotoPage(pageNr) {\n if (dataToBeStored.size <= 0) return\n var data = [...dataToBeStored];\n displayIssue = pageNr % data.length;\n if (displayIssue < 0)\n displayIssue = data.length - displayIssue - 2;\n\n elemById(\"txaText\").value = data[displayIssue].text;\n elemById(\"lblOut\").value = data[displayIssue].labels.join(\",\");\n elemById(\"txfPage\").innerText = ` ${displayIssue + 1} / ${data.length} `;\n}", "function ReaderFactory() {}", "function loadPageTemplate(page){\n //if( page.sent==0 ){\n page.output = fs.readFileSync('app.templates/page.template.html');\n updateSection(page,\"%%TITLE%%\",\"Final Project by Martin2018\");\n //}\n}", "renderPage() {}", "function init() {\n inquirer.prompt(questions).then((response) => {\n let text = gen.generateMarkdown(response);\n try { \n writeToFile(\"README.md\", text)\n } catch (error) {\n console.error(error);\n }})\n\n}", "function init() {\n inquirer.prompt(questions).then((data) => {\n console.log(data);\n let answers = markdown(data);\n console.log(\"This is the template\" + answers);\n writeToFile(\"README.md\", answers)\n })\n}", "function GeneratePage() {\n\tthis.generatedPositions = [];\n\n\t// get the size of our sample div, then remove it, it's served it's purpose\n\tconst div = document.querySelector('[data-o-element-visibility-track]');\n\tif (!div) throw new Error('Demo base div missing');\n\tthis.div = div.getBoundingClientRect();\n\tdiv.parentNode.removeChild(div);\n\n\t// set the body size to be 20% larger than the viewport\n\tthis.body = this.setBodySize(1.2);\n\n\t// calculate a sensible amount of divs to display\n\tconst numDivs = this.numDivs = this.maxDivs();\n\tthis.addDivs(numDivs);\n\n\t// counters\n\tthis.inView = document.getElementsByClassName('inview');\n\n\t// initialise the info box\n\tthis.setupInfo();\n}", "genPrimaryContent(page) {\n switch (page) {\n\n case 'EXPLORER':\n return (\n <Explorer\n position={this.state.position}\n getPosition={this.getPosition}\n />\n );\n\n default:\n return (\n <Welcome\n title={Texts.title}\n label={Texts.titleButtonLabel}\n onClick={this.handleAuthSubmit}\n />\n );\n }\n }", "function init() {\n inquirer.prompt(questions)\n .then((response) => {\n const createFile = generateMarkdown(response);\n writeToFile(createFile);\n })\n}", "function PagesTest() {\n\n return (<>\n 233\n </>)\n}", "function init() {\n inquirer.prompt(questions).then((res) => {\n writeToFile('ReadMe.md', generateMarkdown({...res}));\n }).catch(e => console.log(e));\n }" ]
[ "0.636354", "0.6363466", "0.6363466", "0.6363466", "0.62755156", "0.61579883", "0.6059186", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.6008788", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.60043097", "0.58426595", "0.58412606", "0.58412606", "0.58412606", "0.58412606", "0.58094174", "0.56407213", "0.55687124", "0.5546647", "0.5513923", "0.543995", "0.542596", "0.54171115", "0.5366291", "0.53198975", "0.53076553", "0.5288304", "0.527568", "0.5261188", "0.5255628", "0.52521485", "0.5227665", "0.52160263", "0.5204469", "0.5200695", "0.5191461", "0.516516", "0.5144363", "0.5143392", "0.5141915", "0.51396096", "0.51207876", "0.5118824", "0.50994104", "0.50920546", "0.5076226", "0.5065265", "0.50563985", "0.5048473", "0.5040183", "0.5038522", "0.50275195", "0.5019528", "0.5017212", "0.50165045", "0.5002147", "0.499914", "0.49803838", "0.49767047", "0.49753708", "0.49752983", "0.49685952", "0.4961131", "0.49543175", "0.49542993", "0.49535525", "0.49514496", "0.4948721", "0.49467477", "0.4927024", "0.49140576", "0.49053687", "0.49052864", "0.49052376", "0.4901346" ]
0.6067503
6
Create a page of textreader results.
function txtrresults() { // First, run reportStats and generate the ReportMy stats to be used. reportStats(); // Then setup report using ReportMy data. var prompt1 = "I detect you had entered " + reportMy.numOfSents + " sentence(s), consisting of " + reportMy.numOfWords + " words and " + reportMy.numOfSpaces + " spaces. The average words per sentence therefore is " + reportMy.aveWordsPerSent + ". Thanks for playing!"; var noenter = "I detect you have not entered words in the text area. Ok then."; // Create noenter if no words detected in text area. if ( reportMy.numOfWords === 0) { prompt1 = noenter; } // If word are detected, create page report. var showt = document.getElementById("showtime"); var button1 = document.getElementById("button1id"); showt.removeChild(button1); var port = document.getElementById("portfolio"); var div = appendElementChild("div", showt, "txtresults"); appendTextChild(prompt1, div, "h4"); var button2 = appendElementChild("button", div, "button2id"); button2.innerHTML = "Done!"; button2.setAttribute("name", "button2"); button2.setAttribute("onClick", "portlist()"); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genResults($this, data, callback) {\n\t\tvar res = calcPageResults(data);\n\n\t\t// if results are available, create page elements\n\t\tif (res.total > 0) {\n\t\t\tvar node = $this.find('.poppy_pagination');\n\n\t\t\tif (node[0]) node.remove();\n\n\t\t\t// .. results header\n\t\t\tvar div1 = createResultBarElm(res, callback),\n\t\t\t\tdiv2 = createPaginateElm( res, callback);\n\t\t\t$this.prepend(div2, div1);\n\n\t\t\t// .. results footer\n\t\t\tdiv1.clone(true).appendTo($this);\n\t\t\tdiv2.clone(true).appendTo($this);\n\t\t}\n\t}", "function getNext(){\n page++\n getSearch()\n}", "function nextPage() {\n service.textSearch(request, callback, pagnation);\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 genEachPage(theList, theListLength) {\n const theReturn = [];\n // theList ==== http://www.r18.com/videos/vod/movies/list/id=45425/pagesize=30/price=all/sort=popular/type=studio/page=/\n for(var i=1; i<=theListLength; i++) {\n let page = theList + i;\n theReturn.push(page);\n }\n\n return theReturn;\n}", "function readpage_reader(instance) {\n\n\t// buffer === Page\n\tvar buffer = instance.buffer;\n\tvar count = ((H.PAGESIZE - 1) / H.BLOCKSIZE);\n\tvar filter = [];\n\n\tvar pagetype = buffer.readInt8(0);\n\n\t// Page is empty\n\tif (pagetype === 0)\n\t\treturn filter;\n\n\t// Reads document\n\tfor (var i = 0; i < count; i++) {\n\n\t\tvar offset = (i * H.BLOCKSIZE); // because 1 is type of page\n\t\tvar type = buffer.readInt8(offset);\n\t\tif (type !== H.FLAG_RECORD)\n\t\t\tcontinue;\n\n\t\tvar replication = buffer.readInt8(offset + 1);\n\t\tvar storage = buffer.readInt8(offset + 2);\n\t\tvar idsize = buffer.readInt8(offset + 3);\n\t\tvar datasize = buffer.readInt16BE(offset + 4);\n\n\t\tvar id = type === H.FLAG_RECORD ? buffer.toString('ascii', offset + 6, offset + idsize + 6) : null;\n\t\tvar data = type === H.FLAG_RECORD ? buffer.toString('utf8', offset + 56, offset + 56 + datasize) : null;\n\t\tvar output = { type: type, storage: storage, id: id, data: data, cursor: instance.cursor, replication: replication };\n\n\t\tfilter.push(output);\n\n\t\tswitch (type) {\n\t\t\tcase H.FLAG_RECORD:\n\t\t\t\tinstance.count++;\n\t\t\t\tbreak;\n\t\t\tcase H.FLAG_REMOVED:\n\t\t\t\tinstance.removecount++;\n\t\t\t\tbreak;\n\t\t\tcase H.FLAG_EMPTY:\n\t\t\t\tinstance.emptycount;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn filter;\n}", "function next() {\n pageNumber++;\n getEmployeeDetails(myArr);\n }", "function textreader() {\n\n // Replace \"reserved\" report with feature exercise.\n var port = document.getElementById(\"portfolio\");\n var reserved = document.getElementById(\"reserved\");\n port.removeChild(reserved);\n var div = appendElementChild(\"div\", port, \"showtime\");\n var prompt1 = \"First, a simple exercise. Type complete sentences \"\n + \"in the text area provided then press SUBMIT. I will report \"\n + \"statistics related to your submission. Cool? \";\n appendTextChild(prompt1, div, \"h4\");\n var prompt2 = \"Text Reader and Statistics\";\n var txta = appendElementChild(\"textarea\", div, \"sample\");\n txta.setAttribute(\"name\", \"textReader\");\n txta.setAttribute(\"rows\", \"5\");\n txta.setAttribute(\"cols\", \"30\");\n appendBreakChild(2, div);\n\n // Create button to move to next results page.\n var button1 = appendElementChild(\"button\", div, \"button1id\");\n button1.innerHTML = \"Submit\";\n button1.setAttribute(\"name\", \"button1\");\n button1.setAttribute(\"onClick\", \"txtrresults()\");\n\n return true;\n}", "function generator(text) {\n\n var db = that;\n\n var R = [],\n offset = default_offset,\n last = limit,\n done = false;\n\n // see what next() would return\n function peek() {\n if(done)\n return Promise.resolve({done: true});\n else if(R.length)\n return Promise.resolve({value: R[0], done: false});\n else \n return fetch().then(peek);\n }\n\n // returns a Promise that resolves to {value, done}\n function next() {\n if(done)\n return Promise.resolve({done: true});\n else if(R.length)\n return Promise.resolve({value: R.shift(), done: false});\n else \n return fetch().then(next);\n }\n\n // returns Promise after fetching more results and setting internal\n // buffer to contain the <limit> results, starting at <offset>\n function fetch() {\n return myQuery(text, limit, offset).then(function(rows){\n if(rows.length) {\n R = rows;\n offset += rows.length;\n last = rows.length;\n }\n else {\n done = true;\n }\n });\n }\n\n return {\n next: next,\n peek: peek\n }\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: ( align && isPrevious ),\n next: ( align && isNext )\n };\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: ( align && isPrevious ),\n next: ( align && isNext )\n };\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: ( align && isPrevious ),\n next: ( align && isNext )\n };\n }", "function makePage(number, text, isDisabled, isPrevious, isNext) {\n return {\n number: number,\n text: text,\n disabled: isDisabled,\n previous: align && isPrevious,\n next: align && isNext\n };\n }", "function getPageNums() {\n totalResults = parseInt($('.container h1').text(), 10);\n totalPages = Math.ceil(totalResults / 10); //20\n console.log(totalResults + \" results found, \"+totalPages+\" page(s) to scave!\\n \");\n\n getAllSearchResults();\n}", "function parseResults(results) {\r\n // clear out the old results by deleting everything with class \"article\"\r\n // result is that only 20 results are displayed at a time\r\n document.querySelectorAll('.article').forEach(function(article) {\r\n article.remove();\r\n })\r\n \r\n // display the new search results\r\n let articles = results.articles;\r\n for (let i=0; i<articles.length; i++) {\r\n\r\n // create a div for the article ... content will go inside it\r\n let block = document.createElement('div');\r\n block.classList.add('article'); // tag the block for easy manipulation\r\n resultSection.appendChild(block);\r\n \r\n // add image as a link\r\n addImage(articles[i].url, articles[i].urlToImage, block);\r\n\r\n // add the title as a link\r\n addTitle(articles[i].url, articles[i].title, block);\r\n\r\n // add the source and the date (substring of the publishedAt field to extract date without time)\r\n addChild('h5', articles[i].source['name'] + ', ' + articles[i].publishedAt.substring(0, 10), block);\r\n\r\n // add description\r\n addChild('p', articles[i].description, block);\r\n }\r\n}", "function showResults() {\n let bigString = \"\";\n\n for (let i = page; i < page + 10; i++) {\n let result = results[i];\n\n let smallURL = result.recipe.image;\n if (!smallURL) smallURL = \"Media/gif_finder_images/no-image-found.png\";\n\n //get url of recipe, yield/servings, total time\n let url = result.recipe.url;\n let portions = result.recipe.yield;\n let time = result.recipe.totalTime;\n //if there is no estimate on time (0 minutes), change phrases\n if (time == 0) {\n time = \"N/A\"\n }\n else {\n time += \" min\";\n }\n //get name of recipe, cut off name if too long\n let name = result.recipe.label;\n if (name.length > 42) {\n name = name.substring(0, 42) + \"...\";\n }\n //build HTML\n let line = `<div class='result'><div class=\"title\"><h2>${name}</h2></div><div class=\"info\">Servings: ${portions}\n <br>Time: ${time}</div><div class=\"foodImage\"><img src='${smallURL}' title='${result.id}' /></div>`;\n line += `<div class=\"link\"><a target='_blank' href='${url}'> View Recipe </a></div></div>`;\n bigString += line;\n }\n\n //put into HTML\n document.querySelector('#content').innerHTML = bigString;\n\n document.querySelector('#status').innerHTML = \"<b>Search was successful!</b>\";\n}", "function nextPage() {\n\n if (pastContests.length > pastEndIndex + 30) {\n pastStartIndex = pastStartIndex + 30;\n pastEndIndex = pastEndIndex + 30;\n }\n\n if (nonPastContests.length >= nonPastEndIndex + 30) {\n nonPastStartIndex = nonPastStartIndex + 30;\n nonPastEndIndex = nonPastEndIndex + 30;\n }\n\n makePastCards(pastContests);\n makeNonPastCards(presentContests, futureContests);\n}", "function pageTheResult(resultApiResponse) {\n numberOfPages = getNumberOfPages(resultApiResponse);\n numberOfImages = resultApiResponse.length;\n\n var begin = ((currentPage - 1) * numberPerPage);\n var end = begin + numberPerPage;\n\n pageList = resultApiResponse.slice(begin, end);\n // Enable/Disable paging buttons if necessary\n check();\n return pageList;\n}", "async function reviewsGenerator(page) {}", "function gotPageOfLines(records, fetchNextPage) {\n console.log(\"gotPageOfLines()\");\n // add the records from this page to our captions array\n lines.push(...records);\n // request more pages\n fetchNextPage();\n}", "async nextResultsPage() {\n if (this.state.numHits > 10) {\n let newOffset = this.state.searchOffset + 10;\n this.setState({ searchOffset: newOffset });\n\n if (this.state.searchOffset + 10 > this.state.numHits) {\n this.setState({ searchOffset: this.state.numHits - 10 });\n }\n\n const rez = await this.search();\n this.setState({ searchResults: rez });\n }\n }", "pageNext(num) {\n this.setPage(num)\n }", "async getResults(page = 1) {\n try {\n this.page = page;\n const result = await searchRecipes(this.query, this.page);\n\n this.currResults = result.results;\n this.allResults.push(...result.results);\n this.numRetrieved += result.results.length;\n if (page === 1) this.numTotal = result.totalResults;\n if (this.numRetrieved === this.numTotal) this.allRetrieved = true;\n } catch (error) {\n console.log('Error retrieving results', error);\n throw error;\n }\n }", "function calcPageResults(settings) {\n\t\tvar obj = {};\n\t\tobj.total = settings.totalResults;\n\t\tobj.limit = settings.perPage;\n\t\tobj.start = settings.startPage || 1;\n\t\tobj.pages = getTotalRows(obj.total, obj.limit);\n\t\tobj.first = obj.start * obj.limit + 1 - obj.limit;\n\t\tobj.last = ((obj.first + obj.limit - 1) < obj.total) ? (obj.first + obj.limit - 1) : obj.total;\n\t\treturn obj;\n\t}", "function resultPage(){\n page.empty();\n page.append($(\"<p>\").text(\"Number Correct: \" + numCorrect));\n page.append($(\"<p>\").text(\"Number Wrong: \" + numWrong));\n page.append($(\"<p>\").text(\"Number Unanswered: \" + numTimeLimit));\n\n currentQuestion = 0;\n numWrong = 0;\n numCorrect = 0;\n numTimeLimit = 0;\n\n setTimeout(function(){\n startPage();\n }, 3300);\n \n }", "function getPage(start, number, params) {\n\n var result;\n var totalRows;\n\n getRandomsItems(function cb(randomsItems) {\n var filtered = params.search.predicateObject ? $filter('customFilter')(randomsItems, params.search.predicateObject) : randomsItems;\n console.log(\"Filtro:\" + JSON.stringify(params.search.predicateObject));\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n result = filtered.slice(start, start + number);\n totalRows = randomsItems.length;\n\n /*console.log(\"Result : \" + JSON.stringify(result));\n console.log(\"Total Rows : \" + JSON.stringify(totalRows));*/\n });\n\n\n var deferred = $q.defer();\n\n $timeout(function () {\n\n deferred.resolve({\n data: result,\n numberOfPages: Math.ceil(totalRows / number)\n });\n\n }, 1500);\n\n return deferred.promise;\n\n }", "function searchNewspapers(query) {\n\t$(\"#search-documents\").empty();\n\t$(\"#search-documents\").append(\"<p>Loading results for \" + query + \"</p>\");\n\tvar displayObjects = []; //array where results are kept\n\tvar i = 0;\n\t// Load results from the first 20 pages\n\twhile (i < 20) {\n\t\tajaxCall(query, i + 1, displayObjects);\n\t\ti++;\n\t}\n}", "nextPage() {\n if (this.page < this.totalPages) {\n this.page++;\n this.search();\n }\n }", "function printPage(searchParams, response) {\n return function(error, rows) {\t\n if (error) {throw error;}\n\n\t\tcontent = []; \n\t\t\t\n for (i=0; i<rows.length; i++)\n {\n // add like/dislike datas\t\t\t\t\n var likes = (rows[i]['likes'] != null) ? rows[i]['likes'] : 0;\n var dislikes = (rows[i]['dislikes'] != null) ? rows[i]['dislikes'] : 0;\n var total = likes + dislikes;\n var likePerc, dislikePerc;\t\t\t\n if (total == 0)\n {\n likePerc = 0;\n dislikePerc = 0;\n }\n else\n {\n likePerc = likes / total * 100;\n dislikePerc = dislikes / total * 100;\n }\n var obj = {\n iStatus: rows[i]['status'],\n iId: rows[i]['id'],\n iTitle: rows[i]['title'],\n iLastModified:\trows[i]['lastModified'],\n likecount: likes,\n dislikecount: dislikes,\n likepercentage: likePerc,\n dislikepercentage: dislikePerc\n };\t\n content.push(obj);\n }\n \n /* Setup variables */\n var sortbyQueryString = queryString('sortby', searchParams.sortBy);\n var searchQueryString = queryString('search', searchParams.search);\n var directionQueryString = queryString('direction', searchParams.direction);\n var switchDirQueryString = queryString('direction',\n searchParams.direction == 'ASC' ? 'DESC' : 'ASC');\n var title = \"Latest Issues\";\n if(searchParams.search != null)\n {\n title = \"Search Results For: \" + searchParams.search;\n } \n \n variables = {\n title: title,\n content: content,\n pageNumber: searchParams.page,\n resultCount: searchParams.resultCount,\n noResults: content.length == 0,\n wasSearch: searchParams.search != null,\n pageCount: searchParams.pageCount,\n sortbyQueryString: sortbyQueryString,\n searchQueryString: searchQueryString,\n directionQueryString: directionQueryString,\n switchDirQueryString: switchDirQueryString,\n }\n \n /* Previous page */\n if (searchParams.page - 1 > 0)\n {\n variables.previous = searchParams.page - 1;\n }\n \n /* Next page */\n if (parseInt(searchParams.page) + 1 <= searchParams.pageCount)\n {\n variables.next = parseInt(searchParams.page) + 1;\n }\n\n /* Pager */\n var pager = [];\n for (i = searchParams.page - 2; i <= searchParams.pageCount; i++)\n {\n if (i > 0)\n {\n if (i != searchParams.page)\n {\n var link = '<a href=\"/?' + \n sortbyQueryString + \n searchQueryString + \n directionQueryString +\n 'page=' + i + '\">' + i + '</a>';\n } \n else\n {\n var link = '[' + i + ']';\n }\n var obj = { page: link }\n pager.push(obj);\n }\n }\n variables.pager = pager;\n \n response.render('views/listIssue.html', variables);\n };\n}", "function doScrape() {\n console.log('Article Count : ' + articles.length);\n console.log('URL in process : ' + kompas.getBaseURL());\n\n kompas.scrap().then(function (scraps) {\n scraps.forEach(function (news) {\n if (!news.content || scrapLimit == articles.length) {\n return;\n }\n\n var article = {\n index: news.source + '-' + (++index),\n category: news.category,\n title: news.title,\n date: news.date,\n content: news.content\n };\n\n articles.push(article);\n });\n\n console.log(scraps.length + ' articles scraped.');\n\n // Process next batch (or page) of articles.\n if (scraps.length < 10) {\n // Change date when current scraps result is little than 10 (should work on most case).\n currDate.setDate(currDate.getDate() - 1);\n kompas.setDesiredDate(currDate.getDate(), currDate.getMonth(), currDate.getFullYear());\n kompas.resetPage();\n } else {\n // Go to next page.\n kompas.nextPage();\n }\n\n // Decide whether to continue scrap or not.\n if (scrapLimit > articles.length) {\n console.log();\n doScrape();\n } else if (scrapLimit <= articles.length) {\n if (_.isFunction(callback)) callback(articles);\n }\n });\n }", "function startParser() {\n\n for(var i = 0; i < numeroDePaginas; i++) {\n\n (function () {\n var aux = i;\n\n pagina = offset + (i + 1);\n URL = baseURL + consultaURL + pagina;\n\n request(URL, function (error, response, body) {\n\n if (!error) {\n var $ = cheerio.load(body),\n fields = $('table').last().find('.campo:nth-child(3)').find('a'),\n docURL;\n\n // console.log(body);\n\n for(var i = 0, len = fields.length; i < len; i++) {\n docURL = $(fields[i]).prop('href');\n documentsURL.push(baseURL + docURL);\n }\n\n // captcha\n if(documentsURL.length === 0) {\n console.log('Captcha apareceu! :(');\n }\n else {\n // execute URLs when get all of them\n if(aux === numeroDePaginas - 1) {\n console.log(documentsURL.length + ' urls serão executadas!');\n console.log('======================================================');\n setTimeout(function() {\n executeURLS();\n }, 1000);\n }\n }\n } else {\n console.log(error);\n }\n });\n })();\n }\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 paging(res){\n\t// Does the response include a 'next_cursor_string'\n\tif(\"next_cursor_str\" in res){\n\t\t// https://dev.twitter.com/docs/misc/cursoring\n\t\tres['paging'] = {\n\t\t\tnext : \"?cursor=\" + res.next_cursor_str\n\t\t};\n\t}\n}", "function loadResults (data, source, savedUrlsArr) {\n var sourceId = '#' + source;\n\n // remove throbber\n $(sourceId + ' i').fadeOut();\n // remove previous search results\n $(sourceId + ' .row').remove(); // every result card\n $(sourceId + ' p').remove(); // 'show x more results...'\n\n // common elements to be created below\n var title = '';\n var excerpt = '';\n var url = '';\n\n var numOfResults = '';\n var numOfCards = '';\n // CONFIGURATION for each API integration\n if (source === 'wikipedia') {\n numOfResults = data[1].length;\n } else if (source === 'nyt') {\n numOfResults = data.response.docs.length;\n } else if (source === 'guardian') {\n numOfResults = data.response.results.length;\n }\n\n // limit results displayed based on user's max input\n if (numOfResults >= RESULTS_LIMIT) {\n numOfCards = RESULTS_LIMIT;\n } else {\n numOfCards = numOfResults;\n }\n\n // each loop creates and appends a result card to DOM\n for (var i = 0; i < numOfCards; i++) {\n // CONFIGURATION for each API integration\n // WIKIPEDIA\n if (source === 'wikipedia') {\n title = $('<h3>').text(data[1][i]);\n excerpt = $('<p>').text(data[2][i]);\n url = data[3][i];\n\n // NEW YORK TIMES\n } else if (source === 'nyt') {\n title = $('<h3>').text(data.response.docs[i].headline.main);\n excerpt = $('<p>').text(data.response.docs[i].snippet);\n url = data.response.docs[i].web_url;\n\n // THE GUARDIAN\n } else if (source === 'guardian') {\n title = $('<h3>').text(data.response.results[i].webTitle);\n excerpt = $('<p>').text('no excerpt available');\n url = data.response.results[i].webUrl;\n }\n\n // Note: No need to amend from here onwards - all works with various APIs\n // create html elements before appending to page\n var row = $('<div>').addClass('row');\n var col = $('<div>').addClass('col-sm-12 result-card');\n\n // click to launch BS Modal with relevant iframe\n var a = $('<a>').attr({\n 'url': url, // hidden data, value is set as iframe 'src' when modal is triggered\n 'data-toggle': 'modal',\n 'data-target': '.iframe-modal-lg',\n 'class': 'modal-trigger'\n });\n\n // create URL input field\n var inputGroup = $('<div>').addClass('input-group input-group-sm copy-url');\n var input = $('<input>').attr({\n onclick: 'this.select();',\n type: 'text',\n value: url,\n id: 'link-' + source + '-' + i\n }).addClass('form-control');\n var inputGroupBtns = $('<span>').addClass('input-group-btn');\n\n // --- create and modify star button (save url to backend) ---\n var starBtn = $('<button>').attr({\n 'type': 'button',\n 'url': url\n }).addClass('btn btn-default star-btn');\n var starGlyphicon = '';\n\n // check if user has saved url before\n if (isSavedBefore(url, savedUrlsArr)) {\n starGlyphicon = $('<span>').addClass('glyphicon glyphicon-star');\n starBtn.addClass('starred'); // indicate to frontend that it's starred\n } else if (!isSavedBefore(url, savedUrlsArr)) {\n starGlyphicon = $('<span>').addClass('glyphicon glyphicon-star-empty');\n }\n // nest glyph inside button\n starBtn.append(starGlyphicon);\n\n // --- create and modify COPY button (one click copy) ---\n var copyBtn = $('<button>').attr({\n type: 'button',\n 'data-clipboard-target': '#link-' + source + '-' + i\n }).addClass('clipboard btn btn-default');\n var copyGlyphicon = $('<span>').addClass('glyphicon glyphicon-copy');\n // nest glyph inside button\n copyBtn.append(copyGlyphicon);\n\n // --- create and modify GLOBE button (open in new tab) ---\n var globeBtn = $('<a>').attr({ // yes, it's a hack\n href: url,\n target: '_blank'\n }).addClass('btn btn-default');\n var globeGlyphicon = $('<span>').addClass('glyphicon glyphicon-globe');\n // nest glyph inside button\n globeBtn.append(globeGlyphicon);\n\n // APPEND ALL THE ABOVE TO PAGE\n a.append(title, excerpt);\n inputGroupBtns.append(copyBtn, globeBtn, starBtn);\n inputGroup.append(input, inputGroupBtns);\n col.append(a, inputGroup);\n row.append(col);\n\n // append card to page\n $(sourceId).append(row);\n\n // ============= Star Buttons click handler =============\n $(starBtn).on('click', function (ev) {\n // debugger;\n // url is obtained from 'url' attr of <a>\n var elem = $(this); // element handle\n var urlStr = $(elem).attr('url'); // string value\n\n if (!elem.hasClass('starred')) {\n // format: updateSavedUrls(method, route, data)\n updateSavedUrls('create', '/stars/update', urlStr);\n } else if (elem.hasClass('starred')) {\n // ajax DELETE to destroy matching entry in 'star' table in db\n updateSavedUrls('delete', '/stars/update', urlStr);\n }\n });\n } // -- end for loop --\n\n\n // ============= Modal click handler ==============\n // index.html contains modal with embedded iframe\n // main.js sets relevant 'src' of iframe when result card is clicked\n $('.modal-trigger').on('click', function (ev) {\n // url is obtained from 'url' attr of <a>\n var url = ev.currentTarget.attributes[0].value;\n // prevent re-load of the same content in modal\n if ($('iframe').attr('src') !== url) {\n $('iframe').attr('src', url);\n }\n });\n } // end loadResults", "function createPage(pageNo, resultsPerPage) {\n let totalStudents = masterList.length;\n let firstStudentOnPage = (pageNo-1)*resultsPerPage;\n let lastStudentOnPage = pageNo*resultsPerPage - 1;\n\n for (let i = 0; i < totalStudents; i += 1) { // first hide all students\n masterList[i].style.display = 'none';\n }\n // then display students on their appopriate page\n if (lastStudentOnPage < totalStudents) {\n for (let i = firstStudentOnPage; i <= lastStudentOnPage; i++) {\n masterList[i].style.display = '';\n }\n }\n else {\n for (let i = firstStudentOnPage; i < totalStudents; i++) {\n masterList[i].style.display = '';\n }\n }\n\n}", "function getMovieTitles(substr) {\n const titles = [];\n let totalPages = 1;\n let currentPage = 1;\n\n while (currentPage <= totalPages) {\n https.get(`https://jsonmock.hackerrank.com/api/movies/search/?Title=${substr}&page=${currentPage}`, (resp) => {\n let data = '';\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n resp.on('end', () => {\n console.log(currentPage);\n const res = JSON.parse(data);\n totalPages = res.total_pages;\n titles.concat(res.data.map(item => item['Title']));\n currentPage++;\n });\n });\n }\n\n // for(let i=1; i <= totalPages; i++){\n // https.get(`https://jsonmock.hackerrank.com/api/movies/search/?Title=${substr}&page=${i}`, (resp) => {\n // let data = '';\n // resp.on('data', (chunk) => {\n // data += chunk;\n // });\n\n // resp.on('end', () => {\n // const res = JSON.parse(data);\n // totalPages = res.total_pages;\n // titles.concat(res.data.map(item=>item['Title']));\n // });\n // });\n // }\n\n console.log(titles);\n return titles.sort();\n}", "function paginatedResults(model) {\r\n return (req, res, next) => {\r\n\r\n //get the page an the limit query to a variable\r\n const page = parseInt(req.query.page)\r\n const limit = parseInt(req.query.limit)\r\n \r\n //convert the limit and page for a zero based array\r\n const startIndex = (page - 1) * limit\r\n const endIndex = page* limit\r\n \r\n //make an result object\r\n const results = {}\r\n \r\n //clac next result\r\n if (endIndex < model.length) {\r\n results.next = {\r\n page: page + 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n //clac previous result\r\n if (startIndex > 0){\r\n results.previous = {\r\n page: page - 1,\r\n limit: limit\r\n }\r\n \r\n }\r\n \r\n //slice the array from start to end index\r\n results.results = model.slice(startIndex, endIndex)\r\n \r\n //set the paginated object to a variable in the response\r\n res.paginatedResults = results\r\n next()\r\n \r\n }\r\n}", "function paginatedResults() {\n return async (req, res, next) => {\n let query = {};\n const results = {};\n const { page, limit, title, minPoints, maxPoints, sortOption } = req.query;\n const fields = { Title1: 1, Title2: 1, issn: 1, 'Points.Value': 1, e_issn: 1 };\n const startIndex = (page - 1) * limit;\n const endIndex = page * limit;\n let sortCriteria = {};\n if (typeof title !== 'undefined') {\n const reg = new RegExp(`${title}`);\n query.$or = [{ Title1: reg }, { Title2: reg }];\n }\n const points = {};\n if (typeof minPoints !== 'undefined') {\n points['$gte'] = minPoints;\n }\n if (typeof maxPoints !== 'undefined') {\n points['$lte'] = maxPoints;\n }\n if (Object.keys(points).length > 0) {\n query = { ...query, 'Points.Value': { ...points } };\n }\n if (typeof sortOption !== 'undefined') {\n if (sortOption === 'NameASC') {\n sortCriteria.Title1 = 1;\n }\n if (sortOption === 'NameDESC') {\n sortCriteria.Title1 = -1;\n }\n if (sortOption === 'PointsASC') {\n sortCriteria['Points.Value'] = 1;\n }\n if (sortOption === 'PointsDESC') {\n sortCriteria['Points.Value'] = -1;\n }\n } else {\n sortCriteria.Title1 = 1;\n }\n try {\n const magazines = await magazine\n .find(query, fields)\n .sort(sortCriteria)\n .exec();\n if (endIndex < magazines.length) {\n results.next = {\n page: parseInt(page, 10) + 1,\n limit: limit\n };\n }\n\n if (startIndex > 0) {\n results.previous = {\n page: page - 1,\n limit: limit\n };\n }\n\n results.magazines = magazines.slice(startIndex, endIndex);\n res.paginatedResults = results;\n next();\n // await res.send({ Len: magazines.length });\n } catch (err) {\n console.error(err);\n res.status(500).json({ message: 'Error with fetching list of magazines' });\n }\n };\n}", "function gotPageOfArt(records, fetchNextPage) {\n console.log(\"gotPageOfArt()\");\n // add records from this page to bookshelf array\n artworks.push(...records);\n // request more pages\n fetchNextPage();\n }", "addPagination() {\n if (this.pdfBuilder.includePageNumber) {\n const { doc, margins, documentFont } = this.pdfBuilder;\n let text = this.currentPage;\n doc.font(documentFont);\n doc.fontSize(9);\n\n if (this.docTitle.length > 0) {\n text = `${this.docTitle} - ${text}`;\n }\n doc.text(text, margins.left, this.height + margins.bottom, { align: 'right', width: this.width });\n }\n }", "function drawWikiResults(pages) {\n $.each(pages, function(page, data){\n drawArticle(data);\n });\n}", "function insertResults(data) {\n $(\"link[href='./files/style.css']\").attr(\"href\", \"./files/style-results.css\"); // change style sheet\n $(\".content\").html(\"\");\n\n var searchObj = data[\"query\"][\"search\"]; // search object w/ results\n var pageLink = \"https://en.wikipedia.org/wiki/\";\n\n for(var i = 0; i < searchObj.length; i++) {\n var title = searchObj[i][\"title\"];\n // adds linked anchor tag containing div containing title & text snippet for each search result\n $(\".content\").append(\n \"<a target='_blank' href='\" + pageLink + encodeURI(title) + \"'>\" +\n \"<div class='resultItem'>\" +\n \"<h3>\" + title + \"</h3>\" +\n \"<p class='description'>\" + searchObj[i][\"snippet\"] + \"...\" +\n \"</p></div></a>\"\n );\n }\n }", "function movieLoopArray(movieTitle, cb) {\n movieSearch(movieTitle, function (data) {\n if (data.totalResults > 20) {\n for (var i = 0; i < data.Search.length; i++) {\n movieSearchArray.push(data.Search[i]);\n }\n\n page++;\n if (page < 4) {\n movieLoopArray(movieTitle, cb);\n } else {\n //If the page is 4, then we run our array through the movie details search and reset the page number\n movieDetailsLoop(movieSearchArray, function (data) {\n page = 1;\n\n return cb(movieDetailArray);\n\n });\n }\n } else if (data.totalResults > 10 && data.totalResults <= 20) {\n for (var i = 0; i < data.Search.length; i++) {\n movieSearchArray.push(data.Search[i]);\n }\n page++;\n if (page < 3) {\n movieLoopArray(movieTitle, cb);\n } else {\n //If the page is 4, then we run our array through the movie details search and reset the page number\n movieDetailsLoop(movieSearchArray, function (data) {\n page = 1;\n return cb(movieDetailArray);\n });\n }\n } else if (data.totalResults <= 10) {\n for (var i = 0; i < data.Search.length; i++) {\n movieSearchArray.push(data.Search[i]);\n }\n page++;\n if (page < 2) {\n movieLoopArray(movieTitle, cb);\n } else {\n //If the page is 4, then we run our array through the movie details search and reset the page number\n movieDetailsLoop(movieSearchArray, function (data) {\n page = 1;\n\n return cb(movieDetailArray);\n });\n }\n }\n });\n }", "function gotPageOfArts(records, fetchNextPage) {\n console.log(\"gotPageOfArts()\");\n // add the records from this page to our array\n arts.push(...records);\n // request more pages\n fetchNextPage();\n}", "function putResultsOnPage(results)\n{\n //get search results div\n var theDiv = document.getElementById('search-results');\n \n //clear current content\n theDiv.innerHTML = '';\n \n //reset Y position because it might have changed after some touch scrolling frenzy!\n theDiv.style.top = '0';\n \n //might be no matches\n if(results.rows.length === 0)\n {\n theDiv.innerHTML = 'No matches found in the common words dictionary.\\\n Tweet @japxlate yourAdvancedWord for advanced word definitions.';\n buttonSpinnerVisible(false); //stop the loading spinner\n return;\n }\n \n //some results so loop through and print\n for(var loop = 0; loop < results.rows.length; loop++)\n {\n var item = results.rows.item(loop);\n \n var theRomaji = kana_to_romaji(item.kana);\n //var theRomaji = item.kana;\n var formattedDefinition = format_slashes(item.definition);\n \n var defText = item.kanji + ' / ' + item.kana + ' (' + theRomaji + ') / ' + formattedDefinition;\n defText = defText.replace(new RegExp(global_searchTerm, 'ig'), '<span style=\"color:#990000;\">$&</span>');\n \n var defLine = '<img src=\"img/j.png\" style=\"vertical-align:middle;\"> ' + defText + '<hr>';\n //var defLine = '<p class=\"def-line\"> ' + defText + '</p>'; //had CSS styling issues (mostly text overflow)\n \n theDiv.innerHTML += defLine;\n }\n \n buttonSpinnerVisible(false); //stop the loading spinner\n}", "function sample() {\n var searchTerm = $(\"#searchTerm\").val();\n\n //form the query\n var url = \"https://en.wikipedia.org/w/api.php?\";\n var queryStruct = {\n action: \"query\",\n format: \"json\",\n generator: \"prefixsearch\",\n prop: \"pageimages|pageterms\",\n redirects: \"\",\n piprop: \"thumbnail\",\n pithumbsize: 80, //tumbnail size\n pilimit: 15, //related to number of returned results (?)\n wbptterms: \"description\",\n gpssearch: searchTerm,\n gpsnamespace: 0,\n gpslimit: 15 //related to number of returned results (?)\n };\n url = url + structToURL(queryStruct) + \"&callback=?\";\n\n $.ajax({\n url: url,\n dataType: \"json\",\n\n success: function (data) {\n $(\"#output\").html(\"<hr>\"); //remove list of previous results \n\n //TODO: Clean this up ... first, have the code that creates everything, then have code that orders them in the best possible way!!!!! \n if ((\"query\" in data) && (\"pages\" in data[\"query\"])) {\n data = data[\"query\"][\"pages\"];\n } else {\n data = {}; //nothing interesting ... we can skip\n }\n\n // iterating over data: inspired from https://stackoverflow.com/questions/8312459/iterate-through-object-properties\n Object.keys(data).forEach(function (key) {\n // form an entery in $(\"#output\") of the form:\n // <div> <img> <a href = link to Wiki page> <h2> Title </h2? </a> <p> summary of Wiki page </p></div> <hr> \n var div = document.createElement(\"div\");\n div.className = 'result';\n //add the img corresponding to the entry (if it exists)\n if ((\"thumbnail\" in data[key]) && (\"source\" in data[key][\"thumbnail\"])) {\n imgURL = data[key][\"thumbnail\"][\"source\"];\n var img = document.createElement('img');\n img.src = imgURL;\n img.className = \"wikiImg\";\n div.appendChild(img);\n }\n //add title\n var h2Elem = document.createElement('h2');\n h2Elem.className = \"wikiTitle\";\n var textNode = document.createTextNode(data[key][\"title\"]);\n h2Elem.appendChild(textNode);\n div.appendChild(h2Elem);\n // add the description of each entry to div\n var skipEntry = false;\n if ((\"terms\" in data[key]) && (\"description\" in data[key][\"terms\"])) {\n var descrip = data[key][\"terms\"][\"description\"][0];\n if (descrip === \"Wikimedia disambiguation page\") {\n skipEntry = true;\n };\n var para = document.createElement('p');\n var textNode2 = document.createTextNode(descrip);\n para.appendChild(textNode2);\n div.appendChild(para);\n }\n //add the pick button\n var imgButton = document.createElement(\"img\");\n imgButton.className = \"pickButton\"; //CAN I RE-USE IT???\n imgButton.src = \"https://upload.wikimedia.org/wikipedia/commons/4/45/Twemoji_2705.svg\";\n imgButton.alt = \"pick this wiki entry\";\n imgButton.title = \"pick this wiki entry\";\n // store the page id and title of the wiki page in the data\n $(imgButton).data('pageid', data[key][\"pageid\"]);\n $(imgButton).data('title', data[key][\"title\"]);\n div.appendChild(imgButton);\n // add div to the list of returned wikipedia results, unless Wikipedia page is a \"Wikimedia disambiguation page\"\n if (!skipEntry) {\n $('#output').append(div);\n };\n });\n },\n error: function (error) {\n alert(\"error in searching Wiki\");\n }\n }); //ajax ends\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}", "function parse(result){\n\tvar parsed = JSON.parse(result);\n\t\n\t//Handle basically all the errors (sorta)\n\tif(Object.keys(parsed.collection.items).length == 0)\n\t{\n\t\tdocument.getElementById('numbers').innerHTML = \"No Results Found!\";\n\t\tvar loading = document.getElementById('loading');\n\t\tloading.style.display = \"none\";\n\t\treturn;\n\t}\n\t//alert(parsed);\n\tvar total = parsed.collection.metadata.total_hits;\n\t//document.getElementById('numbers').innerHTML = result;\n\t\n\tvar url_string = window.location.href\n\tvar url = new URL(url_string);\n\tvar search_val = url.searchParams.get(\"q\");\n\tvar page_num = url.searchParams.get(\"page\");\n\t\n\t//Set the proper number of images heading\n\tif((page_num*100) < total)\n\t{\n\t\tdocument.getElementById('numbers').innerHTML = String(1+(page_num-1)*100)+\"-\"+String(page_num*100) + \" of \" + String(total) + \" for \\\"\" + search_val + \"\\\":\";\n\t}\n\telse{\n\t\tdocument.getElementById('numbers').innerHTML = String(1+(page_num-1)*100)+\"-\"+String(total) + \" of \" + String(total) + \" for \\\"\" + search_val + \"\\\":\";\n\t}\n\tvar pictures = parsed.collection.items;\n\t\n\t//Call support function to display all the results in the grid\n\tdisplay_images(pictures);\n\t\n\t//Properly setup the next and previous buttons on the page depending on the situation\n\tvar size = Object.keys(parsed.collection.links).length;\n\tif(size == 2){\n\t\tvar next_url = parsed.collection.links[1].href;\n\t\tvar previous_url = parsed.collection.links[0].href;\n\t\t\n\t\tvar params = previous_url.split(\"?\")[1];\n\t\tpreviousurl = \"search.html?\" + String(params);\n\t\tparams = next_url.split(\"?\")[1];\n\t\tnexturl = \"search.html?\" + String(params);\n\t\t\n\t\tdocument.getElementById('previous').style.display = \"block\";\n\t\tdocument.getElementById('next').style.display = \"block\";\n\t}\n\tif(size == 1 && parsed.collection.links[0][\"prompt\"] == \"Next\"){\n\t\tvar next_url = parsed.collection.links[0].href;\n\t\tvar params = next_url.split(\"?\")[1];\n\t\tnexturl = \"search.html?\" + String(params);\t\n\t\tdocument.getElementById('next').style.display = \"block\";\n\t}\n\telse if(size == 1)\n\t{\n\t\tvar next_url = parsed.collection.links[0].href;\n\t\tvar params = next_url.split(\"?\")[1];\n\t\tpreviousurl = \"search.html?\" + String(params);\t\n\t\tdocument.getElementById('previous').style.display = \"block\";\t\t\n\t}\n\t\n}", "function makePage(number, text, isActive) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tnumber: number,\n\t\t\t\t\t\ttext: text,\n\t\t\t\t\t\tactive: isActive\n\t\t\t\t\t};\n\t\t\t\t}", "loadNextArtistsOrAlbums() {\n this.page++;\n this.loadArtistsOrAlbums(this.page * 6);\n }", "function read(pages) {\n var i;\n var message;\n\n console.log('You started reading.');\n for (i = 0; i < pages; i += 1 ) {\n message = 'You read page ' + String(i);\n console.log(message);\n }\n}", "function getNextPage() {\n\t\t\tloopCount++;\n\n\t\t\t$http.get(url, {params: params}).then(function success(res) {\n\t\t\t\ttotalResults = res.data.pageInfo.totalResults;\n\n\t\t\t\titemList = itemList.concat(res.data.items);\n\n\t\t\t\t//count number of results\n\t\t\t\tresCount += res.data.items.length;\n\n\t\t\t\tif(resCount < resNumber && resCount < totalResults && !!res.data.nextPageToken && loopCount < maxLoop) {\n\n\t\t\t\t\t//Update HTTP request params to fetch the next page\n\t\t\t\t\tparams.pageToken = res.data.nextPageToken;\n\n\t\t\t\t\tgetNextPage();\n\t\t\t\t} else {\n\t\t\t\t\tvar returnArrayLength = (resCount < resNumber ? resCount : resNumber);\n\n\t\t\t\t\t//When all pages have been fetched, return result to caller\n\t\t\t\t\tcallback(false, itemList.slice(0, returnArrayLength));\n\t\t\t\t}\n\n\n\t\t\t}, function error(res) {\n\n\t\t\t\tconsole.error(res);\n\t\t\t});\n\t\t}", "function goNext() {\n\tif (pageNum >= pdfDoc.numPages)\n\t\treturn;\n\tpageNum++;\n\trenderPage(pageNum);\n}", "function nextPage(){\n currentPage++;\n\n search();\n}", "function scrapeAll(i, url) {\n console.log(url);\n var path = path_base + i + \"_all.txt\";\n console.log(path);\n page.open(url, function(status) {\n console.log(status);\n page.includeJs(\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js\", function() {\n console.log('include js');\n\n //click on the joined button in 2 secs after page finishes loading\n window.setTimeout(function() {\n page.evaluate(function() {\n $(\".sortable.joined\").click();\n });\n }, 2000);\n\n //click more\n function clickMore() {\n console.log('click more!');\n window.setTimeout( function () {\n var isMore = page.evaluate(function() {\n if ($('.more.hidden').css('display') == 'block') {\n $('.more.hidden').click();\n return true;\n }\n else {\n return false;\n }\n });\n console.log(isMore);\n if (isMore) {\n clickMore();\n }\n else{\n window.setTimeout(function() {\n // page.render('more.png');\n // phantom.exit();\n var results = page.evaluate(\n function() {\n var results = [];\n // get the id of most recent 20 companies\n var rows = $(\".results_holder div[data-_tn='tags/show/row']\");\n console.log(rows.length);\n for (var i = 0; i < rows.length; ++i) {\n results.push($(rows[i]).find('.name a').attr('data-id'));\n }\n return results;\n }\n );\n fs.write(path, results.join(\",\"), \"w\");\n console.log(results);\n phantom.exit();\n }, 2000 );\n }\n }, 5000);\n }\n clickMore();\n });\n });\n}", "function read(pages) {\n var message;\n var i;\n\n console.log('You started reading.');\n for (i = 0; i < pages; i += 1) {\n message = 'You read page '+ i;\n console.log(message);\n }\n}", "function printRecText(readResults) {\n console.log('Recognized text:');\n for (const page in readResults) {\n if (readResults.length > 1) {\n console.log(`==== Page: ${page}`);\n }\n const result = readResults[page];\n if (result.lines.length) {\n for (const line of result.lines) {\n console.log(line.words.map(w => w.text).join(' '));\n }\n }\n else { console.log('No recognized text.'); }\n }\n }", "function make_pages(lines, page_height){\n function take(n, xs){\n return n === 0 ? [] : pair(head(xs), take(n-1, tail(xs)));\n }\n function drop(n, xs){\n return n === 0 ? xs : drop(n-1, tail(xs));\n }\n if(is_empty_list(lines)){\n return [];\n } else {\n const len = length(lines);\n if(len < page_height){\n return list(lines);\n } else {\n return pair(take(page_height, lines), make_pages(drop(page_height, lines), page_height));\n }\n }\n}", "function generatePage() {\n let pageSec = document.getElementById('pageNumber');\n notice.innerText = `Showing ${ 0} to ${ 10}`;\n for (let i = 1; i <= pageNumbers; i++) {\n let aTag = document.createElement('a');\n aTag.classList.add('paginate_button');\n aTag.innerText = i;\n pageSec.appendChild(aTag);\n }\n}", "async function getPapersChunk (offset) {\n const cursor = await config.db.query(`\n FOR doc IN PaperDev\n SORT doc.createDate ASC\n LIMIT ${offset}, 1000\n RETURN doc\n `)\n return cursor.all()\n}", "_createPages() {\n let self = this,\n size = Math.floor(self.get('queryCount') / self.get('pageSize')) + 1,\n range = Array(size),\n pagesArray = self.get('pagesArray');\n\n pagesArray.clear();\n let i = 1;\n for (i = 1; i <= range.length; i++) {\n var obj = Ember.Object.create({text: i, className: self.get('pageNumber') === i ? \"active\": \"\"});\n pagesArray.pushObject(obj);\n }\n }", "function createPage () {\n\t$(\"ul li\").each(function(index) {\n\t\tobj = $(this)\n\t\tdivCount += 1\n\t\t\tif (divCount < 10) {\n\t\t\t\tobj.show()\n\t\t\t} else {\n\t\t\t\tobj.hide()\n\t\t\t}\n\t\t\tif (index % 10 === 0) {\n\t\t\t\tnewTag += \"<li id=\\\"page\\\"><a href=\\\"#\\\">\" + countCreate + \"</a></li>\"\n\t\t\t\tcountCreate++;\n\t\t\t}\n\t});\n\tif (newTag !== null) {\n\t\t$(\"ul\").append(\"<nav aria-label=\\\"Page navigation\\\"><ul class=\\\"pagination\\\">\" + newTag + \"</ul></nav>\");\n\t}\n\n}", "function gotPageOfMovies(records, fetchNextPage) {\n console.log(\"gotPageOfMovies()\");\n console.log(\"There are \"+records.length+\" items in records\");\n// // This takes the list of records and add them to the people array\n movies.push(...records);\n // request more pages\n fetchNextPage();\n}", "function processHtml(page, pIndex) {\n console.log('\\x1b[34m%s\\x1b[0m', `PROGRESS: Process High Schools HTML pages`);\n // create return array\n const returnArr = [];\n // load data in cheerio object\n const $ = cheerio.load(page);\n\n // select all 'tables' elements\n const tablesArray = $('body')\n .children().first()\n .children().first()\n .children().first()\n .children();\n\n // get the high schools table\n const dataTable = tablesArray\n .children().eq(5) // get the <table> element\n .children().first(); // get the <tr> elements\n // console.log(dataTable.html());\n dataTable.children().each((i, row) => {\n if(i > 0) {\n // get high school item index\n const itemIndex = $(row).children().first().html().replace('&#xA0;', '');\n // console.log(itemIndex);\n // get HS name\n const itemName = $(row).children().eq(1)\n .children().first()\n .children().first()\n .children().first()\n .text().replace('&#xA0;', '').trim();\n // console.log(itemName);\n // get HS href exams list href\n const itemExamListHref = $(row).children().eq(1)\n .children().first()\n .children().first()\n .children().eq(1)\n .children().eq(0)\n .children().first()\n .attr('href');\n // console.log(itemExamListHref);\n // get HS href exams partial results href\n const itemExamPartialResultsHref = $(row).children().eq(1)\n .children().first()\n .children().first()\n .children().eq(1)\n .children().eq(1)\n .children().first()\n .attr('href');\n // console.log(itemExamPartialResultsHref);\n // get HS href exams final results href ordered by name asc\n const itemExamFinalResultsNameHref = $(row).children().eq(1)\n .children().first()\n .children().first()\n .children().eq(1)\n .children().eq(2)\n .children().first()\n .attr('href');\n // console.log(itemExamFinalResultsNameHref);\n // get HS href exams final results href, ordered by score\n const itemExamFinalResultsScoreHref = $(row).children().eq(1)\n .children().first()\n .children().first()\n .children().eq(1)\n .children().eq(3)\n .children().first()\n .attr('href');\n // console.log(itemExamFinalResultsScoreHref);\n // get HS item locality\n const itemLocality = $(row).children().eq(2).html().replace('&#xA0;', '');\n // console.log(itemLocality);\n // get HS item review center\n const itemReviewCenter = $(row).children().eq(3).html()\n .replace(/&#xA0;/g, '')\n .replace(/&quot;/g, '\"');\n // console.log(itemReviewCenter);\n\n // return new item\n returnArr.push({\n index: itemIndex,\n denumire: itemName,\n localitate: itemLocality,\n centruExaminare: itemReviewCenter,\n listaProbeHref: itemExamListHref,\n rezultatePartialeHref: itemExamPartialResultsHref,\n rezultateFinaleAlfabetic: itemExamFinalResultsNameHref,\n rezultateFinaleMedie: itemExamFinalResultsScoreHref,\n })\n }\n });\n // return data\n return returnArr;\n}", "function scrap()\n{\n var list = $('.results-list');\n\n\n list.find('li').each(function(){\n\n var user = {};\n\n user.full_name = $(this).find('.actor-name').html();\n user.linkedin = 'https://www.linkedin.com' + $(this).find('.search-result__result-link').attr('href');\n user.title = $(this).find('.search-result__snippets').html();\n user.address = $(this).find('.subline-level-2').text().trim();\n\n user = breakTitle(user);\n\n if(user){\n users.push(user);\n }\n });\n\n\n if(getCurrentPage() >= end || jQuery('.next').length == 0){\n download(ConvertToCSV(users));\n }else{\n jQuery('.next').click();\n\n setTimeout(function(){\n scrap();\n },Math.random()*10000 + 5000)\n }\n\n\n}", "function createPage() {\n init();\n generateCard();\n makeCommentsWork();\n makeCommentIconsWork();\n makeReactionsWork();\n displayCharLimit();\n}", "function gotPageOfUnits(records, fetchNextPage) {\n console.log(\"gotPageOfUnits()\");\n // add the records from this page to our books array\n units.push(...records);\n // request more pages\n fetchNextPage();\n}", "function resultFrame(pages) {\n\tfor (var page in pages) {\n\t\tvar res = '<div class=\"result-page row\" id=\"'+page+'\">'\n\t\tres+='<div class=\"result-highlight\"></div><div class=\"result-main\"><div class=\"result-title\"></div><div class=\"result-content\"></div></div></div>'\n\t\t$(\".search-results\").append(res)\n\t}\n\n}", "render(): void {\n // Render text for current page\n const startAt = (this._page - 1) * this._numCharsPage;\n const pageText = this._text.substr(startAt, this._numCharsPage);\n output.cursorTo(0, output.contentStartRow);\n console.log(pageText);\n }", "toResults() {\n this.setState({ page: 4 });\n }", "function getPage(params) {\n var start = params.pagination.start || 0;\n var number = params.pagination.number || 10;\n var deferred = $q.defer();\n\n var filtered = params.search.predicateObject ? $filter('filter')(randomsItems, params.search.predicateObject) : randomsItems;\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n var result = filtered.slice(start, start + number);\n\n $timeout(function () {\n //note, the server passes the information about the data set size\n deferred.resolve({\n data: result,\n count: filtered.length,\n numberOfPages: Math.ceil(filtered.length / number)\n });\n }, 100);\n\n\n return deferred.promise;\n }", "function setPages(){\n\t\t\t// Foreach all articles\n\t\t\t$.each(articles, function(key, value){\n\t\t\t\tvar totalCounted\t\t=\t0;\n\t\t\t\tvar elements\t\t\t=\tvalue[\"article\"];\n\t\t\t\tvar marge\t\t\t\t=\t0;\n\t\t\t\tarticleTitles[key]\t\t=\tvalue[\"title\"];\n\t\t\t\t\n\t\t\t\t// Current values\n\t\t\t\tvar current\t\t\t\t=\t[];\n\t\t\t\tcurrent[\"column\"] \t=\t1;\n\t\t\t\tcurrent[\"page\"]\t\t=\t0;\n\t\t\t\tcurrent[\"element\"]\t=\t-1;\n\t\t\t\t\n\t\t\t\t// Height of page\n\t\t\t\tvar HM\t=\t(getDocHeight()-120)%lineHeight;\n\t\t\t\tvar heightOfPage\t=\t(HM < lineHeight/2)\n\t\t\t\t\t?(getDocHeight()-120)-HM\n\t\t\t\t\t:(getDocHeight()-120)+(lineHeight-HM);\t\n\n\t\t\t\tvar done = false;\n\t\t\t\tvar marginTop = 0;\n\t\t\t\tvar lastItemHeight;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// If determined number of columns does not fit onto the page it will recalculate the number of columns\n\t\t\t\tif(value[\"data-cols\"]*(widthOfColumn+space+10) > getDocWidth())\n\t\t\t\t{\n\t\t\t\t\tvar cols\t=\tMath.floor(getDocWidth()/(widthOfColumn+space+10));\n\t\t\t\t\tif(cols == 1){\n\t\t\t\t\t\t$(\".sideMenu\").hide();\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tvar cols\t=\tvalue[\"data-cols\"];\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tdo{\n\t\t\t\t\t// This makes the first page of an article\n\t\t\t\t\tif(current[\"page\"] == 0){\n\t\t\t\t\t\tcurrent[\"page\"]++;\n\t\t\t\t\t\t$(\".viewer\", thisElement).append('<div class=\"page page-'+current[\"page\"]+' theme-'+value[\"data-theme\"]+' first\" id=\"article_'+key+'\" data-pageNumber=\"'+current[\"page\"]+'\" data-articleNumber=\"'+key+'\" style=\"width: '+(widthOfColumn+space)+'px; height: '+heightOfPage+'px\"><div class=\"column column_'+current[\"column\"]+'\" style=\"height: '+heightOfPage+'px\"></div></div>');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If needed it makes a new page\t\t\t\t\t\n\t\t\t\t\tif(marge == 0){\n\t\t\t\t\t\tcurrent[\"element\"]++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmarginTop = lastItemHeight-marge;\n\t\t\t\t\t\tmarge = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Removes headers if its shown half on a page (#1)\n\t\t\t\t\tvar remove = false;\n\t\t\t\t\tif((heightOfPage-totalCounted) < (5*lineHeight) && heightOfPage-totalCounted > 0 && heightOfPage > 7*lineHeight){\n\t\t\t\t\t\tif(typeof(elements[current[\"element\"]]) != 'undefined'){\n\t\t\t\t\t\t\tif(elements[current[\"element\"]][\"node\"] == \"H2\"){\n\t\t\t\t\t\t\t\ttotalCounted += heightOfPage-totalCounted;\n\t\t\t\t\t\t\t\tremove = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t// Check if all elements are done\n\t\t\t\t\tif(typeof(elements[current[\"element\"]]) == 'undefined'){\n\t\t\t\t\t\tdone = true;\n\t\t\t\t\t\t$(\".page\").hide();\n\t\t\t\t\t\t$(\".first#article_0\").show();\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key).addClass(\"last\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(elements[current[\"element\"]][\"node\"] != \"FIGURE\"){\n\t\t\t\t\t\t// Place the content into the current pages/columns\n\t\t\t\t\t\tvar iden = key+\"_\"+current[\"page\"]+\"_\"+current[\"column\"];\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key+\" .column_\"+current[\"column\"]).append('<'+elements[current[\"element\"]][\"node\"]+' id=\"'+iden+'\">'+elements[current[\"element\"]][\"value\"]+'</'+elements[current[\"element\"]][\"node\"]+'>');\n\t\t\t\t\t\ttotalCounted += $(\"#\"+iden).outerHeight(true);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//figure\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key+\" .column_\"+current[\"column\"]).append('<'+elements[current[\"element\"]][\"node\"]+'>'+elements[current[\"element\"]][\"value\"]+'</'+elements[current[\"element\"]][\"node\"]+'>');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Checks if item has to be removed (#1)\n\t\t\t\t\tif(remove){\n\t\t\t\t\t\t$(\"#\"+iden).hide();\n\t\t\t\t\t\tremove = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Use the margin on a element if there is any\n\t\t\t\t\tif(marginTop != 0){\n\t\t\t\t\t\tif(marginTop < 0){\n\t\t\t\t\t\t\tmarginTop = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(current[\"column\"] == (value[\"data-cols\"]-1)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttotalCounted -= marginTop;\n\t\t\t\t\t\t$(\"#\"+iden).css(\"marginTop\", -marginTop+\"px\");\n\t\t\t\t\t\tmarginTop = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Gets the height of the last placed element And removes the id attribute\n\t\t\t\t\tlastItemHeight\t=\t$(\"#\"+iden).outerHeight();\n\t\t\t\t\t$(\"#\"+iden).removeAttr(\"id\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Makes a new column\n\t\t\t\t\tif(totalCounted > heightOfPage){\n\t\t\t\t\t\tif(current[\"column\"] >= cols){\n\t\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key+\" .column_\"+current[\"column\"]).addClass(\"last_column\");\n\t\t\t\t\t\t\tcurrent[\"page\"]++;\n\t\t\t\t\t\t\tcurrent[\"column\"]\t\t=\t1;\n\t\t\t\t\t\t\t$(\".viewer\", thisElement).append('<div class=\"page page-'+current[\"page\"]+' theme-'+value[\"data-theme\"]+'\" id=\"article_'+key+'\" data-pageNumber=\"'+current[\"page\"]+'\" data-articleNumber=\"'+key+'\" style=\"width: '+(widthOfColumn+space)+'px; height: '+heightOfPage+'px\"></div>');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrent[\"column\"]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key).append('<div class=\"column column_'+current[\"column\"]+'\" style=\"height: '+heightOfPage+'px\"></div>');\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key).width((widthOfColumn+space)*current[\"column\"]);\n\t\t\t\t\t\tmarge = (totalCounted-heightOfPage);\n\t\t\t\t\t\ttotalCounted = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\twhile(done != true);\n\t\t\t\t\n\t\t\t});\n\t\t\tafterLoading();\n\t\t}", "createPaging() {\n var result = [];\n for (let i = 1; i <= this.state.totalPage; i++) {\n result.push(\n <MDBPageNav href={\"/product/\" + i} >\n <span aria-hidden=\"true\">{i}</span>\n </MDBPageNav >\n )\n }\n return result;\n }", "pagination() {\n //Convert the data into Int using parseInt(string, base value)\n // || 1 is used in case user does not specify any page value similarly for limit default is 10\n const page = parseInt(this.queryStr.page, 10) || 1;\n const limit = parseInt(this.queryStr.limit, 10) || 10;\n // to get the data on pages rather than page 1\n const skipResults = (page - 1) * limit;\n\n //skip method is used to skip through the specified number of data\n //limit method is used to limit the no of data returned at a time.\n this.query = this.query.skip(skipResults).limit(limit);\n\n return this;\n }", "loadNextPage() {\n this.page = this.page + 1;\n MovieService.filterMovies(this.props.keywords, this.props.genresId, this.page, true);\n }", "function addPagination(totalResults) {\n\tclearDiv('.pagination__ul');\n\tlet numberOfPages = Math.floor(totalResults/20)+1;\n\tif (numberOfPages > 5) {numberOfPages = 5};\n\tfor (i=1;i<=numberOfPages;i++) {\n\t\tconst pageLinkNode = document.createElement('li');\n\t\tconst parentNode = document.querySelector('.pagination__ul');\n\t\tpageLinkNode.innerHTML = i;\n\t\tpageLinkNode.className = \"pagination__page\";\n\t\tparentNode.appendChild(pageLinkNode);\n\t\tpageLinkNode.addEventListener(\"click\", event => {createArticles((pageLinkNode.innerHTML-1)*20)});\n\t}\n}", "function process() {\n\t// Get current page's data\n\toverallResult = overallResult.concat(getPrices());\n\n\tvar morePages = nextPage();\n\n\tif(morePages) {\n\t\t// Wait then call this method again\n\t\twaitCallback();\n\t} else {\n\t\t// Print results and exit\n\t\tconsole.log(overallResult.join(\"\"));\n\t\treturn;\n\t}\n}", "function renderNextPage() {\n renderBookmarks(pagination.currentPage + 1);\n}", "function pagination() {\n console.log('Pagination', resultTotal);\n\n let totalPages = Math.floor(resultTotal / 15) + 1;\n let remainder = resultTotal % 15;\n let paginationControl = ``;\n\n console.log('Total Pages: ' + totalPages + 'Remainder: ' + remainder);\n\n // In the future a page range selection could be implemented by doing somthing like below\n\n // for (let i = 1; i <= totalPages; i++) {\n // paginationControl = `<span>Page ${i++} of ${totalPages}</span>`;\n // return paginationControl;\n // }\n\n return paginationControl = `<span>Page ${pageNum} of ${totalPages}</span>`;\n}", "function read(pages) {\n console.log('You started reading.');\n for (let page=0; page<pages; page += 1) {\n let message = 'You read page '+page;\n console.log(message);\n }\n}", "function makePage(number, text, isActive) {\n\t return {\n\t number: number,\n\t text: text,\n\t active: isActive\n\t };\n\t }", "function getNextPage(param, callback){\n\tlet totalPages = Math.ceil(_docuSkyObj.totalFound / _docuSkyObj.pageSize);\n\n\t// not finished\n\tif (_docuSkyObj.page < totalPages) {\n\t\tparam.page = _docuSkyObj.page + 1;\n\t\t_docuSkyObj.getQueryResultDocuments(param, null, function() {\n\t\t\t_allDocList = _allDocList.concat(_docuSkyObj.docList);\n\t\t\tgetNextPage(param, callback);\n\t\t});\n\n\t// have loaded all data\n\t} else {\n\t\tif (typeof callback === \"function\") callback();\n\t}\n}", "function pageReturn() {\n\t \t\tmovielVm.curPage = 0;\n\t \t\tmovielVm.startIndex = (movielVm.curPage * movielVm.moviesPerPage);\n\t \t}", "async function doPaginate(url, opts, resultsSize, listingsArray) {\n opts.offset += opts.limit;\n url = buildSearchUrl(opts);\n log('Paginating.... ', url);\n const response = await httpRequest(url); \n if (response && response.metadata) {\n log('pages:', response.metadata.pagination);\n listingsArray.push(response);\n return {\n resultsSize: resultsSize += response['search_results'].length,\n lastPagination: response['metadata']['pagination']\n };\n } else {\n error('Encountered error while paginating: ', response);\n }\n}", "function renderNewPage () {\n countToiletsMatchingSearchCriteria();\n $.ajax({\n method: \"GET\",\n url: `/api/toilets?skip=${skip}&ratingLimit=${ratingLimit}&scope=${scope}`,\n success: function(data) {\n resultsLength = data.length;\n if ((resultsLength < limit) || (resultsLength + skip == lengthOfToilets)) {\n $('.next-button').hide();\n } else {\n $('.next-button').show();\n }\n if (skip == 0) {\n $('.previous-button').hide();\n } else {\n $('.previous-button').show();\n }\n\n renderToiletList(data);\n initGoogleMap();\n data.forEach(function (returnData) {\n var marker = new google.maps.Marker({\n position: {lat: returnData.lat, lng: returnData.long},\n map: map,\n title: returnData.name,\n });\n })\n }\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}", "list(options) {\n const iter = this.listPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listPagingPage(options);\n }\n };\n }", "function renderPages(doc) {\n const pagePromises = [];\n // 1-based indexing >_>\n for(var p = 1; p <= doc.numPages; p++) {\n console.log(p);\n pagePromises.push(doc.getPage(p));\n //doc.getPage(p).then(renderPage);\n }\n console.log(pagePromises);\n Promise.all(pagePromises).then(function(resultsArr) {\n for(var i = 0; i < resultsArr.length; i++)\n renderPage(resultsArr[i]);\n });\n }", "function TimeoutCallBack()\n{\n let data=page.evaluate(()=>{\n let titre=document.getElementsByClassName(\"annonce_titre\");\n let text=document.getElementsByClassName(\"annonce_text\");\n\n let data_length=titre.length<=text.length?titre.length:text.length;\n let data=new Array();\n \n for (let index = 0; index < data_length; index++) {\n data.push({\n title:titre[index].innerText,\n text_content:text[index].innerText\n });\n }\n return data;\n });\n data.forEach(element => {\n element.page_number=page_index;\n });\n\n page_index++;\n DAL.WriteToFile(\"jobs.txt\",data);\n console.log(\"jobs are logged\");\n\n if(page_index<=n_pages)\n {\n page.evaluate(()=>{\n document.querySelector(\"#divPages > a.page_arrow\").click();\n });\n window.setTimeout(TimeoutCallBack,periode_ms);\n }\n else\n {\n phantom.exit();\n }\n}", "function parseResults(data){\n \n //pop array with information about the page \n while (thisPage.length) { thisPage.pop(); }\n $('#initialMain').css(\"display\",\"none\");\n $('.row').css(\"display\",\"block\");\n $('#map').css(\"display\",\"block\");\n //Display the next and prev buttons depending on the number of results returned\n if(totalResults > 20)\n {\n //make the next and prev buttons visible\n if(offset > 0)\n {\n $('#prev').css('visibility','visible');\n }\n else\n {\n $('#prev').css('visibility','hidden'); \n }\n if((offset+20) < totalResults)\n {\n $('#next').css('visibility','visible');\n }\n else\n {\n $('#next').css('visibility','hidden');\n }\n }\n \n \n //Initialize the map that shows all the events\n var map_var = map_initialize(latitude,longitude);\n for(var i=0; i < data.results.length; i++){\n index = i;\n //For each result returned, display the result\n printResult(data.results[i],map_var,i);\n }\n}", "async function main() {\n let _arroPagesForThisSeason = [];\n let arrResultPages = [];\n let arrSettledResultPages = [];\n let arrFlatSettledPages = [];\n let sCsvTables;\n let i;\n let sCsv;\n\n browser = await puppeteer.launch();\n\n if (!fs.existsSync(sResultDir)) {\n fs.mkdirSync(sResultDir);\n }\n\n fSetWriters();\n\n // each season has multiple result pages\n // get an array of result pages per season\n // then concat and get all result pages\n for (i = iFirstSeason; i < (iLastSeason + 1); i++) {\n _arroPagesForThisSeason = fparrGetResultPagesBySeason(sRootUrl, i);\n arrResultPages = arrResultPages.concat(_arroPagesForThisSeason);\n }\n\n arrSettledResultPages = await utils.settleAll(arrResultPages);\n arrFlatSettledPages = utils.flatten(arrSettledResultPages);\n\n // TODO: I think you can do this inside settleAll,\n // but playing it safe and serial for now\n sCsvTables = arrFlatSettledPages.reduce(function(acc, oPageData){\n return acc + EOL + tableToCsv(oPageData.sTableParentHtml);\n }, '');\n\n fParseTxt(sCsvTables);\n}", "async function GetDocumentAnalysisResults() {\n let maxResults = 1000;\n let paginationToken = null;\n let finished = false;\n\n let keyMap = {};\n let valueMap = {};\n let blockMap = {};\n\n let blockMapTable = {};\n let table_blocks = [];\n\n\n while (finished == false) {\n let response = null;\n let documentAnalysisRequest = {\n JobId: startJobId,\n MaxResults: maxResults,\n NextToken: paginationToken\n };\n\n response = await new Promise((resolve, reject) => {\n textract.getDocumentAnalysis(documentAnalysisRequest, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n });\n\n let blocks = response.Blocks;\n console.log(\"Analyzed Document Text\");\n console.log(\"Pages:\" + response.DocumentMetadata.Pages);\n\n \n blocks.forEach(block => {\n \n blockId = block.Id;\n blockMapTable[blockId] = block;\n blockMap[blockId] = block;\n\n if (block.BlockType == \"KEY_VALUE_SET\") {\n if(_.includes(block.EntityTypes,\"KEY\")){\n keyMap[blockId] = block\n }else{\n valueMap[blockId] = block\n }\n }\n\n if(block.BlockType==\"TABLE\"){\n table_blocks.push(block)\n }\n\n //DisplayBlockInfo(block);\n if (response.NextToken) {\n paginationToken = response.NextToken\n } else {\n finished = true;\n }\n\n });\n\n }\n\n //Form data processing \n let result\n if(keyMap.length <= 0){\n console.log(\"No Form Data\")\n }else{\n const keyValues = getKeyValueRelationship(keyMap, valueMap, blockMap);\n result = keyValues\n }\n \n //Table data processing\n let csv = {}\n if (table_blocks.length <= 0){\n console.log(\"No tables found\")\n }else{\n for(const [index,table] of table_blocks.entries()){\n let [rows,tableId] = generateTableCsv(table,blockMapTable,index+1)\n csv[tableId] = rows\n }\n }\n\n console.log(\"Operation Complete\")\n return [result,csv]\n \n}", "function search(query, startRecord, maximumRecords, layout) {\n var navhtml = document.getElementById(\"searchnavigation\");\n var resulthtml = document.getElementById(\"searchresults\");\n if (navhtml != null) navhtml.innerHTML = \"<p>loading...</p>\";\n if (maximumRecords == \"\") maximumRecords = 10;\n if (startRecord == \"\") startRecord = 0;\n if (query == null) query == \"\";\n\n var siteModel = new ModifierModel({key:'site',query:query});\n var filetypeModel = new ModifierModel({key:'filetype',query:query});\n var ext = filetypeModel.attributes.value;\n var hl = (layout==\"paragraph\") ? 'true' : 'false';\n\n searchResult = new SearchModel({hl:hl,query:query,start:startRecord,rows:maximumRecords,servlet:\"index.html\",layout:layout}); \n searchResult.fetch({\n success:function(searchResult) {\n navhtml.innerHTML = \"<p>parsing result...</p>\";\n rowCollection = new RowCollection({servlet:searchResult.attributes.servlet});\n rowCollection.add(searchResult.attributes.items);\n var totalResults = searchResult.attributes.totalResults.replace(/[,.]/,\"\");\n var navigation = searchResult.navigationCollection();\n \n // update navigation\n var topics = navigation.facet(\"topics\");\n var sitefacet = navigation.facet(\"domains\");\n var site = sitefacet ? sitefacet.facetElements() : {};\n for (var key in site) {if (query.indexOf(\"site:\" + key) >= 0) delete site[key];}\n var filetypefacet = navigation.facet(\"filetypes\");\n var filetypes = filetypefacet ? filetypefacet.facetElements() : {};\n for (var key in filetypes) {if (query.indexOf(\"filetype:\" + key) >= 0) delete filetypes[key];}\n\n if (ext == \"png\" || ext == \"gif\" || ext == \"jpg\" || ext == \"PNG\" || ext == \"GIF\" || ext == \"JPG\") {\n document.getElementById(\"searchnavigation\").innerHTML = \"<p>found \" + this.length + \" images, preparing...</p>\";\n resulthtml.innerHTML = rowCollection.resultImages();\n hideDownloadScript();\n navhtml.innerHTML = searchResult.fullPageNavigation(\"Image Matrix Size\");\n } else if (layout==\"paragraph\") {\n document.getElementById(\"searchnavigation\").innerHTML = \"<p>found \" + this.length + \" images, preparing result list...</p>\";\n resulthtml.innerHTML = rowCollection.resultList();\n hideScriptButton();\n navhtml.innerHTML = searchResult.fullPageNavigation(\"Result List Size\");\n } else {\n document.getElementById(\"searchnavigation\").innerHTML = \"<p>found \" + this.length + \" documents, preparing table...</p>\";\n resulthtml.innerHTML = rowCollection.resultTable();\n hideDownloadScript();\n navhtml.innerHTML = searchResult.fullPageNavigation(\"Result Table Size\");\n }\n navhtml.innerHTML += searchResult.renderNavigation(\"Result Layout\");\n if (filetypefacet) navhtml.innerHTML += filetypefacet.facetBox(searchResult.attributes.servlet, filetypeModel.attributes.key, filetypeModel.attributes.value, 8, searchResult);\n if (sitefacet) navhtml.innerHTML += sitefacet.facetBox(searchResult.attributes.servlet, siteModel.attributes.key, siteModel.attributes.value, 16, searchResult);\n }\n });\n}", "function initPagination() {\r\n\tvar num_entries = jQuery('#customerreviewhidden div.reviews').length;\r\n // Create content inside pagination element\r\n jQuery(\".paginationblock\").pagination(num_entries, {\r\n \titems_per_page: 1, // Show only one item block per page\r\n \tcallback: function (page_index, jq){\r\n\t var new_content = jQuery('#customerreviewhidden div.reviews:eq('+page_index+')').clone();\r\n\t $('#viewresult').empty().append(new_content);\r\n\t return false;\r\n\t },\r\n\t prev_text:\"Previous &#8249;\",\r\n\t\tnext_text:\"\t&#8250; More\"\r\n });\r\n }", "function createLinks (queryParams, results, rootUrl) {\n const totalPages = Math.ceil(results.hits.total / queryParams.pageSize);\n const pageNumber = queryParams.pageNumber;\n const type = queryParams.type !== 'all' ? queryParams.type : null;\n const self = searchUrl(type, rootUrl, queryParams.query);\n const first = searchUrl(type, rootUrl, xtend(queryParams.query, { 'page[number]': 0 }));\n const last = searchUrl(type, rootUrl, xtend(queryParams.query, { 'page[number]': totalPages - 1 }));\n const prev = pageNumber > 0\n ? searchUrl(type, rootUrl, xtend(queryParams.query, { 'page[number]': pageNumber - 1 }))\n : null;\n const next = pageNumber < totalPages - 1\n ? searchUrl(type, rootUrl, xtend(queryParams.query, { 'page[number]': pageNumber + 1 }))\n : null;\n\n return { self, first, last, prev, next };\n}", "function fetchPaginated(qp, onResponse, onComplete, page, allResults) {\n page = page || 0;\n allResults = allResults || [];\n let _offset = page * WRAPPED_PAGE_SIZE;\n let _limit = WRAPPED_PAGE_SIZE;\n let newQp = _.clone(qp);\n newQp.limit = _limit;\n newQp.offset = _offset;\n let url = createPath({ pathname: RESULTS_URL, search: newQp });\n fetchFromApi(url)\n .then(response => {\n let newResults = allResults.concat(response.results);\n if (typeof onResponse === 'function') onResponse(newResults);\n if (newResults.length < response.total) {\n return fetchPaginated(qp, onResponse, onComplete, page + 1, newResults);\n } else {\n if (typeof onComplete === 'function') onComplete(newResults);\n return;\n }\n });\n}", "function buildPagination()\n {\n // 1. split everything out\n var aPagination = sPagination.split(/\\s+/);\n\n // 2. iterate\n aPagination.forEach(function(sPagination)\n {\n // a. load the pagination\n var oPagination = require('slideshow/'+sPagination+'-pagination')(el, aElItems, go);\n\n // b. push it onto the array\n aoPagination.push(oPagination);\n });\n }", "function nextPage(){\n let list = document.getElementById(\"tweetList\");\n clearDiv(list);\n list.appendChild(tweetList(page+1,15));\n}", "gotoPage(pageNumber) {\n\t\tlet q = this.state.query;\n\t\tq.offset = (pageNumber-1) * this.props.pageSize;\n\t\tq.term = this.refs.searchTerm.value;\n\n\t\tthis.doSearch(q, true);\n\t}", "function pageMaker(){\n var n=document.getElementById('pageInput').value;\n\n\n var tempMyPages=[]\n var tempPages =[];\n var cutArray = myArray.map(x=>x);\n if (n>=1){\n do{\n tempPages=[];\n for (i=0; i<n; i++){\n if (cutArray.length >0){\n tempPages.push(cutArray.shift());\n } else {break}\n }\n tempMyPages.push(tempPages);\n } while (cutArray.length > 0);\n myPages=tempMyPages;\n paginationMaker();\n }\n}", "function next(){\n\n // if in the last page, then go to the new page needs http request\n if(scope.model.currentIndex === (scope.model.results.length - 1))\n {\n angular.element('button.searchbtnbox').toggleClass('changed');\n angular.element('div.section-refresh-overlay').css('visibility','visible');\n var promise = scope.model.next();\n promise.then(function(response){\n\n scope.model.currentStart += scope.model.results[scope.model.currentIndex - 1].length;\n angular.element('button.searchbtnbox').toggleClass('changed');\n angular.element('div.section-refresh-overlay').css('visibility','hidden');\n $rootScope.$emit('setMarkers',{data:scope.model.data});\n\n },function(error){\n console.log(error);\n });\n }\n else {\n scope.model.currentIndex++;\n scope.model.data = scope.model.results[scope.model.currentIndex];\n scope.model.currentStart += scope.model.results[scope.model.currentIndex - 1].length;\n $rootScope.$emit('setMarkers',{data:scope.model.data});\n }\n }" ]
[ "0.6026141", "0.56994754", "0.5635216", "0.56127954", "0.556817", "0.55447096", "0.5498591", "0.549375", "0.54572636", "0.54368854", "0.54368854", "0.54368854", "0.5417612", "0.5332865", "0.5319108", "0.53048456", "0.5294021", "0.52831346", "0.5233221", "0.52245015", "0.52199477", "0.52032316", "0.5194862", "0.51904935", "0.51754755", "0.51478016", "0.5144026", "0.5129189", "0.5099618", "0.5089106", "0.5059122", "0.5039213", "0.5035191", "0.50211346", "0.5017003", "0.50096107", "0.50051856", "0.50048953", "0.5003283", "0.49984372", "0.49906248", "0.4990368", "0.49844858", "0.49741787", "0.49732745", "0.4972791", "0.49725863", "0.49696627", "0.49678993", "0.49542153", "0.4946879", "0.49415755", "0.49351674", "0.4931595", "0.4928294", "0.4925316", "0.4918548", "0.49171636", "0.49113303", "0.490783", "0.4904415", "0.49037853", "0.48999727", "0.48998082", "0.48942986", "0.48817208", "0.48637688", "0.48617065", "0.48592016", "0.4854565", "0.4853428", "0.48518008", "0.4850421", "0.48454255", "0.48435467", "0.4840874", "0.48353145", "0.48313856", "0.48304844", "0.48285362", "0.48256668", "0.4817179", "0.48138574", "0.48093304", "0.4808926", "0.47973678", "0.47949266", "0.478637", "0.47847378", "0.47842857", "0.47738764", "0.47696325", "0.47673035", "0.47653234", "0.4762963", "0.4759222", "0.47581166", "0.47567308", "0.47519103", "0.47517392", "0.47391877" ]
0.0
-1
Replace with whatever exercise you want to display. For now, TextReader().
function showFeature() { textreader(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayExercise() {\n pickRandomExercise();\n displayBox.innerHTML = `${output.reps} <span class=\"multiplier\">×</span> ${output.exercise}`;\n}", "function explainPuzzle(){\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = underground.selected.explanationDisplay();\n}", "function displayExercise(exerciseStructure) {\n editorDisplay.innerHTML = `\n <div class=\"display--exercise\">\n ${exerciseStructure}\n </div>\n `;\n}", "function exercise(input){\n if(input === 'running'){\n var statement = \"Today's excercise: \" + input ; \n }else if (input === 'swimming'){\n var statement = \"Today's excercise: \" + input ; \n }\n return statement; \n}", "function parseAndDisplayExplanations() {\n if (explanationsFirstLine >= 0 &&\n explanationsFirstLine <= explanationsLastLine) {\n let explanationsText = puzzleTextLines[explanationsFirstLine]\n let l = explanationsFirstLine + 1\n while (l <= explanationsLastLine) {\n explanationsText = explanationsText + '\\n' + puzzleTextLines[l]\n l++;\n }\n const explanations = document.getElementById('explanations')\n explanations.innerHTML = explanationsText\n revelationList.push(explanations)\n }\n}", "function doWhatItSayDisplay() {\n\tfs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\t\tif (error) {\n\t\t\tconsole.log(\"Random text error: \" + error);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(data);\n\t\t\tvar doResult = data.split(\",\");\n\t\t\tspotifyDisplay(doResult[0], doResult[1]);\n\t\t} \n\t});\n}", "function exercise07() {}", "function exercise06() {}", "function displayQuestion() {\n push();\n textAlign(LEFT, CENTER);\n textSize(28);\n fill(255);\n text(`lvl #2`, width / 20, height / 20);\n text(`On a scale from 'I got this' to 'AAAAAAH',\nhow confident do you feel about the future?`, width / 20, height / 10 * 2)\n pop()\n}", "function run() {\n console.log(\"--------------------------------------------------------------\");\n console.log(\"Fantasy Name Generator\");\n console.log(\"--------------------------------------------------------------\");\n firstName = readline.question(\"What is your first name: \");\n lastName = readline.question(\"What is your last name: \");\n momMaidenName = readline.question(\"What is your mom's maiden name: \");\n cityBorn = readline.question(\"The city you were born: \");\n favoriteColor = readline.question(\"Your favorite color: \");\n street = readline.question(\"The name of the street you live on: \");\n console.log(\"Thank you for answering every question! Please wait one moment.\");\n console.log(\"CALCULATING, PLEASE WAIT...\");\n console.log(\"**************************************************************\");\n console.log(getNewFirstName() + \" \" + getNewLastName() + \", \" + getTitle() + \" of \" + getHonorific());\n console.log(\"**************************************************************\");\n}", "function Exercise(name) {\n this.title = name;\n this.duration = '';\n this.description = [];\n this.reps = '';\n this.calsToBurn = '';\n userExercise.push(this);\n}", "function question() {\n var questionInput = document.getElementById('question');\n questionInput.textContent = questionText[correctAnswerNumber];\n}", "function exercise11() {}", "function displayAnswer(clue, index) {\n var getBox = document.getElementById(\"questionBox\");\n document.getElementById(\"questionText\").innerHTML = (clue[index].slice(1, -1).replace(/\\\\\"/g, '\"')).trim();\n}", "function formatPuzzle(pc) {\n\tlet pi = display.puzzleIntro;\n\tlet pd = display.puzzleDescription;\n\tlet pt = display.puzzleTitle;\n\tlet dg = display.dayDisplay;\n\tdg.innerHTML = pc.dayDisplay();\n\tpt.innerHTML = pc.puzzleTitle()\n\tpi.innerHTML = pc.puzzleIntro();\n\tlet solD = display.solutionDisplay;\n\tsolD.innerHTML =\"\";\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = \"\";\n}", "function showInEditor(){\n playAnimation(t1);\n const headline = this.previousElementSibling.outerHTML.trim()\n .replace(/(?<=>|^|\\s)\\.{1,}(?=\\s|$|<)/g, \" <mark></mark> \");\n review.innerHTML = headline;\n placeholders = review.querySelectorAll(\"mark\");\n}", "function buildAndShow () {\n\tsectionNameContainer.innerText = exercises[pointer].sectionName;\n\tsectionOrderContainer.innerText = exercises[pointer].sectionOrder;\n\tcontainer.innerHTML\t \t\t\t= exercises[pointer].buildExercise();\n}", "function printProgram(data){\r\n const table = document.getElementById(\"working\");\r\n\r\n for(const exercise of data){\r\n if(exercise.collection_key == 1) createTitle(table);\r\n createExercise(table, exercise);\r\n }\r\n}", "function showAll (text) {\n\n\tasciify.getFonts(function (err, fonts) {\n\t\tif (err) { return console.error(err); }\n\n\t\tvar padSize = ('' + fonts.length).length;\n\n\t\tfonts.forEach(function(font, index) {\n\t\t\tvar opts = {\n\t\t\t\tfont: font,\n\t\t\t\tcolor: argv.color\n\t\t\t};\n\n\t\t\tasciify(exampleText, opts, function (err, result) {\n\t\t\t\tconsole.log(pad(padSize, index+1, '0') + ': ' + font);\n\t\t\t\tconsole.log(result);\n\t\t\t\tconsole.log('');\n\t\t\t});\n\t\t});\n\t});\n}", "function showTriviaGame() {\n\ttriviaOutput = \"<p>Time Remaining: <span class='timer'>30</span></p><p>\" + questionContent[questionNumber] + \"<button class='answer'>\" + answerOptions[questionNumber][0] + \"</button><button class='answer'>\" + answerOptions[questionNumber][1] + \"</button><button class='answer'>\" + answerOptions[questionNumber][2] + \"</button><button class='answer'>\" + answerOptions[questionNumber][3] + \"</button>\";\n\t$(\"#question-answers\").html(triviaOutput);\n\t//hides Play again button\n\tdocument.getElementById(\"redo\").style.display = \"none\";\n}", "function solvePart2(){\n\n // Display the answer\n document.getElementById(\"answer2\").innerHTML = \"fill me in\"\n }", "function switch_input() {\n var in_text = document.getElementById('input_text').value;\n var in_lines = in_text.trim().split(\"\\n\");\n var dir = 0;\n var inp = get_input();\n if (inp == \"result\" && in_lines.length % 2 == 0) {\n dir = 1;\n }\n for (var i = 0; i < in_lines.length; i++) {\n if (i % 2 == (in_lines.length + dir) % 2) {\n in_lines[i] = in_lines[i].replace(/K/g, \"O\");\n in_lines[i] = in_lines[i].replace(/P/g, \"K\");\n in_lines[i] = in_lines[i].replace(/O/g, \"P\");\n }\n if (i % 2 != (in_lines.length + dir) % 2) {\n var split_string = in_lines[i].split(\"\");\n var reverse_array = split_string.reverse();\n in_lines[i] = reverse_array.join(\"\")\n }\n }\n in_lines = in_lines.reverse();\n document.getElementById('input_text').value = in_lines.join(\"\\n\")\n if (inp == \"result\") {\n document.getElementById(\"explain\").innerHTML = \"The sequence of K's and P's correspond left-to-right, top-to-bottom with the visible grid of stitches on the final result\";\n }\n else {\n document.getElementById(\"explain\").innerHTML = \"The sequence of stiches and new rows one would have to knit in order to achieve the final result\"\n }\n}", "displayText(combatStage, index) {\n let paragraph = this.state.paragraph; \n let lines = this.state.lines;\n lines++;\n this.howManylines++;\n let key = \"line\"+this.howManylines;\n let string = \"\";\n let verbAgreement = \"\";\n\n if (lines > 5) {\n // scrollText() or\n paragraph.shift();\n lines--;\n }\n paragraph.push(<p></p>)\n \n switch(combatStage) {\n case \"start\": \n let subject = this.state.playerPhase ? \"You\" : \"The bandit\";\n verbAgreement = this.state.playerPhase ? \"\" : \"s\";\n string = `${subject} attack${verbAgreement}!`;\n break;\n case \"damage\":\n let verb = this.state.playerPhase ? \"inflicted\" : \"received\";\n let damage = this.state.playerPhase ? \n (this.state.player.attack - map[this.state.bandits[index].map[0]-1][this.state.bandits[index].map[1]-1].defense) : \n (this.state.bandits[index].attack - map[this.state.playerMap[0]-1][this.state.playerMap[1]-1].defense);\n string = `You ${verb} ${damage} damage!`;\n if (this.targetVillager) { string = `She receives ${damage} damage!`}\n break;\n case \"dead\":\n let target = this.state.playerPhase ? \"The bandit\" : \"You\";\n verbAgreement = this.state.playerPhase ? \"has\" : \"have\";\n let gameOver = this.state.playerPhase ? \"\" : \" Game over.\"\n string = `${target} ${verbAgreement} been defeated.${gameOver}`;\n if (this.targetVillager) { string = \"The villager has been killed.\" }\n break;\n case \"exp\":\n string = \"You have gained 10 experience.\";\n break;\n case \"next\":\n let toNext = this.expForLevel.find((element) => element >= this.state.player.exp) - this.state.player.exp;\n if (toNext === 0) {\n string = \"You have advanced to the next level.\"\n } else {\n string = `You need ${toNext} experience to advance.`;\n }\n break;\n case \"heal\":\n string = \"Your HP are restored to maximum.\"\n break;\n default:\n string = \"Something went wrong.\"\n break;\n };\n\n let t = 0;\n let framesPerTick = 2;\n const letterRoll = (timestamp) => {\n if (t <= string.length * framesPerTick) {\n if (t % framesPerTick === 0) {\n paragraph[lines-1] = <p key={key}>{string.substring(0, t/framesPerTick)}</p>;\n this.setState({ lines: lines, paragraph: paragraph });\n }\n t++;\n requestAnimationFrame(letterRoll);\n } else {\n if (combatStage === \"start\") {\n this.displayText(\"damage\", index);\n } else if (combatStage === \"dead\" && this.state.playerPhase) {\n this.displayText(\"exp\", index);\n } else if (combatStage === \"exp\") {\n this.displayText(\"next\");\n }\n }\n };\n\n requestAnimationFrame(letterRoll);\n }", "function showAnswer(){\n document.getElementById('answer').innerHTML = \" C (da sea get it?) arrrr!\";\n }", "function lookAround() {\n console.log(\"You stand in the middle of the desert, with nothing around you. If you don't get out soon, you may die\\n\");\n console.log(`\n .\n \\\\ : / \n ' _ '\n -= ( (_) ) =-\n . .\n / : \\\\\n .-. '\n |.|\n /)| |(\\\\\n (.(|'|) )\n ~~~~ \\\\ './ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n |.| ~~\n | | ~~\n ,|'|. ~~\n\\n`);\n whatToDo();\n}", "function showQuestion() {\n\t$('#answer').text(''); // Reset user input\n\t$('#answer').focus();\n\t$('#question').text(questionNumber + '. ' + Questions[questionIndex][0]); // Print question\n\tquestionNumber++;\n}", "function printAns(answer) {\n const TITLE = document.querySelector('#title');\n TITLE.textContent = 'You got: '+RESULTS_MAP[answer].title;\n const RESULT = document.querySelector('#test_result');\n RESULT.textContent = RESULTS_MAP[answer].contents;\n}", "function readIt() {\n\t\tdisplayText(false); \n\t\tcount++;\n\n\t\tif (count >= input.length) { // stop when the input reaches the last word\n\t\t\tcount = 0;\n\t\t\tstop();\n\t\t}\n\t}", "function showAnswer(){\n document.getElementById(\"answer\").innerHTML = \" C (da sea get it?) arrrr!\";\n }", "function Exercise2() {\n\n // Your code here.\n\n}", "function parse() {\n\tprayerOfTheDay.innerHTML = getSubset(\"Prayer of the Day\", \"Amen.\") + \"<strong>Amen.</strong>\";\n\tfirstReading.innerHTML = readingify(getSubset(\"First Reading:\", \"Psalm:\"));\n\tvar psalmText = getSubset(\"Psalm:\", \"Second Reading:\");\n\tif (psalmCheck.checked == false) {//psalm should not be singable\n\t\tpsalmText = psalmText.replace(/\\|/g, \"\");//removes |'s from psalm\n\t}\n\t//TODO: The following DON'T WORK because replace() only replaces the first occurance of a string.\n\t//you will need to figure out REGEX for these next two:\n\tpsalmText = psalmText.replace(/(\\-\\s*)/g, \"\");//removes - between syllables\n\tpsalmText = psalmText.replace(/\\.\\sR/g, \".\");//removes R for refrains (hopefully not beginning of sentences because those have number before)\n\tpsalm.innerHTML = psalmify(psalmText);\n\tsecondReading.innerHTML = readingify(getSubset(\"Second Reading:\", \"Gospel:\"));\n\t\n\tvar gospelEnd;\n\tif (pentecostCheck.checked == true) {\n\t\tgospelEnd = \"Semicontinuous First Reading\";\n\t} else {\n\t\tgospelEnd = \"Prayers of Intercession\";\n\t}\n\n\n\n\tgospel.innerHTML = readingify(getSubset(\"Gospel:\", gospelEnd)); //this used to be \"Semicontinuous First Reading:\"\n\t//experiment:\n\t//var experimentString = getSubset(\"First Reading:\", \"Psalm:\");\n\t//console.log(experimentString);//works\n\t//var startPoint = experimentString.search(/\\d(?=[a-zA-Z])/);\n\t//var expSub = experimentString.substring(startPoint, startPoint + 30);\n\texplainerSection.classList.add(\"hidden\");\n\toutputSection.classList.remove(\"hidden\");\n\n\n}", "function displayQuestion() {\n\n questionsEl.textContent = quizQuestions[currentQuestionIndex].title\n answer1El.textContent = quizQuestions[currentQuestionIndex].choices[0];\n answer2El.textContent = quizQuestions[currentQuestionIndex].choices[1];\n answer3El.textContent = quizQuestions[currentQuestionIndex].choices[2];\n answer4El.textContent = quizQuestions[currentQuestionIndex].choices[3];\n}", "function print5Words() {\r\n let words = READLINE.question(\"What do you want the computer to print 5 times?: \");\r\n console.log(`${words}`);\r\n console.log(`${words}`);\r\n console.log(`${words}`);\r\n console.log(`${words}`);\r\n console.log(`${words}`);\r\n}", "function displayAnswerText(answerSet, idStem) {\r\n //Variable\r\n ///The output of the function, returned at the end\r\n var output = \"\";\r\n\r\n\r\n //Display answer\r\n ///Depending on the type of question load an answer set in the correct format for the answer screen\r\n switch (userSession.questionData.type){\r\n case \"multipleChoice\":\r\n output = displayMultipleChoice(answerSet, idStem);\r\n break;\r\n\r\n case \"boxMatch\":\r\n output = displayBoxMatch(answerSet, idStem);\r\n break;\r\n\r\n default:\r\n output = displayBasicQuestion(answerSet, idStem);\r\n break;\r\n }\r\n\r\n return output;\r\n}", "function displayText(stopReading) {\n\t\tvar readerBox = document.getElementById(\"reader\");\n\t\tvar word = checkPunctuation();\n\t\tif (stopReading) {\n\t\t\treaderBox.innerHTML = \"\";\n\t\t} else {\n\t\t\treaderBox.innerHTML = word;\n\t\t}\n\t}", "function Exercise3() {\n\n // Your code here.\n\n}", "function generateReadme (answer) {\n return `\n# ${answer.title}\n\n![GitHub license](https://img.shields.io/badge/Made%20by-%40ChambersM97-orange)\n\n# Table of Contents\n\n\n- [Description](#description)\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n- [Contributing](#contributing)\n- [Tests](#tests)\n- [Questions](#questions)\n\n## Description:\n This area is designed for leaving a report of what the project is and it's purpose.\n ${answer.description}\n\n## Installation:\n These are the necessary steps to follow/files to download that you need in order to run the application.\n ${answer.installation}\n\n## Usage:\n ${answer.usage}\n\n## License:\n[![License](https://img.shields.io/badge/License-${answer.license}%202.0-blue.svg)](https://opensource.org/licenses/${answer.license})\n\n## Contributing:\n ${answer.contributing}\n\n## Tests:\n\n![Password-Generator-gif](readmeGenerator.gif)\n![Password-Generator_img](readmepic.PNG)\n\n## Questions:\n- GitHub: [${answer.username}](https://github.com/${answer.username})\n- Email: Contact me @ ${answer.email} for any other questions you might have!\n\n `\n\n}", "function showNextQuestion() {\n questionParagraph.textContent = newArrayQuestions[index].question;\n}", "function renderQuestionText() {\n //console.log('Rendering question');\n const currQuestion = getCurrentQuestion();\n $('.quiz').html(generateQuestion(currQuestion));\n}", "function nextQuestion() {\n\n questionPos++;\n pos = 0;\n questionPos = questionPos % data.length;\n\n document.getElementById('clue').innerHTML = '<div id=\"card-title\" class=\"card-title\">' + data[questionPos].category + '</div>' + '<p>' + data[questionPos].question + '</p>';\n\n\n var ans = data[questionPos].answer;\n //setting the answer to the JSON answer field.\n for (var i = 0; i < ans.length; i++) {\n word[i] = findLetter(ans.charAt(i).toLowerCase());\n }\n //make all currently shown letters asterisk's.\n for (var j = 0; j < ans.length; j++) {\n shown[j] = '*';\n change(26);\n\n }\n\n}", "function displayUserInfo(question) {\nrepeatQuestion.innerText = question;\n}", "function simpleTextEditor(input) {\n let operations = inputs[i].split(' ');\n //console.log(operations);\n if( operations[0] == 1) {\n textStack.push(initialText);\n initialText = initialText.concat(operations[1]);\n } else if( operations[0] == 2) {\n textStack.push(initialText);\n initialText = initialText.substring(0, initialText.length - operations[1]);\n // initialText = initialText.slice(operations[1] * -1);\n } else if( operations[0] == 3) {\n console.log(initialText.charAt(operations[1] -1));\n } else if( operations[0] == 4) {\n initialText = textStack.pop();\n }\n //}\n}", "function read_work_v1(work)\n{\n let text = `${work.name} ${work.author} ${work.preface} ${work.lines.join(' ')}`;\n read_work(text);\n}", "function previewPerfectProgrammer() {\n //create a playback with all insert/delete pairs within two comments removed\n projectManager.setNextPlaybackPerfectProgrammer();\n startPlayback(false);\n}", "function fillPage(questions) {\n var output = \"\"\n\n questions.forEach(q=>{\n output += getQuestionText(q);\n })\n\n return output;\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"question\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function displayQuestion() {\n let i = questions[currentQuestion];\n question.innerHTML = i.question;\n answerA.innerHTML = i.answerA;\n answerB.innerHTML = i.answerB;\n answerC.innerHTML = i.answerC;\n answerD.innerHTML = i.answerD;\n console.log();\n}", "function eclipseMode() {\r\n // get a list of questions to remove the screen reader offensive material.\r\n var questions = document.getElementsByClassName(\"questionDisplay\");\r\n for (var question = 0; question < questions.length; ++question) {\r\n try {\r\n var keywords = [\r\n \"public\",\r\n \"static\",\r\n \"void\",\r\n \"throws\",\r\n \"int\",\r\n \"if\",\r\n \"double\",\r\n \"true\",\r\n \"false\",\r\n \"boolean\",\r\n \"long\",\r\n \"float\",\r\n \"for\",\r\n \"do\",\r\n \"while\",\r\n \"byte\",\r\n \"try\",\r\n \"catch\",\r\n \"finally\",\r\n \"throw\",\r\n \"switch\",\r\n \"case\",\r\n \"default\",\r\n \"else\",\r\n ];\r\n for (var keywordId = 0; keywordId < keywords.length; ++keywordId) {\r\n var replaceSpan =\r\n \"<span style=color:#7f0055;font-weight:bold;>\" +\r\n keywords[keywordId] +\r\n \"</span>\";\r\n var regexToReplace = new RegExp(\r\n \"\\\\b\" + keywords[keywordId] + \"\\\\b\",\r\n \"g\"\r\n );\r\n questions[question].getElementsByClassName(\r\n \"wysiwygtext\"\r\n )[0].innerHTML = questions[question]\r\n .getElementsByClassName(\"wysiwygtext\")[0]\r\n .innerHTML.replace(regexToReplace, replaceSpan);\r\n answers = questions[question].getElementsByClassName(\"multiChoice\");\r\n for (var n = 0; n < answers.length; ++n) {\r\n answers[n].getElementsByClassName(\r\n \"multiContent\"\r\n )[0].innerHTML = answers[n]\r\n .getElementsByClassName(\"multiContent\")[0]\r\n .innerHTML.replace(regexToReplace, replaceSpan);\r\n }\r\n }\r\n } catch (err) {\r\n console.log(\"An error has occurred\\n\" + err);\r\n }\r\n }\r\n}", "displayLettersToGuess() {\r\n let lettersNotGuessed = \"\\n\";\r\n for (let letter of Utilities.alphabet) {\r\n if (!this.guessedLetters.includes(letter.toLowerCase())) {\r\n lettersNotGuessed += letter.toUpperCase() + \" \";\r\n }\r\n else {\r\n lettersNotGuessed += \" \";\r\n }\r\n }\r\n lettersNotGuessed += \"\\n\";\r\n console.log(Utilities.strReplaceByIndex(lettersNotGuessed, \"\\n\", 39));\r\n }", "function doWhatItSays(){\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n if (error) {\n return console.log(error);\n }\n \n var dataArr = data.split(\",\"); \n\n action = dataArr[0];\n userQuestion = dataArr[1];\n\n switch(action){\n case \"spotify-this-song\": \n spotifySearch();\n break;\n case \"concert-this\": \n //checks if the second index is in quotes, if so then we remove them because it gives an error\n if(userQuestion.charAt(0) === '\"'){\n userQuestion = userQuestion.substr(1).slice(0, -1);\n concertSearch();\n } else {\n concertSearch();\n }\n break;\n case \"movie-this\": \n movieSearch();\n break; \n }\n }); \n}", "function loadAllText() {\n\n scenarioRooms = adventureManager.states;\n resultsRooms = adventureManager.states;\n\n scenarioRooms[one].setText(\"Where to?\", \"You just lost the lease on your apartment. Where are you moving to?\");\n scenarioRooms[two].setText(\"Should you stay or should you go?\", \"You are looking for an apartment in Manhattan. However, since you do not already have OneWay installed into your body, the lifestyle is troublingly incompatible with your needs. You struggle to even submit a rental application without OneWay, let alone get in touch with real estate agents. What do you want to do?\");\n scenarioRooms[three].setText(\"Software update\", \"You bought OneWay and managed to secure a spot in Manhattan. BigInc has just released a software upgrade that cost nearly as much as the installation itself. This update will put you in deep debt, but is the only way to stay compatible with the technology in Manhattan. What do you do?\");\n resultsRooms[four].setText(\"Yikes\", \"You paid for the update in order to keep OneWay compatible. But, now you are very broke. You can’t even afford your current rent. You try to seek support from the government, but you do not qualify for any aid because having OneWay puts you in the highest bracket of income. You now have the most current technology, but are homeless.\");\n resultsRooms[five].setText(\"Congratulations\", \"You have left what is left of New York. You have escaped the pressure of Big Inc. For now that is…..\");\n scenarioRooms[six].setText(\"Should you stay or should you go?\", \"You are on Staten Island. In order to seek residency, you must commit to an anti-technology oath. The purists have banned all forms of smart devices and have reverted to pre-internet times of living in fear of the evolution of technology. Stay or go someplace else?\");\n scenarioRooms[seven].setText(\"Welcome to Staten Island\", \"You’ve decided to stay on Staten Island. You are having trouble getting accustomed to the tech-free lifestyle and you feel a lot of social pressure from the community on where you stand in response to BigInc taking over NYC. What do you do?\");\n resultsRooms[eight].setText(\"Yikes\", \"You have decided to commit the Purists, but have chosen the side of a losing battle. Your own community has started to lose faith in the cause, resulting in leadership taking unethical actions to keep the community pure. Naturally the community becomes corrupt and loses many members to BigInc.\");\n scenarioRooms[nine].setText(\"In or out?\", \"Big Inc just bought out abandoned buildings all over Brooklyn with plans to convert them to luxury apartments, OneWay compatible apartments with the hopes of inviting other wealthy communities to join their society. If you have OneWay installed, you’ll have the chance to be a part of the extended community and get in early at an up and coming area.\");\n scenarioRooms[ten].setText(\"Software update\",\"You bought OneWay and have been living in a poor quality building while waiting for your spot in the up and coming luxury apartments. BigInc has just released a software upgrade that cost nearly as much as the installation itself. This update will put you in deep debt, but is the only way to secure your spot on the waitlist. What do you do?\");\n resultsRooms[eleven].setText(\"Yikes\", \"The building you are currently living in just got bought out by BigInc. They are doing a complete remodel and kicking out all of the current residents. You can’t afford to live anywhere in Brooklyn anymore. You try to seek support from the government, but you do not qualify for any aid because having OneWay puts you in the highest bracket of income. You now have an outdated form of OneWay and are homeless.\");\n scenarioRooms[twelve].setText(\"In or out?\", \"The building you were living in just got bought out by BigInc. OneWay has taken over all of Brooklyn, displacing its current residents onto the streets. You feel like your only choices are to buy OneWay or leave NYC. What do you do?\");\n\n}", "display() {\n document.querySelector(\"#question\").innerHTML = this.question;\n for (let i = 0; i < 4; i++)\n showAnswer = selectValue(showAnswer, 4);\n answer1.innerHTML = this.answers[showAnswer[0]];\n answer2.innerHTML = this.answers[showAnswer[1]];\n answer3.innerHTML = this.answers[showAnswer[2]];\n answer4.innerHTML = this.answers[showAnswer[3]];\n }", "function solvePuzzle(){\n\tdisplay.disabled = true;\n\tlet solD = display.solutionDisplay;\n\tlet correct = true;\n\tlet txt = \"<br>\"\n\tif (guess.time == underground.selected.puzzle.time){\n\t\ttxt += \"You said it is \" + guess.time +\".\";\n\t\ttxt += \" <em> You were right. </em><br>\";\n\t} else {\n\t\ttxt += \"You said it is \" + guess.time +\".\";\n\t\ttxt += \" <em> You were wrong. </em><br>\";\n\t\tcorrect = false;\n\t} \n\tif (guess.first == underground.selected.puzzle.person1_type){\n\t\ttxt += \"You said the first inhabitant is a \" + guess.first + \"-knight. <em>This was correct.</em><br>\";\n\t} else {\n\t\t\ttxt += \"You said the first inhabitant is a \" + guess.first + \"-knight. <em>This was not correct. </em>\";\n\t\t\ttxt += \"She is a \" + underground.selected.puzzle.person1_type +\"-knight.<br>\"\n\t\tcorrect = false;\n\t} \n\tif (guess.second == underground.selected.puzzle.person2_type){\n\t\ttxt += \"You said the second inhabitant is a \" + guess.second + \"-knight. <em>This was correct.</em><br>\";\n\t} else {\n\t\t\ttxt += \"You said the second inhabitant is a \" + guess.second + \"-knight. <em>This was not correct. </em>\";\n\t\t\ttxt += \"She is a \" + underground.selected.puzzle.person2_type +\"-knight.<br>\"\n\t\tcorrect = false;\n\t}\n\ttxt +=\"<br>\";\n\tif (correct) {\n\t\ttxt += \"<strong> You solved the puzzle!</strong>\"\n\t} else {\n\t\ttxt += \"<strong> Unfortunately, you did not solve the puzzle. </strong>\"\n\t}\n\n\tsolD.innerHTML = txt;\n}", "function displayBasicQuestion(answerSet, idStem) {\r\n //Variables\r\n ///An array to store all of the HTMl for the display - returned from the function as a joined string\r\n var answerBox = [];\r\n\r\n //Generate display\r\n ///For each question prompt\r\n for(var i = 0; i < answerSet.length; i++){\r\n ///Push an answer box with an answer from the answer set\r\n answerBox.push('<input class=\"form-control\" id=\"' + idStem + \".\" + i + '\" type=\"text\" readonly value=\"' + answerSet[i] + '\"></input>');\r\n }\r\n\r\n return answerBox.join(\"\");\r\n}", "function readingEase(num) {\n switch (true) {\n case (num <= 30):\n return \"Readability: College graduate.\";\n break;\n case (num > 30 && num <= 50):\n return \"Readability: College level.\";\n break;\n case (num > 50 && num <= 60):\n return \"Readability: 10th - 12th grade.\";\n break;\n case (num > 60 && num <= 70):\n return \"Readability: 8th - 9th grade.\";\n break;\n case (num > 70 && num <= 80):\n return \"Readability: 7th grade.\";\n break;\n case (num > 80 && num <= 90):\n return \"Readability: 6th grade.\";\n break;\n case (num > 90 && num <= 100):\n return \"Readability: 5th grade.\";\n break;\n default:\n return \"Not available.\";\n break;\n }\n}", "function displayQuestion() {\n $(\".questions\").text(currentQuestionData.question);\n $(\".answer-1\").text(currentQuestionData.otherAnswers[0]);\n $(\".answer-2\").text(currentQuestionData.otherAnswers[1]);\n $(\".answer-3\").text(currentQuestionData.otherAnswers[2]);\n $(\".answer-4\").text(currentQuestionData.otherAnswers[3]);\n }", "function functionQuestionOne(){\n quizHeader.textContent = \"Commonly used data types DO NOT include:\";\n answerOne.textContent = \"strings\";\n answerTwo.textContent = \"booleans\";\n answerThree.textContent = \"alerts\";\n answerFour.textContent = \"numbers\";\n}", "render() {\n\t\tlet words = shuffle(['ad','dolor', '@','Lorem', 'ipsum', 'sit']);\n\t\t\n\t\tlet lesson1 = shuffle(['fjfjfj', 'ffj', 'jfjf','jjf', 'fgfg', 'jhjh', 'hghg', 'ghgh', 'jg', 'jh', 'hj', 'fhh', 'hfhf']);\n\t\tlet lesson2 = shuffle(['asd', 'dad', 'kl;', ';lk', 'kkssd', ';a;a', 'sksk', 'dks', 'lks', ';d;a', 'skl', 'l;a', 'kds;', 'a;sldk', ';dlska', 'aa']);\n\t\tlet lesson3 = shuffle(['jfa;', 'ghfja', ';ghjd', ';;aadk', 'fjkdal', ';lasfjgh', 'hl', 'gs', 'ghld', 'gha;ls', 'hhgklssa', 'lghdaslk;'])\n\t\tlet lesson4 = shuffle(['ry', 'iiuurtiy', 'uiuirtrt', 'itruy', 'ytytriiu', 'rutyirriyt', 'uyi', 'tryui', 'ytriiuy', 'iuy', 'ttry', 'truy', 'yyrrtiu']);\n\t\tlet lesson5 = shuffle(['woopwq', 'oopqqw', 'ppoopow', 'qwqwop', 'popqw', 'woqp', 'opwooqqp', 'wop', 'pow', 'qwop', 'owow', 'owpowqow', 'qwppqqoow', 'op', 'qw', 'owpq']);\n\t\tlet lesson6 = shuffle(['qpiou', 'toop', 'prot', 'iopert', 'iwpqiru', 'poor', 'rotter', 'iutwpo', 'tere', 'pouy', 'qytio', 'eerie', 'tyr', 'trtry', 'uot', 'trew', 'pwipe', 'ooree', 'qwerty', 'pyytrre']);\n\t\tlet lesson7 = shuffle(['qled', ';ilhde', 'ghieos', 'ppqlshg', 'jfiedo', 'yqpe', 'yi;s;eid', 'poiedgg', 'gheikow', 'qllhiel', 'ikpkqlly', 'idrekjg', 'jfpjeit', 'ihg', 's;id', 'ied', 'is;ytqap', 'idkels', 'podl;slke']);\n\t\t\n\t\t\n\t\tlet lesson8 = shuffle(['vvbbnnmm', 'vb', 'nm', 'mvbn', 'vbnm', 'nvbm', 'vvbbnnmm', 'nmvn', 'bbmmnvb', 'mvmbmmnm', 'vbvbmnnmv', 'vbbnnbmv', 'nbmv']);\n\t\tlet lesson9 = shuffle(['zxc', ',./', '//zx', 'cc./', ',.ccx/', 'zzxx..//cc', 'c.z.,c', 'c/.xz', '//,,cxz', 'z.c', ',,cxz', 'z.xc,...x', 'xc,.///zzcx', '.x,,//zzc']);\n\t\tlet lesson10 = shuffle([',xc', 'x,mnvb', 'm,xmn/', 'bv,x/', 'nbmv/', ',,cnzb', 'x,mnvb', '/bnzc', 'xm,/vz', 'nvmz', 'b/x,z', 'bmz/,', '/bz,cx', 'm/z,vx']);\n\t\tlet lesson11 = shuffle(['qni', ';tybv', ',vupoc', 'hct', '/biq', ',p;qw', 'czyop', 'wbv', 'p,gse', 'synb', 'pkl', 'nigh', 'engz', 'ug,z', 'heq/i', 'bzxyti', 'iqwsl']);\n\t\tlet lesson12 = shuffle(['123', '90', '391', '2293', '031', '99002', '19203', '0912', '332900', '1139', '9012', '2013']);\n\t\tlet lesson13 = shuffle(['45678', '5867', '6745', '7654', '8745', '8564', '5678', '4756', '8654', '4685']);\n\t\tlet lesson14 = shuffle(['/7 g', 'w7,z8', '09qwt', 'bv85', ';sa95', 'g7h1', 'vx14', '5ien', 'cpb3', 'j75f', 'v46h', '8,z02', '5;vm/', '1x,', '38tyvbn', '7,egz', '0/,36wsk', 'ks9d']);\n\t\t\n\t\tlet lesson15 = shuffle(['uxW', 'P/,We', 'Gh/jf', 'ETvIO/', 'UiReQ', 'Thi,/F', 'AeiOU', '4rH8', '1IP4vn', 'Yo40', 'Qui7R', 'DaV3', '0cE', 'lOT10', 'V;/34', 'hGIPw83' ]);\n\t\tlet lesson16 = shuffle([\"the\",\"of\",\"and\",\"a\",\"to\",\"in\",\"is\",\"you\",\"that\",\"it\",\"he\",\"was\",\"for\",\"on\",\"are\",\"as\",\"with\",\"his\",\"they\",\"I\",\"at\",\"be\",\"this\",\"have\",\"from\",\"or\",\"one\",\"had\",\"by\",\"word\",\"but\",\"not\",\"what\",\"all\",\"were\",\"we\",\"when\",\"your\",\"can\",\"said\",\"there\",\"use\",\"an\",\"each\",\"which\",\"she\",\"do\",\"how\",\"their\",\"if\",\"will\",\"up\",\"other\",\"about\",\"out\",\"many\",\"then\",\"them\",\"these\",\"so\",\"some\",\"her\",\"would\",\"make\",\"like\",\"him\",\"into\",\"time\",\"has\",\"look\",\"two\",\"more\",\"write\",\"go\",\"see\",\"number\",\"no\",\"way\",\"could\",\"people\",\"my\",\"than\",\"first\",\"water\",\"been\",\"call\",\"who\",\"oil\",\"its\",\"now\",\"find\",\"long\",\"down\",\"day\",\"did\",\"get\",\"come\",\"made\",\"may\",\"part\",\"Because\",\"should\", \"Could\", 'Type', 'Game', 'Tree', 'Fallen', 'Gusty', 'Place', 'Quiet', 'Reading', 'Place', 'Manage', 'Team', 'Picture', 'Ritzy', 'Posh', 'Between', 'Against', 'Screen', 'Castle', 'Team', 'Sense', 'Thought', 'Style', 'Program', 'Laugh', 'Fish', 'Holiday', 'Member', 'Dream', 'Direct', 'Force', 'Bring', 'Wine', 'Stagger', 'Oscar', 'waves', 'See', 'saw', 'doctor', 'acorn', 'reason', 'sand', 'couple', 'continue', 'predict', 'hosts', 'statesman', 'specials', 'survival','timer', 'Flip', 'snow', 'Super', 'cup', 'plot', 'go', 'pour', 'market', 'map', 'league', 'trust', 'single', 'Page']);\n\t\tlet lesson17 = shuffle([\"'?\\\\\", \":[]\", \"<{:\", \">?\\\\]\", \"'\\\\[?}\", \"?>\", \"'>?\\\\\", \"['}:\", \">?[\", \"'}]\"]);\n\t\tlet lesson18;\n\t\t\n\t\t//lesson change for choice of keyboard\n\t\tif(this.props.flagSelect1 === 'usLayout flagHighlighted') {\n\t\t lesson18 = shuffle(['!#', '@(^', '^%$', '%#)', '(*)@', '&$%@', ')!*%', '#$%^&', '&^#!', '(*&@^)']);\n\t\t}\n\t\telse {\n\t\t\t lesson18 = shuffle(['!£', '\"(^', '^%$', '%£)', '(*)\"', '&$%\"', ')!*%', '£$%^&', '&^£!', '(*&\"^)']);\n\t\t}\n\t\t\n\t\tlet lesson19;\n\t\tif(this.props.flagSelect1 === 'usLayout flagHighlighted'){\n\t\t lesson19 = shuffle(['ˋ|\"', '~\"', 'ˋ-=_', 'ˋ+ˋ~', '\"-=', '=|\"\"', '_-+=', '~\"|+', '\"+=', '+_', '\"ˋ=~|']);\n\t\t}\n\t\telse {\n\t\t lesson19 = shuffle(['ˋ|@', '~#', 'ˋ¬-=_', 'ˋ¬+ˋ@~', '#¬-=', '=|@#', '_-+=', '~¬@|+', '¬+=', '#+_', '#ˋ=~|']);\n\t\t}\n\t\t\n\t\tlet lesson20;\n\t\tif(this.props.flagSelect1 === 'usLayout flagHighlighted'){\n\t\t lesson20 = shuffle(['ˋ*)', '@!#_', '+\"$~', '~($|)', '\\'*ˋ', '_\"+?', '&^~|', ':(<ˋ\\\\', '>#+', '||>&', '@ˋ~$%', '%^*', '=@!~']);\n\t\t}\n\t\telse {\n\t\t lesson20 = shuffle(['ˋ*)', '@!#_', '+\"$~', '¬($|)', '\\'*ˋ', '_\"+?', '&^¬|', ':(<ˋ\\\\', '>#¬+', '||>&', '@ˋ¬$%', '%^*', '=@!¬~']);\t\n\t\t}\n\t\t\n\t\tlet lesson21;\n\t\tif(this.props.flagSelect1 === 'usLayout flagHighlighted'){\n\t\t\tlesson21 = shuffle([\"*.ei\", \"iIqP3\", '-_=qi', \"Hh/.\", \"Qiu8[\", \",#ˋ\", \"1&s%\", \"^ip+\", \"+Gg|\", \"e'Ez}\", \"Bc)A!\", \"#V\", \"0=kK;\", \"fS~|\\|\", 'P\"hn#', \"gm*,R5$\", 'we%', \"y@qG\", \"hir\", \"e,9\", \"#:d2\", \"wi1!2\", \"Z?82c\", \"/0G*\", \"H*(U)\", \"bnj)&*\", \"@'kj7\", \"TK>/\", \">sw\", \")JG76\", \"mcnvb74\", \"dui_=64\", \"~;j57\", \"MN\", \".jf93.\", \"9G\", \"|F6\", \"$y{gdr}\", \"09uh(\", \"j8t\", \"9!hlr\", \"JQWin\", \"^YT@h\", \"I7Pu\", \"U(!wzc\", \"tTˋ9ˋnZ\"]);\n\t\t}\n\t\telse {\n\t\t\tlesson21 = shuffle([\"*.ei\", \"iIqP3\", '-_=qi', \"Hh/.\", \"Qiu8[\", \",#ˋ\", \"1&s%\", \"^ip+\", \"+Gg|\", \"e'Ez}\", \"Bc)A!\", \"#¬V\", \"0=kK;\", \"fS~|\\|\", 'P\"hn#', \"gm*,R5$\", 'we%', \"y@qG¬\", \"hir\", \"e,9£\", \"#:d2\", \"wi1!2\", \"Z?82c\", \"/0G*\", \"H*(U)\", \"bnj)&*\", \"@'kj7\", \"TK>/\", \">£sw\", \")JG76\", \"mcnvb74\", \"dui_=64\", \"~;j57\", \"MN\", \".jf93.\", \"9G\", \"|F6\", \"$y{gdr}\", \"09uh(\", \"¬j8t\", \"9!hlr\", \"JQWin\", \"^YT@h\", \"I7Pu\", \"U(!wzc\", \"tTˋ9ˋnZ\"]);\t\n\t\t}\n\t\t\n\t\tlet textString;\n\t\tlet currentLesson = words;\n\t\tlet seed = 0;\n\t\t\n function shuffle(array) {\n let currentIndex = array.length, temporaryValue, randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n\t\t\t\n\t// randomise current index\n\t\t\tif(array.length < 150) {\n\t\t\tarray[randomIndex] = array[randomIndex].split('');\n\t\t\n\t\tfor(let i = array[randomIndex].length -1; i > 0; i--) {\n\t\t\tlet j = Math.floor(Math.random() * (i + 1));\n\t\t\t\n\t\t\t\n\t\t\t[array[randomIndex][i], array[randomIndex][j]] = [array[randomIndex][j], array[randomIndex][i]];\n\t\t\t\n\t\t}\n\t\t\t\n\t\tarray[randomIndex] = array[randomIndex].join('');\n\t\t}// end randomise each index\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\t\t\t\n return array;\n }\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//choose which array to use depending on lesson clicked\n\t\tswitch(this.props.activeLesson) {\n\t\t\t\tcase 'lesson1': \n\t\t\t\t\tcurrentLesson = lesson1;\n\t\t\t\t\tseed = Math.floor((Math.random() * 100) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson2':\n\t\t\t\t\tcurrentLesson = lesson2;\n\t\t\t\t\tseed = Math.floor((Math.random() * 100) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson3':\n\t\t\t\t\tcurrentLesson = lesson3;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson4':\n\t\t\t\t\tcurrentLesson = lesson4;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'lesson5':\n\t\t\t\t\tcurrentLesson = lesson5;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson6':\n\t\t\t\t\tcurrentLesson = lesson6;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\t\n\t\t\tcase 'lesson7':\n\t\t\t\t\tcurrentLesson = lesson7;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson8':\n\t\t\t\t\tcurrentLesson = lesson8;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson9':\n\t\t\t\t\tcurrentLesson = lesson9;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson10':\n\t\t\t\t\tcurrentLesson = lesson10;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson11':\n\t\t\t\t\tcurrentLesson = lesson11;\n\t\t\t\t\tseed = Math.floor((Math.random() * 8) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson12':\n\t\t\t\t\tcurrentLesson = lesson12;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson13':\n\t\t\t\t\tcurrentLesson = lesson13;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tcase 'lesson14':\n\t\t\t\t\tcurrentLesson = lesson14;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'lesson15':\n\t\t\t\t\tcurrentLesson = lesson15;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'lesson16':\n\t\t\t\t\tcurrentLesson = lesson16;\n\t\t\t\t\t\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'lesson17':\n\t\t\t\t\tcurrentLesson = lesson17;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'lesson18':\n\t\t\t\t\tcurrentLesson = lesson18;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'lesson19':\n\t\t\t\t\tcurrentLesson = lesson19;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'lesson20':\n\t\t\t\t\tcurrentLesson = lesson20;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\t\n\t\t\t\n\t\t\tcase 'lesson21':\n\t\t\t\t\tcurrentLesson = lesson21;\n\t\t\t\t\tseed = Math.floor((Math.random() * 20) + 1)\n\t\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\n\t\t\n\t\t\n\t\tsetTimeout(()=>{\n\n\t\t\t\n\t\t\t\n\t\tlet innerText = this.refs.innerText;\n\t\tlet innerTextUsed = this.refs.innerTextUsed;\n\t\t\t\n\t\t\t\n\t\t//textString returns the random string from the Lorem generator lowercase at the moment for lower lessons\n\t\tif(currentLesson === lesson1 || currentLesson === lesson2 || currentLesson === lesson3 || currentLesson === lesson4 || currentLesson === lesson5 || currentLesson === lesson6 || currentLesson === lesson7 || currentLesson === lesson8 || currentLesson === lesson12 || currentLesson === lesson13 || currentLesson === lesson17 || currentLesson === lesson18 || currentLesson === lesson19 || currentLesson === lesson20) {\n\t\ttextString = document.getElementsByTagName('p')[0].firstChild.data.replace(/\\./g,'').toLowerCase();\n\t\t}\n\t\telse if(currentLesson === lesson9 || currentLesson === lesson10 || currentLesson === lesson11 || currentLesson === lesson14)\n\t\t{\n\t\t\ttextString = document.getElementsByTagName('p')[0].firstChild.data.toLowerCase();\n\t\t}\n\t\telse {\n\t\t\ttextString = document.getElementsByTagName('p')[0].firstChild.data;\n\t\t}\n\t\t\t\n\t\t//send string to state once then return after each character struck;\t\n\t\tif(this.props.needText){\n\t\tthis.props.sendString(textString)\n\t\t\n\t\t\n\t\t}\n\t\telse{\n\t\t\tif(this.props.testString.length === 0){\n\t\t\t\tthis.props.sendEnd();\n\t\t\t\t\n\t\t\t}\n\t\t// test which highlight to apply based on key correct or not\n\t\tif(this.props.mistakesLength > this.props.mistakesTemp) {\n\t\tinnerText.innerHTML = this.props.testString.length > 0 ? '<strong className=\"highlight\">' + this.props.testString[0] + '</strong>' + this.props.testString.substring(1,this.props.testString.length) : '<span className=\"highlight\">' + ' ' + '</span>' + this.props.testString.substring(1,this.props.testString.length);\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t\n\t\tinnerText.innerHTML = this.props.testString.length > 0 ? '<span className=\"highlight\">' + this.props.testString[0] + '</span>' + this.props.testString.substring(1,this.props.testString.length) : '<span className=\"highlight\">' +' ' + '</span>' + this.props.testString.substring(1,this.props.testString.length) ;\t\n\t\t}\n\t\t\t\n\t\t\t\n\t\tinnerTextUsed.value = this.props.usedString.split('').reverse().join('');\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\t\n\t\t\n\t\t\n\t\t})\n\t\t\n\t\n\t\t\n\t\treturn(\n\t\t\t<div className=\"typingArea\">\n\t\t\t<form>\n\t\t\t<div className=\"textbox\" id=\"textarea_id\" ref=\"textarea_id\" type=\"textArea\" readOnly={true} >\n\t\t\t<div className=\"marker\"></div>\n\t\t\t<div className=\"innerTextBox\" ref=\"innerText\" readOnly={true}></div>\n\t\t\t<textarea className=\"innerTextBoxUsed\" ref=\"innerTextUsed\" readOnly={true} type=\"textArea\"></textarea>\n\t\t\t</div>\n\t\t\t\n\t\t\t</form>\n\t\t\t<Lorem id=\"textGenerator\" ref=\"text_content\" mode=\"paragraphs\" paragraphLowerBound={3} sentenceUpperBound={7} count=\"1\" words={currentLesson} seed={seed}/>\n\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t)\n\t}", "function solvePart1(){\n // Parse the input\n inp = parseMultilineInput()\n inp = document.getElementById(\"inp\").value.split(\"\\t\")\n\n //\n\n\n\n\n // Display the answer\n document.getElementById(\"answer1\").innerHTML = \"fill me in\"\n }", "function displayQuestions() {\n //gets the current question from global variable currentQuestion\n // display a question\n currentQuestion++;\n $(\".questions\").text(triviaQuestions[currentQuestion].questions);\n }", "function textQuestion (json) {\n textAns.classList.remove('hide')\n altAns.classList.add('hide')\n question.textContent = json.question\n}", "function textreader() {\n\n // Replace \"reserved\" report with feature exercise.\n var port = document.getElementById(\"portfolio\");\n var reserved = document.getElementById(\"reserved\");\n port.removeChild(reserved);\n var div = appendElementChild(\"div\", port, \"showtime\");\n var prompt1 = \"First, a simple exercise. Type complete sentences \"\n + \"in the text area provided then press SUBMIT. I will report \"\n + \"statistics related to your submission. Cool? \";\n appendTextChild(prompt1, div, \"h4\");\n var prompt2 = \"Text Reader and Statistics\";\n var txta = appendElementChild(\"textarea\", div, \"sample\");\n txta.setAttribute(\"name\", \"textReader\");\n txta.setAttribute(\"rows\", \"5\");\n txta.setAttribute(\"cols\", \"30\");\n appendBreakChild(2, div);\n\n // Create button to move to next results page.\n var button1 = appendElementChild(\"button\", div, \"button1id\");\n button1.innerHTML = \"Submit\";\n button1.setAttribute(\"name\", \"button1\");\n button1.setAttribute(\"onClick\", \"txtrresults()\");\n\n return true;\n}", "function parseAndDisplayRelabel() {\n if (relabelFirstLine >= 0 && relabelFirstLine <= relabelLastLine) {\n let l = relabelFirstLine\n while (l <= relabelLastLine) {\n const colon = puzzleTextLines[l].indexOf(':')\n if (colon < 0) {\n throwErr('Line in exolve-relabel does not look like ' +\n '\"id: new-label\":' + puzzleTextLines[l])\n }\n let id = puzzleTextLines[l].substr(0, colon).trim()\n let elt = document.getElementById(id)\n if (!elt) {\n throwErr('exolve-relabel: no element found with id: ' + id)\n }\n elt.innerHTML = puzzleTextLines[l].substr(colon + 1).trim()\n l++;\n }\n }\n if (language) {\n document.documentElement.lang = language\n gridInput.lang = language\n questions.lang = language\n gridInput.maxLength = '' + (2 * langMaxCharCodes)\n }\n}", "function changeQuestion() {\n inputBox.setAttribute(\"placeholder\", \"Cuéntanos\");\n if (num < questions.length) {\n output.innerHTML = questions[num];\n }\n}", "function typeWriter() {\n \tif (i < txt.length) {\n document.getElementById(\"intro\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function reveal(guess) {\n for (var z = 0; z < word.length; z++) {\n if (word[z] == guess) {\n context.fillText(word[z], (100 + (z * 20)), 490);\n lettersRemaining--;\n console.log(\"reveal: \" + lettersRemaining);\n }\n }\n }", "function DifferentialLigningExercise() {\n const {\n A, B, C, D,\n } = diffLigningVars();\n this.txt = 'Find den fuldstændige løsning til differentialligningen. I tilfælde af kommatal, indtast 2 decimaler.';\n this.type = 'differentialligning';\n this.point = 10;\n this.tegn = '';\n this.exerciseVars = { Differentialligning: `f'(x)=${A}x^3+${B}x^2-${C}x+${D}` };\n this.facit = differentialLigningFacit(A, B, C, D);\n this.print = () => {\n console.log(this.txt, this.type, this.point, this.tegn, this.exerciseVars, this.facit);\n };\n}", "function onClickTextEjercise5() {\n document.querySelector(\"#text-exercise-5\").innerHTML =\n \"5. This text was changed!!\";\n}", "function printQA() {\n var currentQA = getRandomQA();\n var message = '<h3 class=\"question\">Q: ' + currentQA.question + \"</h3>\";\n message += '<p class=\"answer\">A: ' + currentQA.answer + \"</p><footer>\";\n if (currentQA.readmore) {\n message += '<p><a class=\"readmore\" href=\"' + currentQA.readmore + '\">Read More...</a></p>';\n }\n if (currentQA.tags) {\n \tmessage += '<span class=\"tags small\">tags: ' + currentQA.tags + '</span>';\n }\n message += \"</footer>\";\n\n document.getElementById(\"qa-box\").innerHTML = message;\n}", "function revealMystery(solution){\n return `${solution.suspect.firstName} ${solution.suspect.lastName} killed Mr. Boddy using the ${solution.weapon.name} in the ${solution.room.name}!`;\n}", "function generateQuestion() {\n\tvar q = \"If there were \" + estimateCount + \" \" + getEstAdj() + \" \" + getEstNoun() + \" in \" + getEstMin() + \", estimate how many you could expect to see in \" + estRandMins + \" \" + getMinutesSuffix(estRandMins) + \"?\";\n\tget('estBonusQuest').innerHTML = q;\n\tget('estBonusResQuest').innerHTML = q;\n}", "function showSolution(){\n\tvar solution = \"\";\n\tfor(move in lastMove){\n\t\tsolution += \">>> \" + lastMove[move][1] + \" \";\n\t}\n\tdocument.getElementById(\"solution\").innerText = solution;\n}", "function displayDirections() {\n console.log(` \n FILE GENERATOR FROM TEMPLATE\n\n This program will generate a stream file based upon a template file.\n Questions are stored in the template file and will be prompted to the user\n to provide substitution in the template. Each question can accept multiple\n lines of input.\n If you are through answering a question enter \"DONE\" and you will be prompted\n for the next question.\n If you want to quit without writing an output file enter \"STOP\".\n ** In a future release you will be able to take a break and\n resume later where you left off enter \"BREAK\". **\n\n `);\n}", "function esBasics(){ askAboutInsert(insertableText.esBasics.text); }", "function answer() {\n let parentSection = this.parentElement.parentElement;\n if (this.textContent === \"Go back to Menu\") {\n backToMenu();\n } else if (this.textContent === \"Play Again\") {\n playAgain(parentSection);\n } else {\n let correct = false;\n let noteTag = gen(\"p\");\n for (let i = 0; i < CORRECT_ANSWER.length; i++) {\n if (CORRECT_ANSWER[i] === this.textContent) {\n noteTag.textContent = \"Correct !\";\n noteTag.classList.add(\"correct\");\n parentSection.appendChild(noteTag);\n correct = true;\n }\n }\n if (!correct) {\n noteTag.textContent = \"Wrong !\";\n noteTag.classList.add(\"wrong\");\n parentSection.appendChild(noteTag);\n }\n setTimeout(() => nextQuestion(parentSection), WAITING_TIME);\n }\n }", "function updateNextStep() {\nnext_step_text.innerHTML = recipe[next_step];\n}", "function displaySolution(solution) {\n\n}", "function reset(){\n getExercises();\n }", "function correctAnswer() {\n return `\n <div>\n <h1 class=\"answer-header\">CORRECT! 🎉</h1>\n <h2>Great job! The correct answer is <span class=\"correct-answer\">${store.questions[store.questionNumber].correctAnswer}</span>.</h2>\n <h3 class=\"score\">Score: ${store.score}/10</h3>\n <p>${store.questions[store.questionNumber].answerFact}</p>\n <button type=\"button\" class=\"next-question-button\">Next Question</button>\n </div>`;\n}", "function printWords() {\r\n let words = READLINE.question(\"What do you want the computer to print?: \");\r\n console.log(`${words}`);\r\n}", "function showQuestion() {\n\n questionSpot.textContent = questions[questionIndex].question;\n showAnswers(); \n \n \n}", "function altQuestion (json) {\n textAns.classList.add('hide')\n altAns.classList.remove('hide')\n _content(json)\n}", "function printProblem() {\n\t//Generate two random integers from 1 - the previously specified 'limit'\n\tvar int1 = Math.floor((Math.random() * limit) + 1); \n\tvar int2 = Math.floor((Math.random() * limit) + 1);\n\n\t//Display the equation onscreen\n\tvar text = int1 + \" + \" + int2;\n\t//Store the actual answer to solution variable\n\tsolution = int1 + int2;\n\n\t//Align the text in the center\n\tctx.textAlign=\"center\"; \n\t//Declare font face and size\n\tctx.font = \"30px Arial\";\n\t//Clear canvas. Starts at 0,0, stretches to canvasWidth/Height.\n\tctx.clearRect(0,0,canvasWidth,canvasHeight);\t\n\t//Draw text right in the center of the canvas\n\tctx.fillText(text,(canvasWidth / 2),(canvasHeight / 2));\n}", "function doWhatItSays() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n if (error) {\n return console.log(error);\n }\n //variable to take text from random.txt and split it\n var output = data.split(\",\");\n // new action variable\n action = output[0];\n // new input varible \n var textInput = output[1];\n console.log(action,textInput);\n //call the spotify-this function to run new input\n spotifyThis(textInput);\n \n });\n\n }", "function generateMathTask(exercise){\n let task;\n switch (parse(localStorage.level)) {\n case 1:\n task = _.random(1, 10) + _.sample(window.tasks.mathOperations.simple) + _.random(1, 10);\n break;\n case 2:\n task = _.random(1, 10) + _.sample(window.tasks.mathOperations.difficult) + _.random(1, 10);\n break;\n case 3:\n task = \"(\" + _.random(1, 10) + _.sample(window.tasks.mathOperations.simple) + _.random(1, 10) + \")\" + _.sample(window.tasks.mathOperations.difficult) + _.random(1, 10);\n break;\n }\n exercise.textContent = task;\n return task;\n }", "seepreview(input){\n marked.use({breaks:true});\n $('#preview').html(marked(input)===null?'<h1>error</h1>':marked(input));\n }", "function problem4() {\n document.getElementById('result').innerHTML = 'Погледнете решението на задача 1';\n}", "function showQuestion() {\n // quiz questions along with possible answers\n questionEl.innerHTML = questions[currentQuesIndex].question;\n answerA.innerHTML = questions[currentQuesIndex].choiceA;\n answerB.innerHTML = questions[currentQuesIndex].choiceB;\n answerC.innerHTML = questions[currentQuesIndex].choiceC;\n\n}", "function correct() {\n score += 20;\n document.getElementById(\"quizBody\").innerHTML = \" \";\n next();\n}", "function exercise10(getData) {}", "function generateText() {\n\t$(\"#display\").html(\"<h3>\" + questionList[questionNumber].question + \"</h3><h4 class='choice'>A. \" + questionList[questionNumber].answerArray[0] + \"</h4><h4 class='choice'>B. \"+questionList[questionNumber].answerArray[1]+\"</h4><h4 class='choice'>C. \"+questionList[questionNumber].answerArray[2]+\"</h4><h4 class='choice'>D. \"+questionList[questionNumber].answerArray[3]+\"</h4>\");\n\n}", "function showQuestion(question) {\n questionElement.innerText = question.question\n}", "function getQuestion (i) {\n\t\t$(\"#restart\").css(\"visibility\", \"hidden\");\n\t\tif (i<trivia.length) {\t\n\t\tcountdown(10);\n\t\t$(\"#game\").append(\"<h3>What was the original group name of \" + trivia[i].question + \"?</h3>\");\t\t\t\n\t\t\tfor (a=0; a<trivia[i].choices.length; a++) {\n\t\t\t\t$(\"#game\").append(\"<p>\" + trivia[i].choices[a] + \"</p>\" );\n\t\t\t}\n\t\t}\t\t\n\t}", "function problem5() {\n document.getElementById('result').innerHTML = 'Погледнете решението на задача 1';\n}", "function scrub(){\n//this generates a \"cooked\" text file whereby the entire text\n//\tis analyzed and changed, and information about the original\n//\ttext file is displayed in the console. \n//\t\t- It will change all Uppercase letters to Lowercase\n//\t\t- All punctuation is removed\n//\t\t- All whitespace is removed\n//\t\t- How many lines are there in the original text file?\n//\t\t- How many chapters are there in the original text file?\n\n\t//how many lines are there?\n\t// console.log(\"there are \" + textLines.length + \" lines!\");\n\n\t//the WHOLE POEM in one HUGE STRING\n\t//var bigSTRING = \"\";\n\t\n\t//concatenate whole book into one string:\n\tfor (var i = 0; i<textLines.length; i++){\n\t\tbigSTRING+=textLines[i]+\" \";\n\t}\n\n\t//strip all punctuation (regex):\n\t//the ^ character is a negation\n\t//the [] say we're talking regular expression-eese, not\n\t//\tliteral strings\n\t//you still start and end with / characters and slap a 'g'\n\t//\ton the end.\n\tbigSTRING = bigSTRING.replace(/[^a-zA-Z0-9' ]/g, \" \");\n\n\t//address any apostrophe at beginning\n\tbigSTRING = bigSTRING.replace(/ '/g, \" \");\n\n\t//address any apostrophe at end \n\tbigSTRING = bigSTRING.replace(/' /g, \" \"); \n\n\t//change to lowercase\n\tbigSTRING = bigSTRING.toLowerCase();\n\n\t//strip leading and extra whitespace (regex):\n\t//a + will take into account repeats\n\tbigSTRING = bigSTRING.replace(/ +/g, \" \");\n\n\t//removes whitespace characters from the beginning\n\t//\tand end of the string\n\tbigSTRING = bigSTRING.trim();\n\n\t// console.log(bigSTRING);\n\n\t// the split will cut a string into an array of substrings\n\t// based on a matching pattern:\n\tvar chapters = bigSTRING.split(/chapter [a-z]+/);\n\t// how many chapters?\n\t// console.log(\"there are \" + chapters.length + \" chapters!\");\n\t \n\t// one last strip of whitespace\n\tfor(var i = 0;i<chapters.length;i++)\n\t{\n\t chapters[i] = chapters[i].trim();\n\t}\n\t \n\n\t// step 4: output a \"cooked\" text file\n\t// write line-by-line:\n\t// saveStrings(chapters, 'alice_cooked.txt');\n}", "function readNewspaper() {\n console.log(newspaper_page + 'の' + newspaper_page + 'ページを読みました。');\n}", "function displayQuestion() {\n formQuestion.textContent = questions[currentQuestion].question;\n answer1.textContent = \" 1. \" + questions[currentQuestion].answers[1];\n answer2.textContent = \" 2. \" + questions[currentQuestion].answers[2];\n answer3.textContent = \" 3. \" + questions[currentQuestion].answers[3];\n answer4.textContent = \" 4. \" + questions[currentQuestion].answers[4];\n}", "function loadExercise(concept_id,exercise_id) {\n if(fireworks){\n stopFireWorks();\n }\n currentExerciseId = parseInt(exercise_id);\n currentConceptId = parseInt(concept_id);\n for(var i=0; i<exercises.length;i++){\n if (exercises[i].concept_id == currentConceptId && exercises[i].exercise_id == currentExerciseId) {\n document.getElementById(\"Exercise\").innerHTML = exercises[i].exerciseDetails;\n if(gameLoaded){\n updateGame(exercises[i].array_length);\n } else {\n initGame(exercises[i].array_length);\n }\n }\n }\n if(coordinates){\n toggleCoordinates(0);\n }\n}", "function revealAnswer() {\n clearInterval(intervalId);\n\n $(\"#correct-answser\").html(\"The Correct Answer was: \" + triviaQuestions[questionIndex].correctAnswerWord);\n $(\"#reveal-image\").html(triviaQuestions[questionIndex].image);\n\n $(\"#choice-A\").empty();\n $(\"#choice-B\").empty();\n $(\"#choice-C\").empty();\n $(\"#choice-D\").empty();\n questionIndex++;\n }", "function revealMistery(solution) {\n \n return solution[0].first_name + \n \" \" + solution[0].last_name + \" killed Mr.Boddy using the \" \n + solution[1].name + \" in the \" + solution[2].name + \"!!!!\";\n}" ]
[ "0.62252015", "0.6130755", "0.58041054", "0.57786036", "0.57417476", "0.569386", "0.5487524", "0.54531574", "0.54326886", "0.5405801", "0.54019594", "0.5375591", "0.5370211", "0.53687036", "0.5248198", "0.5216234", "0.5215954", "0.52051556", "0.51992166", "0.5173646", "0.51649904", "0.51593566", "0.5151095", "0.51454073", "0.5141692", "0.51413053", "0.5139521", "0.51305443", "0.51278967", "0.51232326", "0.5114702", "0.5106884", "0.5104561", "0.50924855", "0.5084698", "0.508082", "0.50782585", "0.5077479", "0.5072603", "0.5069506", "0.5064718", "0.50560045", "0.50528353", "0.5049393", "0.50483084", "0.5046632", "0.50401145", "0.5038665", "0.5037962", "0.5020049", "0.5017462", "0.49978474", "0.49927184", "0.4991581", "0.49914366", "0.4989884", "0.49860594", "0.49719173", "0.49652383", "0.496514", "0.49634865", "0.4962623", "0.49612552", "0.4955645", "0.49508682", "0.4950505", "0.49470413", "0.49463937", "0.4942662", "0.49400547", "0.49389333", "0.4937257", "0.49360693", "0.49344882", "0.4933532", "0.4933321", "0.49246293", "0.49236038", "0.49219173", "0.491433", "0.49131417", "0.49087682", "0.49064404", "0.48993278", "0.48942545", "0.489411", "0.48871487", "0.48866954", "0.48808458", "0.48769456", "0.48723042", "0.4859311", "0.48573348", "0.48535764", "0.4852533", "0.48523515", "0.48515323", "0.48508272", "0.48507538", "0.4848973" ]
0.55105
6
Append text as a child node (w element).
function appendTextChild(text, node, element, idname) { // Check input. if ( text === undefined || text === null || node === undefined || node === null || element === undefined || element === null) { return null; } // Create styled text node. var txt = document.createTextNode(text); var el = _createel(element, idname); el.appendChild(txt); node.appendChild(el); return el; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addText(parent, text) {\n parent.appendChild(document.createTextNode(text));\n }", "function appendElement(parent, child, elementText) {\n var childElement = document.createElement(child);\n childElement.textContent = elementText;\n parent.appendChild(childElement);\n}", "function appendTextToElement(element, text){\n jQuery(element).append(currentDocument.createTextNode(\"\"+text));\n jQuery(element).append(currentDocument.createElement(\"br\"));\n }", "function appendTextElement(doc, elem, childElemName, textValue)\n{\n\tvar child = doc.createElement(childElemName);\n\tchild.appendChild(doc.createTextNode(textValue));\n\telem.appendChild(child);\n}", "function appendText(text, node) {\n\tnode.appendChild(document.createTextNode(text));\n}", "function createElementText(value,attr,element,text,parent){\n\t\tlet elementHTML = createElementPerDiv(value,attr,element)\n\t\tlet textNode = document.createTextNode(text);\n\t\telementHTML.appendChild(textNode);\n\t\tparent.appendChild(elementHTML);\n\t}", "function addText(node, text) {\n node.appendChild(document.createTextNode(text));\n return node.lastChild;\n}", "appendText(text, location) {\n this.childNodes.push(new TextNode(text, location));\n }", "function createTextNode(text, parent)\n\t{\n\t\tvar textnode = document.createTextNode(text);\n\t\tparent.appendChild(textnode);\n\t}", "appendChild(element, child) {\n if (Array.isArray(child)) {\n child.forEach((oneChild) => this.appendChild(element, oneChild));\n }\n else if (child instanceof HTMLElement || child instanceof Text) {\n element.appendChild(child);\n }\n else if (child) {\n element.appendChild(this.text(child.toString()));\n }\n\n return this;\n }", "function addSubTextNode(element, word, additionalClass) {\n if (element === undefined || word === undefined) {\n return;\n }\n element\n .append('tspan')\n .attr('class', additionalClass)\n .classed('text', true)\n .classed('subtext', true)\n .attr('x', 0)\n .attr('y', function() {\n return (element.property('childNodes').length - 1) * SPACE_BETWEEN_SPANS;\n })\n .text(word);\n }", "function appendToDom(newElementType, classValue , idValue, textContent, parentElement) {\n var newElement = document.createElement(newElementType);\n newElement.setAttribute('class', classValue);\n newElement.setAttribute('id', idValue);\n newElement.textContent = textContent;\n parentElement.appendChild(newElement);\n}", "function appendElement(element, text){\n\n return getTextForId(element) + text;\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function text(index, value) {\n var lView = getLView();\n ngDevMode && assertEqual(lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, lView[RENDERER]);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}", "function creatElementAndAppend(parent, child, optional = {}) {\n const elem = document.createElement(child);\n parent.append(elem);\n Object.entries(optional).forEach(([key, value]) => {\n if (key === 'text') {\n elem.textContent = value;\n } else {\n elem.setAttribute(key, value);\n }\n });\n\n return elem;\n}", "function addEl(par, tag, text) {\n\t\t\tvar x = document.createElement(tag);\n\t\t\tx.textContent = text;\n\t\t\tpar.appendChild(x);\n\t\t}", "function addEl(par, tag, text) {\n\t\t\tvar x = document.createElement(tag);\n\t\t\tx.textContent = text;\n\t\t\tpar.appendChild(x);\n\t\t}", "function newElement(type, content, parent) {\r\n var element = document.createElement(type);\r\n element.textContent = content;\r\n parent.appendChild(element);\r\n}", "function text(index, value) {\n ngDevMode && assertEqual(viewData[BINDING_INDEX], tView.bindingStartIndex, 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n var textNative = createTextNode(value, renderer);\n var tNode = createNodeAtIndex(index, 3 /* Element */, textNative, null, null);\n // Text nodes are self closing.\n isParent = false;\n appendChild(textNative, tNode, viewData);\n}", "function setChildTextNode(elementId, text) {\n document.getElementById(elementId).innerText = text;\n}", "function setChildTextNode(elementId, text) {\n document.getElementById(elementId).innerText = text;\n}", "function addNewText() {\n // making a new element object\n let newElement = document.createElement(\"p\");\n // modifying its contents\n newElement.innerHTML = \"new element\";\n // appending it to the end of the body\n document.body.appendChild(newElement);\n }", "function addtext(text){\n var para=document.createElement(\"p\");\n var node=document.createTextNode(\"You said: \"+text+\". \"+response('ib'));\n para.appendChild(node);\n var element = document.getElementById(\"convo\");\n var child = document.getElementById('ib');\n element.insertBefore(para,child);\n}", "function setNodeText(node, text) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n\n node.appendChild(node.ownerDocument.createTextNode(text));\n}", "function p (text){\n let divAffichage = document.querySelector(\"#affichage\");\n let ajoutTexte = document.createTextNode(text);\n\n divAffichage.append(ajoutTexte);\n}", "function text(index,value){var lView=getLView();ngDevMode&&assertEqual(lView[BINDING_INDEX],lView[TVIEW].bindingStartIndex,'text nodes should be created before any bindings');ngDevMode&&ngDevMode.rendererCreateTextNode++;var textNative=createTextNode(value,lView[RENDERER]);var tNode=createNodeAtIndex(index,3/* Element */,textNative,null,null);// Text nodes are self closing.\nsetIsParent(false);appendChild(textNative,tNode,lView);}", "function appendText(text, element, includeBreakBefore) {\n if (includeBreakBefore) {\n appendChild(element, \"br\");\n }\n element.appendChild(document.createTextNode(text));\n }", "function injectTextNode(parentElement, first, index, data) {\n\t\ttry {\n\t\t\tinsertNode(parentElement, first, index)\n\t\t\tfirst.nodeValue = data\n\t\t} catch (e) {\n\t\t\t// IE erroneously throws error when appending an empty text node\n\t\t\t// after a null\n\t\t}\n\t}", "function setTextContent(node, text) {\n node[0].children[0].data = text;\n}", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function createElement(element, text, parent){\n var element = document.createElement(element);\n element.style.textAlign = \"center\";\n var text = document.createTextNode(text);\n element.appendChild(text);\n parent.appendChild(element);\n}", "function createText (pai,texto) { \r\n\tvar t = document.createTextNode(texto); \r\n\tpai.appendChild(t); \r\n }", "append(word) {\n //let container = document.getElementById(this.id);\n this.container.insertAdjacentHTML(\"beforeend\", WordListOutput.createElement(word));\n }", "_addText(nodes, textPiece, interpolationSpan) {\n if (textPiece.text.length > 0) {\n // No need to add empty strings\n const stringSpan = getOffsetSourceSpan(interpolationSpan, textPiece);\n nodes.push(new Text$1(textPiece.text, stringSpan));\n }\n }", "_addText(nodes, textPiece, interpolationSpan) {\n if (textPiece.text.length > 0) {\n // No need to add empty strings\n const stringSpan = getOffsetSourceSpan(interpolationSpan, textPiece);\n nodes.push(new Text$1(textPiece.text, stringSpan));\n }\n }", "appendText(text, location) {\n this.dom.getActive().appendText(text, location);\n }", "function addElement(element, content, parent) {\r\n var newEl = document.createElement(element);\r\n var newContent = document.createTextNode(content);\r\n newEl.appendChild(newContent);\r\n parent.appendChild(newEl);\r\n return newEl;\r\n}", "function createText(text) {\n return document.createTextNode(text);\n }", "function createText(text) {\n return document.createTextNode(text);\n }", "append(child) {\n \n if(child instanceof String || child instanceof HTMLElement) {\n let newNode = new DOMNodeCollection(child);\n this.nodes.forEach((node) => {\n node.innerHTML += newNode\n })\n } else {\n this.nodes.forEach((node) => {\n node.innerHTML += child\n })\n }\n }", "function appendHeading(domParent, text) {\n\tvar heading = document.createElement('h3');\n\theading.className = 'sub-banner';\n\theading.appendChild(document.createTextNode(text));\n\tdomParent.appendChild(heading);\n}", "addText(text) {\n let nodes = this.top().content, last = nodes[nodes.length - 1]\n let node = this.schema.text(text, this.marks), merged\n if (last && (merged = maybeMerge(last, node))) nodes[nodes.length - 1] = merged\n else nodes.push(node)\n }", "add(own, text){\n var line = document.createElement('p');\n var newBub = document.createElement('chat-bubble');\n newBub.msg=text;\n newBub.owner=own;\n this.shadowRoot.appendChild(newBub);\n }", "createElement (text) {\n this.text = text\n return html`<h1>${text}</h1>`\n }", "function addText(element, message) {\n\tconst newPara = document.createElement('p')\n\tconst newParaText = document.createTextNode(message)\n\tnewPara.appendChild(newParaText)\n\telement.appendChild(newPara)\n}", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n }", "function addContentNode(document, content, parent)\n\t{\n\t\tvar anon = new docNode(3, document);\n\t\tif (parent.tagName == 'SPAN')\n\t\t\tanon.nodeValue = content;\n\t\telse\n\t\t\tanon.nodeValue = content.trim();\n\t\t\n\t\tanon.index = document.nodes.length;\n\t\tanon.parentIndex = parent.index;\n\t\tdocument.nodes.push(anon);\n\t\treturn anon;\n\t}", "domTextContent(value, el, child, childClass) {\n if (!value || !el) return; // [1]\n\n const domEl = document.querySelector(el);\n\n if (!domEl) return; // [3]\n\n if (child) {\n const childEl = this.domCreateElement(child);\n\n if (childClass) childEl.classList = childClass;\n childEl.textContent = value;\n\n domEl.appendChild(childEl);\n return;\n };\n\n domEl.textContent = value; // [4]\n }", "function createAndAppendElements(element, classname, text, dataset, parent) {\n\n let childElement = document.createElement(element)\n\n childElement.className = classname\n\n let parentElement = parent.appendChild(childElement)\n\n if (text) {\n childElement.textContent = text\n }\n if (dataset) {\n childElement.setAttribute(`data-id`, dataset)\n }\n return parentElement\n}", "function addText(event){\n var p = document.createElement(\"p\")\n p.innerText = 'Hello world'\n var div = document.getElementById(\"task2a\")\n div.appendChild(p)\n}", "function setText(node, text) {\n if (node.hasChildNodes() && node.firstChild.nodeType == Node.TEXT_NODE) {\n node.firstChild.nodeValue = text;\n } else {\n addText(node, text);\n }\n}", "function newChildNode(parent, child, content, ident){\n let cell = document.createElement(child);\n if (ident){cell.id = ident;}\n cell.innerText = content;\n parent.appendChild(cell);\n}", "function appendNode(parent, node) {\n\n // Handle the replacement based on the type\n if (isElement(node) == true)\n parent.appendChild(node);\n else {\n var el = document.createElement(\"div\");\n el.innerHTML = node;\n\n var nodes = [];\n\n // Populate the nodes\n for (var i = 0; i < el.childNodes.length; i++)\n nodes.push(el.childNodes[i]);\n\n // Insert all the nodes\n for (i = 0; i < nodes.length; i++)\n parent.appendChild(nodes[i]);\n\n }\n\n // Return\n return;\n\n }", "function addTextElement(tag, attribute, value, container, text) {\n var element = document.createElement(tag);\n element.setAttribute(attribute, value);\n container.appendChild(element);\n element.textContent = text;\n return element;\n}", "addText(value) {\n let textElement = new TextElement(value, this._xPos, this._yPos, this._width, this._height, this._line);\n this._textLines.push(textElement);\n this._line += 1;\n return textElement;\n }", "function $t(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}", "function addElement(tag, container, text) {\n var element = document.createElement(tag);\n container.appendChild(element);\n element.textContent = text;\n return element;\n}", "function insertText() {\n\t\t\tconst addTextAgain = document.createElement(\"p\");\n\t\t\tdocument.body.appendChild(addTextAgain);\n\n\t\t\tconst textP = document.createTextNode (\"Voy en medio!\");\n\t\t\taddTextAgain.innerHTML += textP;\n}", "function addHumanText(text) {\r\n const chatContainer = document.createElement(\"div\");\r\n chatContainer.classList.add(\"chat-container\");\r\n const chatBox = document.createElement(\"p\");\r\n chatBox.classList.add(\"voice2text\");\r\n const chatText = document.createTextNode(text);\r\n chatBox.appendChild(chatText);\r\n chatContainer.appendChild(chatBox);\r\n return chatContainer;\r\n}", "function addHumanText(text) {\n //creating a div containing this window\n const chatContainer = document.createElement(\"div\");\n chatContainer.classList.add(\"chat-container\");\n //creating a <p> inside the div\n const chatBox = document.createElement(\"p\");\n chatBox.classList.add(\"voice2text\");\n //creating a text element and appending it to paragraph\n const chatText = document.createTextNode(text);\n chatBox.appendChild(chatText)\n //appending whole to a div, and returning it\n chatContainer.appendChild(chatBox)\n return chatContainer;\n}", "function addHtmlAndAppend(parent, child, html){\n parent.innerHTML = \"\";\n child.innerHTML = html;\n parent.appendChild(child);\n}", "function TTextNode() {}", "function TTextNode() {}", "function TTextNode() {}", "function TTextNode(){}", "function text(x) {\n return document.createTextNode(x);\n }", "function replaceNodeByText(node, text){\n\n node.parentNode.replaceChild( document.createTextNode(text), node );\n\n}", "appendChild(child) {\n this.childNodes.push(child);\n }", "function addTextBlock(element) {\n element\n .append('text')\n .classed('text', true)\n .attr('text-anchor', 'middle');\n }", "function createTextElement(place, parent) {\n var subDiv = document.createElement(\"div\");\n subDiv.classList.add(\"restaurantText\");\n var openingTimeElem = document.createElement(\"p\");\n var adressElem = document.createElement(\"p\");\n\n openingTimeElem.innerText = \"Åpen: \" + getOpeningHours(place);\n adressElem.innerText = \"Adr: \" + formatAddress(place);\n subDiv.appendChild(adressElem);\n subDiv.appendChild(openingTimeElem);\n parent.appendChild(subDiv);\n}", "appendText(append)\n\t{\n\t\tthis.setText(this.getText() + append);\n\t}", "function createElements(elementName, innerText, parentId){\r\n var node = document.createElement(elementName);\r\n var textNode = document.createTextNode(innerText);\r\n node.appendChild(textNode);\r\n document.getElementById(parentId).appendChild(node);\r\n}", "function displayText2() {\n let t1 = createElement('span', 'TEXT 2 (yeah) <br>');\n t1.parent('text2');\n t1.class('large'); \n}", "function addGameWorldText(text)\n{\n var gameWorldTextEl = document.getElementById('game-world-text');\n\n var newEl = document.createElement('div');\n newEl.innerHTML = text;\n\n gameWorldTextEl.appendChild(newEl);\n}", "function addGameWorldText(text)\n{\n var gameWorldTextEl = document.getElementById('game-world-text');\n\n var newEl = document.createElement('div');\n newEl.innerHTML = text;\n\n gameWorldTextEl.appendChild(newEl);\n}", "function addTextToDom(text, id) {\n var element = document.getElementById(id);\n element.innerText = text;\n}", "function createTextElm(type, text) {\r\n var elm = document.createElement(type);\r\n var t = document.createTextNode(text);\r\n elm.appendChild(t);\r\n return elm;\r\n}", "function textElement(text) {\n let element = document.createElement('span');\n element.innerText = text;\n return element;\n}", "function TextNode(text) {\n this.text = text;\n}", "function TextNode(text) {\n this.text = text;\n}", "function appendText(){\n\n let txt1 = \"<p>text</p>\"; //using HTML\n let txt2 = document.createElement(\"p\"); //using DOM\n txt2.innerHTML = \"text\"; \n let txt3 = $(\"<p></p>\").text(\"text\"); //using Jquery\n $(\"body\").append(txt1, txt2, txt3);\n // $(\"body\").prepend(txt1, txt2, txt3);\n\n}", "function addPara(parent, text) {\n const p = document.createElement('p');\n addText(p, text);\n parent.appendChild(p);\n return p;\n }", "appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n }", "function addTextLabel(root,node){var domNode=root.append(\"text\");var lines=processEscapeSequences(node.label).split(\"\\n\");for(var i=0;i<lines.length;i++){domNode.append(\"tspan\").attr(\"xml:space\",\"preserve\").attr(\"dy\",\"1em\").attr(\"x\",\"1\").text(lines[i])}util.applyStyle(domNode,node.labelStyle);return domNode}", "function insertText(place, text) {\n\treturn place.appendChild(document.createTextNode(text));\n}", "function addChild(type, html, element) {\r\n let child = document.createElement(type);\r\n child.innerHTML = html;\r\n element.appendChild(child);\r\n}", "function createNode(type, child) {\n var node = document.createElement(type);\n \n if(typeof child === \"string\") {\n var text = document.createTextNode(child);\n node.appendChild(text);\n } else {\n node.appendChild(child);\n }\n \n return node;\n}", "function appendItem(item){\r\n\t//create paragraph node\r\n\tlet node = document.createElement(\"P\");\r\n\t//create text node and append to newly created P element\r\n\tlet textNode = document.createTextNode(item);\r\n\tnode.appendChild(textNode);\r\n\t//append to cipher-text div\r\n\tdocument.getElementById('cipher-text').appendChild(node);\r\n}", "function textContent(input) {\n var element = document.createElement(\"div\");\n var b = document.createElement(\"b\");\n \n b.textContent = input;\n \n \n element.appendChild(b);\n \n return element\n }", "function newElement(elementType, parent, content) {\n var newEl = document.createElement(elementType);\n newEl.textContent = content;\n parent.appendChild(newEl);\n}", "function addText(divID, text){\n var theDiv = document.getElementById(divID);\n theDiv.innerHTML = \"\";\n var content = document.createTextNode(text);\n theDiv.appendChild(content);\n}", "function pushTextNode(list, html, level, start, ignoreWhitespace, ignoreCollapse) {\n // calculate correct end of the content slice in case there's\n // no tag after the text node.\n var end = html.indexOf('<', start);\n var content = html.slice(start, end === -1 ? undefined : end); // if a node is nothing but whitespace, collapse it as the spec states:\n // https://www.w3.org/TR/html4/struct/text.html#h-9.1\n\n if (!ignoreCollapse && /^\\s*$/.test(content)) {\n content = ' ';\n } // don't add whitespace-only text nodes if they would be trailing text nodes\n // or if they would be leading whitespace-only text nodes:\n // * end > -1 indicates this is not a trailing text node\n // * leading node is when level is -1 and list has length 0\n\n\n if (!ignoreWhitespace && end > -1 && level + list.length >= 0 || content !== ' ') {\n list.push({\n type: 'text',\n content: content\n });\n }\n }", "function addNode(term, text, attr, fore, back) {\n if (text.length == 0) {\n return;\n } \n\n var node = document.createElement('pre');\n node.classList = 'term-char';\n node.innerText = text;\n node.style.color = fore;\n node.style.backgroundColor = back;\n node.style.width = (term.charWidth * text.length) + 'px';\n\n var textDecoration = \"\";\n if (attr & 1) {\n node.style.fontWeight = 'bold';\n node.style.letterSpacing = term.boldWidthAdjust + \"px\";\n }\n if (attr & 2) {\n node.style.fontStyle = 'italic';\n }\n if (attr & 4) {\n textDecoration += 'underline ';\n }\n if (attr & 8) {\n textDecoration += 'line-through'\n }\n node.style.textDecoration = textDecoration;\n\n rowNode.appendChild(node);\n }", "static appendChild(parent, child) {\n if (child) parent.appendChild(child);\n return parent;\n }" ]
[ "0.75390196", "0.7485944", "0.7428857", "0.7399418", "0.7334137", "0.729842", "0.7040578", "0.69747484", "0.68196267", "0.65345156", "0.65172166", "0.64877063", "0.64845026", "0.64551485", "0.64551485", "0.6448808", "0.64404726", "0.64404726", "0.64386183", "0.64048034", "0.6387788", "0.6387788", "0.6345893", "0.6337044", "0.63354397", "0.63334584", "0.629493", "0.62918264", "0.6290735", "0.62837744", "0.6283685", "0.6283685", "0.6283685", "0.6283685", "0.6283685", "0.6283685", "0.6229174", "0.6222437", "0.62201554", "0.61949193", "0.61949193", "0.6188601", "0.6173374", "0.6165989", "0.6165989", "0.6157265", "0.61294234", "0.6113449", "0.6106098", "0.60645926", "0.605695", "0.60522914", "0.6049576", "0.6032032", "0.6019487", "0.60084057", "0.60082746", "0.6006641", "0.5993184", "0.59778976", "0.5976912", "0.5969876", "0.59631854", "0.5954823", "0.5937076", "0.59334594", "0.5915494", "0.5911439", "0.5911439", "0.5911439", "0.58841944", "0.58827496", "0.58822125", "0.5876821", "0.58718026", "0.58714235", "0.5864649", "0.5853342", "0.58511865", "0.5839505", "0.5839505", "0.5820653", "0.5809147", "0.5806122", "0.58050454", "0.58050454", "0.580172", "0.5799706", "0.5796611", "0.57910186", "0.57788736", "0.57696766", "0.5768314", "0.57647663", "0.57546127", "0.5749287", "0.57275563", "0.57189214", "0.5716108", "0.57124704" ]
0.7488636
1
Append xtimes of break(s) as child node(s) to node.
function appendBreakChild(xtimes, node) { // Check input. if ( xtimes === undefined || xtimes === null || node === undefined || node === null) { return null; } var i = 0; // Create xtimes number of breaks. do { node.appendChild(document.createElement("br")); i++; } while ( i < xtimes); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thematicBreak(ctx, node, index, parent) {\n var macro = ctx.thematicBreak || defaultMacro;\n return macro(node);\n}", "function breakNode(root, into) {\n\n\t\tlet line = createLine()\n\n\t\tlet nodes = root.childNodes\n\n\t\tlet lastWordR = null\n\t\tlet lastWordB = null\n\n\t\tfor (let i = 0; i < nodes.length; i++) {\n\n\t\t\tlet node = nodes[i]\n\t\t\tlet name = nodes[i].tagName\n\t\t\tlet type = nodes[i].nodeType\n\n\t\t\tlet copy = node.cloneNode(true)\n\n\t\t\tif (type == Node.TEXT_NODE) {\n\t\t\t\tline.appendChild(copy)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif (type == Node.ELEMENT_NODE) {\n\n\t\t\t\tlet bounds = nodes[i].getBoundingClientRect()\n\n\t\t\t\tlet t = bounds.top\n\t\t\t\tlet l = bounds.left\n\t\t\t\tlet w = bounds.width\n\t\t\t\tlet h = bounds.height\n\n\t\t\t\tlet wordL = l\n\t\t\t\tlet wordR = l + w\n\t\t\t\tlet wordB = t + h\n\n\t\t\t\tif (lastWordR == null) {\n\t\t\t\t\tlastWordR = wordR\n\t\t\t\t}\n\n\t\t\t\tif (lastWordB == null) {\n\t\t\t\t\tlastWordB = wordB\n\t\t\t\t}\n\n\t\t\t\tif (name == 'BR') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (wordL < lastWordR &&\n\t\t\t\t\twordB > lastWordB) {\n\t\t\t\t\tinto.appendChild(line)\n\t\t\t\t\tline = createLine()\n\t\t\t\t}\n\n\t\t\t\tlastWordR = wordR\n\t\t\t\tlastWordB = wordB\n\n\t\t\t\tline.appendChild(copy)\n\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif (line.parentNode == null) {\n\t\t\tinto.appendChild(line)\n\t\t}\n\t}", "function breakNodes() {\n var startPath = new ElementPath(startNode.parent()),\n endPath = new ElementPath(endNode.parent()),\n breakStart = NULL,\n breakEnd = NULL;\n for (var i = 0; i < startPath.elements.length; i++) {\n var element = startPath.elements[ i ];\n\n if (element == startPath.block ||\n element == startPath.blockLimit)\n break;\n\n if (me.checkElementRemovable(element))\n breakStart = element;\n }\n for (i = 0; i < endPath.elements.length; i++) {\n element = endPath.elements[ i ];\n\n if (element == endPath.block ||\n element == endPath.blockLimit)\n break;\n\n if (me.checkElementRemovable(element))\n breakEnd = element;\n }\n\n if (breakEnd)\n endNode._4e_breakParent(breakEnd);\n if (breakStart)\n startNode._4e_breakParent(breakStart);\n }", "function hardBreak(h, node) {\n return [h(node, 'br'), u('text', '\\n')];\n}", "function addBreak() {\n setBreakTime(prevTime => prevTime < 15 ? prevTime + 1 : prevTime);\n }", "function lineBreak(node) {\n addElement(node, \"br\");\n}", "function thematicBreak(h, node) {\n return h(node, 'hr');\n}", "addLineBreak () {\n const spaces = Array.from(document.querySelectorAll('#phrase li.space'));\n spaces.forEach(space => space.classList.remove('break'));\n while (spaces.some(space => (space.offsetLeft + 15) >= innerWidth)) {\n const reference = spaces.find(space => (space.offsetLeft + 15) >= innerWidth);\n if (reference) {\n const refIndex = spaces.indexOf(reference);\n const breakSpot = spaces[refIndex - 1];\n if (breakSpot) {\n breakSpot.classList.contains('break') ? spaces[refIndex].classList.add('break') : breakSpot.classList.add('break');\n } else break;\n }\n };\n if (document.querySelector('#phrase li:last-child').offsetLeft + 65 >= innerWidth &&\n spaces[spaces.length - 1]) {\n spaces[spaces.length - 1].classList.add('break');\n }\n }", "function pad(nodes) {\n var tail = nodes[nodes.length - 1]\n\n if (typeof tail === 'string' && tail.charAt(tail.length - 1) === '\\n') {\n nodes.push(h('br', {key: 'break'}))\n }\n\n return nodes\n }", "function insertLineBreaks() {\n var el = d3.select(this);\n var words=d3.select(this).text().split('#');\n \n el.text('');\n \n for (var i = 0; i < words.length; i++) {\n var tspan = el.append('tspan').text(words[i]);\n if (i > 0) {\n tspan.attr('x', 0).attr('dy', '15');\n }\n };\n }", "function killBreaks(e) {\n e.innerHTML = e.innerHTML.replace(regexps.killBreaksRe, '<br />');\n}", "function VMAPAdBreak(xml) {\n\t var j = void 0;\n\t var k = void 0;\n\t var len = void 0;\n\t var len1 = void 0;\n\t var node = void 0;\n\t var ref1 = void 0;\n\t var subnode = void 0;\n\t var pseudoVast = {};\n\t this.timeOffset = xml.getAttribute('timeOffset');\n\t this.breakType = xml.getAttribute('breakType');\n\t pseudoVast.breakType = this.breakType;\n\t this.breakId = xml.getAttribute('breakId');\n\t this.repeatAfter = xml.getAttribute('repeatAfter');\n\t this.adSource = null;\n\t this.trackingEvents = [];\n\t var ref = xml.childNodes;\n\t for (j = 0, len = ref.length; j < len; j += 1) {\n\t node = ref[j];\n\t switch (node.localName) {\n\t case 'AdSource':\n\t this.adSource = new VMAPAdSource(node);\n\t break;\n\t case 'TrackingEvents':\n\t ref1 = node.childNodes;\n\t for (k = 0, len1 = ref1.length; k < len1; k += 1) {\n\t subnode = ref1[k];\n\t if (subnode.localName === 'Tracking') {\n\t this.trackingEvents.push({\n\t event: subnode.getAttribute('event'),\n\t uri: (subnode.textContent || subnode.text || '').trim()\n\t });\n\t }\n\t }\n\t break;\n\t case 'Extensions':\n\t if (node.childNodes[1].tagName === 'vmap:Extension') {\n\t this.extensions = {};\n\t this.extensions.type = node.childNodes[1].getAttribute('type');\n\t this.extensions.supress_bumper = node.childNodes[1].getAttribute('suppress_bumper') === 'true';\n\t } else {\n\t this.extensions = null;\n\t }\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t if (typeof this.extensions !== 'undefined' && this.extensions.type === 'bumper') {\n\t pseudoVast.bumper = true;\n\t }\n\t if (this.adSource.adTagURI.templateType === 'vast3' && this.adSource.adTagURI.uri) {\n\t pseudoVast.url = this.adSource.adTagURI.uri;\n\t }\n\t switch (this.timeOffset) {\n\t case 'start':\n\t {\n\t pseudoVast.time = 0;\n\t Vast.vastArray.push(pseudoVast); // eslint-disable-line no-use-before-define\n\t break;\n\t }\n\t case 'end':\n\t {\n\t pseudoVast.time = 'end';\n\t Vast.vastArray.push(pseudoVast); // eslint-disable-line no-use-before-define\n\t break;\n\t }\n\t default:\n\t {\n\t var arrTime = this.timeOffset.split(':');\n\t var msTime = 0;\n\t msTime = arrTime[0] * 60 * 60 + arrTime[1] * 60 + Math.floor(arrTime[2]);\n\t pseudoVast.time = msTime;\n\t Vast.vastArray.push(pseudoVast); // eslint-disable-line no-use-before-define\n\t break;\n\t }\n\t }\n\t}", "function addBreak() {\n message.setBreak( true );\n}", "function addOneToBreakTimer() {\n\tbreakTimer = breakTimer + 1;\n \n document.getElementById(\"break\").innerHTML = breakTimer;\n}", "function forceBreakContent( node ) {\n\treturn forceBreakChildren( node ) || ( node.type === 'element' && node.children.length !== 0 && ( [ 'body', 'script', 'style' ].includes( node.name ) || node.children.some( ( child ) => hasNonTextChild( child ) ) ) ) || ( node.firstChild && node.firstChild === node.lastChild && hasLeadingLineBreak( node.firstChild ) && ( ! node.lastChild.isTrailingSpaceSensitive || hasTrailingLineBreak( node.lastChild ) ) );\n}", "function createBreakLine() {\n const breakLine = document.createElement('br');\n return breakLine;\n}", "function forceBreakContent(node) {\n return forceBreakChildren(node) || node.type === \"element\" && node.children.length !== 0 && ([\"body\", \"script\", \"style\"].includes(node.name) || node.children.some(child => hasNonTextChild(child))) || node.firstChild && node.firstChild === node.lastChild && node.firstChild.type !== \"text\" && hasLeadingLineBreak(node.firstChild) && (!node.lastChild.isTrailingSpaceSensitive || hasTrailingLineBreak(node.lastChild));\n}", "AdjustBreakTime(i) {\n console.log(\"adjusting break time\");\n this.BreakTime = this._adjustTime(this.BreakTime,i);\n if (this.mode===\"BREAK\") {\n this._initBreakTimer();\n }\n }", "function appendLineBreak(parent){\n let linebreak = document.createElement(\"br\");\n parent.appendChild(linebreak);\n}", "function brToSoftBreakAtom(node, builder, {addMarkerable, nodeFinished}) {\n if (node.nodeType !== 1 || node.tagName !== 'BR') {\n return;\n }\n\n let softReturn = builder.createAtom('soft-return');\n addMarkerable(softReturn);\n\n nodeFinished();\n }", "function br (ctx, node) {\n const macro = ctx.break ? ctx.break : defaultMacro\n return macro(node)\n}", "function startBreak() {\n isWork = false;\n timerVal.textContent = break_time.textContent;\n runInterval();\n }", "function startBreak(){\n //set that user is on a break\n isOnBreak = true;\n breakNumber = breakNow + 1;\n breakNow = breakNumber;\n if(breakNow !== 3) {\n //short break time\n itsTimeFor.text('Just a short break.');\n minutes.text('00');\n seconds.text('06');\n }\n else {\n //long break time\n itsTimeFor.text('You get a longer break!');\n minutes.text('00');\n seconds.text('07');\n breakNow = 0;\n }\n breakButton.hide();\n startTimer();\n }", "function addRootSizeForEachBreakpoints(atrule, breaks) {\n breaks.reverse().map((_, index) => {\n const nextIndex = index + 1;\n const prevIndex = index - 1;\n\n if (index !== 0 && breaks[nextIndex]) {\n const currentRoot = breaks[index].root;\n const prevRoot = breaks[nextIndex].root;\n const rootDiff = currentRoot - prevRoot;\n\n const nextBreak = parseFloat(breaks[prevIndex].value);\n const currentBreak = parseFloat(breaks[index].value);\n const breaksDiff = nextBreak - currentBreak;\n const root = percentage(prevRoot);\n const breakpoint = toEm(currentBreak);\n\n const fontSize = fontSizeProp(\n `calc(${root} + ${rootDiff} * ((100vw - ${breakpoint}) / ${breaksDiff}))`,\n );\n const rootSelector = makeRootProp(atrule.parent).append(fontSize);\n\n return atrule.parent.after(\n mediaQuery(breaks[index].value).append(rootSelector),\n );\n }\n\n if (index === 0) {\n const root = percentage(breaks[index].root);\n const fontSize = fontSizeProp(root);\n const rootSelector = makeRootProp(atrule.parent).append(fontSize);\n\n return atrule.parent.after(\n mediaQuery(breaks[index].value).append(rootSelector),\n );\n }\n });\n}", "function addChildSpacing(wt) {\n var d = 0, modsumdelta = 0; \n for (var i = 0; i < wt.num_children; i++) { \n d += wt.children[i].shift; \n modsumdelta += d + wt.children[i].change; \n wt.children[i].mod += modsumdelta; \n } \n }", "function setBreak(breakT){\n breakTime = breakT*60;\n }", "function fakeContent() {\n var text = \" \";\n var interval = 13;\n var i;\n for (i = 0; i < interval; i++) {\n text +=\"<br>\";\n }\n document.getElementById(\"fakecont\").innerHTML = text;\n}", "function addTimerBreakPoint(breakTimeString, breakTimeLabel) {\n\t\tvar breakpointObject = document.createElement(\"div\");\n\t\tbreakpointObject.style.position = \"relative\";\n\t\tbreakpointObject.style.width = \"auto\";\n\t\t// breakpointObject.style.height = \"30px\";\n\t\tbreakpointObject.style.borderBottom = \"1px dashed #BBBBBB\";\n\t\t// breakpointObject.style.borderTop = \"1px solid red\";\n\n\t\tbreakpointObject.style.fontFamily = \"sans-serif\";\n\t\tbreakpointObject.style.fontSize = \"20px\";\n\t\tbreakpointObject.style.paddingTop = \"4px\";\n\t\tbreakpointObject.style.paddingBottom = \"3px\";\n\t\tbreakpointObject.style.paddingLeft = \"4px\";\n\n\t\tbreakpointObject.innerHTML = breakTimeString;\n\t\ttimerBreakPointsBox.appendChild(breakpointObject);\n\n\t\tvar breakpointLabel = document.createElement(\"div\");\n\t\tbreakpointLabel.style.position = \"absolute\";\n\t\tbreakpointLabel.style.top = \"4px\";\n\t\tbreakpointLabel.style.left = \"80px\";\n\t\tbreakpointLabel.style.fontSize = \"10px\";\n\t\tbreakpointLabel.innerHTML = breakTimeLabel;\n\t\tbreakpointObject.appendChild(breakpointLabel);\n\t}", "function insertFF56EndGapSep (parentBN) {\r\n let children = parentBN.children;\r\n let len = children.length;\r\n let BN = children[len-1]; // Is there since we just inserted it\r\n sendAddonMsgComplex({\r\n\tsource: \"background\",\r\n\tcontent: \"bkmkCreated\",\r\n\tnewtree: BN_serialize(BN),\r\n\tindex: len-1\r\n });\r\n}", "function newChildNode(parent, child, content, ident){\n let cell = document.createElement(child);\n if (ident){cell.id = ident;}\n cell.innerText = content;\n parent.appendChild(cell);\n}", "function evaluateBreakStatement({ environment, reporting, node }) {\n setInLexicalEnvironment({ env: environment, path: BREAK_SYMBOL, value: true, reporting, node });\n}", "function linebreak(text) {\n text.each(function() {\n var text = d3.select(this),\n words = text.text().split(/\\n/).reverse(),\n word,\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = text.attr(\"y\"),\n x = text.attr(\"x\"),\n dx = text.attr(\"dx\"),\n dy = 0.3 - (words.length-1)*lineHeight*0.5; //ems\n text.text(null);\n while (word = words.pop()) {\n tspan = text.append(\"tspan\").attr(\"dx\",dx).attr(\"x\", x).attr(\"y\", y).attr(\"dy\", lineNumber++ * lineHeight + dy + \"em\").text(word);\n }\n });\n }", "logBreak(node, typescript) {\n if (this.logLevel < 30 /* DEBUG */)\n return;\n console.log(`${chalk.yellow(`break`)} encountered within ${chalk.yellow(stringifySyntaxKind(node.kind, typescript))}`);\n }", "function JSXClosingElement(node, print) {\n\t this.push(\"</\");\n\t print.plain(node.name);\n\t this.push(\">\");\n\t}", "function JSXClosingElement(node, print) {\n\t this.push(\"</\");\n\t print.plain(node.name);\n\t this.push(\">\");\n\t}", "function startBreak() {\n stopTimer();\n var duration;\n if (Vars.PomoSetCounter == Vars.UserData.PomoSetNum) {\n duration = 60 * Vars.UserData.LongBreakDuration\n } else {\n duration = 60 * Vars.UserData.BreakDuration;\n }\n stopTimer();\n Vars.TimerRunnig = true;\n Vars.onBreak = true;\n startTimer(duration, duringBreak, breakEnds);\n}", "enterBreak_stmt(ctx) {\n\t}", "function breakAfter(lineEndNode) {\n // If there's nothing to the right, then we can skip ending the line\n // here, and move root-wards since splitting just before an end-tag\n // would require us to create a bunch of empty copies.\n while (!lineEndNode.nextSibling) {\n lineEndNode = lineEndNode.parentNode;\n if (!lineEndNode) { return; }\n }\n \n function breakLeftOf(limit, copy) {\n // Clone shallowly if this node needs to be on both sides of the break.\n var rightSide = copy ? limit.cloneNode(false) : limit;\n var parent = limit.parentNode;\n if (parent) {\n // We clone the parent chain.\n // This helps us resurrect important styling elements that cross lines.\n // E.g. in <i>Foo<br>Bar</i>\n // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.\n var parentClone = breakLeftOf(parent, 1);\n // Move the clone and everything to the right of the original\n // onto the cloned parent.\n var next = limit.nextSibling;\n parentClone.appendChild(rightSide);\n for (var sibling = next; sibling; sibling = next) {\n next = sibling.nextSibling;\n parentClone.appendChild(sibling);\n }\n }\n return rightSide;\n }\n \n var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);\n \n // Walk the parent chain until we reach an unattached LI.\n for (var parent;\n // Check nodeType since IE invents document fragments.\n (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {\n copiedListItem = parent;\n }\n // Put it on the list of lines for later processing.\n listItems.push(copiedListItem);\n }", "function breakAfter(lineEndNode) {\n // If there's nothing to the right, then we can skip ending the line\n // here, and move root-wards since splitting just before an end-tag\n // would require us to create a bunch of empty copies.\n while (!lineEndNode.nextSibling) {\n lineEndNode = lineEndNode.parentNode;\n if (!lineEndNode) { return; }\n }\n \n function breakLeftOf(limit, copy) {\n // Clone shallowly if this node needs to be on both sides of the break.\n var rightSide = copy ? limit.cloneNode(false) : limit;\n var parent = limit.parentNode;\n if (parent) {\n // We clone the parent chain.\n // This helps us resurrect important styling elements that cross lines.\n // E.g. in <i>Foo<br>Bar</i>\n // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.\n var parentClone = breakLeftOf(parent, 1);\n // Move the clone and everything to the right of the original\n // onto the cloned parent.\n var next = limit.nextSibling;\n parentClone.appendChild(rightSide);\n for (var sibling = next; sibling; sibling = next) {\n next = sibling.nextSibling;\n parentClone.appendChild(sibling);\n }\n }\n return rightSide;\n }\n \n var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);\n \n // Walk the parent chain until we reach an unattached LI.\n for (var parent;\n // Check nodeType since IE invents document fragments.\n (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {\n copiedListItem = parent;\n }\n // Put it on the list of lines for later processing.\n listItems.push(copiedListItem);\n }", "function createBreakPoint(e, f) {\n const breakpointHeight = e.offsetHeight;\n const csstext = `height:${breakpointHeight}px;display:block;width:100%;clear:both;`;\n const breakpointElement = document.createElement('div');\n breakpointElement.setAttribute('insertedbreakpoint','true');\n breakpointElement.style.cssText = csstext;\n const breakpointSpace = document.createTextNode(' ');\n breakpointElement.appendChild(breakpointSpace);\n f.parentNode.insertBefore(breakpointElement, f);\n}", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n } // Get maximum text", "function JSXClosingElement(node, print) {\n this.push(\"</\");\n print.plain(node.name);\n this.push(\">\");\n}", "function reduceBreak() {\n setBreakTime(prevTime => prevTime > 1 ? prevTime - 1 : prevTime);\n }", "function break_up_node(read_node, $write_context) {\n \n // check type to determine how to break it\n if (read_node.nodeType == Node.TEXT_NODE) {\n \n // text nodes get chopped up by words\n $write_context = write_text_to_column($(read_node), $write_context);\n \n } else {\n \n // put an empty clone of it in the column (the same one the whole didn't fit into)\n // and trigger the recursion.\n var $write_sub_context = $(read_node).clone().empty().appendTo($write_context);\n $write_context = walk_read_nodes($(read_node), $write_sub_context);\n }\n return $write_context;\n }", "function split($putInHere, $pullOutHere, $parentColumn, targetHeight) {\n if ($putInHere.contents(':last').\n find(prefixTheClassName('columnbreak', true)).length) {\n //\n // our column is on a column break, so just end here\n return;\n }\n if ($putInHere.contents(':last').\n hasClass(prefixTheClassName('columnbreak'))) {\n //\n // our column is on a column break, so just end here\n return;\n }\n if ($pullOutHere.contents().length) {\n var $cloneMe = $pullOutHere.contents(':first');\n //\n // make sure we're splitting an element\n if (typeof $cloneMe.get(0) == 'undefined' ||\n $cloneMe.get(0).nodeType != 1) return;\n\n //\n // clone the node with all data and events\n var $clone = $cloneMe.clone(true);\n //\n // need to support both .prop and .attr if .prop doesn't exist.\n // this is for backwards compatibility with older versions of jquery.\n if ($cloneMe.hasClass(prefixTheClassName('columnbreak'))) {\n //\n // ok, we have a columnbreak, so add it into\n // the column and exit\n appendSafe($putInHere, $clone);\n $cloneMe.remove();\n } else if (manualBreaks) {\n // keep adding until we hit a manual break\n appendSafe($putInHere, $clone);\n $cloneMe.remove();\n } else if ($clone.get(0).nodeType == 1 &&\n !$clone.hasClass(prefixTheClassName('dontend'))) {\n appendSafe($putInHere, $clone);\n if ($clone.is('img') && $parentColumn.height() < targetHeight +\n 20) {\n //\n // we can't split an img in half, so just add it\n // to the column and remove it from the pullOutHere section\n $cloneMe.remove();\n } else if ($cloneMe.hasClass(prefixTheClassName('dontsplit')) &&\n $parentColumn.height() < targetHeight + 20) {\n //\n // pretty close fit, and we're not allowed to split it, so just\n // add it to the column, remove from pullOutHere, and be done\n $cloneMe.remove();\n } else if ($clone.is('img') ||\n $cloneMe.hasClass(prefixTheClassName('dontsplit'))) {\n //\n // it's either an image that's too tall, or an unsplittable node\n // that's too tall. leave it in the pullOutHere and we'll add it to the\n // next column\n $clone.remove();\n } else {\n //\n // ok, we're allowed to split the node in half, so empty out\n // the node in the column we're building, and start splitting\n // it in half, leaving some of it in pullOutHere\n $clone.empty();\n if (!columnize($clone, $cloneMe, $parentColumn, targetHeight)) {\n // this node may still have non-text nodes to split\n // add the split class and then recur\n $cloneMe.addClass(prefixTheClassName('split'));\n\n //if this node was ol element, the child should continue the number ordering\n if ($cloneMe.get(0).tagName == 'OL') {\n var startWith = $clone.get(0).childElementCount +\n $clone.get(0).start;\n $cloneMe.attr('start', startWith + 1);\n }\n\n if ($cloneMe.children().length) {\n split($clone, $cloneMe, $parentColumn, targetHeight);\n }\n } else {\n // this node only has text node children left, add the\n // split class and move on.\n $cloneMe.addClass(prefixTheClassName('split'));\n }\n if ($clone.get(0).childNodes.length === 0) {\n // it was split, but nothing is in it :(\n $clone.remove();\n $cloneMe.removeClass(prefixTheClassName('split'));\n } else if ($clone.get(0).childNodes.length == 1) {\n // was the only child node a text node w/ whitespace?\n var onlyNode = $clone.get(0).childNodes[0];\n if (onlyNode.nodeType == 3) {\n // text node\n var nonwhitespace = /\\S/;\n var str = onlyNode.nodeValue;\n if (!nonwhitespace.test(str)) {\n // yep, only a whitespace textnode\n $clone.remove();\n // $cloneMe.removeClass(prefixTheClassName(\"split\"));\n }\n }\n }\n }\n }\n }\n }", "function startLongBreakTimer() {\n time = Date.now();\n timerEnd = time + LONG_BREAK_DURATION;\n setTimeout(refreshBreakTimer, UPDATE_TIMER_EVERY);\n updateTable(true);\n let buttons = document.getElementsByTagName(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n let button = buttons[i];\n button.setAttribute(\"disabled\", \"disabled\");\n }\n}", "function _addLineBreakBeforeAndAfter(node) {\n var doc = node.ownerDocument,\n nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), nextSibling);\n }\n if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), node);\n }\n }", "function _addLineBreakBeforeAndAfter(node) {\n var doc = node.ownerDocument,\n nextSibling = _getNextSiblingThatIsNotBlank(node),\n previousSibling = _getPreviousSiblingThatIsNotBlank(node);\n\n if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), nextSibling);\n }\n if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {\n node.parentNode.insertBefore(doc.createElement(\"br\"), node);\n }\n }", "function split($putInHere, $pullOutHere, $parentColumn, targetHeight){\n\t\t\tif($putInHere.contents(\":last\").find(prefixTheClassName(\"columnbreak\", true)).length){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($putInHere.contents(\":last\").hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($pullOutHere.contents().length){\n\t\t\t\tvar $cloneMe = $pullOutHere.contents(\":first\");\n\t\t\t\t//\n\t\t\t\t// make sure we're splitting an element\n\t\t\t\tif($cloneMe.get(0).nodeType != 1) return;\n\n\t\t\t\t//\n\t\t\t\t// clone the node with all data and events\n\t\t\t\tvar $clone = $cloneMe.clone(true);\n\t\t\t\t//\n\t\t\t\t// need to support both .prop and .attr if .prop doesn't exist.\n\t\t\t\t// this is for backwards compatibility with older versions of jquery.\n\t\t\t\tif($cloneMe.hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t\t//\n\t\t\t\t\t// ok, we have a columnbreak, so add it into\n\t\t\t\t\t// the column and exit\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if (manualBreaks){\n\t\t\t\t\t// keep adding until we hit a manual break\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if($clone.get(0).nodeType == 1 && !$clone.hasClass(prefixTheClassName(\"dontend\"))){\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\tif($clone.is(\"img\") && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// we can't split an img in half, so just add it\n\t\t\t\t\t\t// to the column and remove it from the pullOutHere section\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if(!$cloneMe.hasClass(prefixTheClassName(\"dontsplit\")) && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// pretty close fit, and we're not allowed to split it, so just\n\t\t\t\t\t\t// add it to the column, remove from pullOutHere, and be done\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if($clone.is(\"img\") || $cloneMe.hasClass(prefixTheClassName(\"dontsplit\"))){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// it's either an image that's too tall, or an unsplittable node\n\t\t\t\t\t\t// that's too tall. leave it in the pullOutHere and we'll add it to the \n\t\t\t\t\t\t// next column\n\t\t\t\t\t\t$clone.remove();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// ok, we're allowed to split the node in half, so empty out\n\t\t\t\t\t\t// the node in the column we're building, and start splitting\n\t\t\t\t\t\t// it in half, leaving some of it in pullOutHere\n\t\t\t\t\t\t$clone.empty();\n\t\t\t\t\t\tif(!columnize($clone, $cloneMe, $parentColumn, targetHeight)){\n\t\t\t\t\t\t\t// this node still has non-text nodes to split\n\t\t\t\t\t\t\t// add the split class and then recur\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t\tif($cloneMe.children().length){\n\t\t\t\t\t\t\t\tsplit($clone, $cloneMe, $parentColumn, targetHeight);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// this node only has text node children left, add the\n\t\t\t\t\t\t\t// split class and move on.\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($clone.get(0).childNodes.length === 0){\n\t\t\t\t\t\t\t// it was split, but nothing is in it :(\n\t\t\t\t\t\t\t$clone.remove();\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 split($putInHere, $pullOutHere, $parentColumn, targetHeight){\n\t\t\tif($putInHere.contents(\":last\").find(prefixTheClassName(\"columnbreak\", true)).length){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($putInHere.contents(\":last\").hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($pullOutHere.contents().length){\n\t\t\t\tvar $cloneMe = $pullOutHere.contents(\":first\");\n\t\t\t\t//\n\t\t\t\t// make sure we're splitting an element\n\t\t\t\tif($cloneMe.get(0).nodeType != 1) return;\n\n\t\t\t\t//\n\t\t\t\t// clone the node with all data and events\n\t\t\t\tvar $clone = $cloneMe.clone(true);\n\t\t\t\t//\n\t\t\t\t// need to support both .prop and .attr if .prop doesn't exist.\n\t\t\t\t// this is for backwards compatibility with older versions of jquery.\n\t\t\t\tif($cloneMe.hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t\t//\n\t\t\t\t\t// ok, we have a columnbreak, so add it into\n\t\t\t\t\t// the column and exit\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if (manualBreaks){\n\t\t\t\t\t// keep adding until we hit a manual break\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if($clone.get(0).nodeType == 1 && !$clone.hasClass(prefixTheClassName(\"dontend\"))){\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\tif($clone.is(\"img\") && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// we can't split an img in half, so just add it\n\t\t\t\t\t\t// to the column and remove it from the pullOutHere section\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if(!$cloneMe.hasClass(prefixTheClassName(\"dontsplit\")) && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// pretty close fit, and we're not allowed to split it, so just\n\t\t\t\t\t\t// add it to the column, remove from pullOutHere, and be done\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if($clone.is(\"img\") || $cloneMe.hasClass(prefixTheClassName(\"dontsplit\"))){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// it's either an image that's too tall, or an unsplittable node\n\t\t\t\t\t\t// that's too tall. leave it in the pullOutHere and we'll add it to the \n\t\t\t\t\t\t// next column\n\t\t\t\t\t\t$clone.remove();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// ok, we're allowed to split the node in half, so empty out\n\t\t\t\t\t\t// the node in the column we're building, and start splitting\n\t\t\t\t\t\t// it in half, leaving some of it in pullOutHere\n\t\t\t\t\t\t$clone.empty();\n\t\t\t\t\t\tif(!columnize($clone, $cloneMe, $parentColumn, targetHeight)){\n\t\t\t\t\t\t\t// this node still has non-text nodes to split\n\t\t\t\t\t\t\t// add the split class and then recur\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t\tif($cloneMe.children().length){\n\t\t\t\t\t\t\t\tsplit($clone, $cloneMe, $parentColumn, targetHeight);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// this node only has text node children left, add the\n\t\t\t\t\t\t\t// split class and move on.\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($clone.get(0).childNodes.length === 0){\n\t\t\t\t\t\t\t// it was split, but nothing is in it :(\n\t\t\t\t\t\t\t$clone.remove();\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}", "addWordBreakOpportunity() {\n if (\n this._stackItem instanceof BlockStackItem ||\n this._stackItem instanceof TableCellStackItem\n ) {\n this._stackItem.inlineTextBuilder.wordBreakOpportunity = true;\n }\n }", "function breakToken() {\n\t\tvar lastSwitch = {\n\t\t\tblock: 0,\n\t\t\tlabe: 0\n\t\t};\n\t\tif (switchStack.length > 0) {\n\t\t\tlastSwitch = switchStack[switchStack.length - 1];\n\t\t\tasm.push(' JMP end_switch_' + lastSwitch.labe);\n\t\t} else\n\t\t\tputError(lineCount, 14, '');\n\t\t//info(\"\" + lineCount + \" missing switch construct\");\n\t}", "function break_Loop() {\n for(y=0; y < 100; y++) { \n if (y === 12) {break;} //when y is 12 it jumps out of the for loop using 'break'\n content += \"The number is \" + y + \"<br>\";\n }\n document.getElementById(\"breakup\").innerHTML = content;\n}", "function wallGenerator() {\n newWall = document.createElement(\"div\");\n newWall.className = \"walls\";\n gameBox.appendChild(newWall);\n gaps = document.createElement(\"div\");\n gaps.className = \"gap\";\n gaps.style.height = \"200px\";\n newWall.appendChild(gaps);\n console.log(gaps)\n }", "function br() {\n d3.select(id).append(\"br\");\n }", "function resetTimerBreak() {\n resetElement = document.getElementById('timer').innerText = \"5:00\";\n breakMinutes = 5;\n breakSeconds = 00;\n}", "addLineBreak() {\n if (\n !(\n this._stackItem instanceof BlockStackItem ||\n this._stackItem instanceof TableCellStackItem\n )\n ) {\n return;\n }\n if (this._stackItem.isPre) {\n this._stackItem.rawText += \"\\n\";\n } else {\n this._stackItem.inlineTextBuilder.startNewLine();\n }\n }", "append(node, dest, breakToken, shallow = true, rebuild = true) {\n\n\t\tlet clone = cloneNode(node, !shallow); //clona sempre il nodo, sostanzialmente\n\t\tif (node.parentNode && isElement(node.parentNode)) {\n\t\t\tlet parent = findElement(node.parentNode, dest); //dest è sostanzialmente la destinazione ovvero dove deve essere attaccato\n\t\t\tconsole.log(\"Parent in append\", parent, dest); //Non trova il parent all'interno della pagina per il breaktoken. Quindi, va reinserito\n\t\t\t// Rebuild chain\n\t\t\tif (parent) {\n\t\t\t\tparent.appendChild(clone);\n\t\t\t\tconsole.log(\"appendChild\", clone);\n\t\t\t} else if (rebuild) { //Rebuild ancestor serve per ricostruire e reinerire il breaktoken\n\t\t\t\tlet fragment = rebuildAncestors(node);\n\t\t\t\tconsole.log(\"rebuildAncestors fragment\", fragment);\n\t\t\t\tparent = findElement(node.parentNode, fragment); //Gli ho aggiunto i p e section\n\t\t\t\tconsole.log(parent);\n\t\t\t\tif (!parent) {\n\t\t\t\t\tdest.appendChild(clone);\n\t\t\t\t} else if (breakToken && isText(breakToken.node) && breakToken.offset > 0) {\n\t\t\t\t\tclone.textContent = clone.textContent.substring(breakToken.offset); //substring partendo dall'offset del breaktoken.\n\t\t\t\t\tparent.appendChild(clone);\n\t\t\t\t} else {\n\t\t\t\t\tparent.appendChild(clone);\n\t\t\t\t}\n\n\t\t\t\tdest.appendChild(fragment);\n\t\t\t} else {\n\t\t\t\tdest.appendChild(clone);\n\t\t\t}\n\n\n\t\t} else {\n\t\t\tdest.appendChild(clone);\n\t\t}\n\n\t\t/*let nodeHooks = this.hooks.renderNode.triggerSync(clone, node);\n\t\tnodeHooks.forEach((newNode) => {\n\t\t\tif (typeof newNode != \"undefined\") {\n\t\t\t\tclone = newNode;\n\t\t\t}\n\t\t});*/\n\n\t\tthis.getStyle(clone.parentNode);\n\n\t\treturn clone;\n\t}", "function addDescOrdered(parent, child, childStart){\n var i, t, currID;\n \n for(i=0; i < descriptionList.length; i++){\n \n t = descriptionList[i].startTime;\n currID = \"\" + descriptionList[i].id;\n if( childStart > t) continue;\n else{\n parent.insertBefore(child, document.getElementById(currID));\n break;\n }\n }\n\n if(i === descriptionList.length || descriptionList.length === 0){\n parent.appendChild(child);\n }\n}", "function addBreak(text)\n{\n return text.replace(/\\n/g, \"<br />\");\n}", "function addBreak(when,cycle,status){\nobjsCounter++;\nbreakObjsAmount++;\nBreakObj.prototype.totalBreakTime += cycle;\nBreakObj.prototype.breakIdsInObjList.push(objsCounter);\n\nobjsList[objsCounter] = new BreakObj(when,objsCounter,cycle,status);\n\n//console.log(JSON.stringify(objsList));\n}", "function makeLinesOld(node){\r\n //debug('MAKES LINES nodes children:')\r\n //debug(node);\r\n var lines = [];\r\n var nodeMarker=0;\r\n var kids=node.childNodes;\r\n //debug(kids);\r\n if(kids[0].nodeName=='BR'){\r\n //the the first line is blank and we have to correct for the fact\r\n //that makes Lines is going to start counting lines at the first BR\r\n //which skips the first line.\r\n //the solution is to start with a blank line.\r\n var line=[];\r\n lines.push(line);\r\n }\r\n \r\n while(nodeMarker<kids.length){\r\n var line =[];\r\n line.push(kids[nodeMarker]);\r\n nodeMarker++; \r\n // as long as there are more nodes and the next node is not\r\n // a comment or a BR keep adding the next node to the line\r\n // you can only check if it's blue if it is indeed a span, so do that inside the while loop\r\n while(nodeMarker<kids.length && !(kids[nodeMarker].nodeName==\"BR\")){\r\n //if it's blue, it's a comment. Ignore it.\r\n if(kids[nodeMarker].nodeName==\"SPAN\"){\r\n //it's a SPAN\r\n if(kids[nodeMarker].style.getPropertyValue('color')=='blue'){\r\n //it's a comment - don't include it, just increment\r\n nodeMarker++;\r\n }else{\r\n //it's a span but not a comment. Include it!\r\n line.push(kids[nodeMarker]);\r\n nodeMarker++;\r\n }\r\n }else{\r\n //if it's not a comment add it\r\n line.push(kids[nodeMarker]);\r\n nodeMarker++;\r\n }\r\n \r\n }\r\n lines.push(line); \r\n }\r\n return lines;\r\n}", "function appendChildNode(node) {\n ellipsisContentHolder.insertBefore(node, ellipsisTextNode);\n }", "function padDays() {\n for (var x = 1; x < monthDetails.startDay; x++) {\n var blank = document.createElement('span')\n blank.textContent = ''\n daysEl.appendChild(blank)\n }\n }", "function addXToLi () {\r\n\r\n let myListItems = document.getElementsByTagName(\"LI\");\r\n\r\n for (let i = 0; i < myListItems.length; i++) {\r\n let div = document.createElement(\"DIV\");\r\n let text = document.createTextNode(\"\\u00D7\");\r\n div.className = \"close\";\r\n div.appendChild(text);\r\n myListItems[i].appendChild(div);\r\n }\r\n\r\n}", "function parseBreakStatement(node) {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(lastIndex) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError(Messages.IllegalBreak);\n }\n\n return node.finishBreakStatement(null);\n }\n\n if (hasLineTerminator) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError(Messages.IllegalBreak);\n }\n } else if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError(Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError(Messages.IllegalBreak);\n }\n\n return node.finishBreakStatement(label);\n }", "function wrap(d){\n var sel = d3.select(this),\n tokens = sel.text().split(\"\\n\");\n\n if(tokens.length > 1) {\n var h = sel.node().getBBox().height,\n x = sel.attr('x'),\n y = sel.attr('y');\n\n sel.text(null);\n\n for(var i = 0, l = tokens.length; i < l; i++) {\n sel.append('tspan').attr('x', x).attr('y', y).attr('dy', h * i).text(tokens[i].trim());\n }\n }\n }", "ln() {\n return this.getOpenElement({\n tag: \"br\"\n });\n }", "function takeBreak(time) {\n //We have to return the id returned from the invocation of setInterval\n return setInterval(function() {alert(\"Take a break!\")}, time)\n }", "function manualBreak() {\n stopTimer();\n Vars.TimerRunnig = false;\n Vars.onBreak = true;\n Vars.Timer = Consts.POMODORO_DONE_TEXT;\n}", "function Break() {}", "leafFallback(dom) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\"));\n }", "function breakHeight(bp) {\n bp == 'xs' ? y = 250 : y = 500;\n return y;\n }", "function parseBreakStatement(node)\n\t\t{\n\t\t\tvar label = null, key;\n\t\t\texpectKeyword('break');\n\t\t\t// Catch the very common case first: immediately a semicolon (U+003B).\n\t\t\tif (source.charCodeAt(index) === 0x3B)\n\t\t\t{\n\t\t\t\tlex();\n\t\t\t\tif (!(state.inIteration || state.inSwitch))\n\t\t\t\t{\n\t\t\t\t\tthrowError(Messages.IllegalBreak);\n\t\t\t\t}\n\t\t\t\treturn node.finishBreakStatement(null);\n\t\t\t}\n\t\t\tif (peekLineTerminator())\n\t\t\t{\n\t\t\t\tif (!(state.inIteration || state.inSwitch))\n\t\t\t\t{\n\t\t\t\t\tthrowError(Messages.IllegalBreak);\n\t\t\t\t}\n\t\t\t\treturn node.finishBreakStatement(null);\n\t\t\t}\n\t\t\tif (lookahead.type === Token.Identifier)\n\t\t\t{\n\t\t\t\tlabel = parseVariableIdentifier();\n\t\t\t\tkey = '$' + label.name;\n\t\t\t\tif (!Object.prototype.hasOwnProperty.call(state.labelSet, key))\n\t\t\t\t{\n\t\t\t\t\tthrowError(Messages.UnknownLabel, label.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconsumeSemicolon();\n\t\t\tif (label === null && !(state.inIteration || state.inSwitch))\n\t\t\t{\n\t\t\t\tthrowError(Messages.IllegalBreak);\n\t\t\t}\n\t\t\treturn node.finishBreakStatement(label);\n\t\t}", "insertBreak(editor) {\n editor.insertBreak();\n }", "insertBreak(editor) {\n editor.insertBreak();\n }", "function fillTimeText(dom) {\n\tvar startTime = 9;\n\tfor (var i = 0; i <= 24; i++) {\n\t\tvar timeSlot = document.createElement('div');\n\t\tvar hour = startTime + Math.floor(i / 2);\n\t\tvar minute = i % 2 === 0 ? '00' : '30';\n\t\tif (minute === '00') {\n\t\t\tif (hour < 12) {\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute + ' AM')\n\t\t\t} else {\n\t\t\t\tif (hour > 12) {\n\t\t\t\t\thour = hour % 12;\n\t\t\t\t}\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute + ' PM')\n\t\t\t}\n\t\t\ttimeSlot.className = 'timeSlotRound';\n\t\t\ttimeSlot.appendChild(timeText);\n\t\t\tdom.append(timeSlot);\n\t\t} else {\n\t\t\tif (hour < 12) {\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute);\n\t\t\t} else {\n\t\t\t\tif (hour > 12) {\n\t\t\t\t\thour = hour % 12;\n\t\t\t\t}\n\t\t\t\tvar timeText = document.createTextNode(hour + ':' + minute);\n\t\t\t}\n\t\t\ttimeSlot.className = 'timeSlotHalf';\n\t\t\ttimeSlot.appendChild(timeText);\n\t\t\tdom.append(timeSlot);\n\t\t}\n\t}\n}", "function splitChild(child, range, type, data) {\n let resultChildren = [];\n const rangeToChildOffset = range.offset - child.range.offset;\n const rightRangeCoord = range.offset + range.length;\n const rightChildCoord = child.range.offset + child.range.length;\n const textNode = createTextSubNode(range, {\n offset: rangeToChildOffset,\n length: range.length\n }, child.text);\n\n if (rangeToChildOffset > 0) {\n resultChildren.push(\n createTextSubNode({\n offset: child.range.offset,\n length: rangeToChildOffset\n }, {\n offset: 0,\n length: rangeToChildOffset\n }, child.text)\n );\n }\n\n resultChildren.push(createChild(textNode, type, range, data));\n\n if (rightRangeCoord < rightChildCoord) {\n resultChildren.push(\n createTextSubNode({\n offset: rightRangeCoord,\n length: rightChildCoord - rightRangeCoord\n }, {\n offset: rangeToChildOffset + range.length,\n length: rightChildCoord - rightRangeCoord\n }, child.text)\n );\n }\n\n return resultChildren;\n}", "insertWithSubTags(node) {\n const before = node.querySelectorAll(Const_1.XML_TAG_BEFORE);\n const after = node.querySelectorAll(Const_1.XML_TAG_AFTER);\n before.each(item => {\n const insertId = item.attr(Const_1.ATTR_ID);\n const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);\n if (insertId.isPresent()) {\n mona_dish_1.DQ.byId(insertId.value, true).insertBefore(insertNodes);\n this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);\n }\n });\n after.each(item => {\n const insertId = item.attr(Const_1.ATTR_ID);\n const insertNodes = mona_dish_1.DQ.fromMarkup(item.cDATAAsString);\n if (insertId.isPresent()) {\n mona_dish_1.DQ.byId(insertId.value, true).insertAfter(insertNodes);\n this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(insertNodes);\n }\n });\n }", "after(...nodes) {\n\t\tfor (let node of nodes) {\n\t\t\tif (node instanceof BetterHTMLElement)\n\t\t\t\tthis.e.after(node.e);\n\t\t\telse\n\t\t\t\tthis.e.after(node);\n\t\t}\n\t\treturn this;\n\t}", "function insertSpace(child) {\n\t\t if (isString(child.type) && isTwoCNChar(child.props.children)) {\n\t\t return _react2[\"default\"].cloneElement(child, {}, child.props.children.split('').join(' '));\n\t\t }\n\t\t if (isString(child)) {\n\t\t if (isTwoCNChar(child)) {\n\t\t child = child.split('').join(' ');\n\t\t }\n\t\t return _react2[\"default\"].createElement(\n\t\t 'span',\n\t\t null,\n\t\t child\n\t\t );\n\t\t }\n\t\t return child;\n\t\t}", "pageBreakAfter() {\n\n this.props({ pageBreak: 'after' })\n return this\n }", "function removeLastBreak() {\n message.setBreak( false );\n}", "function long(nodes, context, recur, wrap) {\n context.write(WRAPPERS[wrap].left);\n\n for (var i = 0; i < nodes.length; i++) {\n recur(nodes[i]);\n\n if (nodes[i + 1]) {\n context.write(', ');}}\n\n\n\n context.write(WRAPPERS[wrap].right);}", "function parseBreakStatement(node) {\n\t var label = null, key;\n\n\t expectKeyword('break');\n\n\t // Catch the very common case first: immediately a semicolon (U+003B).\n\t if (source.charCodeAt(lastIndex) === 0x3B) {\n\t lex();\n\n\t if (!(state.inIteration || state.inSwitch)) {\n\t throwError(Messages.IllegalBreak);\n\t }\n\n\t return node.finishBreakStatement(null);\n\t }\n\n\t if (hasLineTerminator) {\n\t if (!(state.inIteration || state.inSwitch)) {\n\t throwError(Messages.IllegalBreak);\n\t }\n\t } else if (lookahead.type === Token.Identifier) {\n\t label = parseVariableIdentifier();\n\n\t key = '$' + label.name;\n\t if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n\t throwError(Messages.UnknownLabel, label.name);\n\t }\n\t }\n\n\t consumeSemicolon();\n\n\t if (label === null && !(state.inIteration || state.inSwitch)) {\n\t throwError(Messages.IllegalBreak);\n\t }\n\n\t return node.finishBreakStatement(label);\n\t }", "function breakEnds() {\n var onManualTakeBreak = Vars.onManualTakeBreak\n stopTimer();\n var msg;\n\n //Long break\n if (Vars.PomoSetCounter == Vars.UserData.PomoSetNum) {\n msg = onManualTakeBreak ? \"Break is 0ver\" : \"Long Break is over\";\n pomoReset();\n if (Vars.UserData.LongBreakNotify) {\n notifyHabitica(msg);\n }\n }\n\n //Break Extension on end\n else {\n msg = \"Back to work\";\n startBreakExtension(Vars.UserData.BreakExtention * 60);\n }\n\n //notify\n notify(\"Time's Up\", msg);\n //play sound\n playSound(Vars.UserData.breakEndSound, Vars.UserData.breakEndSoundVolume, false);\n}", "function addMore() {\t\n\tvar new_div = document.createElement('div');\n\tnew_div.appendChild(create_checkbox('Sun'));\n\tnew_div.appendChild(create_checkbox('Mon'));\n\tnew_div.appendChild(create_checkbox('Tue'));\n\tnew_div.appendChild(create_checkbox('Wed'));\n\tnew_div.appendChild(create_checkbox('Thur'));\n\tnew_div.appendChild(create_checkbox('Fri'));\n\tnew_div.appendChild(create_checkbox('Sat'));\n\tindex++;\n\t\n\tnew_div.appendChild(create_time('start'));\n\tvar span = document.createElement('span');\n\tspan.appendChild(document.createTextNode('to'));\n\tnew_div.appendChild(span);\n\tnew_div.appendChild(create_time('end'));\n\t\n\tvar schedule = document.getElementById('schedule');\n\tschedule.insertBefore(new_div, document.getElementById('add-btn'));\n}", "function insertCloseTags(aml_element_char) {\n var existingOpenTags = aml_queue.getAndClearReinsertBuffer().reverse();\n\n _.each(existingOpenTags, function(openTagToken) {\n text_builder.insertText(aml_token.getHTMLCloseTag(openTagToken));\n });\n\n text_builder.insertText(aml_token.getHTMLCloseTag(aml_element_char));\n\n _.each(existingOpenTags, function(openTagToken) {\n text_builder.insertText(aml_token.getHTMLOpenTag(openTagToken));\n aml_queue.push(openTagToken);\n });\n }", "makeBigger(){\n const nextCell = document.createElement(`div`);\n nextCell.classList.add(`snake-cell`);\n board.appendChild(nextCell);\n this.snake.push(nextCell);\n }", "function incrementBreak(incrementBy){\n breakMinutes = breakMinutes + incrementBy;\n if(breakMinutes < 1){\n breakMinutes = 1;\n }\n else if (breakMinutes > 99){\n breakMinutes = 99;\n }\n // Updates the onscreen timer if it isn't currently in use\n if(!timerStarted && !sessionInProgress){\n minutes = breakMinutes;\n seconds = breakSeconds;\n writeTime();\n }\n document.getElementById(\"break-time\").innerHTML = breakMinutes;\n}", "function newLine() {\r\n return document.createElement('br');\r\n }", "function createLabel(question,parent,num){\n\n var label = document.createElement('label');\n label.innerHTML = question;\n \n parent.appendChild(label);\n dynamicBreakline(parent, num);\n return true;\n}", "function skipToBreak() {\n stopAmbientSound();\n stopTimer();\n var title = \"Time's Up\";\n var msg = \"Take a break\";\n Vars.PomoSetCounter++; //Updae set counter\n startBreak();\n notify(title, msg);\n}", "function decBreakTime(){\n if (breakTime > 1 && clockState === state.OFF){\n breakTime--;\n events.emit(\"BreakeStateChanged\", breakTime);\n render();\n }\n }", "function startShortBreakTimer() {\n time = Date.now();\n timerEnd = time + SHORT_BREAK_DURATION;\n setTimeout(refreshBreakTimer, UPDATE_TIMER_EVERY);\n updateTable(true);\n let buttons = document.getElementsByTagName(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n let button = buttons[i];\n button.setAttribute(\"disabled\", \"disabled\");\n }\n}" ]
[ "0.63128895", "0.6152435", "0.6144858", "0.6077617", "0.5868857", "0.5841096", "0.57394487", "0.55721635", "0.5543989", "0.5375537", "0.5123289", "0.50599265", "0.5049691", "0.5017507", "0.50135267", "0.49951822", "0.4987879", "0.49721068", "0.4960886", "0.49425083", "0.4931944", "0.49224323", "0.48766598", "0.48650786", "0.48571166", "0.48452958", "0.4791401", "0.4786589", "0.4731088", "0.47180513", "0.46788445", "0.4673942", "0.46686605", "0.46400127", "0.46400127", "0.4639879", "0.46314228", "0.46198234", "0.46198234", "0.4617817", "0.46053815", "0.46053815", "0.46053815", "0.46053815", "0.46053815", "0.46053815", "0.46030325", "0.4598646", "0.45755765", "0.45732287", "0.45641577", "0.45606995", "0.45606995", "0.45507413", "0.45507413", "0.45389044", "0.45284444", "0.4519358", "0.4518441", "0.45165017", "0.45093817", "0.44747788", "0.44522563", "0.4424355", "0.44206804", "0.4406403", "0.43997684", "0.4398273", "0.4397782", "0.4393542", "0.43900004", "0.4386116", "0.43855965", "0.43746442", "0.4367985", "0.4364584", "0.4359327", "0.4357725", "0.4354228", "0.43517065", "0.43517065", "0.43468004", "0.43401298", "0.4334295", "0.43195933", "0.43149972", "0.4314027", "0.43134284", "0.43094605", "0.43047303", "0.43018794", "0.4300617", "0.43001795", "0.42993045", "0.4297242", "0.429553", "0.42923018", "0.4288963", "0.42885083", "0.42874247" ]
0.7753818
0
Create child node of element with optional idname. You need idname if you want to remove later.
function appendElementChild(element, node, idname) { if ( element === undefined || element === null || node === undefined || node === null) { return null; } var el = _createel(element, idname); node.appendChild(el); return el; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElements(elementName, innerText, parentId){\r\n var node = document.createElement(elementName);\r\n var textNode = document.createTextNode(innerText);\r\n node.appendChild(textNode);\r\n document.getElementById(parentId).appendChild(node);\r\n}", "function newChildNode(parent, child, content, ident){\n let cell = document.createElement(child);\n if (ident){cell.id = ident;}\n cell.innerText = content;\n parent.appendChild(cell);\n}", "function appendElement(identifier, child){\n let t1 = document.getElementById(identifier);\n\n t1.appendChild(child);\n}", "function CreateElement(elem_name, parent_elem, parent_index){\r\n var elem = document.createElement(elem_name);\r\n var parent = document.getElementsByTagName(parent_elem)[parent_index];\r\n parent.appendChild(elem);\r\n}", "function appendChild(tag, childId, childClassName, content, parentId) {\n var newChild = $(\"<\" + tag + \">\", {\n id: childId,\n class: childClassName,\n html: content\n });\n var parentElement = $(\"#\" + parentId);\n parentElement.append(newEl);\n }", "function divCreator(id, parent){\n // console.log('divCreator', id, parent);\n let newDiv = document.createElement('div');\n let newElement = parent.appendChild(newDiv);\n newElement.setAttribute('id', id);\n return newElement;\n }", "function addElementAndItsChildEle(parentElement,newElementTagName,newId,newClass,newIdOFChild,label,spanId){\n var temp = document.getElementById(parentElement);\n var newDiv = document.createElement(\"DIV\");\n\n var newSpan = document.createElement(\"span\");\n newSpan.setAttribute(\"id\",spanId);\n newDiv.appendChild(newSpan);\n newSpan.innerText = label ;\n newDiv.setAttribute(\"class\",newClass);\n newDiv.setAttribute(\"id\",newId);\n temp.appendChild(newDiv);\n\n var firstName = document.createElement(\"input\");\n firstName.setAttribute(\"type\",\"text\");\n firstName.setAttribute(\"value\",\"\");\n firstName.setAttribute(\"id\",newIdOFChild);//\"firstName\"\n newDiv.appendChild(firstName);\n\n}", "function createDiv(parentID, childID) {\n var d = $(document.createElement('div')).attr('id', childID);\n var container = document.getElementById(parentID);\n d.appendTo(container);\n }", "function createDiv(parentID, childID) {\n var d = $(document.createElement('div')).attr('id', childID);\n var container = document.getElementById(parentID);\n d.appendTo(container);\n }", "create_node(id) {\n let new_node = {\n id : id,\n parent_node : undefined,\n child_list : [],\n type : \"Node\",\n };\n return new_node;\n }", "function createItem(id,parentDiv,CustomStyle,price){\n\n\tvar nm = id.substring(id.lastIndexOf(ELMNT_ID_SPACE_CHAR)+1);//create var for elements name attribute\n\tvar newItem = HTMLelement(\"p\",{class:'item stockYES',\n\t\t\t\t\t\t\t\t\t\t\tid:id,\n\t\t\t\t\t\t\t\t\t\t\tvalue:price,\n\t\t\t\t\t\t\t\t\t\t\tname:nm,\n\t\t\t\t\t\t\t\t\t\t\tinnerHTML:nm,\n\t\t\t\t\t\t\t\t\t\t\tCustomStyle});\n\tdocument.getElementById(parentDiv).appendChild(newItem);\n}", "function createNode(name) {\n return document.createElement(name)\n }", "function addElement(parentId, elementTag, elementId, html) {\n var p = document.getElementById(parentId);\n var newElement = document.createElement(elementTag);\n newElement.setAttribute('id', elementId);\n newElement.innerText = html;\n p.insertAdjacentElement('afterend',newElement);\n}", "createElement(tag, attrs, ...children) {\n const element = document.createElement(tag);\n\n // Adding attributes to the element\n Object.keys(attrs).forEach((key) => {\n if (key === 'dataId') {\n element.dataset.id = attrs[key];\n } else if (key === 'dataTid') {\n element.dataset.tid = attrs[key];\n } else {\n element[key] = attrs[key];\n }\n });\n\n // Appending children\n children.forEach((child) => {\n let tempChild = child;\n if (typeof tempChild === 'string') {\n tempChild = document.createTextNode(child);\n }\n element.appendChild(tempChild);\n });\n\n return element;\n }", "function createNewNode(id) {\n\n // Create new node.\n var newNode = {\n group: 'nodes',\n data: {\n id: id\n }\n };\n\n // Add the new node to cy.elements.\n props.cy.add(newNode);\n }", "function generateNode ( element, parentid )\r\n{\r\n\tvar parent = null;\r\n\tif ( parentid == null )\r\n\t\tparent = document.getElementById(\"tree\");\r\n\telse\r\n\t\tparent = document.getElementById(\"C\" + parentid );\r\n\r\n\tvar node = document.getElementById(\"E\" + element.id);\r\n\tif ( node == null )\r\n\t{\r\n\t\tnode = document.createElement(\"li\");\r\n\t}\r\n\tparent.appendChild(node);\r\n\tnode.onclick=onNodeClick;\r\n\tif (node.captureEvents) node.captureEvents(Event.CLICK);\r\n\tnode.innerHTML = \"Loading...\";\r\n\tnode.id = \"E\" + element.id;\r\n\tnode.className = \"loading\";\r\n\tloadElementInfo ( element );\r\n}", "function createElement(name, attrs) {\n const restIndex = 2;\n const argLen = arguments.length;\n let children = null;\n let key = null;\n let hash = 5381; // See djb2 hash - http://www.cse.yorku.ca/~oz/hash.html\n // Flatten arrays inside children to be a single array\n if (argLen > restIndex) {\n children = new Array(argLen - restIndex); // preallocate for perf\n for (let i = restIndex, childIndex = 0; i < argLen; i++) {\n let child = arguments[i];\n if (child instanceof Array) {\n for (let j = 0, n = child.length; j < n; j++) {\n let arrChild = child[j];\n if (hasValue(arrChild)) {\n const childNode = normalizeNode(arrChild);\n children[childIndex++] = childNode;\n hash = updateHashNum(hash, childNode.hash);\n }\n }\n }\n else if (hasValue(child)) {\n const childNode = normalizeNode(child);\n children[childIndex++] = childNode;\n hash = updateHashNum(hash, childNode.hash);\n }\n }\n }\n if (typeof name === \"string\") {\n hash = updateHashStr(hash, name);\n if (attrs) {\n for (let attrName of Object.keys(attrs)) {\n let attrValue = attrs[attrName];\n if (hasValue(attrValue)) {\n attrs[attrName] = attrValue = normalizeAttr(attrName, attrValue);\n updateHashStr(hash, attrName);\n updateHashStr(hash, attrValue);\n if (attrName === \"key\") {\n key = attrValue;\n }\n }\n }\n }\n return { type: 1 /* Element */, name, hash, attrs, key, children, dom: null };\n }\n else if (typeof name === \"function\") {\n return name(attrs, children); // Stateless component\n }\n throw new Error(`unrecognized node name:${name}`);\n }", "function createNode(type, child) {\n var node = document.createElement(type);\n \n if(typeof child === \"string\") {\n var text = document.createTextNode(child);\n node.appendChild(text);\n } else {\n node.appendChild(child);\n }\n \n return node;\n}", "function add_node( id, type, place)\n{\n\tvar my = document.createElement(type);\n\tmy.id = id;\n\n\tmy.style.position = \"relative\";\n\n\tplace.appendChild(my);\n\n\treturn my;\n}", "function generateDivInParent(id, className, text, parentDOM) {\n var newDiv = document.createElement(\"div\");\n newDiv.id = id;\n newDiv.className = className;\n if (text !== null) {\n newDiv.innerHTML = text;\n }\n parentDOM.appendChild(newDiv);\n\n return newDiv;\n}", "function AddElement(iParentId, iElementTag, iElementId, iClassName, iHTML) {\n\t\n var p = document.getElementById(iParentId);\n var wElement = document.createElement(iElementTag);\n wElement.setAttribute('id', iElementId);\n\twElement.setAttribute('class', iClassName)\n wElement.innerHTML = iHTML;\n p.appendChild(wElement);\n\t\n\treturn true;\n}", "function elt(name, attributes) {\n var node = document.createElement(name);\n if (attributes) {\n for (var attr in attributes)\n if (attributes.hasOwnProperty(attr))\n node.setAttribute(attr, attributes[attr]);\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == 'string')\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "function createAndAppendElements(element, classname, text, dataset, parent) {\n\n let childElement = document.createElement(element)\n\n childElement.className = classname\n\n let parentElement = parent.appendChild(childElement)\n\n if (text) {\n childElement.textContent = text\n }\n if (dataset) {\n childElement.setAttribute(`data-id`, dataset)\n }\n return parentElement\n}", "function elt(name, attributes) {\n var node = document.createElement(name);\n if (attributes) {\n for (var attr in attributes)\n if (attributes.hasOwnProperty(attr))\n node.setAttribute(attr, attributes[attr]);\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == \"string\")\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "function elt(name, attributes) {\n var node = document.createElement(name);\n if (attributes) {\n for (var attr in attributes)\n if (attributes.hasOwnProperty(attr))\n node.setAttribute(attr, attributes[attr]);\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i];\n if (typeof child == \"string\")\n child = document.createTextNode(child);\n node.appendChild(child);\n }\n return node;\n}", "function mk( elementName, attrObj, parent, appendChild) {\n\treturn mkHTML( elementName, attrObj, parent, appendChild);\n}", "function elt(name,attrs,...children){\n let element = document.createElement(name);\n for(let attr in attrs){\n element.setAttribute(attr,attrs[attr]);\n }\n for(let child of children){\n element.appendChild(child);\n }\n return element;\n }", "function createNode(name) {\n return {\n name: name,\n children: [],\n getParent: null,\n pos: {\n sl: 0,\n sc: 0,\n el: 0,\n ec: 0\n }\n };\n }", "function newElement(name) {\n return document.createElement(name);\n}", "addChild(childId) {\n if (!this.hasChild(childId)) {\n const child = this.getEntity(childId);\n if (child && child.hasComponent(Children)) {\n child.children.setParent(this.getEntity().id);\n } else {\n this.children.push(childId);\n }\n }\n }", "function addElement(parentId, elementTag, elementId, html) {\n // Adds an element to the document\n var p = document.getElementById(parentId);\n var newElement = document.createElement(elementTag);\n newElement.setAttribute('id', elementId);\n newElement.innerHTML = html;\n p.appendChild(newElement);\n}", "function newElem(name) { return document.createElement(name); }", "function AddChild(childElement, id) {\n let childTagName = childElement.tagName.toLowerCase();\n if (childTagName === 'twx-dt-image' || childTagName === 'twx-dt-model') {\n let childCtrlWidget = { me: {} };\n for (let j = 0; j < childElement.attributes.length; j++) {\n let attributeName = childElement.attributes[j].name;\n let attributeValue = childElement.attributes[j].value;\n childCtrlWidget.me[attributeName] = attributeValue;\n }\n childCtrlWidget.widgetId = id;\n childCtrlWidget.parent = ctrlWidget;\n childCtrlWidget.getWidgetTagName = function() {\n return childTagName;\n };\n childCtrlWidget.element = function() {\n return [ childElement ];\n };\n childCtrlWidget.designPropertyValues = function() {\n return childCtrlWidget.me;\n };\n widget.children.push(childCtrlWidget);\n let childWidgetFactory = ctrl.getWidgetFactory(childElement.tagName.toLowerCase());\n childCtrlWidget.$cvWidget = childWidgetFactory(childCtrlWidget, undefined);\n childCtrlWidget.mutationCallback = function(mutationRecords) {\n let changedProps = {};\n mutationRecords.forEach(function (mutation) {\n let name = mutation.attributeName;\n let value = mutation.target.getAttribute(name);\n changedProps[name] = value;\n childCtrlWidget.me[name] = value;\n });\n ctrl.updateObject(childCtrlWidget, childCtrlWidget.me, changedProps);\n };\n\n ctrl.myWidgets[childCtrlWidget.widgetId] = childCtrlWidget;\n\n childCtrlWidget.mutationObserver = new MutationObserver(childCtrlWidget.mutationCallback);\n childCtrlWidget.mutationObserver.observe(childElement, { attributes: true });\n }\n }", "function createNewElement(elementType, newElementUniqueIdentifier, elementStr, parentElementID) {\n var newElement = document.createElement(elementType);\n newElement.setAttribute(\"id\", newElementUniqueIdentifier)\n var elementText = document.createTextNode(elementStr);\n newElement.appendChild(elementText);\n document.getElementById(parentElementID).appendChild(newElement);\n}", "function createNameNode() {\n return jsonldUtils.createBlankNode({ '@type': TYPE.Name });\n}", "function addElement(parentId, elementTag, elementId, html) {\n // Adds an element to the document\n var p = document.getElementById(parentId);\n var newElement = document.createElement(elementTag);\n newElement.setAttribute('id', elementId);\n newElement.innerHTML = html;\n //Ta funcionando sem esse apeendChild aqui, qualquer coisa revisitar isto\n p.appendChild(newElement);\n return newElement;\n}", "function createNode(element) {\n return document.createElement(element);\n }", "function addElement(type, className, idName){\n\t\tvar elem = document.createElement(type);\n\t\tif( className ){\n\t\t\telem.className = className;\n\t\t}\n\t\tif( idName ){\n\t\t\telem.setAttribute(\"id\", idName);\n\t\t}\n\t\treturn elem;\n\t}", "function myCreateNodes() {\n var para = document.createElement(\"p\");\n var node = document.createTextNode(\"This is new\");\n para.appendChild(node);\n var element = document.getElementById(\"div1\");\n element.appendChild(para);\n}", "function makeNode(name, children, title, extra) {\n var item = {'name': name, '$show': false, '$wasRendered': false};\n\n if (children && children.length) {\n item['children'] = children;\n }\n if (title) {\n item['title'] = title;\n }\n\n if (loDash.isFunction(extra)) {\n\n return loDash.assign(item, extra(item));\n } else {\n\n return loDash.assign(extra || {}, item);\n }\n }", "function createNode(element) {\n return document.createElement(element);\n }", "function createNode(element) {\n return document.createElement(element);\n }", "function create_new_element(element_name, inner_text, append_something = [], parent, attribute_name = [], attribute_value = []){\n var new_element = document.createElement(element_name);\n if (inner_text !== \"\"){\n var text = document.createTextNode(inner_text);\n new_element.appendChild(text);\n }\n if(append_something != \"\"){\n for (e=0; e < append_something.length; e++) {\n new_element.appendChild(append_something[e]);\n }\n }\n if(parent != \"\"){\n parent.appendChild(new_element);\n }\n if(attribute_name != \"\" || attribute_value != \"\"){\n for (e=0; e < attribute_name.length; e++) {\n new_element.setAttribute(attribute_name[e], attribute_value[e]);\n }\n }\n return new_element;\n}", "function createNode(element) {\n return document.createElement(element); // Create the type of element you pass in the parameters\n}", "function appendTextChild(text, node, element, idname) {\n\n // Check input.\n if ( text === undefined || text === null || node === undefined\n || node === null || element === undefined || element === null) {\n return null;\n }\n\n // Create styled text node.\n var txt = document.createTextNode(text);\n var el = _createel(element, idname);\n el.appendChild(txt);\n node.appendChild(el);\n\n return el;\n}", "[_.appendChild](id, node) {\n nodes[id].appendChild(node);\n }", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "createDomElements(id) {\n this.li = document.createElement('li');\n this.edit = document.createElement('button');\n this.delete = document.createElement('button');\n\n this.edit.classList.add('btn-edit');\n this.delete.classList.add('btn-delete');\n\n this.delete.setAttribute('data-id', id);\n this.edit.setAttribute('data-id', id);\n\n this.edit.innerHTML = 'Edit';\n this.delete.innerHTML = 'Delete';\n\n this.li.appendChild(this.delete);\n this.li.appendChild(this.edit);\n }", "function createFormElement(element, type, name, id, value, parent) {\r\n var e = document.createElement(element);\r\n e.setAttribute(\"name\", name);\r\n e.setAttribute(\"type\", type);\r\n e.setAttribute(\"id\", id);\r\n e.setAttribute(\"value\", value);\r\n parent.appendChild(e);\r\n}", "function createElement(parent, nameElement, nameClasse) {\n const element = document.createElement(nameElement);\n element.className = nameClasse;\n parent.appendChild(element);\n return element;\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createNode(element) {\n return document.createElement(element);\n}", "function createFormElement(element, type, name, id, value, parent) {\n var e = document.createElement(element);\n e.setAttribute(\"name\", name);\n e.setAttribute(\"type\", type);\n e.setAttribute(\"id\", id);\n e.setAttribute(\"value\", value);\n parent.appendChild(e);\n}", "function createFormElement(element, type, name, id, value, parent) {\n var e = document.createElement(element);\n e.setAttribute(\"name\", name);\n e.setAttribute(\"type\", type);\n e.setAttribute(\"id\", id);\n e.setAttribute(\"value\", value);\n parent.appendChild(e);\n}", "function createFormElement(element, type, name, id, value, parent) {\n var e = document.createElement(element);\n e.setAttribute(\"name\", name);\n e.setAttribute(\"type\", type);\n e.setAttribute(\"id\", id);\n e.setAttribute(\"value\", value);\n parent.appendChild(e);\n}", "function createPElement (text, direction, idname) {\n\tvar pElement = document.createElement(\"p\");\n\tvar pElementText = document.createTextNode(text);\n\tpElement.appendChild(pElementText);\n\tif (idname != undefined) {\n\t\tpElement.id = idname;\n\t}\n\telse if (direction != undefined) {\n\t\tpElement.id = direction + day;\n\t}\n\telse {\n\t\tpElement.id = \"sentence\"\n\t}\n\tdocument.getElementById(\"story\").appendChild(pElement);\n\twindow.scrollTo(0,document.body.scrollHeight);\n}", "function addChild(name, dob,img, target){\n //get number of siblings/parents\n var childCount = $(target).siblings('ul').children('li').length;\n\n //no child case\n if(childCount <1){\n $('<ul></ul>').append(\n '<li>'+\n drawNode(name,dob,img)+\n '</li>'\n ).insertAfter(target);\n }\n\n //is one child case\n if(childCount >= 1 ){\n //console.log($(this).siblings());\n $('<li></li>').append(\n\n drawNode(name,dob,img)\n\n ).appendTo($(target).siblings());\n }\n\n //update length of node list\n endPos = $('.node').length ;\n}", "function newLi (id){\n var newLi = document.createElement('li');\n newLi.id = id;\n newLi.textContent = 'The Fox';\n return newLi;\n}", "function createElement() {\n\tvar li = document.createElement(\"li\");\n\t\tli.appendChild(document.createTextNode(input.value));\n\t\t\tui.appendChild(li);\n\t\t\tinput.value = \"\";\n\n\t// Create delete button for each new list item\n\tvar btn = document.createElement(\"button\");\n\t\t\tbtn.appendChild(document.createTextNode(\"Delete\"));\n\t\t\tli.appendChild(btn);\n\t\t\tbtn.onclick = removeParent;\n}", "function createDiv( elementId, parentElement ) {\n\t\tif ( $(elementId) ) {\n\t\t\tvar div = $(elementId);\n\t\t} else {\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.id = elementId;\n\t\t\tparentElement.appendChild(div);\n\t\t}\n\t\treturn div;\n\t}", "appendChild(child) {\n this.childNodes.push(child);\n }", "function createElement(param) {\n var element = document.createElementNS(svgns, param.name);\n element.id = param.name + \"_\" + param.id;\n\n if (param.text !== undefined)\n element.innerText = element.textContent = param.text;\n\n addOptions.call(element, param.options);\n addActions.call(element, param.actions);\n return element;\n }", "function createNameNode(newName){\n var nameDiv = document.createElement(\"div\");\n nameDiv.setAttribute(\"class\", \"col-lg-2\");\n //console.log(\"nameDiv: \", nameDiv);\n var nameSpan = document.createElement(\"span\");\n nameSpan.setAttribute(\"class\", \"product-name\");\n nameSpan.innerHTML = newName;\n nameDiv.appendChild(nameSpan);\n \n return nameDiv\n }", "function createElem(elemName, className = [], text, dataIndex, dataFieldIndex) {\r\n const element = document.createElement(elemName);\r\n element.textContent = text;\r\n\r\n className.forEach(elemClass => {\r\n element.classList.add(elemClass);\r\n });\r\n\r\n if (dataIndex) element.setAttribute('data-index', dataIndex);\r\n if (dataFieldIndex) element.setAttribute('data-field-index', dataFieldIndex);\r\n return element;\r\n}", "function append_field(parent_name, element_name, element_value) { \r\n var element = document.createElement(\"input\");\r\n element.id = element_name;\r\n\telement.value = element_value;\r\n\t\r\n var parent = document.getElementById(parent_name); \r\n parent.appendChild(element);\r\n}", "function createElement(d, id){\n\tif (!ids.includes(id)){\n\t\tids.push(id);\n\t}\n\tvar fill = \"#000000\";\n\tvar stroke = \"#000000\";\n\tvar strokeWidth = \"1\";\n\tvar path = document.createElement('path');\n\tpath.setAttribute(\"id\", id);\n\tpath.setAttribute(\"fill\", fill);\n\tpath.setAttribute(\"stroke\", stroke);\n\tpath.setAttribute(\"stroke-width\", strokeWidth);\n\tpath.setAttribute(\"d\", d);\n\t\n\tmain.appendChild(path);\n\tupdateView();\n}", "function createElement(string, parent = null) {\n const elementRegex = /^([^.\\# ]+)/g;\n const idRegex = /(#[^ \\.#]+)/g;\n const classRegex = /\\.([^ \\.#]+)/g;\n\n string = string.trim();\n const elementType = string.match(elementRegex);\n const id = string.match(idRegex)?.map((x) => x.slice(1));\n const classes = string.match(classRegex)?.map((x) => x.slice(1));\n\n const element = document.createElement(elementType);\n if (id) element.id = id;\n if (classes) element.classList.add(...classes);\n if (parent) parent.appendChild(element);\n return element;\n}", "appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n }", "function appendElements(identifier, children){\n let t = document.getElementById(identifier);\n children.forEach(function(elemento){\n t.appendChild(elemento);\n });\n}", "function createLabelElement(name){\r\n\tvar label = document.createElement(\"p\");\r\n\tlabel.setAttribute(\"id\", \"p\"+name);\r\n\tvar node = document.createTextNode(name);\r\n\tlabel.appendChild(node);\r\n\tvar element = document.getElementById(\"selectContainer\");\r\n\telement.appendChild(label);\r\n\r\n}", "function addChild(nodeClickedId) {\r\n var newNodeId = generateANewIdForNode();\r\n // Add a new node to graph info\r\n graphInfo.nodes.push({\r\n \"id\": newNodeId,\r\n \"name\": \"New Node\",\r\n \"genus\": \"New Genus\",\r\n \"graph\": graphInfo.id\r\n });\r\n // Add a new edge to graph info\r\n graphInfo.edges.push({\r\n \"id\": generateANewIdForEdge(),\r\n \"edgeProperties\": [],\r\n \"fromNode\": nodeClickedId,\r\n \"toNode\": newNodeId,\r\n \"graph\": graphInfo.id\r\n });\r\n\r\n // Rebuild all indexes\r\n nodeTraversalAndPlacement();\r\n}", "function createIfNone(parentnode, tagname){let chk = parentnode.getElementsByTagName(tagname)[0];\r\nif(chk === undefined){chk = document.createElement(tagname);parentnode.appendChild(chk);}return chk;}", "function CreateElement(elemText,parentName,parentIndex,value){\n var elem = document.createElement('option');\n var txt = document.createTextNode('');\n var parent = document.getElementsByClassName(parentName)[parentIndex];\n var attribute_value = value;\n elem.appendChild(txt);\n parent.appendChild(elem);\n elem.innerHTML = elemText;\n elem.setAttribute(\"value\", attribute_value);\n}", "addChild(parentNode, childNode) {\n this.roots.remove(childNode);\n childNode.parent = parentNode;\n parentNode.kids.add(childNode);\n }", "function appendToDom(newElementType, classValue , idValue, textContent, parentElement) {\n var newElement = document.createElement(newElementType);\n newElement.setAttribute('class', classValue);\n newElement.setAttribute('id', idValue);\n newElement.textContent = textContent;\n parentElement.appendChild(newElement);\n}", "function buildChildNode(parent, nodeData) {\r\n node = dojo.widget.createWidget(parent.widgetType, nodeData);\r\n //node.childIconSrc =\"../images/icons/tips.gif\";\r\n //\"isFolder\" is attribute with Node,default is false.\r\n //node.isFolder = true;\r\n parent.addChild(node);\r\n node.childIcon.style[\"width\"] = \"11px\";\r\n node.childIcon.style[\"height\"] = \"12px\";\r\n \r\n return node;\r\n}", "appendChild (child, parent) {\n // console.log('appendChild', child)\n this.scene.add(child.root)\n }", "function createElementNode(renderer, name, namespace) {\n ngDevMode && ngDevMode.rendererCreateElement++;\n\n if (isProceduralRenderer(renderer)) {\n return renderer.createElement(name, namespace);\n } else {\n return namespace === null ? renderer.createElement(name) : renderer.createElementNS(namespace, name);\n }\n }", "function appendChild(elem,child){child.parent=elem;if(elem.children.push(child)!==1){var sibling=elem.children[elem.children.length-2];sibling.next=child;child.prev=sibling;child.next=null;}}", "createPly(nameEl, id, x, y, z) {\n var pos = { x: x, y: y, z: z },\n plyEl = document.createElement('a-entity')\n\n this.el.appendChild(plyEl)\n\n plyEl.setAttribute('ply-model', { src: id })\n plyEl.setAttribute('class', nameEl)\n plyEl.setAttribute('position', pos)\n }", "function createDiv(){\n // create an element \n var elem = document.createElement('div');\n // Set the elements id\n elem.setAttribute('id', 'myEle');\n // Append the new div to the dom\n document.body.appendChild(elem);\n}", "function domChild(el, index, tag, ns) {\n var a = el.childNodes[index], b;\n if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {\n b = a || null;\n a = domCreate(el.ownerDocument, tag, ns);\n el.insertBefore(a, b);\n }\n return a;\n }", "function createNode(name, attr, content)\n\t{\n\t\tvar dom = style.dom(),\n\t\t\tnode = element.parentNode.insertBefore(\n\t\t\t\tdom.createElement(name),\n\t\t\t\telement\n\t\t\t),\n\t\t\tp;\n\n\t\tif (attr)\n\t\t\tfor (p in attr)\n\t\t\t\tnode.setAttribute(p, attr[p]);\n\n\t\tif (content)\n\t\t\tnode.appendChild(dom.createCDATASection(content));\n\t}", "appendTo(id) {\n document.getElementById(id).appendChild(this.element)\n }", "function createNode(pNode,attr,...chN){\r\n let parent=document.createElement(pNode);\r\n\r\n for(let att of Object.keys(attr)){\r\n parent.setAttribute(att, attr[att]);\r\n }\r\n\r\n for(let ch of chN) parent.appendChild(ch);\r\n\r\n return parent;\r\n}", "function makeRootNode(name) {\n\tlet node = makeGroupNode(name, true);\n\tnode.apiData.name = name;\n\treturn node;\n}", "function elt(name, attrs, ...children){\n let dom = document.createElement(name);\n for(let attr of Object.keys(attrs)){\n dom.setAttribute(attr, attrs[attr])\n }\n for(let child of children){\n dom.appendChild(child);\n }\n return dom;\n}", "function createDropdown(id, parentID){\n var selectBox = document.createElement(\"SELECT\");\n selectBox.id = id;\n selectBox.name = id; //\t\t\tselectBox.class = \"inputField_box\";\n parentID.appendChild(selectBox);\n}", "function buildNode(tagName, attributes, children) {\n var node = document.createElement(tagName);\n\n /* Apply attributes */\n if (attributes) {\n for (var attribute in attributes) {\n if (attributes.hasOwnProperty(attribute)) {\n node[attribute] = attributes[attribute];\n }\n }\n }\n\n /* Append children */\n if (children) {\n if (typeof children === 'string') {\n node.appendChild(document.createTextNode(children));\n } else if (children.tagName) {\n node.appendChild(children);\n } else if (children.length) {\n for (var i = 0, length = children.length; i < length; ++i) {\n var child = children[i];\n\n if (typeof child === 'string') {\n child = document.createTextNode(child);\n }\n\n node.appendChild(child);\n }\n }\n }\n\n return node;\n }", "function addChild(obj, child) {\n obj.appendChild(child);\n}", "function createElements() {\n var nodeNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodeNames[_i] = arguments[_i];\n }\n return nodeNames.map(function (name) { return document.createElement(name); });\n }", "function createNode(tag, children) {\n if (tag === TEXT_NODE) {\n return document.createTextNode(children[0]);\n } else {\n return document.createElement(tag);\n }\n}", "function createNode(tag, children) {\n if (tag === TEXT_NODE) {\n return document.createTextNode(children[0]);\n } else {\n return document.createElement(tag);\n }\n} // TODO use React like effects for lifecycle events" ]
[ "0.7071792", "0.6987633", "0.68198335", "0.66983515", "0.66118664", "0.6523955", "0.6461049", "0.63809264", "0.63809264", "0.630105", "0.6298641", "0.62631595", "0.62606245", "0.62550783", "0.61740524", "0.6156484", "0.6124785", "0.6103726", "0.6076648", "0.6054449", "0.6044535", "0.60342836", "0.601419", "0.6003871", "0.6003871", "0.5952537", "0.5949247", "0.59491074", "0.59392416", "0.59377766", "0.5929185", "0.59248775", "0.59217453", "0.59216505", "0.5903882", "0.59030354", "0.58943975", "0.58846724", "0.5867522", "0.5861979", "0.58535933", "0.58530146", "0.5852585", "0.5845681", "0.5844378", "0.5815225", "0.5804747", "0.5804747", "0.5804747", "0.5804747", "0.5804747", "0.5804747", "0.5804747", "0.5804482", "0.57925993", "0.5787847", "0.57847744", "0.57847744", "0.57847744", "0.57815427", "0.57815427", "0.57815427", "0.5751313", "0.5748468", "0.5746039", "0.5743978", "0.5739924", "0.5738472", "0.5736128", "0.573351", "0.56806743", "0.5668629", "0.56686217", "0.5648326", "0.5638353", "0.56214184", "0.5620142", "0.56181204", "0.56172", "0.5616552", "0.5612356", "0.560772", "0.55901164", "0.5589459", "0.5588876", "0.5587367", "0.5583414", "0.55793643", "0.55788034", "0.55737364", "0.55705035", "0.55695844", "0.5557196", "0.5546526", "0.5535243", "0.5535095", "0.5524946", "0.5520123", "0.5519159", "0.5515357" ]
0.67878693
3
take projectID and create notification
async createByProjectID({ request, params, response }) { const { title, description, source_user_id, is_read, event_id, event_type, } = request.post(); const projectID = params.projectID; const project = await Project.find(projectID); const students = await project.students().fetch(); const staff = await project.staff().fetch(); const studentsJSON = await students.toJSON(); studentsJSON.forEach(async (student) => { var newNotif = new Notification(); newNotif.title = title; newNotif.description = description; newNotif.user_id = student.user_id; newNotif.source_user_id = source_user_id; newNotif.is_read = is_read; newNotif.event_id = event_id; newNotif.event_type = event_type; await newNotif.save(); }); const staffJSON = await staff.toJSON(); staffJSON.forEach(async (staff) => { var newNotif = new Notification(); newNotif.title = title; newNotif.description = description; newNotif.user_id = staff.user_id; newNotif.source_user_id = source_user_id; newNotif.is_read = is_read; newNotif.event_id = event_id; newNotif.event_type = event_type; await newNotif.save(); }); return response.json({ message: "successfully added", }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notificationCreate(json) {\n if (Notification.isSupported()) {\n elements[json.targetID] = new Notification(json.notificationOptions);\n elements[json.targetID].on('action', (event, index) => { client.write(json.targetID, consts.eventNames.notificationEventActioned, {index: index}) })\n elements[json.targetID].on('click', () => { client.write(json.targetID, consts.eventNames.notificationEventClicked) })\n elements[json.targetID].on('close', () => { client.write(json.targetID, consts.eventNames.notificationEventClosed) })\n elements[json.targetID].on('reply', (event, reply) => { client.write(json.targetID, consts.eventNames.notificationEventReplied, {reply: reply}) })\n elements[json.targetID].on('show', () => { client.write(json.targetID, consts.eventNames.notificationEventShown) })\n }\n client.write(json.targetID, consts.eventNames.notificationEventCreated)\n}", "function newPinNotification(pin_ID) {\n\n\n\tconsole.log('New pin notification sending for #' + pin_ID);\n\n\n\tvar pin = getPin(pin_ID);\n\tvar pinNumber = getPinNumber(pin_ID);\n\n\n\tdoAction('newNotification', 'pin', pin_ID, pinNumber, \"\", \"\");\n\n}", "function makeNotification(title, message){\n\tnotManager.schedule({\n\t\tid: id++,\n\t\ttitle: title,\n\t\ttext: message,\n\t\t// data: null\n\t});\n}", "function newNotification(args) {\r\n if (typeof args === \"string\") {\r\n args = {\r\n message: args,\r\n status: args,\r\n comment: args\r\n };\r\n }\r\n args.key = args.key || new Date().getTime();\r\n args.duration = args.duration || durationDefault;\r\n args.type = args.type || typeDefault;\r\n args._timer = setTimer(args.key, args.duration);\r\n\r\n notificationState.push(args);\r\n}", "function buildNotification(notifInfos, body) {\n let notification = {\n \"id\" : \"urn:ngsi-ld:Notification:\"+getRandomIntInclusive(1, 100000),\n \"type\" : \"Notification\",\n \"subscriptionId\" : notifInfos.subscriptionId,\n \"context\" : \"http://uri.etsi.org/ngsi-ld/notification\",\n \"notifiedAt\": Date(),\n \"data\": body\n };\n return notification;\n}", "function newTaskFillProjects(selectedProjectID) {\n pubSub.publish('fillNewTaskPrjLst', { projectArr, selectedProjectID });\n}", "function notifyUser(notifObj) {\n chrome.notifications.create(notifObj.title, notifObj, function (notificationId) {\n console.log(notificationId, 'notification created');\n });\n}", "async create(notification){\n try {\n let newNotification = await Notification.create(notification);\n newNotification = await newNotification.populate([\n {path:'notifier'},\n {path:'publication'}\n ]).execPopulate();\n console.log(\"the fresh notif is : \"+util.inspect(newNotification));\n return newNotification;\n } catch (error) {\n console.log('error in notif repo create notif');\n throw(error);\n }\n }", "init(project_key, notificationIds) {\n log.start = 'init'\n\n log(`Project ${project_key} set. (v${this.version})`);\n this.project_key = project_key;\n\n log(`프로젝트 키에 기반해, 라이브 중인 공지 아이디들을 사전에 가져와 준비합니다. (${notificationIds})`);\n if (notificationIds) this.notificationIds = notificationIds;\n\n log('프레임 컨테이너를 body 하단에 삽입합니다. (div#attention-container)');\n const container = document.createElement('div');\n container.id = 'attention-container';\n document.body.insertBefore(container, null);\n this.container = container;\n\n log('자식 프레임에서 전송한 메세지를 부모프레임에서 받을 수 있습니다.')\n window.addEventListener('message', this.__receiveMessageFromIframe.bind(this), false);\n }", "function newNotification(str) {\n notifier.notify({\n title: 'Bitmark Node App',\n message: `${str}`,\n icon: path.join(__dirname, 'assets/icons/app_icon.png'),\n sound: true,\n wait: false\n });\n}", "function createdCallback(n_id) {\n console.log(\"Succesfully created \" + n_id + \" notification\");\n}", "function createdCallback(n_id) {\n console.log(\"Succesfully created \" + n_id + \" notification\");\n}", "function createdCallback(n_id) {\n console.log(\"Succesfully created \" + n_id + \" notification\");\n}", "function NewProject ({ joinProjectHandler }) {\n const [width] = useWindowSize()\n const projects = useContext(AvailableProjectContext)\n const styling = {\n cardSize: width > 767 ? 'default' : 'small'\n }\n\n // Send a message that the user has joined the project successsfully\n const openNotificationWithIcon = (type, name) => {\n notification[type]({\n message: 'Welcome!',\n description: `You are now a part of ${name}.`\n })\n }\n\n return (\n <>\n // Map over the projects in state\n {projects.map(project => (\n <Card\n style={{ marginBottom: 10 }}\n bodyStyle={{ paddingTop: 0 }}\n headStyle={{ borderBottom: 'none' }}\n title={project.name}\n size={styling.cardSize}\n >\n <div style={{ wordWrap: 'break-word' }}>\n <span style={{ fontWeight: 600 }}>Skills: </span>\n <span style={{ fontStyle: 'italic' }}>{project.skills}</span>\n </div>\n <div\n style={{\n textAlign: 'left',\n wordWrap: 'break-word',\n marginTop: '0.5rem'\n }}\n >\n <span style={{ fontWeight: 600 }}>Description: </span>\n {project.description}\n </div>\n <br />\n <Button\n id={project._id}\n style={{ backgroundColor: '#FD4F64', border: 'none' }}\n shape='round'\n type='primary'\n onClick={() => {\n openNotificationWithIcon('success', project.name)\n return joinProjectHandler(project._id)\n }}\n >\n Join\n </Button>\n </Card>\n ))}\n </>\n )\n}", "function createNotify()\n{\n\n\t\tif( get[ 'msg' ] == 'insert' )\n\t\t{\n\n\t\t\t\tnotifySuccess( 'El menú <b>' + get[ 'element' ] + '</b> ha sido creado correctamente.' );\n\n\t\t}\n\n}", "function sendNotification(){\n var msg = \"Edited at: \" + new Date().toTimeString(); \n SharedDb.sendGCM(msg);\n}", "onProjectUpdate(project) {}", "function updateproject()\n{\n var logopener=\"----entering updateproject----\";\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 apiworkprojectupdate(tempbutton);\n \n var logcloser=\"----leaving updateproject----\";\n console.log(logcloser);\n}", "function newNotification(str){\n\tnotifier.notify(\n\t\t{\n\t\t\ttitle: \"Bitmark Node\",\n\t\t\tmessage: `${str}`,\n\t\t\ticon: path.join(__dirname, 'assets/icons/app_icon.png'),\n\t\t\tsound: true,\n\t\t\twait: false\n\t\t}\n\t);\n}", "function recieveProject(json){\n\tconst projectDetail = json;\n\treturn {\n\t\ttype: RECEIVE_PROJECT,\n\t\tprojectDetail\n\t}\n}", "showNotification(data) {\n var opt = {\n type: \"basic\",\n title: \"TeamPlay\",\n message: \"Your final score was \" + data.score + \".\",\n iconUrl: \"./images/icon-32.png\"\n }\n chrome.notifications.create(this.uuidv4(), opt, null);\n }", "function creatProject(id, title) {\n return {\n 'id': id,\n 'title': title,\n tasks: []\n }\n\n}", "function getProjectID(evt) {\n projectId =\n evt.target.tagName === \"BUTTON\"\n ? evt.target.parentElement.parentElement.dataset.projectId\n : evt.target.parentElement.parentElement.parentElement.dataset.projectId;\n return projectId;\n}", "function pushToUser(title,body,url,tag){\n\n readAllData('peter-parker')\n .then(function(data) {\n // console.log('peter-parker',data[0].pp);\n if(data[0] == undefined){\n var pId = '';\n }else{\n var pId = data[0].pp;\n }\n \n if(pId){\n //push programatically \n fetch('https://onesignal.com/api/v1/notifications', {\n method: 'POST',\n headers: {\n 'Authorization': 'Basic MWU1ZjQ5YzUtNmM0OS00MzVlLWE5ZGQtMDg2ZjYzMDcwZjE1',\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n 'app_id':'da6349ad-e18f-471b-8d57-30444a9d158f',\n 'contents': {'en': body},\n 'headings': {'en': title},\n 'url': url,\n 'include_player_ids': [pId],\n 'web_push_topic':tag,\n 'chrome_web_image':'http://localhost:8000/images/push-images/completed.png',//512 or >\n 'chrome_web_badge':'http://localhost:8000/images/app-icons/app-icon-96x96.png',// 72 or >\n // 'chrome_web_icon':'http://localhost:8000/images/app-icons/app-icon-192x192.png' //192 or >\n })\n })\n .then(res=> {\n console.log('push ok');\n }) \n .catch(error =>{\n console.log(error) \n })\n } else{\n console.log('no pId to push to')\n } \n })\n \n }", "function createNotification (type, message) {\n\treturn {\n\t\ttype,\n\t\tmessage,\n\t\ttime: Date.now(),\n\t}\n}", "function newTeamNotify(com_id, comName){\n //com_id = '22';\n //comName = 'aaa';\n MailApp.sendEmail({to:\"iboostzone@gmail.com,tngrant@ryerson.ca, jpsilva@ryerson.ca\" , subject: \"New Team Registered\", htmlBody: \"The Following Team has Registered: <br><br><br> Company Name: \" + comName + \"<br><br> iBoost Team ID : \" + com_id+\"<br><br><br><br> Best, <br><br> <img src='cid:logo' height='50' width='150'>\", inlineImages:{logo: imageLogo}});\n}", "function sendNotification(x){\n if (!(\"Notification\" in window)) {\n /* If the browser deosn't support push notifications\n we alert user alert box to inform the user */\n alert(x.tasksTitle);\n }\n else {\n if (Notification.permission === \"granted\") {\n let notification = new Notification(x.tasksTitle);\n }\n }\n}", "function newProject(spec) {\n //first upload the files for pictures and pvs source\n uploadFile(spec.prototypeImage, function (res) {\n var uploadedImageFile = JSON.parse(res.responseText).fileName;\n uploadFile(spec.pvsSpec, function (res) {\n var uploadedSpecFile = JSON.parse(res.responseText).fileName;\n //call websocket to create new project\n ws.send({\n type: \"createProject\",\n uploadedSpecFileName: uploadedSpecFile,\n clientSpecFileName: spec.pvsSpec.name,\n projectName: spec.projectName,\n uploadedImageFileName: uploadedImageFile,\n clientImageFileName: spec.prototypeImage.name\n }, function (res) {\n console.log(res);\n if (!res.error) {\n currentProject = res;\n d3.select(\"div#body\").style(\"display\", null);\n ws.startPVSProcess(res.spec.split(\".pvs\")[0], currentProject.name,\n pvsProcessReady);\n var imagePath = \"../../projects/\" + currentProject.name + \"/\" +\n currentProject.image;\n updateImage(imagePath);\n updateProjectName(currentProject.name);\n d3.select(\"#imageDragAndDrop.dndcontainer\").style(\"display\", \"none\");\n }\n });\n });\n });\n\t}", "function postNotification() {\n var notification,\n notificationDict;\n\n try {\n // Sets notification dictionary.\n notificationDict = {\n content: \"Hello Tizen!\",\n iconPath: \"../icon.png\",\n };\n // Creates notification object.\n notification = new tizen.StatusNotification(\"SIMPLE\", \"Notification Manager\", notificationDict);\n\n // Posts notification.\n tizen.notification.post(notification);\n } catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "async createJiraProj(projName, projKey) {\n return await this.jiraClientAuth.project.createProject({\n description: \"\",\n url: \"http://atlassian.com\",\n name: projName,\n projectTypeKey: \"software\",\n projectTemplateKey: \"com.pyxis.greenhopper.jira:gh-simplified-agility-scrum\", //template for next-gen project\n key: projKey,\n lead: \"admin\",\n assigneeType: \"UNASSIGNED\"\n //categoryId: 10203\n }).then(data => {\n console.log(\"[JIRA]Jira project created\");\n return data.id;\n })\n .catch(e => console.log('[JIRA]Project named ' + projName + ' already exists-- ', e.message));\n }", "notifyOnPullRequestCreated(id, target, options) {\n return this.notifyOn(id, target, {\n ...options,\n events: [RepositoryNotificationEvents.PULL_REQUEST_CREATED],\n });\n }", "function newCommentNotification(pin_ID) {\n\n\n\tconsole.log('New comment notification sending for #' + pin_ID);\n\n\n\tvar pin = getPin(pin_ID);\n\tvar pinNumber = getPinNumber(pin_ID);\n\n\n\tdoAction('newCommentNotification', 'pin', pin_ID, pinNumber, \"\", \"\");\n\n\n\tpinWindow(pin_ID).attr('data-new-notification', 'no');\n\n}", "function new_proj() {\n // First, get text of server status span.\n var status = $('#server_status_badge').text().toLowerCase();\n\n // Note: we don't have to check whether the server is online because\n // the \"new project\" button is only enabled when the server is on.\n\n // Show the loading spinner.\n var button = $('#new_proj_btn');\n var spinner = $('#loading_spinner');\n set_loading_spinner(button, spinner);\n\n // Send new project request.\n // submit ajax request\n var target = 'cgi_request.php';\n var data = {\n action: 'new_proj'\n };\n var callback = parse_new_proj;\n send_ajax_request(target, data, callback, true, spinner);\n}", "function createNotification(title, message) {\n // Let's check if the browser supports notifications\n\n // Let's check if the user is okay to get some notification\n if (Notification.permission === \"granted\") {\n // If it's okay let's create a notification\n\n var img = \"%PUBLIC_URL%/assets/icons/apple-touch-icon.png\";\n var text = message;\n var notification = new Notification(title, {\n body: text,\n icon: img,\n badge: \"%PUBLIC_URL%/assets/icons/android-chrome-512x512.png\",\n timestamp: Date.now()\n // actions: [\n // {\n // action: \"coffee-action\",\n // title: \"Coffee\",\n // icon: \"/images/demos/action-1-128x128.png\"\n // },\n // {\n // action: \"doughnut-action\",\n // title: \"Doughnut\",\n // icon: \"/images/demos/action-2-128x128.png\"\n // }\n // ]\n });\n\n window.navigator.vibrate(500);\n }\n\n // Otherwise, we need to ask the user for permission\n // Note, Chrome does not implement the permission static property\n // So we have to check for NOT 'denied' instead of 'default'\n else if (Notification.permission !== \"denied\") {\n Notification.requestPermission(function(permission) {\n // Whatever the user answers, we make sure Chrome stores the information\n if (!(\"permission\" in Notification)) {\n Notification.permission = permission;\n }\n\n // If the user is okay, let's create a notification\n if (permission === \"granted\") {\n var img = \"%PUBLIC_URL%/assets/icons/apple-touch-icon.png\";\n var text = message;\n var notification = new Notification(\"Todolist\", {\n body: text,\n icon: img\n });\n\n window.navigator.vibrate(500);\n }\n });\n }\n}", "function notify(message) {\n console.log(\"Creating a notification....\");\n chrome.notifications.create({\n \"type\": \"basic\",\n \"iconUrl\": \"http://www.google.com/favicon.ico\",\n \"title\": \"Notification\",\n \"priority\": 1,\n \"message\": message.url\n });\n}", "function generateNotification(title, content){\n if(Notification.permission !== 'granted'){\n Notification.requestPermission();\n }\n\n n = new Notification( title, {\n body: content,\n icon : \"/img/generation-finished.png\"\n });\n}", "function canclePeerreview(project_id,artfact_name) { // id = notification id\n // jQuery AJAX call for JSON\n $.getJSON( '/projects/canclePeerreview/' + project_id + '/' + artfact_name, function( ) {\n\n });\n}", "function doNotify(item) {\n\tif(item == null)\n\t\treturn;\n\tpostObject = item;\n\tchrome.notifications.create(\"id\"+notID++, makeOption(item), creationCallback);\n}", "function createNewProject() {\n\t\n\t// Get number of tracks\n\tvar numTracks = parseInt($(\"#input-num-channels\").val());\n\tif(numTracks < 1) {\n\t\tpopToast(\"Please enter the number of tracks\");\n\t\treturn;\n\t}\n\t\n\t// Get input name\n\tvar newName = $(\"#input-new-project-name\").val();\n\tif(newName == \"\") {\n\t\tpopToast(\"Please fill in the project name\");\n\t\treturn;\n\t}\n\t\n\t\n\t// Get audio file\n\tvar newAudioFile = $(\"#input-audio-upload\").get(0).files[0];\n\tif($(\"#input-audio-upload\").val() == \"\") {\n\t\tpopToast(\"Please select a song file\");\n\t\treturn;\n\t}\n\t\n\t// Create ID\n\tvar newId = idify(newName);\n\t\n\tvar newProjectData = {\n\t\t\"name\": newName,\n\t\t\"id\": newId\n\t};\n\t\n\t// Create project object\n\tvar newTracks = createTrackArray(numTracks);\n\tvar newProjectObject = {\n\t\t\"projectData\": newProjectData,\n\t\t\"tracks\": newTracks\n\t};\n\t\n\tif(mode === MODE_LOCAL) {\n\t\t\n\t\tTimeline.loadProjectObject(newProjectObject);\n\t\tvar audioURL = URL.createObjectURL(newAudioFile); \n\t\twavesurfer.load(audioURL);\n\t}\n\telse {\n\t\tvar newProjectString = JSON.stringify(newProjectObject);\n\t\tvar newProjectFile = new Blob([newProjectString], { type: \"application/json\"});\n\t\t\n\t\t// Create form data\n\t\tvar formData = new FormData();\n\t\tformData.append(\"projectName\", newName);\n\t\tformData.append(\"audioFile\", newAudioFile);\n\t\t//formData.append(\"projectFile\", newProjectFile);\n\t\tformData.append(\"projectText\", newProjectString);\n\t\t\n\t\tvar xhr = new XMLHttpRequest();\n\t\t// Add any event handlers here...\n\t\txhr.open('POST', API_PATH + \"createproject.php\", true);\n\t\t\n\t\txhr.onload = function() {\n\t\t\tpopToast(xhr.response);\n\t\t}\n\t\t\n\t\txhr.send(formData);\n\t}\n\t\n\t$(\".modal\").modal(\"close\");\n}", "addDueDateNotification() {\n this.notificationDOMRef.current.addNotification({\n title: \"Warning\",\n message: \"Project Will Be Overdue\",\n type: \"warning\",\n insert: \"top\",\n container: \"top-right\",\n animationIn: [\"animated\", \"fadeIn\"],\n animationOut: [\"animated\", \"fadeOut\"],\n dismiss: { duration: 5000 },\n dismissable: { click: true }\n });\n }", "function Notification(){}", "function notify(message){\n chrome.notifications.create(null, message, null)\n\n}", "function triggerNotification(issueTitle, issueLink, issueMilestone) {\n var notification = new Notification(issueTitle + \" is ready to be reviewed!\", {\n tag: 'icanhazissues-review-notification',\n body: \"Card has been moved to the review column for the \" + issueMilestone\n + \" milestone.\"\n });\n\n notification.onclick = function() {\n window.open(issueLink);\n }\n\n notification.onshow = function() {\n setTimeout(notification.close.bind(notification), 10000);\n }\n}", "function addNotification (title, author, authorAvatar, date, url) {\n const divBlocNotif = document.createElement('div')\n divBlocNotif.id = 'blocNotif'\n const divDate = document.createElement('div')\n divDate.id = 'date'\n divDate.innerText = date\n const divPseudo = document.createElement('div')\n divPseudo.id = 'pseudo'\n divPseudo.innerText = author\n const divTitle = document.createElement('div')\n divTitle.id = 'title'\n divTitle.innerText = title\n const imgAvatar = document.createElement('img')\n imgAvatar.src = authorAvatar\n const divNotif = document.createElement('div')\n divNotif.id = 'notification'\n const a = document.createElement('a')\n a.href = url\n a.target = '_blank' // Open the notification in a new window\n\n divBlocNotif.appendChild(divDate)\n divBlocNotif.appendChild(divPseudo)\n divBlocNotif.appendChild(divTitle)\n divNotif.appendChild(imgAvatar)\n divNotif.appendChild(divBlocNotif)\n a.appendChild(divNotif)\n contentDiv.appendChild(a)\n}", "@action addNotification(settings){\n this.notificationManager.addNotification(settings);\n }", "createNotification(message) {\n const messageEvent = new CustomEvent(\"notify\", {\n bubbles: false,\n detail: {message}\n });\n this.notification_container.dispatchEvent(messageEvent)\n }", "function createNotification(reminder) {\n const notification = new electron.Notification({ title: \"Cue\", body: \"Hello\" });\n // Open a new window when the notification is clicked\n\n notification.on(\"click\", getClickHandler(reminder));\n notification.show();\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 }", "static async submitProject(id,projectName, projectDescription){\n \n try{\n const response = await db.result(`INSERT INTO projects (users_id,name,project_description)\n VALUES ($1,$2, $3);`,[id,projectName, projectDescription]); \n return response;\n } catch (error){\n return error.message;\n }\n }", "function notification(token,browser){\n var browsername =browser.name;\n\t var bID =browser.version;\n \t $.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: getBaseURL()+'push_notification_controller/add_notification/'+token+'/'+browsername+'/'+bID,\n\t\t \tsuccess: function (data) {\t\t\t\t\n\t\t\tconsole.log(data);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t console.log(textStatus, errorThrown);\n\t\t\t}\n\t\t});\n\t}", "function addProject(project, professor_id) {\n project.professor_id = professor_id; \n return db('projects')\n .insert(project, 'id')\n .then(ids => {\n const [ id ] = ids; \n return db('projects') \n .where({ id })\n .first(); \n }); \n}", "new() {\n this.props.newProject();\n this.props.onNew();\n }", "function createTodoProject(input){\n let id = $(`.changeId`).attr('id')\n console.log('masuk yaaa', input)\n console.log('ini id', id)\n axios({\n url: `${baseUrl}/projects/${id}`,\n method: `post`,\n data: input,\n headers: {\n token: localStorage.getItem('token')\n }\n })\n .then(({data})=>{\n swal.fire('Created todo in project')\n projectDetails(id)\n })\n .catch((err)=>{\n Swal.fire({\n type: 'error',\n title: 'Oops...',\n text: `${err.response.data.message}`\n })\n })\n}", "function projectClick(proj, text) {\n btp = text;\n btp = btp.substring(15, 30);\n var id = proj;\n\n if (btp.includes(\"to\")) {\n id = \"cs3220\";\n }\n\n return id;\n}", "function notificationClicked(id) {\n console.log(\"The notification '\" + id + \"' was clicked\");\n if (!(typeof urls[id] === 'undefined')) {\n chrome.tabs.create({url: urls[id]});\n }\n ;\n}", "function notificationClicked(id) {\n console.log(\"The notification '\" + id + \"' was clicked\" );\n if(!(typeof urls[id] === 'undefined'))\n {\n chrome.tabs.create({url: urls[id]});\n };\n}", "makeNotification(newUsername) {\n const oldName = this.state.currentUser.name;\n return {\n type: 'postNotification',\n content: `User ${oldName} changed their name to ${newUsername}`\n }\n }", "function notify(){\n\n var opt = {\n type: \"basic\",\n title: \"Your need a break\",\n message: \"Rest your eyes to stay healthy!\",\n iconUrl: \"images/coffee.png\"\n }\n\n\topt.buttons = [];\n\topt.buttons.push({ title: 'Take a break' });\n\topt.buttons.push({ title: 'In a few minutes' });\n\n chrome.notifications.clear('ec' + (notId - 1), clearCallback);\n chrome.notifications.create('ec' + notId++, opt, creationCallback);\n if (soundsON){ $('#audioNotif').trigger('play'); }\n}", "function projectCreate(cb) {\n\n var project = new Project ({\n _userId: users[0],\n _resourceId: resources[0],\n _phase: phases[0],\n name:'Project Management',\n type:'IT',\n start_date:'2017-06-06',\n end_date:'2018-02-06',\n budget:45000,\n status: 'Ongoing',\n percentageComplete:40.5,\n description: 'Project Management tool',\n deletedAt: null\n });\n\n project.save( function (err)\n {\n if (err) {\n cb('project', null);\n return;\n }\n console.log('New Project: ' + project);\n projects.push(project);\n cb(null, project);\n })\n}", "function createProject(){\n\n\tvar name = $('#project-name').val();\n\tprojectName = name;\n\t$.ajax({\n\t\tdata : { \n\t\t\tproject : name\n\t\t},\n\t\ttype : 'POST',\n\t\turl : '/create_project'\n\t})\n\t.done(function(data) {\n\t\tif (data.sukses) {\n\t\t\t$('#create-project').hide();\n\t\t\t$('#nama-project').text(name).show();\n\t\t\t$('#setting-custom').show();\n\t\t\tprojectId = data.id;\n\t\t\tconsole.log(projectId);\n\t\t}else{\n\t\t\t$('#name-exist').show();\n\t\t}\n\t\t\t\t\n\t});\n}", "function createProject(account, project, pat, userAgent, callback) {\n \"use strict\";\n\n var teamProject = {};\n let token = encodePat(pat);\n\n var options = addUserAgent({\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n authorization: `Basic ${token}`\n },\n json: true,\n url: `${getFullURL(account)}/_apis/projects`,\n qs: {\n 'api-version': PROJECT_API_VERSION\n },\n body: {\n name: project,\n capabilities: {\n versioncontrol: {\n sourceControlType: 'Git'\n },\n processTemplate: {\n templateTypeId: '6b724908-ef14-45cf-84f8-768b5384da45'\n }\n }\n }\n }, userAgent);\n\n async.series([\n function (thisSeries) {\n request(options, function (err, res, body) {\n teamProject = body;\n thisSeries(err);\n });\n },\n function (thisSeries) {\n var status = '';\n\n // Wait for Team Services to report that the project was created.\n // Use whilst to keep calling the the REST API until the status is\n // either failed or succeeded.\n async.whilst(\n function () {\n return status !== 'failed' && status !== 'succeeded';\n },\n function (finished) {\n setTimeout(function () {\n checkStatus(teamProject.url, token, userAgent, function (err, stat) {\n status = stat.status;\n finished(err);\n });\n }, 15000 + Math.floor((Math.random() * 1000) + 1));\n },\n thisSeries\n );\n },\n function (thisSeries) {\n var options = addUserAgent({\n method: 'GET',\n headers: {\n 'cache-control': 'no-cache',\n 'authorization': `Basic ${token}`\n },\n url: `${getFullURL(account)}/_apis/projects/${project}`,\n qs: {\n 'api-version': PROJECT_API_VERSION\n }\n }, userAgent);\n\n // Get the real id of the team project now that is exist.\n request(options, function (err, res, body) {\n if (err) {\n thisSeries(err);\n return;\n }\n\n if (res.statusCode !== 200) {\n thisSeries({\n message: 'Unable to find newly created project.'\n });\n return;\n }\n\n var project = JSON.parse(body);\n thisSeries(err, project);\n });\n }\n ], function (err, result) {\n // By the time I get there the series would have completed and\n // the first two entries in result would be null. I only want\n // to return the team project and not the array because when we\n // find the team project if it already exist we only return the\n // team project.\n callback(err, result[2]);\n });\n}", "function saveProject(project) {\n var response = $q.defer();\n if (project.id && project.id.length === 36) {\n Project.Update(project)\n .then(function (newProject) {\n $scope.isNew = false;\n $scope.projectid = newProject.id;\n $scope.Model = newProject;\n\n if (newProject.designconsult) {\n $scope.Model.designconsult = new Date(newProject.designconsult);\n }\n if (newProject.install) {\n $scope.Model.install = new Date(newProject.install);\n }\n if (newProject.completed) {\n $scope.Model.completed = new Date(newProject.completed);\n }\n return response.resolve(newProject);\n }, function (error) {\n return response.reject(error);\n });\n }\n else {\n Project.Add(project)\n .then(function (newProject) {\n $scope.isNew = false;\n $scope.projectid = newProject.id;\n $scope.Model = newProject;\n if (newProject.designconsult) {\n $scope.Model.designconsult = new Date(newProject.designconsult);\n }\n if (newProject.install) {\n $scope.Model.install = new Date(newProject.install);\n }\n if (newProject.completed) {\n $scope.Model.completed = new Date(newProject.completed);\n }\n return response.resolve(newProject);\n }, function (error) {\n return response.reject(error);\n });\n }\n\n return response.promise;\n }", "function Project(id, name, description, time) {\n this.id = id.toString();\n this.name = name;\n this.description = description;\n this.time = time;\n}", "function sendNotification(title, text) {\n Pebble.showSimpleNotificationOnPebble(title, text);\n}", "function NotificationObject(aId) {\r\n this._init(aId);\r\n}", "function sendNotification() {\n http.get(`/subscription/${subscritionId}`);\n}", "function addNotification(icon) {\n // Get the app\n let app = icon.parentElement;\n // Get the badge\n let badge = app.getElementsByClassName('badge')[0];\n // Get the badge count\n let badgeCount = getBadgeCount(badge);\n // Increate by between 1 and 3\n badgeCount = badgeCount + 1 + Math.floor(Math.random() * 3);\n // Set the badge\n setBadgeCount(icon, badgeCount);\n // Start a new timer\n addNotificationTimer(icon);\n}", "function addProject() {\n\n\twindow.location.assign(\"project.html?timestamp=\" + Date.now());\n\t\n}", "showNotification(params) {\n params = Object.assign({\n id: GLib.DateTime.new_now_local().to_unix(),\n title: this.name,\n body: '',\n icon: new Gio.ThemedIcon({name: `${this.icon_name}-symbolic`}),\n priority: Gio.NotificationPriority.NORMAL,\n action: null,\n buttons: []\n }, params);\n\n let notif = new Gio.Notification();\n notif.set_title(params.title);\n notif.set_body(params.body);\n notif.set_icon(params.icon);\n notif.set_priority(params.priority);\n\n // Default Action\n if (params.action) {\n let hasParameter = (params.action.parameter !== null);\n\n if (!hasParameter) {\n params.action.parameter = new GLib.Variant('s', '');\n }\n\n notif.set_default_action_and_target(\n 'app.deviceAction',\n new GLib.Variant('(ssbv)', [\n this.id,\n params.action.name,\n hasParameter,\n params.action.parameter\n ])\n );\n }\n\n // Buttons\n for (let button of params.buttons) {\n let hasParameter = (button.parameter !== null);\n\n if (!hasParameter) {\n button.parameter = new GLib.Variant('s', '');\n }\n\n notif.add_button_with_target(\n button.label,\n 'app.deviceAction',\n new GLib.Variant('(ssbv)', [\n this.id,\n button.action,\n hasParameter,\n button.parameter\n ])\n );\n }\n\n this.service.send_notification(`${this.id}|${params.id}`, notif);\n }", "function createDummyProject(total) {\n total = total || 0;\n var projectId = createUUID(12);\n return {\n id: projectId,\n title: 'Project ' + (parseInt(total, 10) + 1),\n timestamp: (+new Date),\n totals: {\n success: null,\n warning: null,\n error: null,\n views: 0\n }\n };\n }", "scheduleNotification({ date, title, message, playSound = true, soundName = 'default' } = {}) {\r\n PushNotification.localNotificationSchedule({\r\n date,\r\n title,\r\n message,\r\n playSound,\r\n soundName,\r\n channelId: this.channelId,\r\n });\r\n }", "function GetProjectId(){}", "function add(notification, callback, $scope) {\n window.plugin.notification.local.add({\n id: notification.id, //(String) A unique id of the notifiction\n date: notification.date, //(Date) This expects a date object\n message: notification.message, //(String) The message that is displayed\n title: notification.title, //(String) The title of the message\n repeat: notification.repeat, //(String) Either 'secondly', 'minutely', 'hourly', 'daily', 'weekly', 'monthly' or 'yearly'\n badge: notification.badge, //(Number) Displays number badge to notification\n sound: notification.sound, //(String) A sound to be played\n json: notification.json, //(String) Data to be passed through the notification\n autoCancel: notification.autoCancel || true, //(Boolean) Setting this flag and the notification is automatically canceled when the user clicks it\n ongoing: notification.ongoing || true //(Boolean) Prevent clearing of notification (Android only)\n }, callback, $scope);\n }", "function sendEmail() {\n var milestoneData = getMilestoneData();\n var htmlBody = getEmailHtml(milestoneData);\n var recipients = getMailAddress();\n var projectTitle = getProjectTitle();\n MailApp.sendEmail({\n to : recipients,\n subject : 'Weekly Updates (' + projectTitle + ')',\n htmlBody : htmlBody\n });\n}", "function _add_push_notification_item(evt){\n try{\n var tmp_var = null;\n var temp_str = evt.name;\n var length = ((temp_str.length)*8 > (self.screen_width-20))?(self.screen_width-20):(temp_str.length)*8;\n if(length <50){\n length = 50;\n }\n tmp_var = {\n level:0,\n length:length,\n content:evt.content,\n name:evt.name,\n source:evt.source,\n source_id:evt.source_id\n };\n _display_contact_item(tmp_var);\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _add_push_notification_item');\n return;\n } \n }", "function sendNotification() {\n // overrides default that no notifs will show when app is in foregruond\n Notifications.setNotificationHandler({\n handleNotification: async () => ({\n shouldShowAlert: true\n })\n });\n\n Notifications.scheduleNotificationAsync({\n content: {\n title: 'Your Service Request',\n body: `Your request for ${selectedService}, ${date} has been submitted`\n },\n // causes notif to fire immed. cd also set to future or repeat or both\n trigger: null\n });\n }", "function Notification (id, controller) {\n // Call superconstructor first (AutomationModule)\n Notification.super_.call(this, id, controller);\n}", "function saveProject(projectName, toSave){\n\tvar DataBaseRef = firebase.database().ref();\n\tvar user = firebase.auth().currentUser;\n\tuid = user.uid\n\tvar message = toSave;\n\tDataBaseRef.child(\"User\").child(uid).child(\"Saved\").child(projectName).set(toSave);\n\talert(\"Project Saved As: \"+projectName);\n}", "function createInfoNotification(message, seconds){\n\tcreateNotification(message, \"info\", seconds);\n}", "function notifyMe(data) {\n const textsPerType = {\n idle: {\n title: \"Don't stay idle!!!\",\n body: data => {\n return \"Hey there! You've been idle for \" + data.idleTime + ' minute(s)';\n }\n },\n done: {\n title: 'Timer complete',\n body: data => {\n return \"Feel free to take a break! Do it!\";\n }\n }\n };\n const texts = textsPerType[data.type];\n // Request permission if not yet granted\n if (Notification.permission !== \"granted\") {\n Notification.requestPermission();\n }\n else {\n var notification = new Notification(texts.title, {\n icon: 'https://ares.gods.ovh/img/Tomato_icon-icons.com_68675.png',\n body: texts.body(data),\n });\n\n notification.onclick = function () {\n window.open(\"http://stackoverflow.com/a/13328397/1269037\"); \n };\n }\n }", "function newProject () {\n ADX.getTemplateList('adc', function (err, adcTemplates) {\n if (err) throw err;\n ADX.getTemplateList('adp', function (err, adpTemplates) {\n if (err) throw err;\n showModalDialog({\n type : 'newADXProject',\n buttonText : {\n ok : 'Create project'\n },\n adcTemplates : adcTemplates,\n adpTemplates : adpTemplates,\n defaultRootDir : app.getPath('documents')\n }, 'main-create-new-project');\n });\n });\n}", "function apiPush(apiInfoId) {\n showSendNotify(\"Pushing Doc\")\n $.ajax({\n type: \"GET\",\n url: apiDocPushUrl,\n data:{ \"apiInfoId\": apiInfoId },\n success: function (data) {\n data = unpackResult(data);\n if (data.code !=200){\n openMsgModal(data.msg);\n return;\n }\n $(\"#repository>.buttons>div\").text(data.data);\n },complete:function () {\n hideSendNotify();\n }\n });\n}", "get id() { return this.projectId }", "function createProject(name) {\n return { id: Date.now().toString(), name: name, tasks: [] };\n}", "async function createNotification(name, endDate, timeOfNotification) {\n let noti = new Date(endDate.getTime())\n noti.setDate(endDate.getDate() - 1)\n\n noti.setHours(timeOfNotification)\n noti.setMinutes(0)\n noti.setSeconds(0)\n\n //makes sure the notification is in the future\n if (noti > new Date()) {\n console.log(\"noti for \" + noti)\n await Notifications.scheduleNotificationAsync({\n content: {\n title: `${name} is recurring soon!`,\n body: `Your ${name} subscription is about to recur`,\n data: { data: 'goes here' },\n },\n trigger: noti,\n })\n\n //TODO: Just for testing\n Notifications.cancelAllScheduledNotificationsAsync()\n }\n}", "projectMessages(number){\n\n }", "function onNotification( e )\n{\n $( \"#app-status-ul\" ).append( '<li>EVENT -> RECEIVED:' + e.event + '</li>' );\n\n switch ( e.event )\n {\n case 'registered':\n if ( e.regid.length > 0 )\n {\n localStorage.setItem( \"regid_L\" , e.regid ); // $( \"#app-status-ul\" ).append( '<li> REGID:' + e.regid + \"</li>\" );\n // Your GCM push server needs to know the regID before it can push to this device here is where you might want to send it the regID for later use.\n $( \"#Timer\" ).val( e.regid );\n }\n break;\n\n case 'message':\n // if this flag is set, this notification happened while we were in the foreground. // you might want to play a sound to get the user's attention, throw up a dialog, etc.\n if ( e.foreground )\n {\n $( \"#app-status-ul\" ).append( '<li>--INLINE NOTIFICATION--' + '</li>' );\n // on Android soundname is outside the payload. // On Amazon FireOS all custom attributes are contained within payload\n var soundfile = e.soundname || e.payload.sound;\n // if the notification contains a soundname, play it. // playing a sound also requires the org.apache.cordova.media plugin\n var my_media = new Media( \"/android_asset/www/\" + soundfile );\n my_media.play();\n }\n else\n {\t// otherwise we were launched because the user touched a notification in the notification tray.\n if ( e.coldstart )\n {\n $( \"#app-status-ul\" ).append( '<li>--COLDSTART NOTIFICATION--' + '</li>' );\n }\n else\n {\n $( \"#app-status-ul\" ).append( '<li>--BACKGROUND NOTIFICATION--' + '</li>' );\n }\n }\n\n $( \"#Timer\" ).append( '<pre>' + preJs( e.payload ) + '</pre>' );\n $( \"#app-status-ul\" ).append( '<li>MESSAGE -> MSG: ' + e.payload.message + '</li>' );\n $( \"#app-status-ul\" ).append( '<li>MESSAGE -> MSG: ' + e.payload.sessionId + '</li>' );\n if ( e.payload.sessionId != undefined && e.payload.sessionId != '' && e.payload.sessionId != null )//&& (localStorage.getItem('session_L')==undefined || localStorage.getItem('session_L')=='')\n {\n localStorage.setItem( \"session_L\" , e.payload.sessionId );\n }\n if ( e.payload.ownerId != undefined && e.payload.ownerId != '' && e.payload.ownerId != null && (localStorage.getItem( 'owner_L' ) == undefined || localStorage.getItem( 'owner_L' ) == '') )\n {\n localStorage.setItem( \"owner_L\" , e.payload.ownerId );\n }\n //android only // $( \"#app-status-ul\" ).append( '<li>message -> timestamp: ' + e.payload.timStamp + '</li>' );\n if ( parseInt( e.payload.status ) == 1 )\n {\n localStorage.setItem( \"join_L\" , '1' );\n location = 'confirm.html';//TODO:\n } // if ( e.payload.message.indexOf( 'join' ) != -1 )\n else if ( parseInt( e.payload.status ) == 2 )\n {//start session\n $( \".Notes\" ).show();\n $( '#blockFromParticipants' ).hide();\n $( '#record_Section' ).show();\n $( '#CameraBtn' ).show();\n\n startTImeShow = startTIme = Math.floor( Date.now() / 1000 );\n secInterval = setInterval( function () {myTimerParticipent()} , 1000 );\n }\n else if ( parseInt( e.payload.status ) == 3 )\n {//stop session\n toast( 'session is about to end in 10 seconds. please upload images and tags. thank you. ' , 5000 );\n setTimeout( function ()\n {//SHOW THE SPLASH SCREEN for 2 seconds after that redirect the user to home page\n $( '#messageOpenSession' ).text( 'session is finished thank you' );\n clearInterval( secInterval );\n $( \".Error_Black_BG,#Thank_message\" ).show();\n localStorage.setItem( \"session_L\" , '' );\n if ( tagsToSend.length > 0 )\n {\n uploadTags();\n }\n\n } , 10000 );\n }\n break;\n case 'error':\n $( \"#app-status-ul\" ).append( '<li>ERROR -> MSG:' + e.msg + '</li>' );\n break;\n\n default:\n $( \"#app-status-ul\" ).append( '<li>EVENT -> Unknown, an event was received and we do not know what it is</li>' );\n break;\n }\n}", "function onNotification(e) {\n console.log('<li>EVENT -> RECEIVED:' + e.event + '</li>');\n\n switch( e.event )\n {\n case 'registered':\n if ( e.regid.length > 0 )\n {\n console.log('<li>REGISTERED -> REGID:' + e.regid + \"</li>\");\n // Your GCM push server needs to know the regID before it can push to this device\n // here is where you might want to send it the regID for later use.\n console.log(\"regID = \" + e.regid);\n\t\t\tPN = e.regid; \n }\n break;\n\n case 'message':\n\t\t//cordova.plugins.notification.badge.set(200);\n // if this flag is set, this notification happened while we were in the foreground.\n // you might want to play a sound to get the user's attention, throw up a dialog, etc.\n console.log(e)\n\t\tpushDriver(e)\n\t\t\n\t\tif ( e.foreground )\n {\n console.log('<li>--INLINE NOTIFICATION--' + '</li>');\n\t\t\tconsole.log(e)\n\t\t\twindow.plugins.toast.showLongBottom(e.payload.message, function(a){console.log('toast success: ' + a)}, function(b){console.log('toast error: ' + b)});\n\t\t\t\n // on Android soundname is outside the payload.\n // On Amazon FireOS all custom attributes are contained within payload\n // var soundfile = e.soundname || e.payload.sound;\n // if the notification contains a soundname, play it.\n // var my_media = new Media(\"/android_asset/www/\"+ soundfile);\n // my_media.play();\n }\n else\n { // otherwise we were launched because the user touched a notification in the notification tray.\n if ( e.coldstart )\n {\n console.log('<li>--COLDSTART NOTIFICATION--' + '</li>');\n }\n else\n {\n console.log('<li>--BACKGROUND NOTIFICATION--' + '</li>');\n }\n }\n\n console.log('<li>MESSAGE -> MSG: ' + e.payload.message + '</li>');\n //Only works for GCM\n console.log('<li>MESSAGE -> MSGCNT: ' + e.payload.msgcnt + '</li>');\n //Only works on Amazon Fire OS\n break;\n\n case 'error':\n console.log('<li>ERROR -> MSG:' + e.msg + '</li>');\n break;\n\n default:\n console.log('<li>EVENT -> Unknown, an event was received and we do not know what it is</li>');\n break;\n }\n}", "async createDocumentNotification(notification, server, logger) {\n const Log = logger.bind()\n try {\n const Notification = mongoose.model('notification')\n const User = mongoose.model('user')\n let promises = []\n promises.push(RestHapi.create(Notification, notification, Log))\n promises.push(\n RestHapi.find(\n User,\n notification.actingUser,\n { $select: ['firstName', 'lastName', 'profileImageUrl'] },\n Log\n )\n )\n let result = await Promise.all(promises)\n let notification = result[0]\n notification.actingUser = result[1]\n server.publish(\n '/notification/' + notification.primaryUser,\n notification\n )\n } catch (err) {\n errorHelper.handleError(err, Log)\n }\n }", "function popupNotification(poptitle, popmessage, popicon)\n{\n options = {\n type : \"basic\",\n title: poptitle,\n message: popmessage,\n iconUrl: popicon,\n priority: 2\n };\n var n_id = \"id\" + notificationId++;\n chrome.notifications.create(n_id, options, createdCallback);\n\n if (JSON.parse(localStorage.clearNotifications))\n {\n // discard notification after timeout period\n window.setTimeout(function() {clearNotification(n_id)},\n parseInt(localStorage.notificationTimeout) * 1000);\n }\n}", "function computeNotification(user, data) {\n var traffic = data.traffic;\n var weather = data.weather;\n\n // identify device token\n var myDevice = new apn.Device(user.token);\n var note = new apn.Notification();\n\n // do something with the data here, check whether notification is in order and populate note as follows -\n\n note.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.\n note.badge = 3;\n note.sound = \"something.aiff\"; // specify the audio file to be played.\n note.alert = \"\\uD83D\\uDCE7 \\u2709 You have a new message\";\n note.payload = {'messageFrom': 'Pacenotes'};\n\n apnConnection.pushNotification(note, myDevice);\n}", "function generateProjectInvitationToken(email_address, project_id){\n // expirates in 1 day\n var now = new Date();\n now.setDate(now.getDate() + 1);\n\n return jwt.sign({\n project_id: project_id,\n email_address: email_address,\n action: 'accept_project',\n exp: parseInt(now.getTime() / 1000)\n },\n 'mySecretPassword');\n}", "function randomNotification() {\n courses = testvue.courses;\n var randomItem = Math.floor(Math.random() * courses.length);\n var notifTitle = courses[randomItem].topic;\n var notifBody = 'Created by ' + courses[randomItem].school + '.';\n var notifImg = 'data/img/' + courses[randomItem].school + '.jpg';\n var options = {\n body: notifBody,\n icon: notifImg\n }\n var notif = new Notification(notifTitle, options);\n setTimeout(randomNotification, 30000);\n}", "function projectileCreate(data){\n var p = {};\n p[id + '_' + data.id] = {\n shipID: id,\n status: 'create',\n pos: data.pos,\n weaponID: data.weaponID,\n style: data.style,\n type: data.type\n };\n io.sockets.emit('projstat', p);\n }", "function pushNotification(x,y,z){\n if(rData == undefined){\n console.log('waiting for async request to complete')\n }\n else{\n for(let i = 1; i < rData.length; i++){\n let t = rData[i].taskDeadlineTime;\n let d = rData[i].taskDeadline;\n let c = rData[i].completed;\n d = d.substring(8,d.length)\n let comTime = x + \":\" + y;\n if(t == comTime && d == z && c == 0 ){\n console.log('pushing notification');\n sendNotification(rData[i]);\n count = 0;\n }\n }\n }\n}", "createProject(projName, description, userId) {\n return newProject = new Project(projName, description, userId);\n }", "function subscribe(project) {\r\n\r\n if (project && !project.subscribed && socketMessage.session) {\r\n\r\n var confirmPostStream = function (response, myarg) {\r\n if (response.status === 'ok') {\r\n project.subscribed = true;\r\n } else {\r\n Y.log(\"post \" + response.status + \" for \" + project.title + ' ' + JSON.stringify(response));\r\n }\r\n };\r\n\r\n // keep subscribed so we can get updates for previously loaded projects\r\n // unsubscribeAll() ;\r\n\r\n // it's okay to subscribe even before we get an ok reply to unsubribes\r\n postJson('/stream/' + socketMessage.session + '/project/' + project.id, null, confirmPostStream);\r\n }\r\n\r\n }", "function showNotification() {\n let notificationOptions = {\n body: 'wegienr',\n icon: './icon.png'\n };\n\n let n = new Notification('My new Notification', notificationOptions);\n n.onclick = () => {\n console.log('Notification Clicked');\n };\n}", "function pushNotification(notifications) {\n if ('Notification' in window) {\n var isRegistryAdmin = User.hasRole(USER_ROLES.REGISTRY_ADMIN);\n if (Notification.permission == 'granted' && isRegistryAdmin && notifications.severity !== 'OPERATIONAL') {\n spawnNotification(notifications.severity, 'GBIF system health');\n }\n }\n }", "createNewProject(project_val, unit_val, field_val){\n pcv_createproject(project_val)\n pcv_createunit(project_val, unit_val)\n pcv_createeditfield(project_val, unit_val, field_val)\n this.setState({newProjectId: project_val})\n this.setState({newUnitId: unit_val})\n }" ]
[ "0.62137127", "0.61979073", "0.61933506", "0.6031134", "0.5994061", "0.5983241", "0.5929354", "0.5915151", "0.58932525", "0.58815825", "0.58437777", "0.58437777", "0.58395106", "0.57691544", "0.576904", "0.5760473", "0.5746217", "0.5735199", "0.5729614", "0.5700186", "0.56846833", "0.5678685", "0.56549454", "0.56524044", "0.56375766", "0.5623682", "0.5588329", "0.5570291", "0.5568368", "0.5567981", "0.5559876", "0.55397666", "0.55341727", "0.55296355", "0.55163276", "0.5497869", "0.5485618", "0.54663473", "0.5438628", "0.543209", "0.54153526", "0.53963155", "0.5375425", "0.53739405", "0.5370112", "0.53676337", "0.5364337", "0.53560513", "0.5355783", "0.5355708", "0.5354624", "0.53520995", "0.53404486", "0.53374183", "0.53339887", "0.53267163", "0.531789", "0.531182", "0.53094953", "0.5298397", "0.5297279", "0.5296676", "0.5293076", "0.5291616", "0.5291266", "0.5289926", "0.5288699", "0.5287613", "0.52850676", "0.5283377", "0.5279543", "0.5274969", "0.52626324", "0.5248837", "0.5245389", "0.523836", "0.5236493", "0.5227249", "0.5225637", "0.5221172", "0.5217995", "0.5215668", "0.5212639", "0.5197948", "0.5189888", "0.5186862", "0.51841396", "0.5180813", "0.51775527", "0.51701725", "0.51673937", "0.5163164", "0.516114", "0.5158841", "0.5158062", "0.51519936", "0.5151982", "0.5150374", "0.5142751", "0.514083" ]
0.61281365
3